UNPKG

@black-flag/checks

Version:

A collection of general purpose check functions for yargs and Black Flag

32 lines (31 loc) 1.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BfcErrorMessage = void 0; const BfcErrorMessage = exports.BfcErrorMessage = { BadType(name, expected, actual) { return `expected the ${name} option to be of type "${expected}", given "${actual}"`; }, OptionMustBeNonNegative(name) { return `option "${name}" must have a non-negative value`; }, OptionMustNotBeFalsy(name) { return `option "${name}" must have a non-empty (non-falsy) value`; }, OptionValueMustBeAlone(option, noun) { return `the "${option}" ${noun} must not be given alongside any others`; }, OptionValueMustBeAloneWhenBaseline(option, noun) { return BfcErrorMessage.OptionValueMustBeAlone(option, noun) + ' when using --baseline'; }, OptionRequiresMinArgs(name, adjective) { return `array option "${name}" requires at least one ${adjective ? `${adjective} ` : ''} value`; }, OptionRequiresNoConflicts(name, tuple) { return `array option "${name}" allows only one of the following values: ${tuple.join(', ')}`; }, OptionRequiresUniqueArgs(name) { return `array option "${name}" must contain only unique values`; } };