rc-js-util
Version:
A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.
20 lines • 646 B
JavaScript
import { arrayMapRange } from "./array-map-range.js";
import { fpIdentity } from "../../fp/impl/fp-identity.js";
/**
* @public
* Generates a range of integers output in an `Array`.
*
* @param from - The value to start from (inclusive).
* @param to - The value to finish with (inclusive).
*
* @returns An array [from, from + 1, ..., to -1, to].
*
* @remarks
* Where `from` and `to` are equal a length 1 array is returned, NaN input is not supported.
*
* See {@link arrayGenerateRange}.
*/
export function arrayGenerateRange(from, to) {
return arrayMapRange(from, to, fpIdentity);
}
//# sourceMappingURL=array-generate-range.js.map