Compare commits
No commits in common. "252be50f2e4da41849a622fe7b6543a4cf191ef6" and "da4bda03ee6860147b176199f3ab41965a17fff3" have entirely different histories.
252be50f2e
...
da4bda03ee
|
@ -1,6 +1,7 @@
|
|||
/// <reference types="node" />
|
||||
import ProtomuxRPC from "protomux-rpc";
|
||||
export default class RPC extends ProtomuxRPC {
|
||||
constructor(stream: any, options?: {});
|
||||
request(method: any, value?: any | string, options?: {}): Promise<any>;
|
||||
request(method: any, value?: Buffer | Uint8Array | string, options?: {}): Promise<any>;
|
||||
}
|
||||
//# sourceMappingURL=index.d.ts.map
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,cAAc,CAAC;AAOvC,MAAM,CAAC,OAAO,OAAO,GAAI,SAAQ,WAAW;gBAC9B,MAAM,EAAE,GAAG,EAAE,OAAO,KAAK;IAW/B,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,GAAE,GAAG,GAAG,MAAW,EAAE,OAAO,KAAK;CAGlE"}
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,WAAW,MAAM,cAAc,CAAC;AAOvC,MAAM,CAAC,OAAO,OAAO,GAAI,SAAQ,WAAW;gBAC9B,MAAM,EAAE,GAAG,EAAE,OAAO,KAAK;IAW/B,OAAO,CACX,MAAM,EAAE,GAAG,EACX,KAAK,GAAE,MAAM,GAAG,UAAU,GAAG,MAAqB,EAClD,OAAO,KAAK;CAQf"}
|
|
@ -15,7 +15,10 @@ export default class RPC extends ProtomuxRPC {
|
|||
};
|
||||
super(stream, options);
|
||||
}
|
||||
async request(method, value = "", options = {}) {
|
||||
async request(method, value = b4a.from(""), options = {}) {
|
||||
if (!b4a.isBuffer(value)) {
|
||||
value = b4a.from(value);
|
||||
}
|
||||
return super.request(method, value, options);
|
||||
}
|
||||
}
|
||||
|
|
10
src/index.ts
10
src/index.ts
|
@ -18,7 +18,15 @@ export default class RPC extends ProtomuxRPC {
|
|||
super(stream, options);
|
||||
}
|
||||
|
||||
async request(method: any, value: any | string = "", 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