@jsenv/fetch 1.1.71 → 1.1.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/fetch",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.73",
|
|
4
4
|
"description": "Unified url fetcher (http, http, file, data)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@jsenv/urls": "2.5.2",
|
|
39
|
-
"@jsenv/server": "15.
|
|
39
|
+
"@jsenv/server": "15.3.0",
|
|
40
40
|
"node-fetch": "3.3.2"
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
// https://github.com/node-fetch/node-fetch/blob/8c197f8982a238b3c345c64b17bfa92e16b4f7c4/src/response.js#L1
|
|
2
2
|
|
|
3
|
-
import nodeFetch, { Response } from "node-fetch";
|
|
4
|
-
import { Agent } from "node:https";
|
|
5
|
-
|
|
6
3
|
import { fetchFileSystem } from "@jsenv/server";
|
|
7
4
|
import {
|
|
8
5
|
fileHandleToReadableStream,
|
|
9
6
|
isFileHandle,
|
|
10
7
|
} from "@jsenv/server/src/interfacing_with_node/body.js";
|
|
11
8
|
import { DATA_URL } from "@jsenv/urls";
|
|
9
|
+
import nodeFetch, { Response } from "node-fetch";
|
|
10
|
+
import { Agent } from "node:https";
|
|
12
11
|
|
|
13
12
|
export const fetchUrl = async (
|
|
14
13
|
url,
|
|
@@ -25,7 +24,7 @@ export const fetchUrl = async (
|
|
|
25
24
|
) => {
|
|
26
25
|
try {
|
|
27
26
|
url = String(new URL(url));
|
|
28
|
-
} catch
|
|
27
|
+
} catch {
|
|
29
28
|
throw new Error(
|
|
30
29
|
`fetchUrl first argument must be an absolute url, received ${url}`,
|
|
31
30
|
);
|