UNPKG

typedash

Version:

modern, type-safe collection of utility functions

19 lines (17 loc) 462 B
'use strict'; // src/functions/range/range.ts function range(startOrEnd, end, step = 1) { if (step <= 0) { return []; } const calculatedStart = end == null ? 0 : startOrEnd; const calculatedEnd = end ?? startOrEnd; const result = []; for (let index = calculatedStart; index < calculatedEnd; index += step) { result.push(index); } return result; } exports.range = range; //# sourceMappingURL=out.js.map //# sourceMappingURL=index.cjs.map