(value: unknown)
| 222 | // --------------------------------------------------------------------------- |
| 223 | |
| 224 | const stableHash = (value: unknown): string => { |
| 225 | const str = JSON.stringify(value, Object.keys(value as Record<string, unknown>).sort()); |
| 226 | let hash = 0; |
| 227 | for (let i = 0; i < str.length; i++) { |
| 228 | hash = ((hash << 5) - hash + str.charCodeAt(i)) | 0; |
| 229 | } |
| 230 | return Math.abs(hash).toString(36).padStart(8, "0"); |
| 231 | }; |
| 232 | |
| 233 | // --------------------------------------------------------------------------- |
| 234 | // Main entry point |
no test coverage detected