UNPKG

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

25 lines (21 loc) 660 B
import { sflow } from "./sf"; import { sfTemplate } from "./sfTemplate"; it("works", async () => { expect(await sfTemplate`hello ${sflow("asdf")} zxcv`.text()).toBe( "hello asdf zxcv", ); }); it("multi", async () => { expect( await sfTemplate`hello ${sflow("asdf")} ${sflow("asdf")} ${sflow( "asdf", )} zxcv`.text(), ).toBe("hello asdf asdf asdf zxcv"); }); it("nest", async () => { expect( await sfTemplate`hello ${await sfTemplate`nested ${sflow("stream1")} ${sflow( "stream2", )} ${sflow("stream3")} zxcv`.text()} ${sflow("asdf")} end`.text(), ).toBe("hello nested stream1 stream2 stream3 zxcv asdf end"); });