mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 23:57:49 +00:00
Bump to v4.16.4.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import baseClamp from './_baseClamp.js';
|
||||
import copyArray from './_copyArray.js';
|
||||
import shuffleSelf from './_shuffleSelf.js';
|
||||
|
||||
@@ -10,7 +11,7 @@ import shuffleSelf from './_shuffleSelf.js';
|
||||
* @returns {Array} Returns the random elements.
|
||||
*/
|
||||
function arraySampleSize(array, n) {
|
||||
return shuffleSelf(copyArray(array), n);
|
||||
return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
|
||||
}
|
||||
|
||||
export default arraySampleSize;
|
||||
|
||||
Reference in New Issue
Block a user