sflow
Version:
sflow is a powerful and highly-extensible library designed for processing and manipulating streams of data effortlessly. Inspired by the functional programming paradigm, it provides a rich set of utilities for transforming streams, including chunking, fil
21 lines (17 loc) • 499 B
text/typescript
import { repeats } from "./repeats";
import { sflow } from "./sf";
it("works", async () => {
expect(await sflow([1, 2, 3]).byLazy(repeats(2)).toArray()).toEqual([
1, 1, 2, 2, 3, 3,
]);
});
it("works infinity", async () => {
expect(await sflow([1, 2, 3]).by(repeats()).limit(5).toArray()).toEqual([
1, 1, 1, 1, 1,
]);
});
// it("works infinity", async () => {
// expect(await sflow([1, 2, 3]).byLazy(repeats()).limit(5).toArray()).toEqual([
// 1, 1, 1, 1, 1,
// ]);
// });