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.

30 lines
933 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.1.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.includes
  17. * @deprecated since v0.26.0
  18. * @example
  19. *
  20. * R.contains(3, [1, 2, 3]); //=> true
  21. * R.contains(4, [1, 2, 3]); //=> false
  22. * R.contains({ name: 'Fred' }, [{ name: 'Fred' }]); //=> true
  23. * R.contains([42], [[42]]); //=> true
  24. * R.contains('ba', 'banana'); //=>true
  25. */
  26. var contains =
  27. /*#__PURE__*/
  28. _curry2(_includes);
  29. export default contains;