*Override request method with defaults for value, and convert value to a buffer if needed
This commit is contained in:
parent
1bb963caa5
commit
e54e7e536d
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue