UNPKG
@pnpm/ramda
Version:
latest (0.28.1)
0.28.1
A practical functional library for JavaScript programmers.
ramdajs.com
ramda/ramda
@pnpm/ramda
/
src
/
internal
/
_aperture.js
14 lines
(11 loc)
•
280 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function
_aperture
(
n, list
) {
var
idx =
0
;
var
limit = list.
length
- (n -
1
);
var
acc =
new
Array
(limit >=
0
? limit :
0
);
while
(idx < limit) { acc[idx] =
Array
.
prototype
.
slice
.
call
(list, idx, idx + n); idx +=
1
; }
return
acc; }
module
.
exports
= _aperture;