push
github
1188 of 1998 branches covered (59.46%)
Branch coverage included in aggregate %.
147 of 211 new or added lines in 13 files covered. (69.67%)
30011 existing lines in 424 files now uncovered.37457 of 108056 relevant lines covered (34.66%)
0.79 hits per line
| 1 |
// loaders.gl
|
1✔ |
| 2 |
// SPDX-License-Identifier: MIT
|
1✔ |
| 3 |
// Copyright vis.gl contributors
|
1✔ |
| 4 |
|
1✔ |
| 5 |
import {Buffer as BufferPolyfill} from './buffer';
|
|
| 6 |
|
1✔ |
| 7 |
/** Install the Node.js Buffer polyfill (NO-OP in Node.js) */
|
1✔ |
| 8 |
export function installBufferPolyfill(): typeof Buffer {
|
1✔ |
|
UNCOV
9
|
const Buffer_ = typeof Buffer !== 'undefined' ? Buffer : null; |
× |
|
UNCOV
10
|
if (!Buffer_) {
|
× |
|
UNCOV
11
|
// @ts-expect-error
|
× |
|
UNCOV
12
|
globalThis.Buffer = BufferPolyfill; |
× |
|
UNCOV
13
|
return BufferPolyfill as unknown as typeof Buffer;
|
× |
|
UNCOV
14
|
} |
× |
|
UNCOV
15
|
|
× |
|
UNCOV
16
|
globalThis.process = globalThis.process || {};
|
× |
|
UNCOV
17
|
// Buffer is a global variable in Node.js
|
× |
|
UNCOV
18
|
return Buffer_;
|
× |
|
UNCOV
19
|
} |
× |