diff --git a/src/index.ts b/src/index.ts index 217c649..328f917 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,4 +16,12 @@ 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); + } + + return super.request(method, value, options); + } }