Skip to content

Commit

Permalink
Update typescript-most-practical-features-compilation.md
Browse files Browse the repository at this point in the history
  • Loading branch information
owenlongbo authored Jan 25, 2024
1 parent 8a16a75 commit 78ada7e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ type T3 = T1<number> // 'number
一般是和泛型条件结合使用,结合实际例子理解:
如果泛型参数 T 能赋值给类型 \{t: infer Test\},那么类型是推断类型 Test,否则类型是 string。
如果泛型参数 T 能赋值给类型 `{t: infer Test}`,那么类型是推断类型 Test,否则类型是 string。
```typescript
type Foo<T> = T extends {t: infer Test} ? Test : string
Expand Down

0 comments on commit 78ada7e

Please sign in to comment.