source: node_modules/ramda-adjunct/es/allIdentical.js

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