MCPcopy Create free account
hub / github.com/microsoft/vscode-cpptools / isValidEnum

Method isValidEnum

Extension/src/LanguageServer/settings.ts:734–739  ·  view source on GitHub ↗
(enumDescription: any, value: any)

Source from the content-addressed store, hash-verified

732
733 // Checks a given enum value against a list of valid enum values from package.json.
734 private isValidEnum(enumDescription: any, value: any): value is string {
735 if (isString(value) && isArray(enumDescription) && enumDescription.length > 0) {
736 return enumDescription.some(x => x.toLowerCase() === value.toLowerCase());
737 }
738 return false;
739 }
740
741 private isArrayOfCommentContinuationPatterns(x: any): x is (string | CommentPattern)[] {
742 return isArray(x) && x.every(y => isString(y) || this.isCommentPattern(y));

Callers 4

getAsStringMethod · 0.95
getAsArrayOfStringsMethod · 0.95

Calls 2

isStringFunction · 0.90
isArrayFunction · 0.90

Tested by

no test coverage detected