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