Skip to content

Commit 1501fc1

Browse files
authored
fix: resolve issue with class extends utility (#314)
- `ctor.constructor` is `Function` - `base.constructor` is `Function` They're not `Function` when they're instances of a class, but since we are comparing the constructors, their constructors are `Function`, since classes are basically functions, as such, the utility was always returning `true` for anything that is a class.
1 parent b8a2688 commit 1501fc1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/strategies/Shared.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function isClass(value: unknown): value is AbstractCtor {
1818
export function classExtends<T extends AbstractCtor>(value: AbstractCtor, base: T): value is T {
1919
let ctor: AbstractCtor | null = value;
2020
while (ctor !== null) {
21-
if (ctor.constructor === base.constructor) return true;
21+
if (ctor === base) return true;
2222
ctor = Object.getPrototypeOf(ctor);
2323
}
2424

0 commit comments

Comments
 (0)