From cafa33304162c9839b11d1ec7862f466943a0a02 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 27 Nov 2022 18:22:49 -0500 Subject: [PATCH] *Prettier --- src/index.ts | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/src/index.ts b/src/index.ts index 328f917..a829851 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,27 +1,32 @@ // @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 - }; - super(stream, options); + constructor(stream: any, options = {}) { + options = { + ...{ + id: ID, + valueEncoding: c.json, + }, + ...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 = {}) { - if (!b4a.isBuffer(value)) { - value = b4a.from(value); - } - - return super.request(method, value, options); - } + return super.request(method, value, options); + } }