Skip to content

Commit

Permalink
typo in initiating schemas + more typings support
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaaz committed Nov 17, 2018
1 parent 62a4ba2 commit 27c2734
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"signale": "^1.3.0"
},
"main": "./index.js",
"types": "./index.d.ts",
"scripts": {
"lint": "eslint .",
"test": "eslint src *.js",
Expand Down
10 changes: 9 additions & 1 deletion src/Structures/Module.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 27c2734

Please sign in to comment.