Compare commits

..

No commits in common. "5eeee8bff8db2e82cb121b9bf2750b66aad9c6f8" and "a53c238889b7671f62a20b2582f3e35ec4c08e0e" have entirely different histories.

3 changed files with 5 additions and 28 deletions

12
dist/index.js vendored
View File

@ -134,16 +134,8 @@ class Message extends Client {
onmessage: !!this.onmessage, onmessage: !!this.onmessage,
}, },
}, async (data) => { }, async (data) => {
if (data.args) { if (data?.args && data?.args[0] instanceof Uint8Array) {
data.args = data.args.filter((arg) => { data.args[0] = b4a.from(data.args[0]);
if (arg instanceof Uint8Array) {
return b4a.from(arg);
}
return arg;
});
}
if (data?.args && data?.args[0]?.buffer instanceof Uint8Array) {
data.args[0].buffer = b4a.from(data.args[0].buffer);
} }
switch (data.action) { switch (data.action) {
case "encode": case "encode":

View File

@ -12,10 +12,5 @@
"@types/b4a": "^1.6.0", "@types/b4a": "^1.6.0",
"prettier": "^2.8.7", "prettier": "^2.8.7",
"typescript": "^5.0.4" "typescript": "^5.0.4"
},
"pnpm": {
"patchedDependencies": {
"b4a@1.6.3": "patches/b4a@1.6.3.patch"
}
} }
} }

View File

@ -216,18 +216,8 @@ class Message extends Client {
}, },
}, },
async (data: any) => { async (data: any) => {
if (data.args) { if (data?.args && data?.args[0] instanceof Uint8Array) {
data.args = data.args.filter((arg: any) => { data.args[0] = b4a.from(data.args[0]);
if (arg instanceof Uint8Array) {
return b4a.from(arg);
}
return arg;
});
}
if (data?.args && data?.args[0]?.buffer instanceof Uint8Array) {
data.args[0].buffer = b4a.from(data.args[0].buffer);
} }
switch (data.action) { switch (data.action) {
case "encode": case "encode":