1.0.0-rc.1 • Published 7 years ago
babel-plugin-smoosh v1.0.0-rc.1
babel-plugin-smoosh
Lets intellectuals use Array.prototype.smoosh() and
Array.prototype.smooshMap() instead of Array.prototype.flat() and
Array.prototype.flatMap().
Installation
npm i --save-dev babel-plugin-smooshAdd the following to your .babelrc or .babelrc.js file:
{
"plugins": ["smoosh"]
}Usage
const myArray = [1, 2, [3, 4]];
myArray.smoosh(); // [1, 2, 3, 4]const myArray = [1, 2, [3, 4];
myArray.smooshMap(x => [x * 2]) // [2, 4, 6, 8]1.0.0-rc.1
7 years ago