JSPM

arrayify-compact

0.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 38061
  • Score
    100M100P100Q151988F

Similar to Lo-Dash's compact method, but coerces values to arrays first, then returns a flattened array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are all falsey.

Package Exports

  • arrayify-compact

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (arrayify-compact) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

arrayify-compact NPM version

Similar to Lo-Dash's compact method, but coerces values to arrays first, then returns a flattened array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are all falsey.

Install

Install with npm:

npm i arrayify-compact --save-dev

Usage

var arrayify = require('arrayify-compact');
console.log(arrayify('a'));
//=> ['a']

console.log(arrayify(['a', 'b', ['c', ['d']]]));
//=> ['a', 'b', 'c', 'd']

console.log(arrayify(['a', 'b', ['c', ['d'], null, false, 0, NaN, '', [], undefined]]));
//=> ['a', 'b', 'c', 'd']

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license


This file was generated by verb-cli on July 06, 2014.