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

Function normalizeBrandCasingNode

scripts/codegen/utils.ts:134–160  ·  view source on GitHub ↗
(node: unknown)

Source from the content-addressed store, hash-verified

132}
133
134function normalizeBrandCasingNode(node: unknown): void {
135 if (Array.isArray(node)) {
136 for (const item of node) normalizeBrandCasingNode(item);
137 return;
138 }
139 if (node === null || typeof node !== "object") return;
140 const obj = node as Record<string, unknown>;
141
142 for (const defsKey of ["definitions", "$defs"] as const) {
143 const defs = obj[defsKey];
144 if (defs && typeof defs === "object" && !Array.isArray(defs)) {
145 renameBrandDefinitionKeys(defs as Record<string, unknown>);
146 }
147 }
148
149 for (const [key, value] of Object.entries(obj)) {
150 if (typeof value === "string") {
151 if (key === "$ref") {
152 obj[key] = fixBrandRef(value);
153 } else if (BRAND_NORMALIZED_STRING_KEYS.has(key)) {
154 obj[key] = fixBrandCasing(value);
155 }
156 } else {
157 normalizeBrandCasingNode(value);
158 }
159 }
160}
161
162/** Apply brand-casing only to the definition-name segment of a `$ref`. */
163function fixBrandRef(ref: string): string {

Callers 1

Calls 3

fixBrandRefFunction · 0.70
fixBrandCasingFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…