UNPKG

929 BJavaScriptView Raw
1import _curry1 from "./internal/_curry1.js";
2import _dispatchable from "./internal/_dispatchable.js";
3import _xdropRepeatsWith from "./internal/_xdropRepeatsWith.js";
4import dropRepeatsWith from "./dropRepeatsWith.js";
5import equals from "./equals.js";
6/**
7 * Returns a new list without any consecutively repeating elements.
8 * [`R.equals`](#equals) is used to determine equality.
9 *
10 * Acts as a transducer if a transformer is given in list position.
11 *
12 * @func
13 * @memberOf R
14 * @since v0.14.0
15 * @category List
16 * @sig [a] -> [a]
17 * @param {Array} list The array to consider.
18 * @return {Array} `list` without repeating elements.
19 * @see R.transduce
20 * @example
21 *
22 * R.dropRepeats([1, 1, 1, 2, 3, 4, 4, 2, 2]); //=> [1, 2, 3, 4, 2]
23 */
24
25var dropRepeats =
26/*#__PURE__*/
27_curry1(
28/*#__PURE__*/
29_dispatchable([],
30/*#__PURE__*/
31_xdropRepeatsWith(equals),
32/*#__PURE__*/
33dropRepeatsWith(equals)));
34
35export default dropRepeats;
\No newline at end of file