UNPKG

900 BJavaScriptView Raw
1import _includes from "./internal/_includes.js";
2import _curry2 from "./internal/_curry2.js";
3/**
4 * Returns `true` if the specified value is equal, in [`R.equals`](#equals)
5 * terms, to at least one element of the given list; `false` otherwise.
6 * Works also with strings.
7 *
8 * @func
9 * @memberOf R
10 * @since v0.26.0
11 * @category List
12 * @sig a -> [a] -> Boolean
13 * @param {Object} a The item to compare against.
14 * @param {Array} list The array to consider.
15 * @return {Boolean} `true` if an equivalent item is in the list, `false` otherwise.
16 * @see R.any
17 * @example
18 *
19 * R.includes(3, [1, 2, 3]); //=> true
20 * R.includes(4, [1, 2, 3]); //=> false
21 * R.includes({ name: 'Fred' }, [{ name: 'Fred' }]); //=> true
22 * R.includes([42], [[42]]); //=> true
23 * R.includes('ba', 'banana'); //=>true
24 */
25
26var includes =
27/*#__PURE__*/
28_curry2(_includes);
29
30export default includes;
\No newline at end of file