Home

Awesome

arrayify-compact NPM version

Casts the given value to a flatten array, and removes falsey items (similar to lodash compact).

Install

Install with npm

$ npm i arrayify-compact --save

Install with bower

$ bower install arrayify-compact --save

Usage

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']

Related

Other utils for working with arrays.

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on June 19, 2015.