MCPcopy Create free account
hub / github.com/Effect-TS/effect / range

Function range

packages/effect/src/Iterable.ts:95–102  ·  view source on GitHub ↗
(start: number, end?: number)

Source from the content-addressed store, hash-verified

93 * @since 2.0.0
94 */
95export const range = (start: number, end?: number): Iterable<number> => {
96 if (end === undefined) {
97 return makeBy((i) => start + i)
98 }
99 return makeBy((i) => start + i, {
100 length: start <= end ? end - start + 1 : 1
101 })
102}
103
104/**
105 * Returns a `Iterable` containing a value repeated the specified number of times.

Callers

nothing calls this directly

Calls 1

makeByFunction · 0.85

Tested by

no test coverage detected