Skip to content

Commit 9f2ca62

Browse files
authored
Merge branch 'master' into better-types
2 parents b783a1a + 7d00e05 commit 9f2ca62

File tree

7 files changed

+23
-10
lines changed

7 files changed

+23
-10
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
"description": "Bare minimum fetch polyfill in 500 bytes",
55
"unpkg": "polyfill/index.js",
66
"main": "dist/unfetch.js",
7-
"module": "dist/unfetch.mjs",
8-
"jsnext:main": "dist/unfetch.mjs",
7+
"module": "dist/unfetch.module.js",
8+
"jsnext:main": "dist/unfetch.module.js",
99
"umd:main": "dist/unfetch.umd.js",
1010
"scripts": {
1111
"test": "eslint src test && jest",
12-
"build": "microbundle src/index.mjs && microbundle -f cjs polyfill/polyfill.mjs -o polyfill/index.js --no-sourcemap && cp dist/unfetch.mjs dist/unfetch.es.js",
12+
"build": "microbundle src/index.mjs && microbundle -f cjs polyfill/polyfill.mjs -o polyfill/index.js --no-sourcemap && cp dist/unfetch.module.js dist/unfetch.es.js",
1313
"prepare": "npm run -s build",
1414
"release": "cross-var npm run build -s && cross-var git commit -am $npm_package_version && cross-var git tag $npm_package_version && git push && git push --tags && npm publish"
1515
},
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = window.fetch || (window.fetch = require('unfetch').default || require('unfetch'));
1+
module.exports = self.fetch || (self.fetch = require('unfetch').default || require('unfetch'));
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
function r(m){return m && m.default || m;}
12
module.exports = global.fetch = global.fetch || (
2-
typeof process=='undefined' ? (require('unfetch').default || require('unfetch')) : (function(url, opts) {
3-
return (require('node-fetch').default || require('node-fetch'))(url.replace(/^\/\//g,'https://'), opts);
3+
typeof process=='undefined' ? r(require('unfetch')) : (function(url, opts) {
4+
return r(require('node-fetch'))(String(url).replace(/^\/\//g,'https://'), opts);
45
})
56
);

packages/isomorphic-unfetch/package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/isomorphic-unfetch/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
"browser": "browser.js",
1313
"main": "index.js",
1414
"types": "index.d.ts",
15-
"license": "MIT",
1615
"dependencies": {
17-
"node-fetch": "^2.2.0",
16+
"node-fetch": "^2.6.1",
1817
"unfetch": "^4.0.0"
1918
}
2019
}

polyfill/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"name": "unfetch-polyfill",
33
"main": "index.js",
4-
"module": "polyfill.mjs"
4+
"module": "polyfill.module.js"
55
}

polyfill/polyfill.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
import unfetch from '../src/index.mjs';
1+
import unfetch from '..';
22
if (!self.fetch) self.fetch = unfetch;

0 commit comments

Comments
 (0)