(obj: T, ...keys: K[])
| 3 | }; |
| 4 | |
| 5 | export function pick<T, K extends keyof T>(obj: T, ...keys: K[]): Pick<T, K> { |
| 6 | const result = {} as Pick<T, K>; |
| 7 | keys.forEach((key) => { |
| 8 | result[key] = obj[key]; |
| 9 | }); |
| 10 | return result; |
| 11 | } |
| 12 | |
| 13 | // https://stackoverflow.com/questions/53966509/typescript-type-safe-omit-function |
| 14 | export const omit = <T extends object, K extends keyof T>( |
no outgoing calls
no test coverage detected