Skip to content

Commit 39aff98

Browse files
committed
Create char.ts
1 parent c3d4c22 commit 39aff98

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/type/char.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
export type Char<Type extends string> = Type extends `${infer FirstChar}${infer Rest}`
3+
? Rest extends ''
4+
? Type
5+
: never
6+
: never;

0 commit comments

Comments
 (0)