github
595 of 835 branches covered (71.26%)
Branch coverage included in aggregate %.
66 of 101 new or added lines in 7 files covered. (65.35%)
8541 existing lines in 129 files now uncovered.18683 of 36740 relevant lines covered (50.85%)
11.74 hits per line
| 1 |
// luma.gl
|
1✔ |
| 2 |
// SPDX-License-Identifier: MIT
|
1✔ |
| 3 |
// Copyright (c) vis.gl contributors
|
1✔ |
| 4 |
|
1✔ |
| 5 |
import {TypedArray} from '@luma.gl/core';
|
1✔ |
| 6 |
|
1✔ |
| 7 |
/** deeply compare two arrays */
|
1✔ |
| 8 |
export function deepArrayEqual(
|
|
| 9 |
x: unknown | unknown[] | TypedArray, |
209✔ |
| 10 |
y: unknown | unknown[] | TypedArray |
209✔ |
| 11 |
): boolean {
|
209✔ |
| 12 |
if (x === y) {
|
|
| 13 |
return true; |
19✔ |
| 14 |
} |
|
| 15 |
if (isArray(x) && isArray(y) && x.length === y.length) {
|
|
|
UNCOV
16
|
for (let i = 0; i < x.length; ++i) { |
× |
|
UNCOV
17
|
if (x[i] !== y[i]) {
|
× |
|
UNCOV
18
|
return false; |
× |
|
UNCOV
19
|
} |
× |
|
UNCOV
20
|
} |
× |
|
UNCOV
21
|
return true; |
× |
|
UNCOV
22
|
} |
|
| 23 |
return false; |
190✔ |
| 24 |
} |
190✔ |
| 25 |
|
1✔ |
| 26 |
function isArray(x: unknown): x is unknown[] {
|
|
| 27 |
return Array.isArray(x) || ArrayBuffer.isView(x);
|
190✔ |
| 28 |
} |
190✔ |