You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
900 B

4 years ago
  1. import _includes from "./internal/_includes.js";
  2. import _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. var includes =
  26. /*#__PURE__*/
  27. _curry2(_includes);
  28. export default includes;