(self: unknown, that: unknown)
| 179 | } |
| 180 | |
| 181 | function compareBoth(self: unknown, that: unknown): boolean { |
| 182 | if (self === that) return true |
| 183 | if (self == null || that == null) return false |
| 184 | const selfType = typeof self |
| 185 | if (selfType !== typeof that) { |
| 186 | return false |
| 187 | } |
| 188 | // Special case for NaN: NaN should be considered equal to NaN |
| 189 | if (selfType === "number" && self !== self && that !== that) { |
| 190 | return true |
| 191 | } |
| 192 | if (selfType !== "object" && selfType !== "function") { |
| 193 | return false |
| 194 | } |
| 195 | |
| 196 | if (byReferenceInstances.has(self) || byReferenceInstances.has(that)) { |
| 197 | return false |
| 198 | } |
| 199 | |
| 200 | // For objects and functions, use cached comparison |
| 201 | return withCache(self, that, compareObjects) |
| 202 | } |
| 203 | |
| 204 | /** Helper to run comparison with proper visited tracking */ |
| 205 | function withVisitedTracking( |
no test coverage detected