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

Function renameBrandDefinitionKeys

scripts/codegen/utils.ts:171–183  ·  view source on GitHub ↗
(defs: Record<string, unknown>)

Source from the content-addressed store, hash-verified

169}
170
171function renameBrandDefinitionKeys(defs: Record<string, unknown>): void {
172 for (const oldKey of Object.keys(defs)) {
173 const newKey = fixBrandCasing(oldKey);
174 if (newKey === oldKey) continue;
175 if (newKey in defs && stableStringify(defs[newKey]) !== stableStringify(defs[oldKey])) {
176 throw new Error(
177 `Brand-casing normalization collision: "${oldKey}" -> "${newKey}" but a different definition already exists under "${newKey}".`
178 );
179 }
180 defs[newKey] = defs[oldKey];
181 delete defs[oldKey];
182 }
183}
184
185/** Load a JSON schema file and normalize GitHub brand casing in titles, refs, and definition keys. */
186export async function loadSchemaJson<T>(filePath: string): Promise<T> {

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…