main
Last change
on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
280 bytes
|
Line | |
---|
1 | function _aperture(n, list) {
|
---|
2 | var idx = 0;
|
---|
3 | var limit = list.length - (n - 1);
|
---|
4 | var acc = new Array(limit >= 0 ? limit : 0);
|
---|
5 |
|
---|
6 | while (idx < limit) {
|
---|
7 | acc[idx] = Array.prototype.slice.call(list, idx, idx + n);
|
---|
8 | idx += 1;
|
---|
9 | }
|
---|
10 |
|
---|
11 | return acc;
|
---|
12 | }
|
---|
13 |
|
---|
14 | module.exports = _aperture; |
---|
Note:
See
TracBrowser
for help on using the repository browser.