From e7aedc9950e726e4a64c977cfa26f3a246ff83ab Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 28 Aug 2022 13:09:47 -0400 Subject: [PATCH] *Use shorthand function --- src/index.ts | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/src/index.ts b/src/index.ts index 096f9bb..2e2d484 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,28 +1,27 @@ -import type {Plugin, PluginAPI} from "@lumeweb/relay"; -import {RPCResponse} from "@lumeweb/relay"; +import type { Plugin, PluginAPI } from "@lumeweb/relay"; +import { RPCResponse } from "@lumeweb/relay"; const plugin: Plugin = { - name: "core", - async plugin(api: PluginAPI): Promise { - api.registerMethod("ping", { - cacheable: false, - handler: async (): Promise => { - return { - data: "pong" - } - } - }) + name: "core", + async plugin(api: PluginAPI): Promise { + api.registerMethod("ping", { + cacheable: false, + async handler(): Promise { + return { + data: "pong", + }; + }, + }); - api.registerMethod("get_methods", { - cacheable: false, - handler: async (): Promise => { - return { - data: api.getMethods() - } - } - }) - } - -} + api.registerMethod("get_methods", { + cacheable: false, + async handler(): Promise { + return { + data: api.getMethods(), + }; + }, + }); + }, +}; export default plugin;