*Prettier
This commit is contained in:
parent
ff6babc53c
commit
cafa333041
19
src/index.ts
19
src/index.ts
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue