Comparing version 3.1.1 to 3.1.2
@@ -20,3 +20,3 @@ var index = typeof fetch=='function' ? fetch.bind() : function(url, options) { | ||
request.send(options.body); | ||
request.send(options.body || null); | ||
@@ -23,0 +23,0 @@ function response() { |
@@ -1,2 +0,2 @@ | ||
var e="function"==typeof fetch?fetch.bind():function(e,t){return t=t||{},new Promise(function(n,r){function s(){var e,t=[],n=[],r={};return o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(s,o,u){t.push(o=o.toLowerCase()),n.push([o,u]),e=r[o],r[o]=e?e+","+u:u}),{ok:2==(o.status/100|0),status:o.status,statusText:o.statusText,url:o.responseURL,clone:s,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(o.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([o.response]))},headers:{keys:function(){return t},entries:function(){return n},get:function(e){return r[e.toLowerCase()]},has:function(e){return e.toLowerCase()in r}}}}var o=new XMLHttpRequest;o.open(t.method||"get",e,!0);for(var u in t.headers)o.setRequestHeader(u,t.headers[u]);o.withCredentials="include"==t.credentials,o.onload=function(){n(s())},o.onerror=r,o.send(t.body)})};module.exports=e; | ||
var e="function"==typeof fetch?fetch.bind():function(e,n){return n=n||{},new Promise(function(t,r){function s(){var e,n=[],t=[],r={};return o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(s,o,u){n.push(o=o.toLowerCase()),t.push([o,u]),e=r[o],r[o]=e?e+","+u:u}),{ok:2==(o.status/100|0),status:o.status,statusText:o.statusText,url:o.responseURL,clone:s,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(o.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([o.response]))},headers:{keys:function(){return n},entries:function(){return t},get:function(e){return r[e.toLowerCase()]},has:function(e){return e.toLowerCase()in r}}}}var o=new XMLHttpRequest;o.open(n.method||"get",e,!0);for(var u in n.headers)o.setRequestHeader(u,n.headers[u]);o.withCredentials="include"==n.credentials,o.onload=function(){t(s())},o.onerror=r,o.send(n.body||null)})};module.exports=e; | ||
//# sourceMappingURL=unfetch.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.unfetch=n()}(this,function(){return"function"==typeof fetch?fetch.bind():function(e,n){return n=n||{},new Promise(function(t,o){function r(){var e,n=[],t=[],o={};return s.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(r,s,u){n.push(s=s.toLowerCase()),t.push([s,u]),e=o[s],o[s]=e?e+","+u:u}),{ok:2==(s.status/100|0),status:s.status,statusText:s.statusText,url:s.responseURL,clone:r,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},headers:{keys:function(){return n},entries:function(){return t},get:function(e){return o[e.toLowerCase()]},has:function(e){return e.toLowerCase()in o}}}}var s=new XMLHttpRequest;s.open(n.method||"get",e,!0);for(var u in n.headers)s.setRequestHeader(u,n.headers[u]);s.withCredentials="include"==n.credentials,s.onload=function(){t(r())},s.onerror=o,s.send(n.body)})}}); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.unfetch=n()}(this,function(){return"function"==typeof fetch?fetch.bind():function(e,n){return n=n||{},new Promise(function(t,o){function r(){var e,n=[],t=[],o={};return s.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(r,s,u){n.push(s=s.toLowerCase()),t.push([s,u]),e=o[s],o[s]=e?e+","+u:u}),{ok:2==(s.status/100|0),status:s.status,statusText:s.statusText,url:s.responseURL,clone:r,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},headers:{keys:function(){return n},entries:function(){return t},get:function(e){return o[e.toLowerCase()]},has:function(e){return e.toLowerCase()in o}}}}var s=new XMLHttpRequest;s.open(n.method||"get",e,!0);for(var u in n.headers)s.setRequestHeader(u,n.headers[u]);s.withCredentials="include"==n.credentials,s.onload=function(){t(r())},s.onerror=o,s.send(n.body||null)})}}); | ||
//# sourceMappingURL=unfetch.umd.js.map |
{ | ||
"name": "unfetch", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"description": "Bare minimum fetch polyfill in 500 bytes", | ||
@@ -5,0 +5,0 @@ "unpkg": "dist/unfetch.umd.js", |
<p align="center"> | ||
<img src="https://i.imgur.com/JaXEFNp.png" width="300" height="300" alt="unfetch"> | ||
<img src="https://i.imgur.com/0cSIPzP.png" width="300" height="300" alt="unfetch"> | ||
<br> | ||
<a href="https://www.npmjs.org/package/unfetch"><img src="https://img.shields.io/npm/v/unfetch.svg?style=flat" alt="npm"></a> | ||
<a href="https://cdn.jsdelivr.net/npm/unfetch/dist/unfetch.umd.js"><img src="http://img.badgesize.io/https://cdn.jsdelivr.net/npm/unfetch/dist/unfetch.umd.js?compression=gzip" alt="gzip size"></a> | ||
<a href="https://packagephobia.now.sh/result?p=unfetch"><img src="https://packagephobia.now.sh/badge?p=unfetch" alt="install size"></a> | ||
<a href="https://unpkg.com/unfetch/polyfill"><img src="https://img.badgesize.io/https://unpkg.com/unfetch/polyfill/index.js?compression=gzip" alt="gzip size"></a> | ||
<a href="https://www.npmjs.com/package/unfetch"><img src="https://img.shields.io/npm/dt/unfetch.svg" alt="downloads" ></a> | ||
@@ -8,0 +7,0 @@ <a href="https://travis-ci.org/developit/unfetch"><img src="https://travis-ci.org/developit/unfetch.svg?branch=master" alt="travis"></a> |
@@ -17,2 +17,2 @@ import { | ||
export default unfetch; | ||
export = unfetch; |
@@ -20,3 +20,3 @@ export default typeof fetch=='function' ? fetch.bind() : function(url, options) { | ||
request.send(options.body); | ||
request.send(options.body || null); | ||
@@ -23,0 +23,0 @@ function response() { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28195
241