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:
600 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | import identity from "./identity.js";
|
---|
| 2 | import uniqBy from "./uniqBy.js";
|
---|
| 3 | /**
|
---|
| 4 | * Returns a new list containing only one copy of each element in the original
|
---|
| 5 | * list. [`R.equals`](#equals) is used to determine equality.
|
---|
| 6 | *
|
---|
| 7 | * @func
|
---|
| 8 | * @memberOf R
|
---|
| 9 | * @since v0.1.0
|
---|
| 10 | * @category List
|
---|
| 11 | * @sig [a] -> [a]
|
---|
| 12 | * @param {Array} list The array to consider.
|
---|
| 13 | * @return {Array} The list of unique items.
|
---|
| 14 | * @example
|
---|
| 15 | *
|
---|
| 16 | * R.uniq([1, 1, 2, 1]); //=> [1, 2]
|
---|
| 17 | * R.uniq([1, '1']); //=> [1, '1']
|
---|
| 18 | * R.uniq([[42], [42]]); //=> [[42]]
|
---|
| 19 | */
|
---|
| 20 |
|
---|
| 21 | var uniq =
|
---|
| 22 | /*#__PURE__*/
|
---|
| 23 | uniqBy(identity);
|
---|
| 24 | export default uniq; |
---|
Note:
See
TracBrowser
for help on using the repository browser.