mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-12 11:57:49 +00:00
Enhance range with toNumber to allow binary and octal strings.
This commit is contained in:
@@ -12976,15 +12976,15 @@
|
|||||||
if (step && isIterateeCall(start, end, step)) {
|
if (step && isIterateeCall(start, end, step)) {
|
||||||
end = step = undefined;
|
end = step = undefined;
|
||||||
}
|
}
|
||||||
start = +start;
|
start = toNumber(start);
|
||||||
start = start === start ? start : 0;
|
start = start === start ? start : 0;
|
||||||
step = step === undefined ? 1 : (+step || 0);
|
step = step === undefined ? 1 : (toNumber(step) || 0);
|
||||||
|
|
||||||
if (end === undefined) {
|
if (end === undefined) {
|
||||||
end = start;
|
end = start;
|
||||||
start = 0;
|
start = 0;
|
||||||
} else {
|
} else {
|
||||||
end = +end || 0;
|
end = toNumber(end) || 0;
|
||||||
}
|
}
|
||||||
var n = nativeMax(nativeCeil((end - start) / (step || 1)), 0);
|
var n = nativeMax(nativeCeil((end - start) / (step || 1)), 0);
|
||||||
return baseTimes(n, function(index) {
|
return baseTimes(n, function(index) {
|
||||||
|
|||||||
Reference in New Issue
Block a user