Meet npm Pro: unlimited public & private packages + package-based permissions.Learn more »

babel-plugin-transform-member-expression-literals

6.9.4 • Public • Published

babel-plugin-transform-member-expression-literals

Turn valid member expression property literals into plain identifiers

Example

In

obj["foo"] = "isValid";
 
obj.const = "isKeyword";
obj["var"] = "isKeyword";

Out

obj.foo = "isValid";
 
obj["const"] = "isKeyword";
obj["var"] = "isKeyword";

Installation

npm install babel-plugin-transform-member-expression-literals --save-dev

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["transform-member-expression-literals"]
}

Via CLI

babel --plugins transform-member-expression-literals script.js

Via Node API

require("@babel/core").transform("code", {
  plugins: ["transform-member-expression-literals"]
});

Keywords

Install

npm i babel-plugin-transform-member-expression-literals

DownloadsWeekly Downloads

1,191,035

Version

6.9.4

License

MIT

Unpacked Size

2.13 kB

Total Files

5

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar