UNPKG

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