Pavel Ševčík
3 years ago
No known key found for this signature in database
GPG Key ID: CFA54E4C0CD58DF0
1 changed files with
13 additions and
0 deletions
-
lib/util.js
|
|
@ -351,6 +351,19 @@ class Util { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description Generate array of sequential numbers from start to stop |
|
|
|
* @param {number} start |
|
|
|
* @param {number} stop |
|
|
|
* @param {number=} step |
|
|
|
* @returns {number[]} |
|
|
|
*/ |
|
|
|
static range(start, stop, step = 1) { |
|
|
|
return Array(Math.ceil((stop - start) / step)) |
|
|
|
.fill(start) |
|
|
|
.map((x, y) => x + y * step) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|