push
github
1026 of 1145 branches covered (89.61%)
Branch coverage included in aggregate %.
23 of 23 new or added lines in 3 files covered. (100.0%)
17 existing lines in 1 file now uncovered.3240 of 4032 relevant lines covered (80.36%)
47.42 hits per line
UNCOV
1
|
import fs from "node:fs/promises";
|
|
UNCOV
2
|
|
× |
UNCOV
3
|
import nodeFetch from "node-fetch";
|
× |
UNCOV
4
|
|
× |
UNCOV
5
|
export async function readFile(urlOrPath: string) { |
× |
UNCOV
6
|
if (urlOrPath.startsWith("http")) { |
× |
UNCOV
7
|
const response = await nodeFetch(urlOrPath);
|
× |
UNCOV
8
|
|
× |
UNCOV
9
|
return await response.text();
|
× |
UNCOV
10
|
} |
× |
UNCOV
11
|
|
× |
UNCOV
12
|
if (urlOrPath.startsWith("file")) { |
× |
UNCOV
13
|
return await fs.readFile(new URL(urlOrPath), "utf8"); |
× |
UNCOV
14
|
} |
× |
UNCOV
15
|
|
× |
UNCOV
16
|
return await fs.readFile(urlOrPath, "utf8"); |
× |
UNCOV
17
|
} |
× |