UNPKG

511 BJavaScriptView Raw
1import {isElementMarker} from './ast';
2import transformation from './transformation';
3
4
5module.exports = function() {
6 return {
7 visitor: {
8 JSXElement: {
9 enter: function(path) {
10 const {node} = path;
11 if (isElementMarker(node) && transformation.needsTransformation(node)) {
12 path.replaceWith(transformation.transformElementMarker(node));
13 }
14 }
15 }
16 }
17 };
18};