$ gnpm install arrify
Convert a value to an array
$ npm install arrify
import arrify from 'arrify';
arrify('????');
//=> ['????']
arrify(['????']);
//=> ['????']
arrify(new Set(['????']));
//=> ['????']
arrify(null);
//=> []
arrify(undefined);
//=> []
Specifying null
or undefined
results in an empty array.
Copyright 2013 - present © cnpmjs.org | Home |