mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +00:00
Enhance random with toNumber to allow binary and octal strings.
This commit is contained in:
committed by
John-David Dalton
parent
f45fc10cb1
commit
19e0650c4f
@@ -11382,12 +11382,12 @@
|
|||||||
max = 1;
|
max = 1;
|
||||||
noMax = false;
|
noMax = false;
|
||||||
}
|
}
|
||||||
min = +min || 0;
|
min = toNumber(min) || 0;
|
||||||
if (noMax) {
|
if (noMax) {
|
||||||
max = min;
|
max = min;
|
||||||
min = 0;
|
min = 0;
|
||||||
} else {
|
} else {
|
||||||
max = +max || 0;
|
max = toNumber(max) || 0;
|
||||||
}
|
}
|
||||||
if (floating || min % 1 || max % 1) {
|
if (floating || min % 1 || max % 1) {
|
||||||
var rand = nativeRandom();
|
var rand = nativeRandom();
|
||||||
|
|||||||
Reference in New Issue
Block a user