Ramda Adjunct 1.14.0

isNotEmpty.js

  1. import { complement, isEmpty } from 'ramda';
  2. /**
  3. * Returns true if the given value is not its type's empty value; `false` otherwise.
  4. *
  5. * @func isNotEmpty
  6. * @memberOf RA
  7. * @since {@link https://char0n.github.io/ramda-adjunct/0.4.0|v0.4.0}
  8. * @category Type
  9. * @sig * -> Boolean
  10. * @param {*} val The value to test
  11. * @return {Boolean}
  12. * @see {@link http://ramdajs.com/docs/#isEmpty|isEmpty}
  13. * @example
  14. *
  15. * RA.isNotEmpty([1, 2, 3]); //=> true
  16. * RA.isNotEmpty([]); //=> false
  17. * RA.isNotEmpty(''); //=> false
  18. * RA.isNotEmpty(null); //=> true
  19. * RA.isNotEmpty(undefined): //=> true
  20. * RA.isNotEmpty({}); //=> false
  21. * RA.isNotEmpty({length: 0}); //=> true
  22. */
  23. const isNotEmpty = complement(isEmpty);
  24. export default isNotEmpty;