From d969423266fccee56ef769da6744cc8bacb04550 Mon Sep 17 00:00:00 2001 From: Jussi Saurio Date: Tue, 7 May 2024 21:14:28 +0300 Subject: [PATCH] Fix #3437: extendShape erases JSDoc property documentation (#3463) --- deno/lib/helpers/util.ts | 8 +++----- src/helpers/util.ts | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) 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]; }; }