summaryrefslogtreecommitdiffstats
path: root/node_modules/saslprep/lib/util.js
blob: 506bdc992db0f0c28cd99d30fc8e0c6f03db914b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'use strict';

/**
 * Create an array of numbers.
 * @param {number} from
 * @param {number} to
 * @returns {number[]}
 */
function range(from, to) {
  // TODO: make this inlined.
  const list = new Array(to - from + 1);

  for (let i = 0; i < list.length; i += 1) {
    list[i] = from + i;
  }
  return list;
}

module.exports = {
  range,
};