From 8c39275d821957b05164fa1124bb60ed6fd2fabe Mon Sep 17 00:00:00 2001 From: aswinsvijay <69852170+aswinsvijay@users.noreply.github.com> Date: Mon, 18 Sep 2023 21:45:47 +0530 Subject: [PATCH] improve WidenLiteral --- src/entrypoints/utils.d.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/entrypoints/utils.d.ts b/src/entrypoints/utils.d.ts index 00171cb..aafa566 100644 --- a/src/entrypoints/utils.d.ts +++ b/src/entrypoints/utils.d.ts @@ -3,15 +3,7 @@ declare namespace TSReset { ? never : T; - type WidenLiteral = T extends string - ? string - : T extends number - ? number - : T extends boolean - ? boolean - : T extends bigint - ? bigint - : T extends symbol - ? symbol + type WidenLiteral = T extends string | number | boolean | bigint | symbol + ? ReturnType : T; }