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.
explode()
Visitor
The various shorthands are:
Identifier() { ... }
Identifier: { enter() { ... } }
"Identifier|NumericLiteral": { ... }
Identifier: { ... }, NumericLiteral: { ... }
@babel/types
Property: { ... }
ObjectProperty: { ... }, ClassProperty: { ... }
Other normalizations are:
enter
exit
explode()will take aVisitorobject 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: { ... }@babel/types: e.g.Property: { ... }->ObjectProperty: { ... }, ClassProperty: { ... }Other normalizations are:
enterandexitfunctions are wrapped in arrays, to ease merging of visitors