MCPcopy Create free account
hub / github.com/github/copilot-sdk / stableStringify

Function stableStringify

java/scripts/codegen/java.ts:89–100  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

87}
88
89function stableStringify(value: unknown): string {
90 if (Array.isArray(value)) {
91 return `[${value.map((item) => stableStringify(item)).join(",")}]`;
92 }
93
94 if (value && typeof value === "object") {
95 const entries = Object.entries(value as Record<string, unknown>).sort(([a], [b]) => a.localeCompare(b));
96 return `{${entries.map(([key, entryValue]) => `${JSON.stringify(key)}:${stableStringify(entryValue)}`).join(",")}}`;
97 }
98
99 return JSON.stringify(value) ?? "undefined";
100}
101
102function renameBrandDefinitionKeys(defs: Record<string, unknown>): void {
103 for (const oldKey of Object.keys(defs)) {

Callers 1

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…