We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf87041 commit e949177Copy full SHA for e949177
node/package.json
@@ -2,6 +2,7 @@
2
"name": "tpy",
3
"version": "v1.0.0-pre-release-5",
4
"description": "🔑 A strongly typed Pylon API client.",
5
+ "author": "insyri",
6
"license": "MIT",
7
"type": "commonjs",
8
"main": "lib/mod.js",
src/fetch_polyfill.ts
@@ -5,9 +5,11 @@ if (
'process' in globalThis && // If Node
Number(globalThis.process.version.substring(1, 3)) < 18
) {
+ const fetch = (url: RequestInfo, init?: RequestInit): Promise<Response> =>
9
+ import('node-fetch').then(({ default: fetch }) => fetch(url, init));
10
Object.defineProperty(
11
globalThis,
12
'fetch',
- require('node-fetch'),
13
+ fetch,
14
);
15
}
0 commit comments