$ npm install babel-plugin-transform-member-expression-literals
Turn valid member expression property literals into plain identifiers
In
obj["foo"] = "isValid";
obj.const = "isKeyword";
obj["var"] = "isKeyword";
Out
obj.foo = "isValid";
obj["const"] = "isKeyword";
obj["var"] = "isKeyword";
npm install babel-plugin-transform-member-expression-literals
.babelrc
(Recommended).babelrc
{
"plugins": ["transform-member-expression-literals"]
}
babel --plugins transform-member-expression-literals script.js
require("@babel/core").transform("code", {
plugins: ["transform-member-expression-literals"]
});
© 2010 - cnpmjs.org x YWFE | Home | YWFE