(obj: Obj, keys: Keys[])
| 5 | |
| 6 | /** Returns a shallowly cloned object with the provided keys omitted */ |
| 7 | export const omit = <Obj extends object, Keys extends keyof Obj>(obj: Obj, keys: Keys[]): Omit<Obj, Keys> => { |
| 8 | return Object.keys(obj).reduce((acc, key: any) => { |
| 9 | if (!keys.includes(key)) { |
| 10 | acc[key] = (obj as any)[key] |
| 11 | } |
| 12 | return acc |
| 13 | }, {} as any) |
| 14 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…