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:
1.0 KB
|
Rev | Line | |
---|
[d24f17c] | 1 | var _curry1 =
|
---|
| 2 | /*#__PURE__*/
|
---|
| 3 | require("./internal/_curry1.js");
|
---|
| 4 |
|
---|
| 5 | var _dispatchable =
|
---|
| 6 | /*#__PURE__*/
|
---|
| 7 | require("./internal/_dispatchable.js");
|
---|
| 8 |
|
---|
| 9 | var _xdropRepeatsWith =
|
---|
| 10 | /*#__PURE__*/
|
---|
| 11 | require("./internal/_xdropRepeatsWith.js");
|
---|
| 12 |
|
---|
| 13 | var dropRepeatsWith =
|
---|
| 14 | /*#__PURE__*/
|
---|
| 15 | require("./dropRepeatsWith.js");
|
---|
| 16 |
|
---|
| 17 | var equals =
|
---|
| 18 | /*#__PURE__*/
|
---|
| 19 | require("./equals.js");
|
---|
| 20 | /**
|
---|
| 21 | * Returns a new list without any consecutively repeating elements.
|
---|
| 22 | * [`R.equals`](#equals) is used to determine equality.
|
---|
| 23 | *
|
---|
| 24 | * Acts as a transducer if a transformer is given in list position.
|
---|
| 25 | *
|
---|
| 26 | * @func
|
---|
| 27 | * @memberOf R
|
---|
| 28 | * @since v0.14.0
|
---|
| 29 | * @category List
|
---|
| 30 | * @sig [a] -> [a]
|
---|
| 31 | * @param {Array} list The array to consider.
|
---|
| 32 | * @return {Array} `list` without repeating elements.
|
---|
| 33 | * @see R.transduce
|
---|
| 34 | * @example
|
---|
| 35 | *
|
---|
| 36 | * R.dropRepeats([1, 1, 1, 2, 3, 4, 4, 2, 2]); //=> [1, 2, 3, 4, 2]
|
---|
| 37 | */
|
---|
| 38 |
|
---|
| 39 |
|
---|
| 40 | var dropRepeats =
|
---|
| 41 | /*#__PURE__*/
|
---|
| 42 | _curry1(
|
---|
| 43 | /*#__PURE__*/
|
---|
| 44 | _dispatchable([], function () {
|
---|
| 45 | return _xdropRepeatsWith(equals);
|
---|
| 46 | },
|
---|
| 47 | /*#__PURE__*/
|
---|
| 48 | dropRepeatsWith(equals)));
|
---|
| 49 |
|
---|
| 50 | module.exports = dropRepeats; |
---|
Note:
See
TracBrowser
for help on using the repository browser.