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

Function normalizeBrandCasingNode

java/scripts/codegen/java.ts:55–81  ·  view source on GitHub ↗
(node: unknown)

Source from the content-addressed store, hash-verified

53}
54
55function normalizeBrandCasingNode(node: unknown): void {
56 if (Array.isArray(node)) {
57 for (const item of node) normalizeBrandCasingNode(item);
58 return;
59 }
60 if (node === null || typeof node !== "object") return;
61 const obj = node as Record<string, unknown>;
62
63 for (const defsKey of ["definitions", "$defs"] as const) {
64 const defs = obj[defsKey];
65 if (defs && typeof defs === "object" && !Array.isArray(defs)) {
66 renameBrandDefinitionKeys(defs as Record<string, unknown>);
67 }
68 }
69
70 for (const [key, value] of Object.entries(obj)) {
71 if (typeof value === "string") {
72 if (key === "$ref") {
73 obj[key] = fixBrandRef(value);
74 } else if (BRAND_NORMALIZED_STRING_KEYS.has(key)) {
75 obj[key] = fixBrandCasing(value);
76 }
77 } else {
78 normalizeBrandCasingNode(value);
79 }
80 }
81}
82
83function fixBrandRef(ref: string): string {
84 const lastSlash = ref.lastIndexOf("/");

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…