Skip to content

Commit f00c553

Browse files
committed
Fetch 2 and 3 dependencie
1 parent 4727149 commit f00c553

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
"build:fix-file": "mv -f dist/src dist/types && find dist/types -name \"*.d.mts\" -exec sh -c 'mv \"$0\" \"${0%.d.mts}.d.ts\"' {} \\; && find dist/types -name \"*.d.ts\" -exec sed -i 's/\\.mjs//g' {} \\;",
2424
"build": "rm -rf dist && npm run build:cjs && npm run build:esm && npm run build:types && npm run build:fix-file"
2525
},
26-
"dependencies": {
27-
"node-fetch": "^3.3.2"
26+
"peerDependencies": {
27+
"node-fetch": "^2.6.0 || ^3.0.0"
2828
},
2929
"keywords": [
3030
"Telesign",

src/RequestWrapper.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ async function fetchWithTimeout(url, options) {
2121
/** @type {any} */
2222
let fetch = (typeof window !== 'undefined' ? window : global).fetch || null;
2323
if (!fetch) {
24-
fetch = (await import('node-fetch')).default;
24+
fetch = await import('node-fetch').then(m => m.default ?? m);
2525
}
2626
return await Promise.race([
2727
fetch(url, options),

0 commit comments

Comments
 (0)