source: node_modules/ramda/es/aperture.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: 1.0 KB
Line 
1import _aperture from "./internal/_aperture.js";
2import _curry2 from "./internal/_curry2.js";
3import _dispatchable from "./internal/_dispatchable.js";
4import _xaperture from "./internal/_xaperture.js";
5/**
6 * Returns a new list, composed of n-tuples of consecutive elements. If `n` is
7 * greater than the length of the list, an empty list is returned.
8 *
9 * Acts as a transducer if a transformer is given in list position.
10 *
11 * @func
12 * @memberOf R
13 * @since v0.12.0
14 * @category List
15 * @sig Number -> [a] -> [[a]]
16 * @param {Number} n The size of the tuples to create
17 * @param {Array} list The list to split into `n`-length tuples
18 * @return {Array} The resulting list of `n`-length tuples
19 * @see R.transduce
20 * @example
21 *
22 * R.aperture(2, [1, 2, 3, 4, 5]); //=> [[1, 2], [2, 3], [3, 4], [4, 5]]
23 * R.aperture(3, [1, 2, 3, 4, 5]); //=> [[1, 2, 3], [2, 3, 4], [3, 4, 5]]
24 * R.aperture(7, [1, 2, 3, 4, 5]); //=> []
25 */
26
27var aperture =
28/*#__PURE__*/
29_curry2(
30/*#__PURE__*/
31_dispatchable([], _xaperture, _aperture));
32
33export default aperture;
Note: See TracBrowser for help on using the repository browser.