Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function pluck<T, K extends keyof T>(source: T, key: K): Record<K, T[K]> {
- return { [key]: source[key] } as Record<K, T[K]>;
- }
- function pluck<T, K extends keyof T>(source: T, key: K): Pick<T,K> {
- return { [key]: source[key] } as Pick<T,K>;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement