(value: unknown)
| 488 | } |
| 489 | |
| 490 | export function stableStringify(value: unknown): string { |
| 491 | if (Array.isArray(value)) { |
| 492 | return `[${value.map((item) => stableStringify(item)).join(",")}]`; |
| 493 | } |
| 494 | |
| 495 | if (value && typeof value === "object") { |
| 496 | const entries = Object.entries(value as Record<string, unknown>).sort(([a], [b]) => a.localeCompare(b)); |
| 497 | return `{${entries.map(([key, entryValue]) => `${JSON.stringify(key)}:${stableStringify(entryValue)}`).join(",")}}`; |
| 498 | } |
| 499 | |
| 500 | return JSON.stringify(value) ?? "undefined"; |
| 501 | } |
| 502 | |
| 503 | export interface ApiSchema { |
| 504 | definitions?: Record<string, JSONSchema7Definition>; |
no test coverage detected
searching dependent graphs…