MCPcopy Create free account
hub / github.com/ember-cli/ember-cli / validateOption

Function validateOption

lib/models/command.js:428–446  ·  view source on GitHub ↗

Validates option @method validateOption @param {Object} option @return {Boolean}

(option)

Source from the content-addressed store, hash-verified

426 @return {Boolean}
427 */
428 validateOption(option) {
429 let parsedAliases;
430
431 if (!option.name || !option.type) {
432 throw new Error(`The command "${this.name}" has an option without the required type and name fields.`);
433 }
434
435 if (option.name !== option.name.toLowerCase()) {
436 throw new Error(`The "${option.name}" option's name of the "${this.name}" command contains a capital letter.`);
437 }
438
439 this.normalizeOption(option);
440
441 if (option.aliases) {
442 parsedAliases = option.aliases.map(this.parseAlias.bind(this, option));
443 return parsedAliases.map(this.assignAlias.bind(this, option)).indexOf(false) === -1;
444 }
445 return false;
446 },
447
448 /**
449 Parses alias for an option and adds it to optionsAliases

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…