UNPKG

@monstermann/fn

Version:

A utility library for TypeScript.

22 lines 662 B
//#region src/set/hasAny.d.ts /** * `hasAny(target, values)` * * Checks if the `target` set contains any of the specified `values` from an iterable. Returns `true` if at least one value exists, `false` otherwise. * * ```ts * hasAny(new Set([1, 2, 3]), [3, 4]); // true * hasAny(new Set([1, 2, 3]), [4, 5]); // false * ``` * * ```ts * pipe(new Set([1, 2, 3]), hasAny([3, 4])); // true * pipe(new Set([1, 2, 3]), hasAny([4, 5])); // false * ``` */ declare const hasAny: { <T>(values: Iterable<NoInfer<T>>): (target: ReadonlySet<T>) => boolean; <T>(target: ReadonlySet<T>, values: Iterable<NoInfer<T>>): boolean; }; //#endregion export { hasAny };