From afb027a5b6287fa520283172392b0c39a628a6ae Mon Sep 17 00:00:00 2001 From: Seth Silesky <5115498+silesky@users.noreply.github.com> Date: Sun, 26 Feb 2023 15:24:52 -0600 Subject: [PATCH] update typescript to 4.7 (#805) --- .changeset/brown-boxes-hug.md | 6 ++++++ examples/with-vite/package.json | 2 +- package.json | 2 +- .../fixtures/create-fetch-method.ts | 2 +- packages/core/src/utils/pick.ts | 2 +- yarn.lock | 20 +++++++++---------- 6 files changed, 20 insertions(+), 14 deletions(-) create mode 100644 .changeset/brown-boxes-hug.md diff --git a/.changeset/brown-boxes-hug.md b/.changeset/brown-boxes-hug.md new file mode 100644 index 000000000..bc1ee6bce --- /dev/null +++ b/.changeset/brown-boxes-hug.md @@ -0,0 +1,6 @@ +--- +'@segment/analytics-next': patch +'@segment/analytics-core': patch +--- + +Upgrade typescript diff --git a/examples/with-vite/package.json b/examples/with-vite/package.json index 91e2b00fb..5a680ce30 100644 --- a/examples/with-vite/package.json +++ b/examples/with-vite/package.json @@ -16,7 +16,7 @@ "@types/react": "^18.0.0", "@types/react-dom": "^18.0.0", "@vitejs/plugin-react": "^1.3.0", - "typescript": "^4.6.4", + "typescript": "^4.7.0", "vite": "^2.9.13" } } diff --git a/package.json b/package.json index 8ae871e5c..63ee38e2a 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "ts-jest": "^28.0.4", "ts-node": "^10.8.0", "turbo": "^1.3.1", - "typescript": "^4.6.4" + "typescript": "^4.7.0" }, "resolutions": { "@segment/analytics-next": "workspace:*", diff --git a/packages/browser/src/test-helpers/fixtures/create-fetch-method.ts b/packages/browser/src/test-helpers/fixtures/create-fetch-method.ts index b27f041d1..3ba5b64c2 100644 --- a/packages/browser/src/test-helpers/fixtures/create-fetch-method.ts +++ b/packages/browser/src/test-helpers/fixtures/create-fetch-method.ts @@ -5,7 +5,7 @@ import { cdnSettingsMinimal } from './cdn-settings' export const createMockFetchImplementation = ( cdnSettings: Partial = {} ) => { - return (url: RequestInfo, req?: RequestInit) => { + return (...[url, req]: Parameters) => { const reqUrl = url.toString() if (!req || (req.method === 'get' && reqUrl.includes('cdn.segment.com'))) { // GET https://cdn.segment.com/v1/projects/{writeKey} diff --git a/packages/core/src/utils/pick.ts b/packages/core/src/utils/pick.ts index 43057bc17..917b1ab50 100644 --- a/packages/core/src/utils/pick.ts +++ b/packages/core/src/utils/pick.ts @@ -1,4 +1,4 @@ -export const pickBy = ( +export const pickBy = ( obj: T, fn: (key: K, v: T[K]) => boolean ) => { diff --git a/yarn.lock b/yarn.lock index c38701994..2072423a7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -962,7 +962,7 @@ __metadata: "@vitejs/plugin-react": ^1.3.0 react: ^18.0.0 react-dom: ^18.0.0 - typescript: ^4.6.4 + typescript: ^4.7.0 vite: ^2.9.13 languageName: unknown linkType: soft @@ -4350,7 +4350,7 @@ __metadata: ts-jest: ^28.0.4 ts-node: ^10.8.0 turbo: ^1.3.1 - typescript: ^4.6.4 + typescript: ^4.7.0 languageName: unknown linkType: soft @@ -13520,23 +13520,23 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^4.6.4": - version: 4.6.4 - resolution: "typescript@npm:4.6.4" +"typescript@npm:^4.7.0": + version: 4.9.5 + resolution: "typescript@npm:4.9.5" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: e7bfcc39cd4571a63a54e5ea21f16b8445268b9900bf55aee0e02ad981be576acc140eba24f1af5e3c1457767c96cea6d12861768fb386cf3ffb34013718631a + checksum: ee000bc26848147ad423b581bd250075662a354d84f0e06eb76d3b892328d8d4440b7487b5a83e851b12b255f55d71835b008a66cbf8f255a11e4400159237db languageName: node linkType: hard -"typescript@patch:typescript@^4.6.4#~builtin": - version: 4.6.4 - resolution: "typescript@patch:typescript@npm%3A4.6.4#~builtin::version=4.6.4&hash=7ad353" +"typescript@patch:typescript@^4.7.0#~builtin": + version: 4.9.5 + resolution: "typescript@patch:typescript@npm%3A4.9.5#~builtin::version=4.9.5&hash=7ad353" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 1cb434fbc637d347be90e3a0c6cd05e33c38f941713c8786d3031faf1842c2c148ba91d2fac01e7276b0ae3249b8633f1660e32686cc7a8c6a8fd5361dc52c66 + checksum: 2eee5c37cad4390385db5db5a8e81470e42e8f1401b0358d7390095d6f681b410f2c4a0c496c6ff9ebd775423c7785cdace7bcdad76c7bee283df3d9718c0f20 languageName: node linkType: hard