babel-plugin-smoosh

1.0.0-rc.1 • Public • Published

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:

{
  "plugins": ["smoosh"]
}

Usage

const myArray = [1, 2, [3, 4]];
myArray.smoosh(); // [1, 2, 3, 4]
const myArray = [1, 2, [3, 4];
myArray.smooshMap(x => [* 2]) // [2, 4, 6, 8]

Dependencies (0)

    Dev Dependencies (9)

    Package Sidebar

    Install

    npm i babel-plugin-smoosh

    Weekly Downloads

    0

    Version

    1.0.0-rc.1

    License

    ISC

    Unpacked Size

    2.17 kB

    Total Files

    3

    Last publish

    Collaborators

    • drewpowers