Skip to content

Instantly share code, notes, and snippets.

@guxuerui
Created August 11, 2023 14:36
Show Gist options
  • Save guxuerui/606eeb034098e2ac65dc85f1180f7020 to your computer and use it in GitHub Desktop.
Save guxuerui/606eeb034098e2ac65dc85f1180f7020 to your computer and use it in GitHub Desktop.
手动实现TS泛型Pick方法
type MyPick<T, K extends keyof T> = {
[key in K]: T[key]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment