Sha256: 134600a369e098c5f6a5892d2020ce6ad7c51da158b4fec85b80926edee48372

Contents?: true

Size: 850 Bytes

Versions: 276

Compression:

Stored size: 850 Bytes

Contents

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeCeil = Math.ceil,
    nativeMax = Math.max;

/**
 * The base implementation of `_.range` and `_.rangeRight` which doesn't
 * coerce arguments.
 *
 * @private
 * @param {number} start The start of the range.
 * @param {number} end The end of the range.
 * @param {number} step The value to increment or decrement by.
 * @param {boolean} [fromRight] Specify iterating from right to left.
 * @returns {Array} Returns the range of numbers.
 */
function baseRange(start, end, step, fromRight) {
  var index = -1,
      length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
      result = Array(length);

  while (length--) {
    result[fromRight ? length : ++index] = start;
    start += step;
  }
  return result;
}

module.exports = baseRange;

Version data entries

276 entries across 274 versions & 31 rubygems

Version Path
ilog-0.4.1 node_modules/lodash/_baseRange.js
ilog-0.4.0 node_modules/lodash/_baseRange.js
ilog-0.3.3 node_modules/lodash/_baseRange.js
condenser-0.2 lib/condenser/processors/node_modules/lodash/_baseRange.js
condenser-0.1 lib/condenser/processors/node_modules/lodash/_baseRange.js
condenser-0.0.12 lib/condenser/processors/node_modules/lodash/_baseRange.js
condenser-0.0.11 lib/condenser/processors/node_modules/lodash/_baseRange.js
condenser-0.0.10 lib/condenser/processors/node_modules/lodash/_baseRange.js
condenser-0.0.9 lib/condenser/processors/node_modules/lodash/_baseRange.js
condenser-0.0.8 lib/condenser/processors/node_modules/lodash/_baseRange.js
sumomo-0.8.7 data/sumomo/api_modules/node_modules/lodash/_baseRange.js
sumomo-0.8.6 data/sumomo/api_modules/node_modules/lodash/_baseRange.js
learn_create-0.0.22 lib/templates/javascript_lab_template/node_modules/lodash/_baseRange.js
jester-data-8.0.0 node_modules/lodash/_baseRange.js
ezii-os-5.2.1 node_modules/lodash/_baseRange.js
ezii-os-2.0.1 node_modules/lodash/_baseRange.js
ezii-os-1.1.0 node_modules/lodash/_baseRange.js
ezii-os-1.0.0 node_modules/lodash/_baseRange.js
condenser-0.0.7 lib/condenser/processors/node_modules/lodash/_baseRange.js
ezii-os-0.0.0.1.0 node_modules/lodash/_baseRange.js