MCPcopy Index your code
hub / github.com/github/copilot-sdk / getEnumValueDescriptions

Function getEnumValueDescriptions

scripts/codegen/utils.ts:455–472  ·  view source on GitHub ↗
(schema: JSONSchema7 | null | undefined)

Source from the content-addressed store, hash-verified

453}
454
455export function getEnumValueDescriptions(schema: JSONSchema7 | null | undefined): EnumValueDescriptions | undefined {
456 if (!schema || typeof schema !== "object") return undefined;
457
458 const rawDescriptions = (schema as Record<string, unknown>)["x-enumDescriptions"];
459 if (!rawDescriptions || typeof rawDescriptions !== "object" || Array.isArray(rawDescriptions)) return undefined;
460
461 const descriptions: EnumValueDescriptions = {};
462 for (const [value, description] of Object.entries(rawDescriptions)) {
463 if (typeof description !== "string") continue;
464
465 const trimmedDescription = description.trim();
466 if (trimmedDescription.length > 0) {
467 descriptions[value] = trimmedDescription;
468 }
469 }
470
471 return Object.keys(descriptions).length > 0 ? descriptions : undefined;
472}
473
474const INT32_MIN = -(2 ** 31);
475const INT32_MAX = 2 ** 31 - 1;

Callers 11

resolveRustTypeFunction · 0.85
generateApiTypesCodeFunction · 0.85
rewriteFunction · 0.85
resolveRpcTypeFunction · 0.85
resolveGoPropertyTypeFunction · 0.85
goUntaggedUnionVariantFunction · 0.85
emitGoRpcDefinitionFunction · 0.85
getPyNamedSchemaTypeFunction · 0.85
resolvePyPropertyTypeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…