Skip to content

Commit

Permalink
hange the generic names (Str -> T)
Browse files Browse the repository at this point in the history
  • Loading branch information
hverlin committed Dec 11, 2023
1 parent 90e4da2 commit 7773f89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/reverse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* Reverses a string.
* - `T` The string to reverse.
*/
type Reverse<Str extends string, _acc extends string = ''> = Str extends `${infer Head}${infer Tail}`
type Reverse<T extends string, _acc extends string = ''> = T extends `${infer Head}${infer Tail}`
? Reverse<Tail, `${Head}${_acc}`>
: _acc extends '' ? Str : _acc
: _acc extends '' ? T : _acc

/**
* A strongly-typed function to reverse a string.
Expand Down

0 comments on commit 7773f89

Please sign in to comment.