From 27c2734ae4bfd4a4ffc8731fdaedee19cdb1951a Mon Sep 17 00:00:00 2001 From: Khaazz Date: Sat, 17 Nov 2018 19:05:23 +0100 Subject: [PATCH] typo in initiating schemas + more typings support --- package.json | 1 + src/Structures/Module.js | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 2dc8de89..08616746 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "signale": "^1.3.0" }, "main": "./index.js", + "types": "./index.d.ts", "scripts": { "lint": "eslint .", "test": "eslint src *.js", diff --git a/src/Structures/Module.js b/src/Structures/Module.js index 431eb63a..c28268b7 100755 --- a/src/Structures/Module.js +++ b/src/Structures/Module.js @@ -108,6 +108,10 @@ class Module extends Base { * @memberof Module */ initAllCommands(commands) { + if (commands.default) { + this.Logger.error(`[Module(${this.label})] Commands: No commands found.`); + return; + } for (const [, Value] of Object.entries(commands)) { const newCmd = new Value(this); if (newCmd.hasSubcmd) { @@ -128,6 +132,10 @@ class Module extends Base { * @memberof Module */ initAllEvents(events) { + if (events.default) { + this.Logger.error(`[Module(${this.label})] Events: No events found.`); + return; + } for (const [, Value] of Object.entries(events)) { const newEvent = new Value(this); this.registerEvent(newEvent); @@ -276,7 +284,7 @@ class Module extends Base { if (this.schemas.has(key)) { throw new AxonError(`[Module](${this.label}) - Schemas: ${key} - You have already registered a schema in this module.`, 'INIT'); } - this.schemas(key, schema); + this.schemas.set(key, schema); return true; }