isNotNil.js 627 B

123456789101112131415161718192021222324252627
  1. import isNil from "./isNil.js";
  2. import _curry1 from "./internal/_curry1.js";
  3. /**
  4. * Checks if the input value is not `null` and not `undefined`.
  5. *
  6. * @func
  7. * @memberOf R
  8. * @since v0.29.0
  9. * @category Type
  10. * @sig * -> Boolean
  11. * @param {*} x The value to test.
  12. * @return {Boolean} `true` if `x` is not `undefined` or not `null`, otherwise `false`.
  13. * @example
  14. *
  15. * R.isNotNil(null); //=> false
  16. * R.isNotNil(undefined); //=> false
  17. * R.isNotNil(0); //=> true
  18. * R.isNotNil([]); //=> true
  19. */
  20. var isNotNil =
  21. /*#__PURE__*/
  22. _curry1(function isNotNil(x) {
  23. return !isNil(x);
  24. });
  25. export default isNotNil;