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

Function renameBrandDefinitionKeys

java/scripts/codegen/java.ts:102–114  ·  view source on GitHub ↗
(defs: Record<string, unknown>)

Source from the content-addressed store, hash-verified

100}
101
102function renameBrandDefinitionKeys(defs: Record<string, unknown>): void {
103 for (const oldKey of Object.keys(defs)) {
104 const newKey = fixBrandCasing(oldKey);
105 if (newKey === oldKey) continue;
106 if (newKey in defs && stableStringify(defs[newKey]) !== stableStringify(defs[oldKey])) {
107 throw new Error(
108 `Brand-casing normalization collision: "${oldKey}" -> "${newKey}" but a different definition already exists under "${newKey}".`
109 );
110 }
111 defs[newKey] = defs[oldKey];
112 delete defs[oldKey];
113 }
114}
115
116function toPascalCase(name: string): string {
117 return fixBrandCasing(name.split(/[-_.]/).map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join(""));

Callers 1

normalizeBrandCasingNodeFunction · 0.70

Calls 2

fixBrandCasingFunction · 0.70
stableStringifyFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…