@babel/plugin-transform-member-expression-literals
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": ["@babel/plugin-transform-member-expression-literals"]
}
Via CLI
babel --plugins @babel/plugin-transform-member-expression-literals script.js
Via Node API
require("@babel/core").transform("code", {
plugins: ["@babel/plugin-transform-member-expression-literals"]
});