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 |
import {getFirstCharacters} from '../binary-utils/get-first-characters';
|
|
| 2 |
|
1✔ |
| 3 |
/**
|
1✔ |
| 4 |
* Minimal JSON parser that throws more meaningful error messages |
1✔ |
| 5 |
*/ |
1✔ |
| 6 |
export function parseJSON(string: string): any { |
1✔ |
|
UNCOV
7
|
try {
|
× |
|
UNCOV
8
|
return JSON.parse(string); |
× |
|
UNCOV
9
|
} catch (_) {
|
× |
|
UNCOV
10
|
throw new Error(`Failed to parse JSON from data starting with "${getFirstCharacters(string)}"`); |
× |
|
UNCOV
11
|
} |
× |
|
UNCOV
12
|
} |
× |