CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes45downloads
_createRange.js31 linesDownload Raw Back to lodash-es
1import baseRange from './_baseRange.js';2import isIterateeCall from './_isIterateeCall.js';3import toFinite from './toFinite.js';4 5/**6 * Creates a `_.range` or `_.rangeRight` function.7 *8 * @private9 * @param {boolean} [fromRight] Specify iterating from right to left.10 * @returns {Function} Returns the new range function.11 */12function createRange(fromRight) {13  return function(start, end, step) {14    if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {15      end = step = undefined;16    }17    // Ensure the sign of `-0` is preserved.18    start = toFinite(start);19    if (end === undefined) {20      end = start;21      start = 0;22    } else {23      end = toFinite(end);24    }25    step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);26    return baseRange(start, end, step, fromRight);27  };28}29 30export default createRange;31 
basant307/AI_Governance_Project · CoolFace