replace `Array.from` with an ponyfill function
npm install @59naga/babel-plugin-transform-array-frombabel-plugin-transform-array-from
---
Replace Array.from with an ponyfill function.
Installation
---
``bash`
npm install @59naga/babel-plugin-transform-array-from --save
Example
---
In
`js`
Array.from('👺');
Out
`js`
var _arrayFrom = Array.from || function(){...};
_arrayFrom('👺');
.babelrc
`json`
{
"plugins": ["@59naga/babel-plugin-transform-array-from"]
}
`bash`
$ babel --plugins @59naga/babel-plugin-transform-array-from script.js
`js`
require("babel-core").transform("code", {
plugins: ["@59naga/babel-plugin-transform-array-from"]
});
Development
---
Requirement global
* NodeJS v0.12.13
* Npm v3.7.1
`bash
git clone https://github.com/59naga/@59naga/babel-plugin-transform-array-from
cd @59naga/babel-plugin-transform-array-from
npm install
npm test
``
License
---
MIT