Ramda Adjunct 4.0.0

isNonEmptyArray.js

  1. import { both } from 'ramda';
  2. import isNotEmpty from './isNotEmpty';
  3. import isArray from './isArray';
  4. /**
  5. * Checks if input value is not an empty `Array`.
  6. *
  7. * @func isNonEmptyArray
  8. * @memberOf RA
  9. * @since {@link https://char0n.github.io/ramda-adjunct/2.4.0|v2.4.0}
  10. * @category Type
  11. * @sig * -> Boolean
  12. * @param {*} val The value to test
  13. * @return {boolean}
  14. * @see {@link RA.isEmptyArray|isEmptyArray}
  15. * @example
  16. *
  17. * RA.isNonEmptyArray([42]); // => true
  18. * RA.isNonEmptyArray([]); // => false
  19. * RA.isNonEmptyArray({}); // => false
  20. * RA.isNonEmptyArray(null); // => false
  21. * RA.isNonEmptyArray(undefined); // => false
  22. * RA.isNonEmptyArray(42); // => false
  23. * RA.isNonEmptyArray('42'); // => false
  24. */
  25. const isNonEmptyArray = both(isArray, isNotEmpty);
  26. export default isNonEmptyArray;