whatwg-fetch
Advanced tools
Comparing version 3.6.6 to 3.6.7
@@ -7,5 +7,7 @@ (function (global, factory) { | ||
var global = | ||
/* eslint-disable no-prototype-builtins */ | ||
var g = | ||
(typeof globalThis !== 'undefined' && globalThis) || | ||
(typeof self !== 'undefined' && self) || | ||
// eslint-disable-next-line no-undef | ||
(typeof global !== 'undefined' && global) || | ||
@@ -15,7 +17,7 @@ {}; | ||
var support = { | ||
searchParams: 'URLSearchParams' in global, | ||
iterable: 'Symbol' in global && 'iterator' in Symbol, | ||
searchParams: 'URLSearchParams' in g, | ||
iterable: 'Symbol' in g && 'iterator' in Symbol, | ||
blob: | ||
'FileReader' in global && | ||
'Blob' in global && | ||
'FileReader' in g && | ||
'Blob' in g && | ||
(function() { | ||
@@ -29,4 +31,4 @@ try { | ||
})(), | ||
formData: 'FormData' in global, | ||
arrayBuffer: 'ArrayBuffer' in global | ||
formData: 'FormData' in g, | ||
arrayBuffer: 'ArrayBuffer' in g | ||
}; | ||
@@ -237,2 +239,3 @@ | ||
*/ | ||
// eslint-disable-next-line no-self-assign | ||
this.bodyUsed = this.bodyUsed; | ||
@@ -384,3 +387,3 @@ this._bodyInit = body; | ||
this.signal = options.signal || this.signal || (function () { | ||
if ('AbortController' in global) { | ||
if ('AbortController' in g) { | ||
var ctrl = new AbortController(); | ||
@@ -507,3 +510,3 @@ return ctrl.signal; | ||
exports.DOMException = global.DOMException; | ||
exports.DOMException = g.DOMException; | ||
try { | ||
@@ -569,3 +572,3 @@ new exports.DOMException(); | ||
try { | ||
return url === '' && global.location.href ? global.location.href : url | ||
return url === '' && g.location.href ? g.location.href : url | ||
} catch (e) { | ||
@@ -623,7 +626,7 @@ return url | ||
if (!global.fetch) { | ||
global.fetch = fetch; | ||
global.Headers = Headers; | ||
global.Request = Request; | ||
global.Response = Response; | ||
if (!g.fetch) { | ||
g.fetch = fetch; | ||
g.Headers = Headers; | ||
g.Request = Request; | ||
g.Response = Response; | ||
} | ||
@@ -630,0 +633,0 @@ |
33
fetch.js
@@ -1,4 +0,6 @@ | ||
var global = | ||
/* eslint-disable no-prototype-builtins */ | ||
var g = | ||
(typeof globalThis !== 'undefined' && globalThis) || | ||
(typeof self !== 'undefined' && self) || | ||
// eslint-disable-next-line no-undef | ||
(typeof global !== 'undefined' && global) || | ||
@@ -8,7 +10,7 @@ {} | ||
var support = { | ||
searchParams: 'URLSearchParams' in global, | ||
iterable: 'Symbol' in global && 'iterator' in Symbol, | ||
searchParams: 'URLSearchParams' in g, | ||
iterable: 'Symbol' in g && 'iterator' in Symbol, | ||
blob: | ||
'FileReader' in global && | ||
'Blob' in global && | ||
'FileReader' in g && | ||
'Blob' in g && | ||
(function() { | ||
@@ -22,4 +24,4 @@ try { | ||
})(), | ||
formData: 'FormData' in global, | ||
arrayBuffer: 'ArrayBuffer' in global | ||
formData: 'FormData' in g, | ||
arrayBuffer: 'ArrayBuffer' in g | ||
} | ||
@@ -230,2 +232,3 @@ | ||
*/ | ||
// eslint-disable-next-line no-self-assign | ||
this.bodyUsed = this.bodyUsed | ||
@@ -377,3 +380,3 @@ this._bodyInit = body | ||
this.signal = options.signal || this.signal || (function () { | ||
if ('AbortController' in global) { | ||
if ('AbortController' in g) { | ||
var ctrl = new AbortController(); | ||
@@ -500,3 +503,3 @@ return ctrl.signal; | ||
export var DOMException = global.DOMException | ||
export var DOMException = g.DOMException | ||
try { | ||
@@ -562,3 +565,3 @@ new DOMException() | ||
try { | ||
return url === '' && global.location.href ? global.location.href : url | ||
return url === '' && g.location.href ? g.location.href : url | ||
} catch (e) { | ||
@@ -616,7 +619,7 @@ return url | ||
if (!global.fetch) { | ||
global.fetch = fetch | ||
global.Headers = Headers | ||
global.Request = Request | ||
global.Response = Response | ||
if (!g.fetch) { | ||
g.fetch = fetch | ||
g.Headers = Headers | ||
g.Request = Request | ||
g.Response = Response | ||
} |
{ | ||
"name": "whatwg-fetch", | ||
"description": "A window.fetch polyfill.", | ||
"version": "3.6.6", | ||
"version": "3.6.7", | ||
"main": "./dist/fetch.umd.js", | ||
@@ -13,3 +13,2 @@ "module": "./fetch.js", | ||
"eslint": "^7.20.0", | ||
"eslint-plugin-github": "4.1.1", | ||
"karma": "^3.0.0", | ||
@@ -16,0 +15,0 @@ "karma-chai": "^0.1.0", |
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
55437
16
1091