Bump to v4.16.4.

This commit is contained in:
John-David Dalton
2016-10-05 19:49:52 -07:00
parent eb1446def5
commit 39e2b943dc
20 changed files with 324 additions and 291 deletions

View File

@@ -1,4 +1,5 @@
var shuffleSelf = require('./_shuffleSelf'),
var baseClamp = require('./_baseClamp'),
shuffleSelf = require('./_shuffleSelf'),
values = require('./values');
/**
@@ -10,7 +11,8 @@ var shuffleSelf = require('./_shuffleSelf'),
* @returns {Array} Returns the random elements.
*/
function baseSampleSize(collection, n) {
return shuffleSelf(values(collection), n);
var array = values(collection);
return shuffleSelf(array, baseClamp(n, 0, array.length));
}
module.exports = baseSampleSize;