Skip to content

Commit

Permalink
doc: update typescript.md (#439)
Browse files Browse the repository at this point in the history
修正类型技巧内Capitalize的推导结果
  • Loading branch information
wsypower committed Sep 23, 2023
1 parent ecb59d8 commit 106d7aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,7 @@ const Row = (props: RowProps) => {
type Capitalize<T extends string> = T extends `${infer U}${infer V}`
? `${Uppercase<U>}${V}`
: T
type capitalized = Capitalize<"hello world"> // Hello World
type capitalized = Capitalize<"hello world"> // Hello world
```
也可以在 infer 中使用条件约束(`extends`
Expand Down

0 comments on commit 106d7aa

Please sign in to comment.