Ramda Adjunct 4.0.0

isNotNil.js

  1. import { isNil, complement } from 'ramda';
  2. /**
  3. * Checks if input value is complement of `null` or `undefined`.
  4. *
  5. * @func isNotNil
  6. * @memberOf RA
  7. * @since {@link https://char0n.github.io/ramda-adjunct/0.3.0|v0.3.0}
  8. * @category Type
  9. * @sig * -> Boolean
  10. * @param {*} val The value to test
  11. * @return {boolean}
  12. * @see {@link http://ramdajs.com/docs/#isNil|R.isNil}
  13. * @example
  14. *
  15. * RA.isNotNil(null); //=> false
  16. * RA.isNotNil(undefined); //=> false
  17. * RA.isNotNil(0); //=> true
  18. * RA.isNotNil([]); //=> true
  19. */
  20. const isNotNil = complement(isNil);
  21. export default isNotNil;