mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 23:37:49 +00:00
Bump to v3.10.0.
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import baseSlice from '../internal/baseSlice';
|
||||
import isIterateeCall from '../internal/isIterateeCall';
|
||||
|
||||
/** Native method references. */
|
||||
var ceil = Math.ceil;
|
||||
|
||||
/* Native method references for those with the same name as other `lodash` methods. */
|
||||
var nativeMax = Math.max;
|
||||
var nativeCeil = Math.ceil,
|
||||
nativeFloor = Math.floor,
|
||||
nativeMax = Math.max;
|
||||
|
||||
/**
|
||||
* Creates an array of elements split into groups the length of `size`.
|
||||
@@ -31,12 +30,12 @@ function chunk(array, size, guard) {
|
||||
if (guard ? isIterateeCall(array, size, guard) : size == null) {
|
||||
size = 1;
|
||||
} else {
|
||||
size = nativeMax(+size || 1, 1);
|
||||
size = nativeMax(nativeFloor(size) || 1, 1);
|
||||
}
|
||||
var index = 0,
|
||||
length = array ? array.length : 0,
|
||||
resIndex = -1,
|
||||
result = Array(ceil(length / size));
|
||||
result = Array(nativeCeil(length / size));
|
||||
|
||||
while (index < length) {
|
||||
result[++resIndex] = baseSlice(array, index, (index += size));
|
||||
|
||||
Reference in New Issue
Block a user