(a: TypedArray, b: TypedArray)
| 74 | type TypedArray = Pick<Uint8Array | BigUint64Array, "length" | number>; |
| 75 | const TypedArray = Object.getPrototypeOf(Uint8Array); |
| 76 | function compareTypedArrays(a: TypedArray, b: TypedArray) { |
| 77 | if (a.length !== b.length) return false; |
| 78 | for (let i = 0; i < b.length; i++) { |
| 79 | if (!sameValueZero(a[i], b[i])) return false; |
| 80 | } |
| 81 | return true; |
| 82 | } |
| 83 | |
| 84 | /** Check both strict equality (`0 == -0`) and `Object.is` (`NaN == NaN`) */ |
| 85 | function sameValueZero(a: unknown, b: unknown) { |
no test coverage detected