( self: Record<PropertyKey, unknown>, that: Record<PropertyKey, unknown> )
| 338 | } |
| 339 | |
| 340 | function compareRecords( |
| 341 | self: Record<PropertyKey, unknown>, |
| 342 | that: Record<PropertyKey, unknown> |
| 343 | ): boolean { |
| 344 | const selfKeys = getAllObjectKeys(self) |
| 345 | const thatKeys = getAllObjectKeys(that) |
| 346 | |
| 347 | if (selfKeys.size !== thatKeys.size) { |
| 348 | return false |
| 349 | } |
| 350 | |
| 351 | for (const key of selfKeys) { |
| 352 | if (!(thatKeys.has(key)) || !compareBoth(self[key], that[key])) { |
| 353 | return false |
| 354 | } |
| 355 | } |
| 356 | |
| 357 | return true |
| 358 | } |
| 359 | |
| 360 | /** @internal */ |
| 361 | export function makeCompareMap<K, V>(keyEquivalence: Equivalence<K>, valueEquivalence: Equivalence<V>) { |
no test coverage detected