Bump to v4.16.0.

This commit is contained in:
John-David Dalton
2016-09-17 22:28:43 -07:00
parent 28663c1e27
commit 94ac73824f
102 changed files with 526 additions and 320 deletions

View File

@@ -1,4 +1,4 @@
import baseRandom from './_baseRandom.js';
import arraySample from './_arraySample.js';
import isArrayLike from './isArrayLike.js';
import values from './values.js';
@@ -17,10 +17,7 @@ import values from './values.js';
* // => 2
*/
function sample(collection) {
var array = isArrayLike(collection) ? collection : values(collection),
length = array.length;
return length > 0 ? array[baseRandom(0, length - 1)] : undefined;
return arraySample(isArrayLike(collection) ? collection : values(collection));
}
export default sample;