Sha256: 134600a369e098c5f6a5892d2020ce6ad7c51da158b4fec85b80926edee48372

Contents?: true

Size: 850 Bytes

Versions: 266

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

266 entries across 264 versions & 30 rubygems

Version Path
optimacms-0.4.3 spec/dummy/node_modules/lodash/_baseRange.js
optimacms-0.4.2 spec/dummy/node_modules/lodash/_baseRange.js
locomotivecms-4.0.0.alpha1 app/javascript/node_modules/lodash/_baseRange.js
lux_assets-0.2.11 ./node_modules/lodash/_baseRange.js
lux_assets-0.2.9 ./node_modules/lodash/_baseRange.js
lux_assets-0.2.4 ./node_modules/lodash/_baseRange.js
lux_assets-0.2.2 ./node_modules/lodash/_baseRange.js
lux_assets-0.2.1 ./node_modules/lodash/_baseRange.js
ela-4.1.2 node_modules/lodash/_baseRange.js
sumomo-0.8.4 data/sumomo/api_modules/node_modules/lodash/_baseRange.js
ela-4.1.1 node_modules/lodash/_baseRange.js
ela-4.1.0 node_modules/lodash/_baseRange.js
locomotivecms-3.4.0 app/javascript/node_modules/lodash/_baseRange.js
cortex-0.1.3 spec/dummy/node_modules/lodash/_baseRange.js
sumomo-0.8.3 data/sumomo/api_modules/node_modules/lodash/_baseRange.js
sumomo-0.8.2 data/sumomo/api_modules/node_modules/lodash/_baseRange.js
sumomo-0.8.1 data/sumomo/api_modules/node_modules/lodash/_baseRange.js
condenser-0.0.4 lib/condenser/processors/node_modules/lodash/_baseRange.js
ela-4.0.0 node_modules/lodash/_baseRange.js
ela-3.4.3 node_modules/lodash/_baseRange.js