Sha256: 854e4646cc3febc55528db5120b991e5dd08eb463d9d401d5a92b0aeb72e1afa

Contents?: true

Size: 827 Bytes

Versions: 3

Compression:

Stored size: 827 Bytes

Contents

"use strict";

exports.__esModule = true;

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj["default"] = obj; return newObj; } }

var _types = require("../../../types");

var t = _interopRequireWildcard(_types);

var metadata = {
  optional: true,
  group: "builtin-trailing"
};

exports.metadata = metadata;
var MemberExpression = {
  exit: function exit(node) {
    var prop = node.property;
    if (node.computed && t.isLiteral(prop) && t.isValidIdentifier(prop.value)) {
      // foo["bar"] => foo.bar
      node.property = t.identifier(prop.value);
      node.computed = false;
    }
  }
};
exports.MemberExpression = MemberExpression;

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gulp_assets-1.0.0.pre.5 template/node_modules/babel-core/lib/babel/transformation/transformers/minification/member-expression-literals.js
gulp_assets-1.0.0.pre.4 template/node_modules/babel-core/lib/babel/transformation/transformers/minification/member-expression-literals.js
gulp_assets-1.0.0.pre.3 template/node_modules/babel-core/lib/babel/transformation/transformers/minification/member-expression-literals.js