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

visgl / luma.gl / 17192022436

24 Aug 2025 06:02PM UTC coverage: 62.079% (-13.2%) from 75.234%
17192022436

Pull #2437

github

web-flow
Merge 562c391b0 into 8314ecefa
Pull Request #2437: test(engine): add ShaderPassRenderer test

956 of 1559 branches covered (61.32%)

Branch coverage included in aggregate %.

491 of 666 new or added lines in 7 files covered. (73.72%)

5291 existing lines in 117 files now uncovered.

23238 of 37414 relevant lines covered (62.11%)

3.53 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