1 | var _aperture =
|
2 | /*#__PURE__*/
|
3 | require("./internal/_aperture");
|
4 |
|
5 | var _curry2 =
|
6 | /*#__PURE__*/
|
7 | require("./internal/_curry2");
|
8 |
|
9 | var _dispatchable =
|
10 | /*#__PURE__*/
|
11 | require("./internal/_dispatchable");
|
12 |
|
13 | var _xaperture =
|
14 | /*#__PURE__*/
|
15 | require("./internal/_xaperture");
|
16 | /**
|
17 | * Returns a new list, composed of n-tuples of consecutive elements. If `n` is
|
18 | * greater than the length of the list, an empty list is returned.
|
19 | *
|
20 | * Acts as a transducer if a transformer is given in list position.
|
21 | *
|
22 | * @func
|
23 | * @memberOf R
|
24 | * @since v0.12.0
|
25 | * @category List
|
26 | * @sig Number -> [a] -> [[a]]
|
27 | * @param {Number} n The size of the tuples to create
|
28 | * @param {Array} list The list to split into `n`-length tuples
|
29 | * @return {Array} The resulting list of `n`-length tuples
|
30 | * @see R.transduce
|
31 | * @example
|
32 | *
|
33 | * R.aperture(2, [1, 2, 3, 4, 5]); //=> [[1, 2], [2, 3], [3, 4], [4, 5]]
|
34 | * R.aperture(3, [1, 2, 3, 4, 5]); //=> [[1, 2, 3], [2, 3, 4], [3, 4, 5]]
|
35 | * R.aperture(7, [1, 2, 3, 4, 5]); //=> []
|
36 | */
|
37 |
|
38 |
|
39 | var aperture =
|
40 | /*#__PURE__*/
|
41 | _curry2(
|
42 | /*#__PURE__*/
|
43 | _dispatchable([], _xaperture, _aperture));
|
44 |
|
45 | module.exports = aperture; |
\ | No newline at end of file |