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

7 lines (5 loc) 221 B
import type { FlowSource } from "./index"; import { wseFrom } from "./wse"; export const toStream: { <T>(src: FlowSource<T>): ReadableStream<T>; } = (src) => (src instanceof ReadableStream ? src : wseFrom(src ?? []));