From cf8b48b16fca87bc9850257e1bc55b936965013b Mon Sep 17 00:00:00 2001 From: Caleb Kniffen Date: Tue, 18 Jul 2023 13:38:53 -0500 Subject: [PATCH] feat: bump typescript to 5.x (#2387) --- package-lock.json | 34 ++++++++++----------- package.json | 2 +- packages/ripple-address-codec/src/index.ts | 2 +- packages/ripple-address-codec/tsconfig.json | 1 - packages/ripple-binary-codec/tsconfig.json | 1 - packages/xrpl/package.json | 2 +- packages/xrpl/test/createMockRippled.ts | 2 +- packages/xrpl/tsconfig.json | 1 - 8 files changed, 21 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index bec534d6c7..ce695c4366 100644 --- a/package-lock.json +++ b/package-lock.json @@ -59,7 +59,7 @@ "ts-jest": "^29.0.3", "ts-loader": "^9.2.5", "ts-node": "^10.2.1", - "typescript": "^4.4.2", + "typescript": "^5.1.6", "url": "^0.11.0", "webpack": "^5.81.0", "webpack-bundle-analyzer": "^4.1.0", @@ -15789,9 +15789,9 @@ } }, "node_modules/typedoc": { - "version": "0.24.7", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.24.7.tgz", - "integrity": "sha512-zzfKDFIZADA+XRIp2rMzLe9xZ6pt12yQOhCr7cD7/PBTjhPmMyMvGrkZ2lPNJitg3Hj1SeiYFNzCsSDrlpxpKw==", + "version": "0.24.8", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.24.8.tgz", + "integrity": "sha512-ahJ6Cpcvxwaxfu4KtjA8qZNqS43wYt6JL27wYiIgl1vd38WW/KWX11YuAeZhuz9v+ttrutSsgK+XO1CjL1kA3w==", "dev": true, "dependencies": { "lunr": "^2.3.9", @@ -15806,7 +15806,7 @@ "node": ">= 14.14" }, "peerDependencies": { - "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x" + "typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x" } }, "node_modules/typedoc/node_modules/brace-expansion": { @@ -15839,16 +15839,16 @@ "integrity": "sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g==" }, "node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/ua-parser-js": { @@ -16857,7 +16857,7 @@ "karma-webpack": "^5.0.0", "node-polyfill-webpack-plugin": "^2.0.1", "react": "^18.2.0", - "typedoc": "^0.24.6" + "typedoc": "^0.24.8" }, "engines": { "node": ">=10.13.0" @@ -29273,9 +29273,9 @@ } }, "typedoc": { - "version": "0.24.7", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.24.7.tgz", - "integrity": "sha512-zzfKDFIZADA+XRIp2rMzLe9xZ6pt12yQOhCr7cD7/PBTjhPmMyMvGrkZ2lPNJitg3Hj1SeiYFNzCsSDrlpxpKw==", + "version": "0.24.8", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.24.8.tgz", + "integrity": "sha512-ahJ6Cpcvxwaxfu4KtjA8qZNqS43wYt6JL27wYiIgl1vd38WW/KWX11YuAeZhuz9v+ttrutSsgK+XO1CjL1kA3w==", "dev": true, "requires": { "lunr": "^2.3.9", @@ -29310,9 +29310,9 @@ "integrity": "sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g==" }, "typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "dev": true }, "ua-parser-js": { @@ -29975,7 +29975,7 @@ "ripple-address-codec": "^4.3.0", "ripple-binary-codec": "^1.7.0", "ripple-keypairs": "^1.3.0", - "typedoc": "^0.24.6", + "typedoc": "^0.24.8", "ws": "^8.2.2" } }, diff --git a/package.json b/package.json index 4ee14e6034..9a8ca28936 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "ts-jest": "^29.0.3", "ts-loader": "^9.2.5", "ts-node": "^10.2.1", - "typescript": "^4.4.2", + "typescript": "^5.1.6", "url": "^0.11.0", "webpack": "^5.81.0", "webpack-bundle-analyzer": "^4.1.0", diff --git a/packages/ripple-address-codec/src/index.ts b/packages/ripple-address-codec/src/index.ts index 51053e8866..2dced14132 100644 --- a/packages/ripple-address-codec/src/index.ts +++ b/packages/ripple-address-codec/src/index.ts @@ -40,7 +40,7 @@ function encodeXAddress( // RIPEMD160 is 160 bits = 20 bytes throw new Error('Account ID must be 20 bytes') } - if (tag > MAX_32_BIT_UNSIGNED_INT) { + if (tag !== false && tag > MAX_32_BIT_UNSIGNED_INT) { throw new Error('Invalid tag') } const theTag = tag || 0 diff --git a/packages/ripple-address-codec/tsconfig.json b/packages/ripple-address-codec/tsconfig.json index cc5a324ab2..941f61aa67 100644 --- a/packages/ripple-address-codec/tsconfig.json +++ b/packages/ripple-address-codec/tsconfig.json @@ -11,7 +11,6 @@ "noUnusedParameters": true, "removeComments": false, "preserveConstEnums": false, - "suppressImplicitAnyIndexErrors": false, "skipLibCheck": true, "declaration": true, "strictNullChecks": true diff --git a/packages/ripple-binary-codec/tsconfig.json b/packages/ripple-binary-codec/tsconfig.json index 9c8f38ba5b..645c4aeae3 100644 --- a/packages/ripple-binary-codec/tsconfig.json +++ b/packages/ripple-binary-codec/tsconfig.json @@ -14,7 +14,6 @@ "noImplicitAny": false, "removeComments": false, "preserveConstEnums": false, - "suppressImplicitAnyIndexErrors": true, "skipLibCheck": true, "declaration": true }, diff --git a/packages/xrpl/package.json b/packages/xrpl/package.json index b6b28d82d5..d1d6ad9d35 100644 --- a/packages/xrpl/package.json +++ b/packages/xrpl/package.json @@ -45,7 +45,7 @@ "karma-webpack": "^5.0.0", "node-polyfill-webpack-plugin": "^2.0.1", "react": "^18.2.0", - "typedoc": "^0.24.6" + "typedoc": "^0.24.8" }, "resolutions": { "elliptic": "^6.5.4" diff --git a/packages/xrpl/test/createMockRippled.ts b/packages/xrpl/test/createMockRippled.ts index bae75b6b90..48ef5253ed 100644 --- a/packages/xrpl/test/createMockRippled.ts +++ b/packages/xrpl/test/createMockRippled.ts @@ -55,7 +55,7 @@ export type MockedWebSocketServer = WebSocketServer & addResponse: ( command: string, response: - | Response + | BaseResponse | ErrorResponse | ((r: Request) => Response | ErrorResponse | Record) | Record, diff --git a/packages/xrpl/tsconfig.json b/packages/xrpl/tsconfig.json index 9a2f13b956..a906155d36 100644 --- a/packages/xrpl/tsconfig.json +++ b/packages/xrpl/tsconfig.json @@ -12,7 +12,6 @@ "removeComments": true, "preserveConstEnums": false, "esModuleInterop": true, - "suppressImplicitAnyIndexErrors": false, "resolveJsonModule": true, "preserveSymlinks": true },