Bakhtina Sofya b84cb877be 1st comm | hai 3 semanas | |
---|---|---|
.. | ||
index.d.ts | hai 3 semanas | |
index.js | hai 3 semanas | |
license | hai 3 semanas | |
package.json | hai 3 semanas | |
readme.md | hai 3 semanas |
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