diff --git a/lib/rand.js b/lib/rand.js index 60a749c..1f30147 100644 --- a/lib/rand.js +++ b/lib/rand.js @@ -59,12 +59,17 @@ function shuffle(arr) { }); } +function rotate(arr, i) { + return arr[i % arr.length]; +}; + exports.randomize = randomize; exports.getInt = getInt; exports.one = one; exports.makeString = makeString; exports.uuidv4 = uuidv4; exports.shuffle = shuffle; +exports.rotate = rotate; exports.VERSIONINFO = "Random Module (random.js) version 0.2"; exports.global = global;