Skip to content

Commit

Permalink
Add one more check to isTraverser()
Browse files Browse the repository at this point in the history
  • Loading branch information
kafkas committed Dec 23, 2023
1 parent c2627d2 commit 7b356cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/internal/utils/isTraverser.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import type { Traverser } from '../../api';

export function isTraverser<D>(candidate: Traverser<D> | unknown): candidate is Traverser<D> {
export function isTraverser<D>(candidate: unknown): candidate is Traverser<D> {
const t = candidate as Traverser<D>;
return (
!!t &&
typeof t === 'object' &&
t.traversable !== null &&
typeof t.traversable === 'object' &&
t.traversalConfig !== null &&
Expand Down

0 comments on commit 7b356cd

Please sign in to comment.