/**
 * Generates Array with end - start number of elements
 *
 * More:
 *      https://dev.to/ycmjason/how-to-create-range-in-javascript-539i
 *
 * @param start
 * @param end
 */
function range(start, end) {
    const nrOfElements = Math.abs(end - start) + 1;
    const invert = start > end;
    return Array.from({ length: nrOfElements }, (_, i) => {
        return start + (invert ? i * -1 : i);
    });
}
/**
 * Loops through range of numbers
 *
 * @param start
 * @param end
 */
function loop(start, end) {
    return {
        through: (callback) => {
            range(start, end).forEach((value) => callback(value));
        },
    };
}

export { loop, range };
//# sourceMappingURL=range.js.map
