MCPcopy Index your code
hub / github.com/deployd/deployd / createRange

Function createRange

test-app/public/sinon.js:15960–15976  ·  view source on GitHub ↗

* Creates a `_.range` or `_.rangeRight` function. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new range function.

(fromRight)

Source from the content-addressed store, hash-verified

15958 * @returns {Function} Returns the new range function.
15959 */
15960 function createRange(fromRight) {
15961 return function(start, end, step) {
15962 if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
15963 end = step = undefined;
15964 }
15965 // Ensure the sign of `-0` is preserved.
15966 start = toFinite(start);
15967 if (end === undefined) {
15968 end = start;
15969 start = 0;
15970 } else {
15971 end = toFinite(end);
15972 }
15973 step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
15974 return baseRange(start, end, step, fromRight);
15975 };
15976 }
15977
15978 /**
15979 * Creates a function that performs a relational operation on two values.

Callers 1

sinon.jsFile · 0.85

Calls 3

isIterateeCallFunction · 0.85
toFiniteFunction · 0.85
baseRangeFunction · 0.85

Tested by

no test coverage detected