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:
885 bytes
|
Line | |
---|
1 | import { curry, identical, all } from 'ramda';
|
---|
2 |
|
---|
3 | /**
|
---|
4 | * Returns true if all items in the list are equivalent to user provided value using `R.identical` for equality comparisons.
|
---|
5 | *
|
---|
6 | * @func allIdenticalTo
|
---|
7 | * @memberOf RA
|
---|
8 | * @since {@link https://char0n.github.io/ramda-adjunct/2.11.0|v2.11.0}
|
---|
9 | * @category List
|
---|
10 | * @sig a -> [b] -> Boolean
|
---|
11 | * @param {*} val User provided value to check the `list` against
|
---|
12 | * @param {Array} list The list of values
|
---|
13 | * @return {boolean}
|
---|
14 | * @see {@link RA.allIdentical|allIdentical}, {@link http://ramdajs.com/docs/#identical|R.identical}
|
---|
15 | * @example
|
---|
16 | *
|
---|
17 | * RA.allIdenticalTo(1, [ 1, 2, 3, 4 ]); //=> false
|
---|
18 | * RA.allIdenticalTo(1, [ 1, 1, 1, 1 ]); //=> true
|
---|
19 | * RA.allIdenticalTo(1, []); //=> true
|
---|
20 | * RA.allIdenticalTo({}, [ {}, {} ]); //=> false
|
---|
21 | *
|
---|
22 | */
|
---|
23 | const allIdenticalTo = curry((val, list) => all(identical(val), list));
|
---|
24 |
|
---|
25 | export default allIdenticalTo;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.