Sha256: fddbed1714457a56bf4da3fddfeccbde039cae8cc06621b82ce2518b38625cee

Contents?: true

Size: 548 Bytes

Versions: 264

Compression:

Stored size: 548 Bytes

Contents

var baseClamp = require('./_baseClamp'),
    shuffleSelf = require('./_shuffleSelf'),
    values = require('./values');

/**
 * The base implementation of `_.sampleSize` without param guards.
 *
 * @private
 * @param {Array|Object} collection The collection to sample.
 * @param {number} n The number of elements to sample.
 * @returns {Array} Returns the random elements.
 */
function baseSampleSize(collection, n) {
  var array = values(collection);
  return shuffleSelf(array, baseClamp(n, 0, array.length));
}

module.exports = baseSampleSize;

Version data entries

264 entries across 262 versions & 29 rubygems

Version Path
sumomo-0.10.0 data/sumomo/api_modules/node_modules/lodash/_baseSampleSize.js
reed_sdk-1.0.1 node_modules/lodash/_baseSampleSize.js
reed_sdk-1.0.0 node_modules/lodash/_baseSampleSize.js
boring_generators-0.12.0 tmp/templates/app_template/node_modules/lodash/_baseSampleSize.js
sumomo-0.9.0 data/sumomo/api_modules/node_modules/lodash/_baseSampleSize.js
sumomo-0.8.22 data/sumomo/api_modules/node_modules/lodash/_baseSampleSize.js
sumomo-0.8.21 data/sumomo/api_modules/node_modules/lodash/_baseSampleSize.js
sumomo-0.8.20 data/sumomo/api_modules/node_modules/lodash/_baseSampleSize.js
sumomo-0.8.17 data/sumomo/api_modules/node_modules/lodash/_baseSampleSize.js
sumomo-0.8.16 data/sumomo/api_modules/node_modules/lodash/_baseSampleSize.js
disco_app-0.18.0 test/dummy/node_modules/lodash/_baseSampleSize.js
disco_app-0.18.2 test/dummy/node_modules/lodash/_baseSampleSize.js
sumomo-0.8.15 data/sumomo/api_modules/node_modules/lodash/_baseSampleSize.js
trusty-cms-5.0.7 node_modules/lodash/_baseSampleSize.js
appmap-0.72.2 ./node_modules/lodash/_baseSampleSize.js
trusty-cms-5.0.6 node_modules/lodash/_baseSampleSize.js
appmap-0.72.1 ./node_modules/lodash/_baseSampleSize.js
appmap-0.72.0 ./node_modules/lodash/_baseSampleSize.js
trusty-cms-5.0.5 node_modules/lodash/_baseSampleSize.js
trusty-cms-5.0.4 node_modules/lodash/_baseSampleSize.js