From b3ee9bb3b7c2e45f55c7e22e987d21c527576046 Mon Sep 17 00:00:00 2001 From: Jake Champion Date: Fri, 31 Jul 2020 00:58:48 +0100 Subject: [PATCH 1/6] Stop using top-level `this` to stop rollup warning fixes https://github.com/github/fetch/issues/802 --- fetch.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fetch.js b/fetch.js index b695d15b..5f113cf4 100644 --- a/fetch.js +++ b/fetch.js @@ -1,7 +1,8 @@ -var global = (function(self) { - return self - // eslint-disable-next-line no-invalid-this -})(typeof self !== 'undefined' ? self : this) +var global = + (typeof globalThis !== "undefined" && globalThis) || + (typeof self !== "undefined" && self) || + (typeof global !== "undefined" && global); + var support = { searchParams: 'URLSearchParams' in global, iterable: 'Symbol' in global && 'iterator' in Symbol, From 6e0daece02e1574a90305fe781550d1d1caa93df Mon Sep 17 00:00:00 2001 From: Jake Champion Date: Fri, 31 Jul 2020 00:59:10 +0100 Subject: [PATCH 2/6] Update rollup.config.js --- rollup.config.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 3ed622ca..d4297335 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -3,7 +3,6 @@ export default { output: { file: 'dist/fetch.umd.js', format: 'umd', - name: 'WHATWGFetch', - strict: false + name: 'WHATWGFetch' } } From f74898a793b6c75c70f8976a41ecc53f1d568b4c Mon Sep 17 00:00:00 2001 From: Jake Champion Date: Fri, 31 Jul 2020 01:03:00 +0100 Subject: [PATCH 3/6] Update fetch.js --- fetch.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fetch.js b/fetch.js index 5f113cf4..cc894bb0 100644 --- a/fetch.js +++ b/fetch.js @@ -1,7 +1,7 @@ var global = - (typeof globalThis !== "undefined" && globalThis) || - (typeof self !== "undefined" && self) || - (typeof global !== "undefined" && global); + (typeof globalThis !== 'undefined' && globalThis) || + (typeof self !== 'undefined' && self) || + (typeof global !== 'undefined' && global); var support = { searchParams: 'URLSearchParams' in global, From 6b4e359c90a19d3cade5cea1307aa99d3bfcca96 Mon Sep 17 00:00:00 2001 From: Jake Champion Date: Fri, 31 Jul 2020 01:09:04 +0100 Subject: [PATCH 4/6] Update fetch.js --- fetch.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fetch.js b/fetch.js index cc894bb0..f1d6b46f 100644 --- a/fetch.js +++ b/fetch.js @@ -1,7 +1,6 @@ var global = - (typeof globalThis !== 'undefined' && globalThis) || (typeof self !== 'undefined' && self) || - (typeof global !== 'undefined' && global); + (typeof global !== 'undefined' && global) var support = { searchParams: 'URLSearchParams' in global, From c59f6be72cf8b680d0ddc03fa2995b65d5a36532 Mon Sep 17 00:00:00 2001 From: Jake Champion Date: Fri, 31 Jul 2020 01:12:44 +0100 Subject: [PATCH 5/6] Update fetch.js --- fetch.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fetch.js b/fetch.js index f1d6b46f..cd1b1e23 100644 --- a/fetch.js +++ b/fetch.js @@ -1,5 +1,4 @@ -var global = - (typeof self !== 'undefined' && self) || +var global = (typeof self !== 'undefined' && self) || (typeof global !== 'undefined' && global) var support = { From d4c3fb8a50fb5df437f369c9f47b39507446f1ec Mon Sep 17 00:00:00 2001 From: Jake Champion Date: Fri, 31 Jul 2020 01:19:55 +0100 Subject: [PATCH 6/6] Update fetch.js --- fetch.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fetch.js b/fetch.js index cd1b1e23..b763a53a 100644 --- a/fetch.js +++ b/fetch.js @@ -1,5 +1,4 @@ -var global = (typeof self !== 'undefined' && self) || - (typeof global !== 'undefined' && global) +var global = (typeof self !== 'undefined' && self) || (typeof global !== 'undefined' && global) var support = { searchParams: 'URLSearchParams' in global,