1 | var _curry1 =
|
2 | /*#__PURE__*/
|
3 | require("./internal/_curry1");
|
4 |
|
5 | var _dispatchable =
|
6 | /*#__PURE__*/
|
7 | require("./internal/_dispatchable");
|
8 |
|
9 | var _xdropRepeatsWith =
|
10 | /*#__PURE__*/
|
11 | require("./internal/_xdropRepeatsWith");
|
12 |
|
13 | var dropRepeatsWith =
|
14 | /*#__PURE__*/
|
15 | require("./dropRepeatsWith");
|
16 |
|
17 | var equals =
|
18 | /*#__PURE__*/
|
19 | require("./equals");
|
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([],
|
45 | /*#__PURE__*/
|
46 | _xdropRepeatsWith(equals),
|
47 | /*#__PURE__*/
|
48 | dropRepeatsWith(equals)));
|
49 |
|
50 | module.exports = dropRepeats; |
\ | No newline at end of file |