source: node_modules/ramda-adjunct/es/allUnique.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: 709 bytes
Line 
1import { converge, length, uniq } from 'ramda';
2import lengthEq from './lengthEq';
3
4/**
5 * Returns true if all items in the list are unique. `R.equals` is used to determine equality.
6 *
7 * @func allUnique
8 * @memberOf RA
9 * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
10 * @category List
11 * @sig [a] -> Boolean
12 * @param {Array} list The list of values
13 * @return {boolean}
14 * @see {@link RA.notAllUnique|notAllUnique}, {@link https://ramdajs.com/docs/#equals|equals}
15 * @example
16 *
17 * RA.allUnique([ 1, 2, 3, 4 ]); //=> true
18 * RA.allUnique([ 1, 1, 2, 3 ]); //=> false
19 * RA.allUnique([]); //=> true
20 *
21 */
22var allUnique = converge(lengthEq, [length, uniq]);
23export default allUnique;
Note: See TracBrowser for help on using the repository browser.