Comparing version 0.2.1 to 0.2.2
{ | ||
"name": "xfetch-js", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "node.js", |
@@ -79,4 +79,4 @@ /* | ||
return isBrowser | ||
? extend({ fetch: fetch.bind(window), URL, Response, URLSearchParams, baseURI: document.baseURI }) | ||
? extend({ fetch: fetch.bind(window), URL, Response, URLSearchParams, Headers, baseURI: document.baseURI }) | ||
: extend() | ||
}) |
@@ -1,1 +0,1 @@ | ||
((a,b)=>{"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?module.exports=b():a.xf=b()})(this,()=>{const a=["get","post","put","patch","delete","head"];class b extends Error{constructor(a){super(a.statusText),this.name="HTTPError",this.response=a}}class c extends Promise{}for(const a of["arrayBuffer","blob","formData","json","text"])c.prototype[a]=function(b){return this.then(b=>b[a]()).then(b||(a=>a))};const{assign:d}=Object,e=a=>a.reduce((a,[b,c])=>(a[b]=c,a),{}),f=a=>{if(!a.ok)throw new b(a);return a},g=(h={})=>{const i=(a,b={})=>{d(b,h);const g=a=>new b.URLSearchParams(a).toString(),i=new b.URL(a,b.baseURI||void 0);return b.headers?b.headers instanceof b.Headers&&(b.headers=e([...b.headers.entries()])):b.headers={},b.json?(b.body=JSON.stringify(b.json),b.headers["Content-Type"]="application/json"):b.form&&(b.body=g(b.form),b.headers["Content-Type"]="application/x-www-form-urlencoded"),b.qs&&("string"==typeof b.qs&&(b.qs=(a=>e([...new b.URLSearchParams(a).entries()]))(b.qs)),i.search=g(d(e([...i.searchParams.entries()]),b.qs))),b.credentials||(b.credentials="same-origin"),c.resolve(b.fetch(i,b).then(f))};for(const b of a)i[b]=(a,c={})=>(c.method=b,i(a,c));return i.extend=a=>g(d({},h,a)),i.HTTPError=b,i},h="undefined"!=typeof window&&"undefined"!=typeof document;return h?g({fetch:fetch.bind(window),URL,Response,URLSearchParams,baseURI:document.baseURI}):g()}); | ||
((a,b)=>{"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?module.exports=b():a.xf=b()})(this,()=>{const a=["get","post","put","patch","delete","head"];class b extends Error{constructor(a){super(a.statusText),this.name="HTTPError",this.response=a}}class c extends Promise{}for(const a of["arrayBuffer","blob","formData","json","text"])c.prototype[a]=function(b){return this.then(b=>b[a]()).then(b||(a=>a))};const{assign:d}=Object,e=a=>a.reduce((a,[b,c])=>(a[b]=c,a),{}),f=a=>{if(!a.ok)throw new b(a);return a},g=(h={})=>{const i=(a,b={})=>{d(b,h);const g=a=>new b.URLSearchParams(a).toString(),i=new b.URL(a,b.baseURI||void 0);return b.headers?b.headers instanceof b.Headers&&(b.headers=e([...b.headers.entries()])):b.headers={},b.json?(b.body=JSON.stringify(b.json),b.headers["Content-Type"]="application/json"):b.form&&(b.body=g(b.form),b.headers["Content-Type"]="application/x-www-form-urlencoded"),b.qs&&("string"==typeof b.qs&&(b.qs=(a=>e([...new b.URLSearchParams(a).entries()]))(b.qs)),i.search=g(d(e([...i.searchParams.entries()]),b.qs))),b.credentials||(b.credentials="same-origin"),c.resolve(b.fetch(i,b).then(f))};for(const b of a)i[b]=(a,c={})=>(c.method=b,i(a,c));return i.extend=a=>g(d({},h,a)),i.HTTPError=b,i},h="undefined"!=typeof window&&"undefined"!=typeof document;return h?g({fetch:fetch.bind(window),URL,Response,URLSearchParams,Headers,baseURI:document.baseURI}):g()}); |
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
14421