mirror of
https://github.com/swc-project/swc.git
synced 2024-12-21 04:32:01 +03:00
31 lines
956 B
TypeScript
31 lines
956 B
TypeScript
// Loaded from https://deno.land/x/ramda@v0.27.2/source/includes.js
|
|
|
|
|
|
import _includes from './internal/_includes.js';
|
|
import _curry2 from './internal/_curry2.js';
|
|
|
|
/**
|
|
* Returns `true` if the specified value is equal, in [`R.equals`](#equals)
|
|
* terms, to at least one element of the given list; `false` otherwise.
|
|
* Also works with strings.
|
|
*
|
|
* @func
|
|
* @memberOf R
|
|
* @since v0.26.0
|
|
* @category List
|
|
* @sig a -> [a] -> Boolean
|
|
* @param {Object} a The item to compare against.
|
|
* @param {Array} list The array to consider.
|
|
* @return {Boolean} `true` if an equivalent item is in the list, `false` otherwise.
|
|
* @see R.any
|
|
* @example
|
|
*
|
|
* R.includes(3, [1, 2, 3]); //=> true
|
|
* R.includes(4, [1, 2, 3]); //=> false
|
|
* R.includes({ name: 'Fred' }, [{ name: 'Fred' }]); //=> true
|
|
* R.includes([42], [[42]]); //=> true
|
|
* R.includes('ba', 'banana'); //=>true
|
|
*/
|
|
var includes = _curry2(_includes);
|
|
export default includes;
|