From b53b69357809058b96e68874c71e0faa1a702cca Mon Sep 17 00:00:00 2001 From: Silas Boyd-Wickizer Date: Tue, 10 Jan 2023 11:22:00 -0800 Subject: [PATCH] chore: remove the @ungap/url-search-params polyfill (#3342) Use URLSearchParams instead. --- package.json | 1 - src/app/saga.ts | 5 ++--- yarn.lock | 5 ----- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index f1f805807e5..1647db23996 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,6 @@ "@sentry/react-native": "^4.10.1", "@sentry/types": "^7.22.0", "@th3rdwave/react-navigation-bottom-sheet": "^0.2.1", - "@ungap/url-search-params": "^0.1.2", "@walletconnect/client": "^1.8.0", "@walletconnect/react-native-compat": "^2.1.3", "@walletconnect/sign-client": "^2.1.3", diff --git a/src/app/saga.ts b/src/app/saga.ts index bc86393bc4d..599362c316e 100644 --- a/src/app/saga.ts +++ b/src/app/saga.ts @@ -1,7 +1,6 @@ import { compressedPubKey } from '@celo/cryptographic-utils' import { PhoneNumberHashDetails } from '@celo/identity/lib/odis/phone-number-identifier' import { hexToBuffer } from '@celo/utils/lib/address' -import URLSearchParamsReal from '@ungap/url-search-params' import { AppState, Platform } from 'react-native' import DeviceInfo from 'react-native-device-info' import * as Keychain from 'react-native-keychain' @@ -78,7 +77,7 @@ import { mtwAddressSelector, walletAddressSelector, } from 'src/web3/selectors' -import { parse } from 'url' +import { URLSearchParams, parse } from 'url' const TAG = 'app/saga' @@ -249,7 +248,7 @@ function parseValue(value: string) { // Parses the query string into an object. Only works with built-in strings, booleans and numbers. function convertQueryToScreenParams(query: string) { - const decodedParams = new URLSearchParamsReal(decodeURIComponent(query)) + const decodedParams = new URLSearchParams(decodeURIComponent(query)) const params: { [key: string]: any } = {} for (const [key, value] of decodedParams.entries()) { params[key] = parseValue(value) diff --git a/yarn.lock b/yarn.lock index 9854bdb8400..cef827aac62 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5395,11 +5395,6 @@ "@typescript-eslint/types" "5.15.0" eslint-visitor-keys "^3.0.0" -"@ungap/url-search-params@^0.1.2": - version "0.1.2" - resolved "https://registry.yarnpkg.com/@ungap/url-search-params/-/url-search-params-0.1.2.tgz#8ba8c0527543fe675d1c29ae0a2daca842e8ee4f" - integrity sha512-WVk5+lJ+AoNLh2sIDMhnEAgLsVQuI067hWLJCzirErH1GYiy1gs09q4+XZxYWSvdAsslKsaO4q1iXXMx2c72dA== - "@valora/eslint-config-typescript@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@valora/eslint-config-typescript/-/eslint-config-typescript-1.0.0.tgz#1e88c1b5508d7abd3fe2b40dd9462b1cb1d69331"