How to use the babel-traverse.default.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 vicwang163 / react-to-vue / src / utility.js View on Github external
export function transformSourceString (statement) {
  if (!Array.isArray(statement)) {
    statement = [statement]
  }
  let result = []
  for (let i = 0; i < statement.length; i++) {
    let replacement = statement[i]
    replacement = babylon.parse(replacement)
    replacement = replacement.program.body[0]
    result.push(babelTraverse.removeProperties(replacement))
  }
  return result
}