JSON with object keys in sorted order, at every depth.
(value)
| 68 | |
| 69 | /** JSON with object keys in sorted order, at every depth. */ |
| 70 | function stableStringify(value) { |
| 71 | if (Array.isArray(value)) return `[${value.map(stableStringify).join(',')}]`; |
| 72 | if (value && typeof value === 'object') { |
| 73 | const keys = Object.keys(value).sort(); |
| 74 | return `{${keys.map((k) => `${JSON.stringify(k)}:${stableStringify(value[k])}`).join(',')}}`; |
| 75 | } |
| 76 | return JSON.stringify(value) ?? 'null'; |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Which window of which application a call is aimed at. |
no test coverage detected