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.
24 lines • 860 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.arrayGenerateRange = void 0;
const array_map_range_js_1 = require("./array-map-range.js");
const fp_identity_js_1 = require("../../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}.
*/
function arrayGenerateRange(from, to) {
return (0, array_map_range_js_1.arrayMapRange)(from, to, fp_identity_js_1.fpIdentity);
}
exports.arrayGenerateRange = arrayGenerateRange;
//# sourceMappingURL=array-generate-range.js.map