We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f5e929 commit e904c06Copy full SHA for e904c06
docs/utility.md
@@ -125,7 +125,7 @@ type Exclude<T, U> = T extends U ? never : T;
125
126
上面代码中,等号右边的部分,表示先判断`T`是否兼容`U`,如果是的就返回`never`类型,否则返回当前类型`T`。由于`never`类型是任何其他类型的子类型,它跟其他类型组成联合类型时,可以直接将`never`类型从联合类型中“消掉”,因此`Exclude<T, U>`就相当于删除兼容的类型,剩下不兼容的类型。
127
128
-## `Extract<Type, Union>`
+## `Extract<UnionType, Union>`
129
130
`Extract<UnionType, Union>`用来从联合类型`UnionType`之中,提取指定类型`Union`,组成一个新类型返回。它与`Exclude<T, U>`正好相反。
131
0 commit comments