Skip to content

Commit 1cd312d

Browse files
Exclude the apply and call methods on class
1 parent fc54649 commit 1cd312d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

class.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ export type Class<C extends object = {}> =
4949
* @returns Class type or never.
5050
*/
5151
export type IsClass<T, C extends object = {}> = T extends
52-
(Omit<Function, 'length' | 'name'> & { prototype: object } & C)
53-
? (T extends (abstract new (...args: any[]) => any) ? T
52+
(Omit<Function, 'apply' | 'call' | 'length' | 'name'> & {
53+
prototype: object;
54+
} & C) ? (T extends (abstract new (...args: any[]) => any) ? T
5455
: (T extends ((...args: any[]) => any) ? never : T))
5556
: never;

0 commit comments

Comments
 (0)