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-smoosh
Add the following to your .babelrc
or .babelrc.js
file:
Usage
const myArray = 1 2 3 4;myArray; // [1, 2, 3, 4]
const myArray = 1 2 3 4;myArray // [2, 4, 6, 8]