node-fetch patch by jimmywarting #181
@ -1,6 +1,7 @@
|
|||||||
if (typeof fetch === "undefined") global.fetch = require("node-fetch");
|
const fetchS = (...args) => import("node-fetch").then(mod => mod.default(...args));
|
||||||
|
if (typeof fetch === "undefined") global.fetch = fetchS;
|
||||||
module.exports = {
|
module.exports = {
|
||||||
JSON: async (url = "", options) => await (await fetch(url, options)).json(),
|
JSON: async (url = "", options) => await (await fetchS(url, options)).json(),
|
||||||
TEXT: async (url = "", options) => await (await fetch(url, options)).text(),
|
TEXT: async (url = "", options) => await (await fetchS(url, options)).text(),
|
||||||
BUFFER: async (url = "", options) => Buffer.from(await (await fetch(url, options)).arrayBuffer()),
|
BUFFER: async (url = "", options) => Buffer.from(await (await fetchS(url, options)).arrayBuffer()),
|
||||||
}
|
}
|
8263
package-lock.json
generated
8263
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -67,7 +67,7 @@
|
|||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"minimist": "^1.2.5",
|
"minimist": "^1.2.5",
|
||||||
"node-cron": "^3.0.0",
|
"node-cron": "^3.0.0",
|
||||||
"node-fetch": "2.6.1",
|
"node-fetch": "^2.6.1",
|
||||||
"oci-sdk": "^2.0.0",
|
"oci-sdk": "^2.0.0",
|
||||||
"open": "^8.0.0",
|
"open": "^8.0.0",
|
||||||
"properties-to-json": "^0.2.1",
|
"properties-to-json": "^0.2.1",
|
||||||
|
Reference in New Issue
Block a user