(value: unknown)
| 1018 | } |
| 1019 | |
| 1020 | function stableStringify(value: unknown): string { |
| 1021 | if (Array.isArray(value)) return `[${value.map(stableStringify).join(",")}]` |
| 1022 | if (!value || typeof value !== "object") return JSON.stringify(value) |
| 1023 | return `{${Object.entries(value) |
| 1024 | .toSorted(([a], [b]) => a.localeCompare(b)) |
| 1025 | .map(([key, item]) => `${JSON.stringify(key)}:${stableStringify(item)}`) |
| 1026 | .join(",")}}` |
| 1027 | } |
| 1028 | |
| 1029 | function restoreFromMessages(messages: readonly MessageInfo[]) { |
| 1030 | const user = messages.findLast( |
no outgoing calls
no test coverage detected