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
UNCOV
1
|
// deck.gl
|
|
UNCOV
2
|
// SPDX-License-Identifier: MIT
|
× |
UNCOV
3
|
// Copyright (c) vis.gl contributors
|
× |
UNCOV
4
|
× | |
UNCOV
5
|
/* global document */
|
× |
UNCOV
6
|
× | |
UNCOV
7
|
// Ensure we only load a script once
|
× |
UNCOV
8
|
const scriptLoadPromises = {}; |
× |
UNCOV
9
|
× | |
UNCOV
10
|
export function loadScript(url) { |
× |
11 |
if (!scriptLoadPromises[url]) {
|
× |
12 |
const script = document.createElement('script');
|
× |
13 |
script.type = 'text/javascript';
|
× |
14 |
script.src = url; |
× |
15 |
const head = document.querySelector('head');
|
× |
16 |
head.appendChild(script); |
× |
17 | × | |
18 |
scriptLoadPromises[url] = new Promise(resolve => {
|
× |
19 |
script.onload = resolve; |
× |
20 |
}); |
× |
21 |
} |
× |
22 |
return scriptLoadPromises[url];
|
× |
23 |
} |
× |