source: node_modules/ramda-adjunct/src/included.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 981 bytes
Line 
1import { flip, includes } from 'ramda';
2
3/**
4 * Returns true if the specified value is equal, in R.equals terms,
5 * to at least one element of the given list or false otherwise.
6 * Given list can be a string.
7 *
8 * Like {@link http://ramdajs.com/docs/#includes|R.includes} but with argument order reversed.
9 *
10 * @func included
11 * @memberOf RA
12 * @since {@link https://char0n.github.io/ramda-adjunct/3.0.0|v3.0.0}
13 * @category List
14 * @sig [a] -> a -> Boolean
15 * @param {Array|String} list The list to consider
16 * @param {*} a The item to compare against
17 * @return {boolean} Returns Boolean `true` if an equivalent item is in the list or `false` otherwise
18 * @see {@link http://ramdajs.com/docs/#includes|R.includes}
19 * @example
20 *
21 * RA.included([1, 2, 3], 3); //=> true
22 * RA.included([1, 2, 3], 4); //=> false
23 * RA.included([{ name: 'Fred' }], { name: 'Fred' }); //=> true
24 * RA.included([[42]], [42]); //=> true
25 */
26const included = flip(includes);
27
28export default included;
Note: See TracBrowser for help on using the repository browser.