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

13 lines (11 loc) 329 B
import { unwind } from "unwind-array"; import { flatMaps } from "./flatMaps"; import type { Unwinded } from "./Unwinded"; export function unwinds< T extends Record<string, unknown>, K extends keyof T & string, >(key: K) { return flatMaps<T, Unwinded<T, K>>( (e) => unwind(e, { path: key }) as Unwinded<T, K>[], ); }