(obj: any)
| 1554 | } |
| 1555 | |
| 1556 | function stableStringify(obj: any): string { |
| 1557 | function sortKeys(obj: any): any { |
| 1558 | if (typeof obj !== "object" || obj === null) { |
| 1559 | return obj; |
| 1560 | } |
| 1561 | |
| 1562 | if (Array.isArray(obj)) { |
| 1563 | return obj.map(sortKeys); |
| 1564 | } |
| 1565 | |
| 1566 | const sortedKeys = Object.keys(obj).sort(); |
| 1567 | const sortedObj: { [key: string]: any } = {}; |
| 1568 | |
| 1569 | for (const key of sortedKeys) { |
| 1570 | sortedObj[key] = sortKeys(obj[key]); |
| 1571 | } |
| 1572 | |
| 1573 | return sortedObj; |
| 1574 | } |
| 1575 | |
| 1576 | const sortedObj = sortKeys(obj); |
| 1577 | return JSON.stringify(sortedObj); |
| 1578 | } |
| 1579 | |
| 1580 | type CallbackFunction = ( |
| 1581 | level: "DEBUG" | "INFO" | "WARN" | "ERROR" | "LOG", |
no test coverage detected
searching dependent graphs…