How to use the babel-traverse.removeProperties function in babel-traverse

To help you get started, we’ve selected a few babel-traverse examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github istarkov / babel-plugin-webpack-loaders / src / plugin.js View on Github external
if (
                    pathM.node.object.name === '__webpack_require__' &&
                    pathM.node.property.name === 'p'
                  ) {
                    pathM.replaceWith(StringLiteral(publicPath)); // eslint-disable-line
                  }
                },
              });
            },
          });
        }
      },
    });
  }

  return traverse.removeProperties(expr);
};
github sozialhelden / wheelmap-frontend / retranslate / babel-plugin-retranslate / src / plugin.js View on Github external
function generateAstFromTemplateString(input) {
  var parsed = babylon.parse(`\`${input}\``, parseOptions);
  var ast = traverse.removeProperties(parsed, { preserveComments: parseOptions.preserveComments });
  return ast.program.body[0].expression;
}