* Creates a `_.range` or `_.rangeRight` function. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new range function.
(fromRight)
| 5420 | * @returns {Function} Returns the new range function. |
| 5421 | */ |
| 5422 | function createRange(fromRight) { |
| 5423 | return function(start, end, step) { |
| 5424 | if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { |
| 5425 | end = step = undefined; |
| 5426 | } |
| 5427 | // Ensure the sign of `-0` is preserved. |
| 5428 | start = toFinite(start); |
| 5429 | if (end === undefined) { |
| 5430 | end = start; |
| 5431 | start = 0; |
| 5432 | } else { |
| 5433 | end = toFinite(end); |
| 5434 | } |
| 5435 | step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); |
| 5436 | return baseRange(start, end, step, fromRight); |
| 5437 | }; |
| 5438 | } |
| 5439 | |
| 5440 | /** |
| 5441 | * Creates a function that performs a relational operation on two values. |
no test coverage detected