diff --git a/deno/lib/helpers/util.ts b/deno/lib/helpers/util.ts index 26c1cb185..058da47fa 100644 --- a/deno/lib/helpers/util.ts +++ b/deno/lib/helpers/util.ts @@ -132,11 +132,9 @@ export namespace objectUtil { }; export type extendShape = { - [K in keyof A | keyof B]: K extends keyof B - ? B[K] - : K extends keyof A - ? A[K] - : never; + [K in keyof A as K extends keyof B ? never : K]: A[K]; + } & { + [K in keyof B]: B[K]; }; } diff --git a/src/helpers/util.ts b/src/helpers/util.ts index 26c1cb185..058da47fa 100644 --- a/src/helpers/util.ts +++ b/src/helpers/util.ts @@ -132,11 +132,9 @@ export namespace objectUtil { }; export type extendShape = { - [K in keyof A | keyof B]: K extends keyof B - ? B[K] - : K extends keyof A - ? A[K] - : never; + [K in keyof A as K extends keyof B ? never : K]: A[K]; + } & { + [K in keyof B]: B[K]; }; }