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

glideapps / glide-data-grid / 7333166280

26 Dec 2023 10:45PM UTC coverage: 90.585% (+4.2%) from 86.42%
7333166280

Pull #810

github

jassmith
5.99.9-charlie1
Pull Request #810: 6.0.0

2594 of 3246 branches covered (0.0%)

3363 of 3831 new or added lines in 62 files covered. (87.78%)

265 existing lines in 12 files now uncovered.

15759 of 17397 relevant lines covered (90.58%)

3076.99 hits per line

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

88.14
/packages/core/src/common/support.ts
1
export function proveType<T>(_val: T) {
1✔
2
    // do nothing, just prove the compiler thinks the types match
20,046✔
3
}
20,046✔
4

1✔
UNCOV
5
function panic(message: string = "This should not happen"): never {
×
6
    throw new Error(message);
×
UNCOV
7
}
×
8

1✔
9
export function assert(fact: boolean, message: string = "Assertion failed"): asserts fact {
1✔
10
    if (fact) return;
536!
11
    return panic(message);
×
UNCOV
12
}
×
13

1✔
14
export function assertNever(_never: never, msg?: string): never {
1✔
15
    return panic(msg ?? "Hell froze over");
×
UNCOV
16
}
×
17
export function maybe<T>(fn: () => T, defaultValue: T) {
1✔
18
    try {
2✔
19
        return fn();
2✔
20
    } catch {
2✔
21
        return defaultValue;
1✔
22
    }
1✔
23
}
2✔
24

1✔
25
// The following code is licensed under the MIT license to Luke Edwards
1✔
26
// Original license and code can be found here: https://github.com/lukeed/dequal/blob/master/license
1✔
27
// I have merely "ported" it to be TS (any any any) and directly included it for convenience.
1✔
28
const has = Object.prototype.hasOwnProperty;
1✔
29
// eslint-disable-next-line sonarjs/cognitive-complexity
1✔
30
export function deepEqual(foo: any, bar: any): boolean {
1✔
31
    let ctor: any, len: number;
13✔
32
    if (foo === bar) return true;
13✔
33

6✔
34
    // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
6✔
35
    if (foo && bar && (ctor = foo.constructor) === bar.constructor) {
13✔
36
        if (ctor === Date) return foo.getTime() === bar.getTime();
5!
37
        if (ctor === RegExp) return foo.toString() === bar.toString();
5!
38

5✔
39
        if (ctor === Array) {
5✔
40
            if ((len = foo.length) === bar.length) {
2✔
41
                while (len-- && deepEqual(foo[len], bar[len]));
1✔
42
            }
1✔
43
            return len === -1;
2✔
44
        }
2✔
45

3✔
46
        // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
3✔
47
        if (!ctor || typeof foo === "object") {
5✔
48
            len = 0;
3✔
49
            // eslint-disable-next-line guard-for-in
3✔
50
            for (ctor in foo) {
3✔
51
                if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
5!
52
                if (!(ctor in bar) || !deepEqual(foo[ctor], bar[ctor])) return false;
5!
53
            }
5✔
54
            return Object.keys(bar).length === len;
3✔
55
        }
3✔
56
    }
5✔
57

1✔
58
    return foo !== foo && bar !== bar;
13!
59
}
13✔
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

© 2025 Coveralls, Inc