@jil/args
Version:
A convention based argument parsing and formatting library, with strict validation checks
24 lines • 1.27 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.OPTION_LIKE = exports.SHORT_OPTION_GROUP_FORMAT = exports.SHORT_OPTION_FORMAT = exports.LONG_OPTION_FORMAT = exports.COMMAND_FORMAT = exports.DEFAULT_STRING_VALUE = exports.DEFAULT_NUMBER_VALUE = exports.DEFAULT_BOOLEAN_VALUE = void 0;
// Default values for option types.
exports.DEFAULT_BOOLEAN_VALUE = false;
exports.DEFAULT_NUMBER_VALUE = 0;
exports.DEFAULT_STRING_VALUE = '';
// Supports letters, numbers, dashes, and camel case.
// Minimum 2 characters. Must start and end with a letter.
exports.COMMAND_FORMAT = /^[a-z][-a-z0-9:]*[a-z]$/iu;
// Double dash followed by a long name.
// Supports letters, numbers, dashes, and camel case.
// Minimum 2 characters. Must start with a letter.
exports.LONG_OPTION_FORMAT = /^--[a-z][-a-z0-9]+$/iu;
// Single dash followed by a short name.
// Exactly 1 character.
exports.SHORT_OPTION_FORMAT = /^-[a-z]{1}$/iu;
// Single dash followed by N short names.
// Minimum 2 characters, otherwise its a single short option.
exports.SHORT_OPTION_GROUP_FORMAT = /^-[a-z]{2,}$/iu;
// Pattern to match all the above, with the addition
// of an inline value check.
exports.OPTION_LIKE = /^-{1,2}[a-z][-a-z0-9]*=?/iu;
//# sourceMappingURL=constants.js.map