Files
NapCatQQ/.pnpm-store/v3/files/c1/0c5e8022d59bd98b49f12f76e22ed4ea73ecb8e7f2e8bc7b49ae1c7c3e25a3b4d92b4e036cd6176613d432c4866d33bd5f5a59363e4679d5804d272d10c419
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

19 lines
546 B
Plaintext

import baseClamp from './_baseClamp.js';
import shuffleSelf from './_shuffleSelf.js';
import values from './values.js';
/**
* 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));
}
export default baseSampleSize;