UNPKG

@monstermann/fn

Version:

A utility library for TypeScript.

24 lines (22 loc) 517 B
import { dfdlT } from "@monstermann/dfdl"; //#region src/set/has.ts /** * `has(target, value)` * * Checks if the `target` set contains the specified `value`. Returns `true` if the value exists, `false` otherwise. * * ```ts * has(new Set([1, 2, 3]), 2); // true * has(new Set([1, 2, 3]), 4); // false * ``` * * ```ts * pipe(new Set([1, 2, 3]), has(2)); // true * pipe(new Set([1, 2, 3]), has(4)); // false * ``` */ const has = dfdlT((target, value) => { return target.has(value); }, 2); //#endregion export { has };