diff --git a/src/utils.ts b/src/utils.ts index beb3c83..bdc8f86 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -17,7 +17,7 @@ import { Deferred } from './deferred_promise.ts' * functions are not considered as class constructor. */ export function isClass(value: unknown): value is Constructor { - return typeof value === 'function' && value.toString().startsWith('class ') + return typeof value === 'function' && /^class(\s|{)/.test(value.toString()) } /**