@effect-ts/system
Version:
Effect-TS is a zero dependency set of libraries to write highly productive, purely functional TypeScript at scale.
19 lines (15 loc) • 338 B
JavaScript
import { append_, empty } from "../core.mjs";
/**
* Fills a chunk with the result of applying `f` `n` times
*/
export function fill(n, f) {
if (n <= 0) {
return empty();
}
let builder = empty();
for (let i = 0; i < n; i++) {
builder = append_(builder, f(i));
}
return builder;
}
//# sourceMappingURL=fill.mjs.map