@hephaestus/core
Advanced tools
Comparing version 1.0.0-alpha.3 to 1.0.0-alpha.4
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CommandMap = void 0; | ||
const utils_1 = require("@hephaestus/utils"); | ||
const loadable_1 = require("../loadable"); | ||
@@ -10,8 +11,18 @@ class CommandMap extends loadable_1.LoadableMap { | ||
} | ||
if (!('name' in loadable)) { | ||
if (!(0, utils_1.unknownHasKey)(loadable, 'name')) { | ||
return false; | ||
} | ||
if (!('action' in loadable) && | ||
(!('subCommands' in loadable) || !('subCommandGroups' in loadable))) { | ||
return false; | ||
if (!(0, utils_1.unknownHasKey)(loadable, 'action')) { | ||
if (!(0, utils_1.unknownHasKey)(loadable, 'options') || | ||
!Array.isArray(loadable.options)) { | ||
return false; | ||
} | ||
return loadable.options.some((option) => { | ||
if ((0, utils_1.unknownHasKey)(option, 'type')) { | ||
if (typeof option.type === 'number' && option.type <= 2) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}); | ||
} | ||
@@ -18,0 +29,0 @@ return true; |
{ | ||
"name": "@hephaestus/core", | ||
"version": "1.0.0-alpha.3", | ||
"version": "1.0.0-alpha.4", | ||
"description": "> TODO: description", | ||
@@ -32,3 +32,3 @@ "author": "Alex Taxiera <alex.taxiera@gmail.com>", | ||
}, | ||
"gitHead": "f49886fcfd1e80fbc2bd2293fb73f03aefc21238" | ||
"gitHead": "d33175d0273332c7557344189d69ec4d8db4f45d" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33676
545