Update rand.js

This commit is contained in:
Namhyeon Go 2022-05-02 23:56:42 +09:00 committed by GitHub
parent 6a13d9437b
commit b587b31485
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,6 +71,10 @@ function rotate(arr, i) {
return arr[i % arr.length];
}
function sample(arr, length) {
return shuffle(arr).slice(0, length);
}
exports.randomize = randomize;
exports.getInt = getInt;
exports.one = one;
@ -78,7 +82,8 @@ exports.makeString = makeString;
exports.uuidv4 = uuidv4;
exports.shuffle = shuffle;
exports.rotate = rotate;
exports.sample = sample;
exports.VERSIONINFO = "Random Module (rand.js) version 0.3";
exports.VERSIONINFO = "Random Module (rand.js) version 0.4";
exports.global = global;
exports.require = global.require;