From 32107759e298c8f2e97cd630009b8b661e2eeaee Mon Sep 17 00:00:00 2001 From: Norbert Renner Date: Mon, 8 May 2023 17:15:58 +0200 Subject: [PATCH] Re-add fetch polyfill (#727) Removed in #367, but core-js does not include fetch, and eslint-plugin-compat just doesn't seem to complain when inside an if block. --- .eslintrc.json | 11 ++++++++++- README.md | 2 ++ package.json | 3 ++- yarn.lock | 5 +++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 8b4be5a..fa0b2d4 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -5,6 +5,15 @@ "es2021": true }, "settings": { - "polyfills": ["URL", "Promise", "navigator", "Uint8Array", "performance", "location.hostname", "document.body"] + "polyfills": [ + "URL", + "Promise", + "navigator", + "Uint8Array", + "performance", + "location.hostname", + "document.body", + "fetch" + ] } } diff --git a/README.md b/README.md index a8dc43d..843361b 100644 --- a/README.md +++ b/README.md @@ -142,3 +142,5 @@ Copyright (c) 2018 Norbert Renner and [contributors](https://github.com/nrenner/ [CC0-1.0 License](https://github.com/ideditor/temaki/blob/main/LICENSE.md) - [leaflet-osm-notes](https://github.com/osmlab/leaflet-osm-notes) [The Unlicense](https://github.com/osmlab/leaflet-osm-notes/blob/gh-pages/LICENSE) +- [Fetch polyfill](https://github.com/Github/fetch) + Copyright (c) 2014-2016 GitHub, Inc.; [MIT License](https://github.com/github/fetch/blob/master/LICENSE) diff --git a/package.json b/package.json index 26ad32b..9153133 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,8 @@ "regenerator-runtime": "0.13.11", "togpx": "nrenner/togpx#722d291", "tokml": "0.4.0", - "url-search-params": "1.1.0" + "url-search-params": "1.1.0", + "whatwg-fetch": "^3.6.2" }, "devDependencies": { "@babel/cli": "7.19.3", diff --git a/yarn.lock b/yarn.lock index bbf9923..41f23fb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12602,6 +12602,11 @@ whatwg-encoding@^2.0.0: dependencies: iconv-lite "0.6.3" +whatwg-fetch@^3.6.2: + version "3.6.2" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz#dced24f37f2624ed0281725d51d0e2e3fe677f8c" + integrity sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA== + whatwg-mimetype@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz#5fa1a7623867ff1af6ca3dc72ad6b8a4208beba7"