UNPKG

@thi.ng/associative

Version:

ES Map/Set-compatible implementations with customizable equality semantics & supporting operations

23 lines 907 B
import type { Reducer } from "@thi.ng/transducers"; /** * Computes union of sets `a` and `b` and writes results to new set or * optionally given set `out` (assumed to be empty for correct results). * * @param a - first set * @param b - other set * @param out - result set */ export declare const union: <T>(a: Set<T>, b: Set<T>, out?: Set<T>) => Set<T>; /** * Reducer version of {@link union}. If `src` is given returns the reduced union * of given inputs, else merely returns a reducer to be used with * [`reduce`](https://docs.thi.ng/umbrella/transducers/functions/reduce.html) * / * [`transduce`](https://docs.thi.ng/umbrella/transducers/functions/transduce.html) * functions. * * @param src - input collections */ export declare function unionR<T>(): Reducer<Iterable<T>, Set<T>>; export declare function unionR<T>(src: Iterable<Iterable<T>>): Set<T>; //# sourceMappingURL=union.d.ts.map