From c6f5058801cb22576c826e321c162ec243416c9b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Mar 2024 15:24:21 +0000 Subject: [PATCH 1/2] chore(deps-dev): bump typescript from 4.5.2 to 4.9.5 Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.5.2 to 4.9.5. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml) - [Commits](https://github.com/Microsoft/TypeScript/compare/v4.5.2...v4.9.5) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6756331b..f8711d58 100644 --- a/package-lock.json +++ b/package-lock.json @@ -57,7 +57,7 @@ "ts-jest": "^27.0.7", "ts-node": "^10.4.0", "typed-emitter": "^2.1.0", - "typescript": "^4.5.2" + "typescript": "^4.9.5" }, "engines": { "node": ">=18.15.0", @@ -11741,9 +11741,9 @@ } }, "node_modules/typescript": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz", - "integrity": "sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -20886,9 +20886,9 @@ } }, "typescript": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz", - "integrity": "sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true }, "unbox-primitive": { diff --git a/package.json b/package.json index fba19e79..64e1f1c9 100644 --- a/package.json +++ b/package.json @@ -247,7 +247,7 @@ "ts-jest": "^27.0.7", "ts-node": "^10.4.0", "typed-emitter": "^2.1.0", - "typescript": "^4.5.2" + "typescript": "^4.9.5" }, "scripts": { "build": "tsc -p tsconfig.src.json", From bb33dc58072494acd642e47ebb61ff682eba181e Mon Sep 17 00:00:00 2001 From: Masafumi Koba <473530+ybiquitous@users.noreply.github.com> Date: Sat, 23 Mar 2024 00:32:10 +0900 Subject: [PATCH 2/2] Fix type errors --- src/utils/errors.ts | 2 +- src/utils/objects/merge-assign.ts | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/utils/errors.ts b/src/utils/errors.ts index 9cb7cdf8..e59ac49f 100644 --- a/src/utils/errors.ts +++ b/src/utils/errors.ts @@ -20,7 +20,7 @@ export function serializeErrors(object: T visited: WeakMap, ): RInner => { if (!obj || typeof obj !== 'object') { - return obj as RInner; + return obj as unknown as RInner; } if (visited.has(obj as unknown as object)) { diff --git a/src/utils/objects/merge-assign.ts b/src/utils/objects/merge-assign.ts index 904bac85..174fafe7 100644 --- a/src/utils/objects/merge-assign.ts +++ b/src/utils/objects/merge-assign.ts @@ -7,7 +7,11 @@ import { isObject } from './is-object'; * @param source1 The first source object from which to copy properties. * @param source2 The second source object from which to copy properties. */ -export function mergeAssign(target: T, source1: U, source2?: V): T & U & V { +export function mergeAssign( + target: T, + source1: U | undefined, + source2?: V, +): T & U & V { const targetAsUnion = target as T & U & V; for (const object of [source1, source2]) { @@ -37,7 +41,9 @@ export function mergeAssign(target: T, source1: U, source2?: V): T & U targetAsUnion[key] = {} as (T & U & V)[typeof key]; } - targetAsUnion[key] = mergeAssign(targetAsUnion[key], value); + targetAsUnion[key] = mergeAssign(targetAsUnion[key] as object, value) as (T & + U & + V)[typeof key]; } else { targetAsUnion[key] = value as (T & U & V)[typeof key]; }