*Prettier

This commit is contained in:
Derrick Hammer 2022-11-27 18:22:49 -05:00
parent ff6babc53c
commit cafa333041
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 24 additions and 19 deletions

View File

@ -1,27 +1,32 @@
// @ts-ignore // @ts-ignore
import ProtomuxRPC from "protomux-rpc" import ProtomuxRPC from "protomux-rpc";
// @ts-ignore // @ts-ignore
import c from "compact-encoding" import c from "compact-encoding";
import b4a from "b4a" import b4a from "b4a";
const ID = b4a.from("lumeweb") const ID = b4a.from("lumeweb");
export default class RPC extends ProtomuxRPC { export default class RPC extends ProtomuxRPC {
constructor(stream: any, options = {}) { constructor(stream: any, options = {}) {
options = { options = {
...{ ...{
id: ID, id: ID,
valueEncoding: c.json valueEncoding: c.json,
}, ...options },
}; ...options,
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);
} }
async request(method: any, value: Buffer | Uint8Array | string = b4a.from(""), options = {}) { return super.request(method, value, options);
if (!b4a.isBuffer(value)) { }
value = b4a.from(value);
}
return super.request(method, value, options);
}
} }