vlad 6f123ff03e 18.07 | 6 gadi atpakaļ | |
---|---|---|
.. | ||
index.js | 6 gadi atpakaļ | |
license | 6 gadi atpakaļ | |
package.json | 6 gadi atpakaļ | |
readme.md | 6 gadi atpakaļ |
Convert a value to an array
$ npm install --save arrify
const arrify = require('arrify');
arrify('unicorn');
//=> ['unicorn']
arrify(['unicorn']);
//=> ['unicorn']
arrify(null);
//=> []
arrify(undefined);
//=> []
Supplying null
or undefined
results in an empty array.
MIT © Sindre Sorhus