Bump to v4.16.2.

This commit is contained in:
John-David Dalton
2016-09-25 13:40:14 -07:00
parent 5425ef9a59
commit ab95e7dde7
28 changed files with 128 additions and 47 deletions

View File

@@ -1,5 +1,5 @@
import arrayShuffle from './_arrayShuffle.js';
import baseClamp from './_baseClamp.js';
import copyArray from './_copyArray.js';
import shuffleSelf from './_shuffleSelf.js';
/**
* A specialized version of `_.sampleSize` for arrays.
@@ -10,9 +10,7 @@ import baseClamp from './_baseClamp.js';
* @returns {Array} Returns the random elements.
*/
function arraySampleSize(array, n) {
var result = arrayShuffle(array);
result.length = baseClamp(n, 0, result.length);
return result;
return shuffleSelf(copyArray(array), n);
}
export default arraySampleSize;