main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
611 bytes
|
Line | |
---|
1 | import { reject } from 'ramda';
|
---|
2 | import isFalsy from './isFalsy';
|
---|
3 |
|
---|
4 | /**
|
---|
5 | * Creates an array with all falsy values removed.
|
---|
6 | * The values false, null, 0, "", undefined, and NaN are falsy.
|
---|
7 | *
|
---|
8 | * @func compact
|
---|
9 | * @memberOf RA
|
---|
10 | * @since {@link https://char0n.github.io/ramda-adjunct/2.5.0|v2.5.0}
|
---|
11 | * @category List
|
---|
12 | * @sig Filterable f => f a -> f a
|
---|
13 | * @param {Array} list The array to compact
|
---|
14 | * @return {Array} Returns the new array of filtered values
|
---|
15 | * @see {@link RA.isFalsy|isFalsy}
|
---|
16 | * @example
|
---|
17 | *
|
---|
18 | * RA.compact([0, 1, false, 2, '', 3]); //=> [1, 2, 3]
|
---|
19 | */
|
---|
20 | var compact = reject(isFalsy);
|
---|
21 | export default compact; |
---|
Note:
See
TracBrowser
for help on using the repository browser.