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
710 B

4 years ago
  1. import _curry2 from "./internal/_curry2.js";
  2. /**
  3. * Exclusive disjunction logical operation.
  4. * Returns `true` if one of the arguments is truthy and the other is falsy.
  5. * Otherwise, it returns `false`.
  6. *
  7. * @func
  8. * @memberOf R
  9. * @since v0.27.1
  10. * @category Logic
  11. * @sig a -> b -> Boolean
  12. * @param {Any} a
  13. * @param {Any} b
  14. * @return {Boolean} true if one of the arguments is truthy and the other is falsy
  15. * @see R.or, R.and
  16. * @example
  17. *
  18. * R.xor(true, true); //=> false
  19. * R.xor(true, false); //=> true
  20. * R.xor(false, true); //=> true
  21. * R.xor(false, false); //=> false
  22. */
  23. var xor =
  24. /*#__PURE__*/
  25. _curry2(function xor(a, b) {
  26. return Boolean(!a ^ !b);
  27. });
  28. export default xor;