From da7c4171d55976f6a0d099bc42e80a91052bbfa1 Mon Sep 17 00:00:00 2001 From: jacoobes Date: Thu, 10 Feb 2022 12:58:29 -0600 Subject: [PATCH] format and comment registerModules --- src/handler/sern.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/handler/sern.ts b/src/handler/sern.ts index 412e62a..56e3784 100644 --- a/src/handler/sern.ts +++ b/src/handler/sern.ts @@ -25,7 +25,7 @@ export class Handler { this.client .on("ready", async () => { Files.buildData(this) - .then(this.registerModules); + .then(this.registerModules); if (wrapper.init !== undefined) wrapper.init(this); }) @@ -99,7 +99,17 @@ export class Handler { const fn = await module.mod.delegate(context, parsedArgs) return fn?.val } - private async registerModules(modArr: { name: string, mod: Module, absPath: string }[]) { + /** + * This function chains `Files.buildData` + * @param {{name: string, mod: Module, absPath: string}} modArr module information + */ + private async registerModules( + modArr: { + name: string, + mod: Module, + absPath: string + }[] + ) { for (const { name, mod, absPath } of modArr) { const { cmdName, testOnly } = Files.fmtFileName(name); switch (mod.type) {