Skip to content

Commit

Permalink
improve WidenLiteral
Browse files Browse the repository at this point in the history
  • Loading branch information
aswinsvijay authored Sep 18, 2023
1 parent b2df073 commit 8c39275
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/entrypoints/utils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,7 @@ declare namespace TSReset {
? never
: T;

type WidenLiteral<T> = T extends string
? string
: T extends number
? number
: T extends boolean
? boolean
: T extends bigint
? bigint
: T extends symbol
? symbol
type WidenLiteral<T> = T extends string | number | boolean | bigint | symbol
? ReturnType<T["valueOf"]>
: T;
}

0 comments on commit 8c39275

Please sign in to comment.