mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-14 20:57:49 +00:00
Move arraySample definition to fix builds.
This commit is contained in:
26
lodash.js
26
lodash.js
@@ -712,19 +712,6 @@
|
|||||||
return accumulator;
|
return accumulator;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* A specialized version of `_.sample` for arrays without support for iteratee
|
|
||||||
* shorthands.
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @param {Array} array The array to sample.
|
|
||||||
* @returns {*} Returns the random element.
|
|
||||||
*/
|
|
||||||
function arraySample(array) {
|
|
||||||
var length = array.length;
|
|
||||||
return length ? array[baseRandom(0, length - 1)] : undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A specialized version of `_.some` for arrays without support for iteratee
|
* A specialized version of `_.some` for arrays without support for iteratee
|
||||||
* shorthands.
|
* shorthands.
|
||||||
@@ -2392,6 +2379,19 @@
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A specialized version of `_.sample` for arrays without support for iteratee
|
||||||
|
* shorthands.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Array} array The array to sample.
|
||||||
|
* @returns {*} Returns the random element.
|
||||||
|
*/
|
||||||
|
function arraySample(array) {
|
||||||
|
var length = array.length;
|
||||||
|
return length ? array[baseRandom(0, length - 1)] : undefined;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used by `_.defaults` to customize its `_.assignIn` use.
|
* Used by `_.defaults` to customize its `_.assignIn` use.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user