From 106d7aa6025c73f05df1b6fdbf98519793c710f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F?= <2553241022@qq.com> Date: Sat, 23 Sep 2023 17:26:33 +0800 Subject: [PATCH] doc: update typescript.md (#439) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正类型技巧内Capitalize的推导结果 --- docs/typescript.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/typescript.md b/docs/typescript.md index 9e9b497f..94cbc522 100644 --- a/docs/typescript.md +++ b/docs/typescript.md @@ -1360,7 +1360,7 @@ const Row = (props: RowProps) => { type Capitalize = T extends `${infer U}${infer V}` ? `${Uppercase}${V}` : T -type capitalized = Capitalize<"hello world"> // Hello World +type capitalized = Capitalize<"hello world"> // Hello world ``` 也可以在 infer 中使用条件约束(`extends`)