@monstermann/fn
Version:
A utility library for TypeScript.
22 lines (20 loc) • 384 B
JavaScript
import { dfdlT } from "@monstermann/dfdl";
//#region src/array/has.ts
/**
* `has(array, value)`
*
* Returns `true` if `array` contains `value`, otherwise returns `false`.
*
* ```ts
* has([1, 2, 3, 4], 3); // true
* ```
*
* ```ts
* pipe([1, 2, 3, 4], has(3)); // true
* ```
*/
const has = dfdlT((target, value) => {
return target.includes(value);
}, 2);
//#endregion
export { has };