• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

visgl / luma.gl / 16861002932

10 Aug 2025 11:45AM UTC coverage: 51.305% (-22.6%) from 73.868%
16861002932

Pull #2416

github

web-flow
Merge 92c90562d into f90a93cf3
Pull Request #2416: chore: Tests for texture reads

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

Source File
Press 'n' to go to next uncovered line, 'b' for previous

26.92
/modules/engine/src/utils/deep-equal.ts
1
// luma.gl
1✔
2
// SPDX-License-Identifier: MIT
1✔
3
// Copyright (c) vis.gl contributors
1✔
4

1✔
5
/**
1✔
6
 * Fast partial deep equal for prop.
1✔
7
 *
1✔
8
 * @param a Prop
1✔
9
 * @param b Prop to compare against `a`
1✔
10
 * @param depth Depth to which to recurse in nested Objects/Arrays. Use 0 (default) for shallow comparison, -1 for infinite depth
1✔
11
 */
1✔
12
/* eslint-disable complexity */
1✔
13
export function deepEqual(a: any, b: any, depth: number): boolean {
1✔
UNCOV
14
  if (a === b) {
×
UNCOV
15
    return true;
×
UNCOV
16
  }
×
UNCOV
17
  if (!depth || !a || !b) {
×
UNCOV
18
    return false;
×
UNCOV
19
  }
×
UNCOV
20
  if (Array.isArray(a)) {
×
UNCOV
21
    if (!Array.isArray(b) || a.length !== b.length) {
×
UNCOV
22
      return false;
×
UNCOV
23
    }
×
UNCOV
24
    for (let i = 0; i < a.length; i++) {
×
UNCOV
25
      if (!deepEqual(a[i], b[i], depth - 1)) {
×
UNCOV
26
        return false;
×
UNCOV
27
      }
×
UNCOV
28
    }
×
UNCOV
29
    return true;
×
UNCOV
30
  }
×
UNCOV
31
  if (Array.isArray(b)) {
×
UNCOV
32
    return false;
×
UNCOV
33
  }
×
UNCOV
34
  if (typeof a === 'object' && typeof b === 'object') {
×
UNCOV
35
    const aKeys = Object.keys(a);
×
UNCOV
36
    const bKeys = Object.keys(b);
×
UNCOV
37
    if (aKeys.length !== bKeys.length) {
×
UNCOV
38
      return false;
×
UNCOV
39
    }
×
UNCOV
40
    for (const key of aKeys) {
×
UNCOV
41
      if (!b.hasOwnProperty(key)) {
×
42
        return false;
×
43
      }
×
UNCOV
44
      if (!deepEqual(a[key], b[key], depth - 1)) {
×
UNCOV
45
        return false;
×
UNCOV
46
      }
×
UNCOV
47
    }
×
UNCOV
48
    return true;
×
UNCOV
49
  }
×
50
  return false;
×
51
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc