MCPcopy Index your code
hub / github.com/deployd/deployd / sampleSize

Function sampleSize

test-app/public/sinon.js:20418–20426  ·  view source on GitHub ↗

* Gets `n` random elements at unique keys from `collection` up to the * size of `collection`. * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to sample. * @param

(collection, n, guard)

Source from the content-addressed store, hash-verified

20416 * // => [2, 3, 1]
20417 */
20418 function sampleSize(collection, n, guard) {
20419 if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
20420 n = 1;
20421 } else {
20422 n = toInteger(n);
20423 }
20424 var func = isArray(collection) ? arraySampleSize : baseSampleSize;
20425 return func(collection, n);
20426 }
20427
20428 /**
20429 * Creates an array of shuffled values, using a version of the

Callers

nothing calls this directly

Calls 3

isIterateeCallFunction · 0.85
toIntegerFunction · 0.85
isArrayFunction · 0.70

Tested by

no test coverage detected