UNPKG

@thi.ng/associative

Version:

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

24 lines 954 B
import type { Reducer } from "@thi.ng/transducers"; /** * Computes the difference of sets `a - 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 - optional result set */ export declare const difference: <T>(a: Set<T>, b: Set<T>, out?: Set<T>) => Set<T>; /** * Reducer version of {@link difference}. If `src` is given returns the reduced * difference 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 differenceR<T>(): Reducer<Iterable<T>, Set<T>>; export declare function differenceR<T>(src: Iterable<Iterable<T>>): Set<T>; //# sourceMappingURL=difference.d.ts.map