How to use babel-helper-explode-assignable-expression - 1 common examples

To help you get started, we’ve selected a few babel-helper-explode-assignable-expression 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 babel / babel / packages / babel-helper-builder-conditional-assignment-operator-visitor / src / index.js View on Github external
exports.ExpressionStatement = function (path, file) {
    // hit the `AssignmentExpression` one below
    if (path.isCompletionRecord()) return;

    const expr = path.node.expression;
    if (!opts.is(expr, file)) return;

    const nodes = [];

    const exploded = explode(expr.left, nodes, file, path.scope);

    nodes.push(t.ifStatement(
      opts.build(exploded.uid, file),
      t.expressionStatement(buildAssignment(exploded.ref, expr.right))
    ));

    return nodes;
  };

babel-helper-explode-assignable-expression

Helper function to explode an assignable expression

MIT
Latest version published 8 years ago

Package Health Score

82 / 100
Full package analysis

Popular babel-helper-explode-assignable-expression functions

Similar packages