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", 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]; }