Socket
Socket
Sign inDemoInstall

arrayify-compact

Package Overview
Dependencies
1
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    arrayify-compact

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


Version published
Weekly downloads
40K
decreased by-16.09%
Maintainers
1
Install size
13.1 kB
Created
Weekly downloads
 

Readme

Source

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

Other utils for working with arrays.

  • arr-flatten: Recursively flatten an array or arrays. This is the fastest implementation of array flatten.
  • arr-reduce: Fast array reduce that also loops over sparse elements.
  • arr-pluck: Retrieves the value of a specified property from all elements in the collection.
  • arr-map: Faster, node.js focused alternative to JavaScript's native array map.
  • arr-union: Combines a list of arrays, returning a single array with unique values, using strict equality… more
  • array-unique: Return an array free of duplicate values. Fastest ES5 implementation.
  • utils: Fast, generic JavaScript/node.js utility functions.

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.

Keywords

FAQs

Last updated on 20 Jun 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc