Skip to content

Commit

Permalink
Account for null state in wrapWithStateOrWrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Jul 5, 2023
1 parent b66afb2 commit 70eaf38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/babel-traverse/src/visitors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function isVirtualType(type: string): type is VIRTUAL_TYPES {
return type in virtualTypes;
}
export type VisitWrapper<S = any> = (
stateName: string | null | undefined,
stateName: string | undefined,
visitorType: VisitPhase,
callback: VisitNodeFunction<S, Node>,
) => VisitNodeFunction<S, Node>;
Expand Down Expand Up @@ -273,7 +273,7 @@ export function merge(

function wrapWithStateOrWrapper<State>(
oldVisitor: ExplVisitNode<State, Node>,
state: State,
state: State | null,
wrapper?: VisitWrapper<State> | null,
): ExplVisitNode<State, Node> {
const newVisitor: ExplVisitNode<State, Node> = {};
Expand Down

0 comments on commit 70eaf38

Please sign in to comment.