MCPcopy
hub / github.com/webpack/webpack / getExpectedValue

Function getExpectedValue

lib/cli.js:692–709  ·  view source on GitHub ↗
(argConfig)

Source from the content-addressed store, hash-verified

690 * @returns {string | undefined} expected message
691 */
692const getExpectedValue = (argConfig) => {
693 switch (argConfig.type) {
694 case "boolean":
695 return "true | false";
696 case "RegExp":
697 return "regular expression (example: /ab?c*/)";
698 case "enum":
699 return /** @type {NonNullable<ArgumentConfig["values"]>} */ (
700 argConfig.values
701 )
702 .map((v) => `${v}`)
703 .join(" | ");
704 case "reset":
705 return "true (will reset the previous value to an empty array)";
706 default:
707 return argConfig.type;
708 }
709};
710
711/** @typedef {null | string | number | boolean | RegExp | EnumValue | []} ParsedValue */
712

Callers 1

processArgumentConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected