*protomux will automatically encode data to JSON, so just set value default to empty string
This commit is contained in:
parent
da4bda03ee
commit
49fc39ab08
10
src/index.ts
10
src/index.ts
|
@ -18,15 +18,7 @@ export default class RPC extends ProtomuxRPC {
|
|||
super(stream, options);
|
||||
}
|
||||
|
||||
async request(
|
||||
method: any,
|
||||
value: Buffer | Uint8Array | string = b4a.from(""),
|
||||
options = {}
|
||||
) {
|
||||
if (!b4a.isBuffer(value)) {
|
||||
value = b4a.from(value);
|
||||
}
|
||||
|
||||
async request(method: any, value: any | string = "", options = {}) {
|
||||
return super.request(method, value, options);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue