From f6c8d09001f2374af8c8245186bad59ee0dc933f Mon Sep 17 00:00:00 2001 From: bjoluc Date: Mon, 22 Nov 2021 23:58:47 +0100 Subject: [PATCH] fix(Dependencies): Install lz-string from the NPM registry instead of the GitHub repo Please take a look at #20 for the corresponding conversation Closes #20 --- main/package.json | 3 ++- main/src/cookies.ts | 4 +++- main/tsconfig.json | 2 +- package-lock.json | 27 +++++++++++++++++++++------ 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/main/package.json b/main/package.json index 8f610d2..24d5c1a 100644 --- a/main/package.json +++ b/main/package.json @@ -44,7 +44,7 @@ "immer": "^9.0.6", "lodash": "^4.17.21", "lodash-es": "^4.17.21", - "lz-string": "github:pieroxy/lz-string#b2e0b27", + "lz-string": "^1.4.4", "nookies": "^2.5.2", "type-fest": "^2.5.4" }, @@ -56,6 +56,7 @@ "@size-limit/preset-small-lib": "^5.0.3", "@types/jest": "^27.0.3", "@types/lodash": "^4.14.177", + "@types/lz-string": "^1.3.34", "@types/node": "^16.11.9", "@types/set-cookie-parser": "^2.4.1", "next": "^12.0.4", diff --git a/main/src/cookies.ts b/main/src/cookies.ts index 80c4dde..65e738b 100644 --- a/main/src/cookies.ts +++ b/main/src/cookies.ts @@ -40,7 +40,9 @@ export class StateCookies { } private static _decodeState(state: string, compressed: boolean) { - return JSON.parse((compressed ? decompressFromEncodedURIComponent : decodeURIComponent)(state)); + return JSON.parse( + (compressed ? decompressFromEncodedURIComponent : decodeURIComponent)(state)! + ); } /** diff --git a/main/tsconfig.json b/main/tsconfig.json index c6a2359..871cdbd 100644 --- a/main/tsconfig.json +++ b/main/tsconfig.json @@ -3,7 +3,7 @@ "include": ["src", "types"], "compilerOptions": { "module": "esnext", - "target": "esnext", // TODO Why is this required for the tests to work? + "target": "esnext", "lib": ["dom", "esnext"], "importHelpers": true, // output .d.ts declaration files for consumers diff --git a/package-lock.json b/package-lock.json index ec2c34a..896e13a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -71,7 +71,7 @@ "immer": "^9.0.6", "lodash": "^4.17.21", "lodash-es": "^4.17.21", - "lz-string": "github:pieroxy/lz-string#b2e0b27", + "lz-string": "^1.4.4", "nookies": "^2.5.2", "type-fest": "^2.5.4" }, @@ -80,6 +80,7 @@ "@size-limit/preset-small-lib": "^5.0.3", "@types/jest": "^27.0.3", "@types/lodash": "^4.14.177", + "@types/lz-string": "^1.3.34", "@types/node": "^16.11.9", "@types/set-cookie-parser": "^2.4.1", "next": "^12.0.4", @@ -3789,6 +3790,12 @@ "integrity": "sha512-0fDwydE2clKe9MNfvXHBHF9WEahRuj+msTuQqOmAApNORFvhMYZKNGGJdCzuhheVjMps/ti0Ak/iJPACMaevvw==", "dev": true }, + "node_modules/@types/lz-string": { + "version": "1.3.34", + "resolved": "https://registry.npmjs.org/@types/lz-string/-/lz-string-1.3.34.tgz", + "integrity": "sha512-j6G1e8DULJx3ONf6NdR5JiR2ZY3K3PaaqiEuKYkLQO0Czfi1AzrtjfnfCROyWGeDd5IVMKCwsgSmMip9OWijow==", + "dev": true + }, "node_modules/@types/minimatch": { "version": "3.0.5", "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==", @@ -13953,8 +13960,8 @@ }, "node_modules/lz-string": { "version": "1.4.4", - "resolved": "git+ssh://git@github.com/pieroxy/lz-string.git#b2e0b270a9f3cf330b778b777385fcba384a1a02", - "license": "MIT", + "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.4.4.tgz", + "integrity": "sha1-wNjq82BZ9wV5bh40SBHPTEmNOiY=", "bin": { "lz-string": "bin/bin.js" } @@ -28932,6 +28939,12 @@ "integrity": "sha512-0fDwydE2clKe9MNfvXHBHF9WEahRuj+msTuQqOmAApNORFvhMYZKNGGJdCzuhheVjMps/ti0Ak/iJPACMaevvw==", "dev": true }, + "@types/lz-string": { + "version": "1.3.34", + "resolved": "https://registry.npmjs.org/@types/lz-string/-/lz-string-1.3.34.tgz", + "integrity": "sha512-j6G1e8DULJx3ONf6NdR5JiR2ZY3K3PaaqiEuKYkLQO0Czfi1AzrtjfnfCROyWGeDd5IVMKCwsgSmMip9OWijow==", + "dev": true + }, "@types/minimatch": { "version": "3.0.5", "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==", @@ -36828,8 +36841,9 @@ "dev": true }, "lz-string": { - "version": "git+ssh://git@github.com/pieroxy/lz-string.git#b2e0b270a9f3cf330b778b777385fcba384a1a02", - "from": "lz-string@github:pieroxy/lz-string#b2e0b27" + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.4.4.tgz", + "integrity": "sha1-wNjq82BZ9wV5bh40SBHPTEmNOiY=" }, "magic-string": { "version": "0.25.7", @@ -37405,6 +37419,7 @@ "@types/cookie": "^0.4.1", "@types/jest": "^27.0.3", "@types/lodash": "^4.14.177", + "@types/lz-string": "^1.3.34", "@types/node": "^16.11.9", "@types/set-cookie-parser": "^2.4.1", "cookie": "^0.4.1", @@ -37412,7 +37427,7 @@ "immer": "^9.0.6", "lodash": "^4.17.21", "lodash-es": "^4.17.21", - "lz-string": "github:pieroxy/lz-string#b2e0b27", + "lz-string": "^1.4.4", "next": "^12.0.4", "next-redux-wrapper": "^7.0.5", "node-mocks-http": "^1.11.0",