$ cnpm install arrayify-compact
Casts the given value to a flatten array, and removes falsey items (similar to lodash compact).
Install with npm
$ npm i arrayify-compact --save
Install with bower
$ bower install arrayify-compact --save
var arrayify = require('arrayify-compact');
arrayify('a');
//=> ['a']
arrayify(['a', 'b', ['c', ['d']]]);
//=> ['a', 'b', 'c', 'd']
arrayify(['a', 'b', ['c', ['d'], null, false, 0, NaN, '', [], undefined]]);
//=> ['a', 'b', 'c', 'd']
Other utils for working with arrays.
Install dev dependencies:
$ npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright © 2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on June 19, 2015.
Copyright 2013 - present © cnpmjs.org | Home |