github
4769 of 5426 branches covered (87.89%)
Branch coverage included in aggregate %.
13 of 14 new or added lines in 3 files covered. (92.86%)
6854 existing lines in 152 files now uncovered.47062 of 58712 relevant lines covered (80.16%)
4938.11 hits per line
1 |
// deck.gl
|
1✔ |
2 |
// SPDX-License-Identifier: MIT
|
1✔ |
3 |
// Copyright (c) vis.gl contributors
|
1✔ |
4 |
|
1✔ |
5 |
// TODO - can we reuse the core util? Assuming we don't want to export it
|
1✔ |
6 |
|
1✔ |
7 |
/* eslint-disable complexity */
|
1✔ |
8 |
|
1✔ |
9 |
// Compares two objects to see if their keys are shallowly equal
|
1✔ |
10 |
export function shallowEqualObjects(a, b) {
|
|
UNCOV
11
|
if (a === b) {
|
× |
UNCOV
12
|
return true; |
× |
UNCOV
13
|
} |
× |
UNCOV
14
|
|
× |
UNCOV
15
|
if (typeof a !== 'object' || a === null || typeof b !== 'object' || b === null) { |
× |
UNCOV
16
|
return false; |
× |
UNCOV
17
|
} |
× |
UNCOV
18
|
|
× |
UNCOV
19
|
if (Object.keys(a).length !== Object.keys(b).length) {
|
× |
UNCOV
20
|
return false; |
× |
UNCOV
21
|
} |
× |
UNCOV
22
|
|
× |
UNCOV
23
|
for (const key in a) { |
× |
UNCOV
24
|
if (!(key in b) || a[key] !== b[key]) {
|
× |
UNCOV
25
|
return false; |
× |
UNCOV
26
|
} |
× |
UNCOV
27
|
} |
× |
UNCOV
28
|
for (const key in b) { |
× |
UNCOV
29
|
if (!(key in a)) {
|
× |
30 |
return false; |
× |
31 |
} |
× |
UNCOV
32
|
} |
× |
UNCOV
33
|
return true; |
× |
UNCOV
34
|
} |
× |