Type annotations + QC
var suite = require('suite.js');
var f = require('funkit/array');
var equals = require('funkit/operators/equals');
suite(f.chunk, function(op, len, arr) {
return equals(f.concat(op(len, arr)), arr);
});
define(['../common/annotate', '../math/range', '../functional/map', '../operators/gt'], function(annotate, range, map, gt) {
function chunk(len, a) {
return map(function(k) {
return a.slice(k, k + len);
}, range(0, a.length, len));
}
return annotate(chunk, gt(0), Array);
});