Skip to content

Commit e904c06

Browse files
committed
docs(utility): fixed typo
1 parent 1f5e929 commit e904c06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/utility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ type Exclude<T, U> = T extends U ? never : T;
125125

126126
上面代码中,等号右边的部分,表示先判断`T`是否兼容`U`,如果是的就返回`never`类型,否则返回当前类型`T`。由于`never`类型是任何其他类型的子类型,它跟其他类型组成联合类型时,可以直接将`never`类型从联合类型中“消掉”,因此`Exclude<T, U>`就相当于删除兼容的类型,剩下不兼容的类型。
127127

128-
## `Extract<Type, Union>`
128+
## `Extract<UnionType, Union>`
129129

130130
`Extract<UnionType, Union>`用来从联合类型`UnionType`之中,提取指定类型`Union`,组成一个新类型返回。它与`Exclude<T, U>`正好相反。
131131

0 commit comments

Comments
 (0)