Refine a bit eslint configuration
[benchmarks-js.git] / benchmark-utils.js
1 /**
2 * @param max
3 * @param min
4 */
5 function 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
12 const LIST_FORMATTER = new Intl.ListFormat('en-US', {
13 style: 'long',
14 type: 'conjunction'
15 })
16
17 module.exports = { generateRandomInteger, LIST_FORMATTER }