(value: unknown)
| 87 | } |
| 88 | |
| 89 | function 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 | |
| 102 | function renameBrandDefinitionKeys(defs: Record<string, unknown>): void { |
| 103 | for (const oldKey of Object.keys(defs)) { |
no test coverage detected
searching dependent graphs…