Skip to content

Commit 3353d35

Browse files
authored
Merge pull request #48 from rokoroku/issue-45-patch
Fix compilation issue with Omit type
2 parents 9a3722a + 18a518c commit 3353d35

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/app/utils/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ export function omit<T extends object, K extends keyof T>(target: T, ...omitKeys
66
}
77
return res;
88
},
9-
{} as Omit<T, K>
9+
{} as any
1010
);
1111
}

types/global.d.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ declare module '*.css' {
66
export = styles;
77
}
88

9-
// Omit type https://github.com/Microsoft/TypeScript/issues/12215
10-
type SimpleKeyOf<T> = Extract<keyof T, 'number' | 'string'>;
11-
type Diff<T extends string, U extends string> = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T];
12-
type Omit<T, K extends SimpleKeyOf<T>> = { [P in Diff<SimpleKeyOf<T>, K>]: T[P] };
13-
9+
// Omit type https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-377567046
10+
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
1411
type PartialPick<T, K extends keyof T> = Partial<T> & Pick<T, K>;

0 commit comments

Comments
 (0)