MCPcopy Create free account
hub / github.com/MicrosoftDocs/mcp / parseEnumValue

Function parseEnumValue

cli/src/utils/options.ts:37–43  ·  view source on GitHub ↗
(value: string, allowedValues: readonly TValue[], label: string)

Source from the content-addressed store, hash-verified

35}
36
37function parseEnumValue<TValue extends string>(value: string, allowedValues: readonly TValue[], label: string): TValue {
38 if (allowedValues.includes(value as TValue)) {
39 return value as TValue;
40 }
41
42 throw new InvalidArgumentError(`Unsupported ${label}. Expected one of: ${allowedValues.join(', ')}.`);
43}

Callers 1

parseDoctorFormatFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected