Repository URL to install this package:
|
Version:
2.1.0-1 ▾
|
| .. |
| index.js |
| package.json |
| readme.md |
| index.d.ts |
| license |
Convert a value to an array
$ npm install arrify
const arrify = require('arrify'); arrify('🦄'); //=> ['🦄'] arrify(['🦄']); //=> ['🦄'] arrify(new Set(['🦄'])); //=> ['🦄'] arrify(null); //=> [] arrify(undefined); //=> []
Supplying null or undefined results in an empty array.
MIT © Sindre Sorhus