move stuff around until it feels right

This commit is contained in:
MapleLeaf
2021-12-26 12:06:06 -06:00
parent d10618e3c1
commit 894e6abb26
35 changed files with 30 additions and 22 deletions

15
helpers/omit.ts Normal file
View File

@@ -0,0 +1,15 @@
import type { Except } from "type-fest"
// eslint-disable-next-line import/no-unused-modules
export function omit<Subject extends object, Key extends keyof Subject>(
subject: Subject,
keys: Key[],
): Except<Subject, Key> {
const result: any = {}
for (const key in subject) {
if (!keys.includes(key as unknown as Key)) {
result[key] = subject[key]
}
}
return result
}