123456789101112131415161718192021222324252627282930 |
- var baseRange = require('./_baseRange'),
- isIterateeCall = require('./_isIterateeCall'),
- toFinite = require('./toFinite');
- function createRange(fromRight) {
- return function(start, end, step) {
- if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
- end = step = undefined;
- }
-
- start = toFinite(start);
- if (end === undefined) {
- end = start;
- start = 0;
- } else {
- end = toFinite(end);
- }
- step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
- return baseRange(start, end, step, fromRight);
- };
- }
- module.exports = createRange;
|