Refine a bit eslint configuration
[benchmarks-js.git] / benchmark-utils.js
CommitLineData
e9bfc28e
JB
1/**
2 * @param max
3 * @param min
4 */
ed2968f2
JB
5function generateRandomInteger (max, min = 0) {
6 if (min) {
7 return Math.floor(Math.random() * (max - min + 1) + min)
8 }
9 return Math.floor(Math.random() * max + 1)
10}
11
12const LIST_FORMATTER = new Intl.ListFormat('en-US', {
13 style: 'long',
14 type: 'conjunction'
15})
16
17module.exports = { generateRandomInteger, LIST_FORMATTER }