more comprehensive tests
This commit is contained in:
12
src/helpers/omit.ts
Normal file
12
src/helpers/omit.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
export function omit<Subject extends object, Key extends keyof Subject>(
|
||||
subject: Subject,
|
||||
...keys: Key[]
|
||||
): Omit<Subject, Key> {
|
||||
const result: any = {}
|
||||
for (const key in subject) {
|
||||
if (!keys.includes(key as unknown as Key)) {
|
||||
result[key] = subject[key]
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user