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

Function toEnumMemberName

scripts/codegen/python.ts:1447–1457  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

1445}
1446
1447function toEnumMemberName(value: string): string {
1448 const cleaned = value
1449 .replace(/([a-z])([A-Z])/g, "$1_$2")
1450 .replace(/[^A-Za-z0-9]+/g, "_")
1451 .replace(/^_+|_+$/g, "")
1452 .toUpperCase();
1453 if (!cleaned) {
1454 return "VALUE";
1455 }
1456 return /^[0-9]/.test(cleaned) ? `VALUE_${cleaned}` : cleaned;
1457}
1458
1459function wrapParser(resolved: PyResolvedType, arg = "x"): string {
1460 return `lambda ${arg}: ${resolved.fromExpr(arg)}`;

Callers 2

getOrCreatePyEnumFunction · 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…