github
13 of 238 branches covered (5.46%)
Branch coverage included in aggregate %.
0 of 472 new or added lines in 41 files covered. (0.0%)
19728 existing lines in 193 files now uncovered.91 of 28170 relevant lines covered (0.32%)
0.02 hits per line
UNCOV
1
|
// luma.gl, MIT license
|
|
UNCOV
2
|
// Copyright (c) vis.gl contributors
|
× |
UNCOV
3
|
|
× |
UNCOV
4
|
const uidCounters: Record<string, number> = {}; |
× |
UNCOV
5
|
|
× |
UNCOV
6
|
/**
|
× |
UNCOV
7
|
* Returns a UID. |
× |
UNCOV
8
|
* @param id= - Identifier base name |
× |
UNCOV
9
|
* @return uid |
× |
UNCOV
10
|
**/ |
× |
UNCOV
11
|
export function uid(id: string = 'id'): string { |
× |
UNCOV
12
|
uidCounters[id] = uidCounters[id] || 1;
|
× |
UNCOV
13
|
const count = uidCounters[id]++;
|
× |
UNCOV
14
|
return `${id}-${count}`; |
× |
UNCOV
15
|
} |
× |
UNCOV
16
|
|
× |
UNCOV
17
|
/** Returns true if given object is empty, false otherwise. */
|
× |
UNCOV
18
|
export function isObjectEmpty(obj: object): boolean {
|
× |
UNCOV
19
|
let isEmpty = true;
|
× |
UNCOV
20
|
// @ts-ignore key is unused
|
× |
UNCOV
21
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
× |
UNCOV
22
|
for (const key in obj) { |
× |
UNCOV
23
|
isEmpty = false;
|
× |
UNCOV
24
|
break;
|
× |
UNCOV
25
|
} |
× |
UNCOV
26
|
return isEmpty;
|
× |
UNCOV
27
|
} |
× |