Transforms method chaining to sequence of expressions.
In
var result = Class.newBuilder().build();
Out
var _a;
var result = (_a = Class.newBuilder(), _a.build)();
_a = undefined;
npm install babel-plugin-method-unchaining
.babelrc
{
"plugins": ["babel-plugin-method-unchaining"]
}
babel --plugins babel-plugin-method-unchaining script.js
require("babel-core").transform("code", {
plugins: ["babel-plugin-method-unchaining"]
});