format and comment registerModules

This commit is contained in:
jacoobes
2022-02-10 12:58:29 -06:00
parent 198e17eca2
commit da7c4171d5

View File

@@ -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<unknown>, absPath: string }[]) {
/**
* This function chains `Files.buildData`
* @param {{name: string, mod: Module<unknown>, absPath: string}} modArr module information
*/
private async registerModules(
modArr: {
name: string,
mod: Module<unknown>,
absPath: string
}[]
) {
for (const { name, mod, absPath } of modArr) {
const { cmdName, testOnly } = Files.fmtFileName(name);
switch (mod.type) {