*Override request method with defaults for value, and convert value to a buffer if needed

This commit is contained in:
Derrick Hammer 2022-11-27 18:22:12 -05:00
parent 1bb963caa5
commit e54e7e536d
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 8 additions and 0 deletions

View File

@ -16,4 +16,12 @@ export default class RPC extends ProtomuxRPC {
}; };
super(stream, options); super(stream, options);
} }
async request(method: any, value: Buffer | Uint8Array | string = b4a.from(""), options = {}) {
if (!b4a.isBuffer(value)) {
value = b4a.from(value);
}
return super.request(method, value, options);
}
} }