code: function(topPath) {
              if (
                !topPath.parentPath.isExpressionStatement() &&
                !topPath.parentPath.isSequenceExpression()
              ) {
                return;
              }
  
              const mutations = [];
              let firstLeft = null;
              let operator = null;
              function visit(path) {
                if (path.isConditionalExpression()) {
                  let bail = visit(path.get("consequent"));
                  if (bail) {
                    return true;
                  }
                  bail = visit(path.get("alternate"));
                  return bail;
                }
  
                if (operator == null) {
                  operator = path.node.operator;
                } else if (path.node.operator !== operator) {
                  return true;
                }
  
                if (
                  !path.isAssignmentExpression() ||
                  !(
                    path.get("left").isIdentifier() ||
                    path.get("left").isMemberExpression()
                  )
                ) {
                  return true;
                }
  
                const left = path.get("left").node;
                if (firstLeft == null) {
                  firstLeft = left;
                } else if (!t.isNodesEquivalent(left, firstLeft)) {
                  return true;
                }
  
                mutations.push(() => path.replaceWith(path.get("right").node));
              }
  
              const bail = visit(topPath);
              if (bail) {
                return;
              }
  
              mutations.forEach(f => f());
              topPath.replaceWith(
                t.assignmentExpression(operator, firstLeft, topPath.node)
              );
            }
docs: a ? x = foo : b ? x = bar : x = baz; x = a ? foo : b ? bar : baz;