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
13 lines (11 loc) • 325 B
text/typescript
import { unwind } from "unwind-array";
import type { Unwinded } from "./Unwinded";
import { flatMaps } from "./flatMaps";
export function unwinds<
T extends Record<string, any>,
K extends keyof T & string,
>(key: K) {
return flatMaps<T, Unwinded<T, K>>(
(e) => unwind(e, { path: key }) as Unwinded<T, K>[],
);
}