Sha256: 97a152a89db01535bbb458b33d75732b659162b46541e2e4df14530c8514c6cb

Contents?: true

Size: 687 Bytes

Versions: 8

Compression:

Stored size: 687 Bytes

Contents

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});

exports["default"] = function (_ref) {
  var Plugin = _ref.Plugin;
  var t = _ref.types;

  return new Plugin("member-expression-literals", {
    metadata: {
      group: "builtin-trailing"
    },

    visitor: {
      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;
          }
        }
      }
    }
  });
};

module.exports = exports["default"];

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
ilog-0.4.1 node_modules/babel-plugin-member-expression-literals/lib/index.js
ilog-0.4.0 node_modules/babel-plugin-member-expression-literals/lib/index.js
ilog-0.3.3 node_modules/babel-plugin-member-expression-literals/lib/index.js
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/babel-plugin-member-expression-literals/lib/index.js
xcodebuild-helper-1.2.3 externals/ios-sim-master/node_modules/babel-plugin-member-expression-literals/lib/index.js
es6_tilt-0.1.2 test/dummy/app/assets/javascripts/node_modules/babel-plugin-member-expression-literals/lib/index.js
es6_tilt-0.1.1 test/dummy/app/assets/javascripts/node_modules/babel-plugin-member-expression-literals/lib/index.js
es6_tilt-0.1.0 test/dummy/app/assets/javascripts/node_modules/babel-plugin-member-expression-literals/lib/index.js