MCPcopy
hub / github.com/Kong/insomnia / arraySampleSize

Function arraySampleSize

packages/insomnia/bin/yarn-standalone.js:10077–10079  ·  view source on GitHub ↗

* A specialized version of `_.sampleSize` for arrays. * * @private * @param {Array} array The array to sample. * @param {number} n The number of elements to sample. * @returns {Array} Returns the random elements.

(array, n)

Source from the content-addressed store, hash-verified

10075 * @returns {Array} Returns the random elements.
10076 */
10077 function arraySampleSize(array, n) {
10078 return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
10079 }
10080
10081 /**
10082 * A specialized version of `_.shuffle` for arrays.

Callers

nothing calls this directly

Calls 3

shuffleSelfFunction · 0.85
copyArrayFunction · 0.85
baseClampFunction · 0.85

Tested by

no test coverage detected