babel-plugin-transform-array-prototype-includes
Transforms arr.includes(value)
to ES5 without a polyfill
Inspired by babel-plugin-array-includes.
Example
In
1 2 3;1 2 3'includes'1;arr;arr'includes'1;
Out
1 2 3 !== -1;1 2 3 !== -1;Array ? arr !== -1 : arr;Array ? arr !== -1 : arr'includes'1;
Installation
$ npm install babel-plugin-transform-array-prototype-includes
Usage
.babelrc
(Recommended)
Via .babelrc
Via CLI
$ babel --plugins transform-array-prototype-includes script.js
Via Node API
;