From c68d08ac26f6241bfc3c2d286c36504a0414aa7b Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Wed, 15 Sep 2021 11:03:12 -0700 Subject: [PATCH] fix: shim array-flat (#2346) * chore: remove @types/lodash.flatmap * fix: shim array-flat --- package.json | 5 ++++- src/polyfills.ts | 5 +++++ yarn.lock | 19 +++++++++++-------- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index d9a9c9f871..17443f0aa0 100644 --- a/package.json +++ b/package.json @@ -23,12 +23,13 @@ "@testing-library/jest-dom": "^5.14.1", "@testing-library/react": "^12.0.0", "@typechain/ethers-v5": "^7.0.0", + "@types/array.prototype.flat": "^1.2.1", + "@types/array.prototype.flatmap": "^1.2.2", "@types/d3": "^6.7.1", "@types/jest": "^25.2.1", "@types/lingui__core": "^2.7.1", "@types/lingui__macro": "^2.7.4", "@types/lingui__react": "^2.8.3", - "@types/lodash.flatmap": "^4.5.6", "@types/luxon": "^1.24.4", "@types/ms.macro": "^2.0.0", "@types/multicodec": "^1.0.0", @@ -66,6 +67,8 @@ "@web3-react/walletconnect-connector": "^7.0.2-alpha.0", "@web3-react/walletlink-connector": "^6.2.3", "ajv": "^6.12.3", + "array.prototype.flat": "^1.2.4", + "array.prototype.flatmap": "^1.2.4", "cids": "^1.0.0", "copy-to-clipboard": "^3.2.0", "cypress": "^7.7.0", diff --git a/src/polyfills.ts b/src/polyfills.ts index 71d26a0796..dd9eb84077 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -1 +1,6 @@ import 'polyfill-object.fromentries' +import flat from 'array.prototype.flat' +import flatMap from 'array.prototype.flatmap' + +flat.shim() +flatMap.shim() diff --git a/yarn.lock b/yarn.lock index e9c81fc99a..808cecc5c9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3445,6 +3445,16 @@ resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-4.2.2.tgz#ed4e0ad92306a704f9fb132a0cfcf77486dbe2bc" integrity sha512-HnYpAE1Y6kRyKM/XkEuiRQhTHvkzMBurTHnpFLYLBGPIylZNPs9jJcuOOYWxPLJCSEtmZT0Y8rHDokKN7rRTig== +"@types/array.prototype.flat@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@types/array.prototype.flat/-/array.prototype.flat-1.2.1.tgz#5433a141730f8e1d7a8e7486458ceb8144ee5edc" + integrity sha512-JOvNJUU/zjfJWcA1aHDnCKHwQjZ7VQ3UNfbcMKXrkQKKyMkJHrQ9vpSVMhgsztrtsbIRJKazMDvg2QggFVwJqw== + +"@types/array.prototype.flatmap@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@types/array.prototype.flatmap/-/array.prototype.flatmap-1.2.2.tgz#9041c2dc907d583ffb80b8882a782b42436d57c1" + integrity sha512-dto5M/8GxPzjaScvQeft2IG0EkoZZfPg2+1noM2BWiU1VR2zsGHf76LonTOnLQKDuJlKDLzKaru4b+5Sci0Yhg== + "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.7": version "7.1.15" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.15.tgz#2ccfb1ad55a02c83f8e0ad327cbc332f55eb1024" @@ -3849,14 +3859,7 @@ "@types/lingui__core" "*" "@types/react" "*" -"@types/lodash.flatmap@^4.5.6": - version "4.5.6" - resolved "https://registry.npmjs.org/@types/lodash.flatmap/-/lodash.flatmap-4.5.6.tgz" - integrity sha512-ELNrUL9q+MB7AACaHivWIsKDFDgYhHE3/svXhqvDJgONtn2c467Cy87nEb7CEDvfaGCPv91lPaW596I8s5oiNQ== - dependencies: - "@types/lodash" "*" - -"@types/lodash@*", "@types/lodash@^4.14.53": +"@types/lodash@^4.14.53": version "4.14.169" resolved "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.169.tgz" integrity sha512-DvmZHoHTFJ8zhVYwCLWbQ7uAbYQEk52Ev2/ZiQ7Y7gQGeV9pjBqjnQpECMHfKS1rCYAhMI7LHVxwyZLZinJgdw==