simple-common-utils
Advanced tools
Comparing version 1.2.1 to 1.3.1
@@ -224,2 +224,12 @@ export default class StaticUtils { | ||
} | ||
static random(min, max, round, maxInclusive) { | ||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random | ||
const mn = round ? Math.ceil(min) : min; | ||
const mx = round ? Math.floor(max) : max; | ||
const rnd = Math.random() * (mx - mn + (round && maxInclusive ? 1 : 0)); | ||
return (round ? Math.floor(rnd) : rnd) + mn; | ||
} | ||
} |
{ | ||
"name": "simple-common-utils", | ||
"version": "1.2.1", | ||
"version": "1.3.1", | ||
"description": "A collection of utility classes.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
19662
296
0