UNPKG

super-utils-plus

Version:

A superior alternative to Lodash with improved performance, TypeScript support, and developer experience

32 lines (31 loc) 989 B
/** * Creates an array of numbers progressing from start up to, but not including, end. * If end is not specified, it starts from 0. * * @param start - The start of the range or the end when used as a single argument * @param end - The end of the range * @param step - The increment or decrement value * @returns The range of numbers * * @example * ```ts * range(4); * // => [0, 1, 2, 3] * * range(1, 5); * // => [1, 2, 3, 4] * * range(0, 20, 5); * // => [0, 5, 10, 15] * ``` */ export declare function range(start: number, end?: number, step?: number): number[]; /** * This method is like `range` except that it populates values in descending order. * * @param start - The start of the range or the end when used as a single argument * @param end - The end of the range * @param step - The increment or decrement value * @returns The range of numbers in reverse order */ export declare function rangeRight(start: number, end?: number, step?: number): number[];