UNPKG

typedash

Version:

modern, type-safe collection of utility functions

17 lines (16 loc) 450 B
// 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; } export { range }; //# sourceMappingURL=out.js.map //# sourceMappingURL=chunk-MQN56CRS.js.map