mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Ensure _.random() returns 1 or 0.
This commit is contained in:
5
dist/lodash.js
vendored
5
dist/lodash.js
vendored
@@ -6192,17 +6192,18 @@
|
||||
noMax = max == null;
|
||||
|
||||
if (floating == null) {
|
||||
if (typeof min == 'boolean' && noMax) {
|
||||
if (noMax && typeof min == 'boolean') {
|
||||
floating = min;
|
||||
min = 1;
|
||||
}
|
||||
else if (!noMax && typeof max == 'boolean') {
|
||||
else if (typeof max == 'boolean') {
|
||||
floating = max;
|
||||
noMax = true;
|
||||
}
|
||||
}
|
||||
if (noMin && noMax) {
|
||||
max = 1;
|
||||
noMax = false;
|
||||
}
|
||||
min = +min || 0;
|
||||
if (noMax) {
|
||||
|
||||
Reference in New Issue
Block a user