MCPcopy
hub / github.com/webpack/webpack / processArgumentConfig

Function processArgumentConfig

lib/cli.js:667–685  ·  view source on GitHub ↗
(argConfig, config, value, index)

Source from the content-addressed store, hash-verified

665 * @returns {LocalProblem | null} a problem if any
666 */
667const processArgumentConfig = (argConfig, config, value, index) => {
668 if (index !== undefined && !argConfig.multiple) {
669 return {
670 type: "multiple-values-unexpected",
671 path: argConfig.path
672 };
673 }
674 const parsed = parseValueForArgumentConfig(argConfig, value);
675 if (parsed === undefined) {
676 return {
677 type: "invalid-value",
678 path: argConfig.path,
679 expected: getExpectedValue(argConfig)
680 };
681 }
682 const problem = setValue(config, argConfig.path, parsed, index);
683 if (problem) return problem;
684 return null;
685};
686
687/**
688 * Gets expected value.

Callers 1

processValueFunction · 0.85

Calls 3

getExpectedValueFunction · 0.85
setValueFunction · 0.70

Tested by

no test coverage detected