Ale*_*kin 10 javascript typescript tsc
在ts-toolbelt的源代码中,经常存在空对象和映射类型的交集。这样做的目的是什么?
export type ReadonlyFlat<O> = {
+readonly [K in keyof O]: O[K];
} & {}; // there
export type OptionalFlat<O> = {
[K in keyof O]?: O[K];
} & {}; // there
type __Pick<O extends object, K extends keyof O> = {
[P in K]: O[P];
} & {}; // there
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
561 次 |
| 最近记录: |