source: node_modules/ramda/es/dropRepeats.js

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: 941 bytes
Line 
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([], function () {
30 return _xdropRepeatsWith(equals);
31},
32/*#__PURE__*/
33dropRepeatsWith(equals)));
34
35export default dropRepeats;
Note: See TracBrowser for help on using the repository browser.