Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace visitors

Index

Functions

Functions

explode

  • explode<S>(visitor: Visitor<S>): {}
  • explode() will take a Visitor object with all of the various shorthands that we support, and validates & normalizes it into a common format, ready to be used in traversal.

    The various shorthands are:

    • Identifier() { ... } -> Identifier: { enter() { ... } }
    • "Identifier|NumericLiteral": { ... } -> Identifier: { ... }, NumericLiteral: { ... }
    • Aliases in @babel/types: e.g. Property: { ... } -> ObjectProperty: { ... }, ClassProperty: { ... }

    Other normalizations are:

    • Visitors of virtual types are wrapped, so that they are only visited when their dynamic check passes
    • enter and exit functions are wrapped in arrays, to ease merging of visitors

    Type parameters

    • S = {}

    Parameters

    Returns {}

merge

  • Type parameters

    • S = {}

    Parameters

    Returns Visitor<unknown>

verify

  • Parameters

    Returns void