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