babel-plugin-transform-inline-consecutive-adds
Advanced tools
Comparing version 0.4.0-alpha.6546ad11 to 0.4.0-alpha.caaefb4c
"use strict"; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var Collapser = require("./collapser"); | ||
var ArrayCollapser = function (_Collapser) { | ||
var ArrayCollapser = | ||
/*#__PURE__*/ | ||
function (_Collapser) { | ||
_inherits(ArrayCollapser, _Collapser); | ||
@@ -38,3 +42,2 @@ | ||
// foo.push(rval1, ...nrvals) | ||
var callee = expr.get("callee"); | ||
@@ -48,2 +51,3 @@ | ||
prop = callee.get("property"); | ||
if (!obj.isIdentifier() || obj.node.name !== objName || !prop.isIdentifier() || prop.node.name !== "push") { | ||
@@ -54,5 +58,7 @@ return false; | ||
var args = expr.get("arguments"); | ||
if (args.some(checkReference)) { | ||
return false; | ||
} | ||
return true; | ||
@@ -59,0 +65,0 @@ }; |
"use strict"; | ||
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); | ||
function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var Collapser = require("./collapser"); | ||
var ArrayPropertyCollapser = function (_Collapser) { | ||
var ArrayPropertyCollapser = | ||
/*#__PURE__*/ | ||
function (_Collapser) { | ||
_inherits(ArrayPropertyCollapser, _Collapser); | ||
@@ -40,3 +46,2 @@ | ||
// foo[num] = rval | ||
var left = expr.get("left"); | ||
@@ -50,2 +55,3 @@ | ||
prop = left.get("property"); | ||
if (!obj.isIdentifier() || obj.node.name !== objName) { | ||
@@ -64,2 +70,3 @@ return false; | ||
var right = expr.get("right"); | ||
if (checkReference(right)) { | ||
@@ -85,8 +92,11 @@ return false; | ||
var elements = init.elements; | ||
for (var i = elements.length; i <= index; i++) { | ||
elements.push(null); | ||
} | ||
if (elements[index] !== null) { | ||
return false; | ||
} | ||
elements[index] = rval.node; | ||
@@ -108,13 +118,12 @@ return true; | ||
}); | ||
}; | ||
// We make an inexact calculation of how much space we save. | ||
}; // We make an inexact calculation of how much space we save. | ||
// It's inexact because we don't know how whitespaces will get minimized, | ||
// and other factors. | ||
if (anyUndefined([statements[statements.length - 1].node.end, varDecl.node.end])) { | ||
return false; | ||
} | ||
var statementsLength = statements[statements.length - 1].node.end - varDecl.node.end; | ||
// Approx. formula of the change in `init`'s length = | ||
var statementsLength = statements[statements.length - 1].node.end - varDecl.node.end; // Approx. formula of the change in `init`'s length = | ||
// (# commas added) + (size of all the new rvals added), where | ||
@@ -124,2 +133,3 @@ // # commas added = (difference between the lengths of the old and new arrays) | ||
var numCommaAdded = newInit.elements.length - oldInit.elements.length; | ||
if (anyUndefined(assignments.map(function (_ref4) { | ||
@@ -138,2 +148,3 @@ var _ref5 = _slicedToArray(_ref4, 2), | ||
} | ||
var sizeOfRvals = assignments.map(function (_ref8) { | ||
@@ -140,0 +151,0 @@ var _ref9 = _slicedToArray(_ref8, 2), |
"use strict"; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
var NotImplementedError = Error("NotImplementedError"); | ||
var Collapser = function () { | ||
var Collapser = | ||
/*#__PURE__*/ | ||
function () { | ||
function Collapser() { | ||
@@ -11,0 +15,0 @@ _classCallCheck(this, Collapser); |
"use strict"; | ||
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); | ||
function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } } | ||
var COLLAPSERS = [require("./object-collapser"), require("./array-collapser"), require("./array-property-collapser"), require("./set-collapser")].map(function (Collapser) { | ||
@@ -12,4 +14,4 @@ return new Collapser(); | ||
return p.isFunction(); | ||
}); | ||
// don"t traverse higher than the function the var is defined in. | ||
}); // don"t traverse higher than the function the var is defined in. | ||
return parent === scopeParent ? null : parent; | ||
@@ -36,2 +38,3 @@ } | ||
} | ||
return references; | ||
@@ -43,2 +46,3 @@ } | ||
var binding = parent.scope.getBinding(name); | ||
if (!binding) { | ||
@@ -53,3 +57,2 @@ return false; | ||
}, new Set()); | ||
return Array.from(references); | ||
@@ -67,4 +70,4 @@ } | ||
// otherwise returns [foo as string, ?rval, index of the variable declaration] | ||
var declarations = path.get("declarations"); | ||
var declarations = path.get("declarations"); | ||
if (declarations.length !== 1) { | ||
@@ -77,2 +80,3 @@ return; | ||
init = declaration.get("init"); | ||
if (!id.isIdentifier()) { | ||
@@ -83,2 +87,3 @@ return; | ||
var parent = path.parentPath; | ||
if (!parent.isBlockParent() || !parent.isScopable()) { | ||
@@ -89,6 +94,9 @@ return; | ||
var body = parent.get("body"); | ||
if (!Array.isArray(body)) { | ||
return; | ||
} | ||
var startIndex = body.indexOf(path); | ||
if (startIndex === -1) { | ||
@@ -115,2 +123,3 @@ return; | ||
}); | ||
if (_exprs.some(function (e) { | ||
@@ -137,4 +146,6 @@ return e === null; | ||
var allExprs = []; | ||
for (var i = start; i < end; i++) { | ||
var exprs = collectExpressions(body[i], isExprTypeValid); | ||
if (exprs === null || !exprs.every(function (e) { | ||
@@ -145,5 +156,7 @@ return checkExpr(e); | ||
} | ||
statements.push(body[i]); | ||
allExprs = allExprs.concat(exprs); | ||
} | ||
return [statements, allExprs]; | ||
@@ -188,2 +201,3 @@ } | ||
var newInit = t.cloneDeep(oldInit); | ||
if (!assignments.every(function (assignment) { | ||
@@ -193,5 +207,5 @@ return collapser.addSuccessfully(t, assignment, newInit); | ||
return; | ||
} | ||
} // some collapses may increase the size | ||
// some collapses may increase the size | ||
if (!collapser.isSizeSmaller({ | ||
@@ -216,3 +230,2 @@ newInit, | ||
var t = _ref.types; | ||
return { | ||
@@ -223,2 +236,3 @@ name: "transform-inline-consecutive-adds", | ||
var topLevel = validateTopLevel(varDecl); | ||
if (!topLevel) { | ||
@@ -232,5 +246,7 @@ return; | ||
var references = getIdAndFunctionReferences(name, varDecl.parentPath); | ||
if (references === false) { | ||
return; | ||
} | ||
var checkReference = getReferenceChecker(references); | ||
@@ -244,4 +260,5 @@ | ||
} | ||
} | ||
}; | ||
}; |
"use strict"; | ||
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); | ||
function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var Collapser = require("./collapser"); | ||
var ObjectCollapser = function (_Collapser) { | ||
var ObjectCollapser = | ||
/*#__PURE__*/ | ||
function (_Collapser) { | ||
_inherits(ObjectCollapser, _Collapser); | ||
@@ -40,4 +46,4 @@ | ||
// foo.a = rval | foo[a] = rval | ||
var left = expr.get("left"); | ||
var left = expr.get("left"); | ||
if (!left.isMemberExpression()) { | ||
@@ -49,8 +55,11 @@ return false; | ||
prop = left.get("property"); | ||
if (!obj.isIdentifier() || obj.node.name !== objName) { | ||
return false; | ||
} | ||
if (!prop.isIdentifier() && checkReference(prop)) { | ||
return false; | ||
} | ||
if (left.node.computed && !(prop.isStringLiteral() || prop.isNumericLiteral())) { | ||
@@ -61,2 +70,3 @@ return false; | ||
var right = expr.get("right"); | ||
if (checkReference(right)) { | ||
@@ -63,0 +73,0 @@ return false; |
"use strict"; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var Collapser = require("./collapser"); | ||
var SetCollapser = function (_Collapser) { | ||
var SetCollapser = | ||
/*#__PURE__*/ | ||
function (_Collapser) { | ||
_inherits(SetCollapser, _Collapser); | ||
@@ -25,4 +29,3 @@ | ||
value: function isInitTypeValid(init) { | ||
return init.isNewExpression() && init.get("callee").isIdentifier() && init.node.callee.name === "Set" && ( | ||
// other iterables might not be append-able | ||
return init.isNewExpression() && init.get("callee").isIdentifier() && init.node.callee.name === "Set" && ( // other iterables might not be append-able | ||
init.node.arguments.length === 0 || init.node.arguments.length === 1 && init.get("arguments")[0].isArrayExpression()); | ||
@@ -41,3 +44,2 @@ } | ||
// foo.add(rval) | ||
var callee = expr.get("callee"); | ||
@@ -51,2 +53,3 @@ | ||
prop = callee.get("property"); | ||
if (!obj.isIdentifier() || obj.node.name !== objName || !prop.isIdentifier() || prop.node.name !== "add") { | ||
@@ -57,8 +60,11 @@ return false; | ||
var args = expr.get("arguments"); | ||
if (args.length !== 1) { | ||
return false; | ||
} | ||
if (checkReference(args[0])) { | ||
return false; | ||
} | ||
return true; | ||
@@ -78,2 +84,3 @@ }; | ||
} | ||
init.arguments[0].elements.push(arg); | ||
@@ -80,0 +87,0 @@ return true; |
{ | ||
"name": "babel-plugin-transform-inline-consecutive-adds", | ||
"version": "0.4.0-alpha.6546ad11", | ||
"version": "0.4.0-alpha.caaefb4c", | ||
"description": "This plugin inlines consecutive property assignments, array pushes, etc.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -63,5 +63,5 @@ # babel-plugin-transform-inline-consecutive-adds | ||
```javascript | ||
require("babel-core").transform("code", { | ||
require("@babel/core").transform("code", { | ||
plugins: ["transform-inline-consecutive-adds"] | ||
}); | ||
``` |
573
26821