*Update dist

This commit is contained in:
Derrick Hammer 2023-04-09 00:35:45 -04:00
parent fbaf4314f3
commit 51eabd809d
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 3 additions and 3 deletions

6
dist/index.js vendored
View File

@ -1,7 +1,7 @@
import { Client, factory } from "@lumeweb/libkernel-universal"; import { Client, factory } from "@lumeweb/libkernel-universal";
import { MODULE } from "@lumeweb/kernel-swarm-client"; import { MODULE } from "@lumeweb/kernel-swarm-client";
import defer from "p-defer"; import defer from "p-defer";
import b4a from "b4a"; import { Buffer } from "buffer";
export default class Protomux { export default class Protomux {
isProtomux = true; isProtomux = true;
constructor(stream) { constructor(stream) {
@ -137,13 +137,13 @@ class Message extends Client {
if (data.args) { if (data.args) {
data.args = data.args.filter((arg) => { data.args = data.args.filter((arg) => {
if (arg instanceof Uint8Array) { if (arg instanceof Uint8Array) {
return b4a.from(arg); return Buffer.from(arg);
} }
return arg; return arg;
}); });
} }
if (data?.args && data?.args[0]?.buffer instanceof Uint8Array) { if (data?.args && data?.args[0]?.buffer instanceof Uint8Array) {
data.args[0].buffer = b4a.from(data.args[0].buffer); data.args[0].buffer = Buffer.from(data.args[0].buffer);
} }
switch (data.action) { switch (data.action) {
case "encode": case "encode":