(obj: T, ...propNames: K[])
| 126 | } |
| 127 | |
| 128 | export function omit<T extends object, K extends keyof T>(obj: T, ...propNames: K[]) { |
| 129 | const resultMap = {} as Omit<T, K>; |
| 130 | Object.keys(obj).forEach((key) => { |
| 131 | if (!includes(propNames, key as K)) { |
| 132 | resultMap[key as OmittedKey<T, K>] = obj[key as OmittedKey<T, K>]; |
| 133 | } |
| 134 | }); |
| 135 | |
| 136 | return resultMap; |
| 137 | } |
| 138 | |
| 139 | export function pickProperty(target: Record<string, any>, keys: string[]) { |
| 140 | const { length } = keys; |
no test coverage detected