Merge pull request #79 from biubiubiu999/main

fix typo
This commit is contained in:
Ruan YiFeng
2023-09-11 11:41:50 +08:00
committed by GitHub

View File

@@ -466,7 +466,7 @@ type Flatten<Type, Item> =
Type extends Array<Item> ? Item : Type;
```
上面是不使用`infer`的写法,每次调用`Fleatten`的时候,都要传入两个参数,就比较麻烦。
上面是不使用`infer`的写法,每次调用`Flatten`的时候,都要传入两个参数,就比较麻烦。
下面的例子使用`infer`,推断函数的参数类型和返回值类型。