手写Pick

更新于 阅读 1

被问到怎么实现一个ts的Pick,突然卡壳,就回家练练手。

type MyPick<T, Key extends keyof T> = { [P in Key]: T[P] }