Ramda Adjunct 2.33.0

lengthLte.js

  1. import { flip, lte } from 'ramda';
  2. import compareLength from './internal/compareLength';
  3. /**
  4. * Returns `true` if the supplied list or string has a length less than or equal to `valueLength`.
  5. *
  6. * @func lengthLte
  7. * @memberOf RA
  8. * @since {@link https://char0n.github.io/ramda-adjunct/2.8.0|v2.8.0}
  9. * @category List
  10. * @sig Number -> [*] -> Boolean
  11. * @param {number} valueLength The length of the list or string
  12. * @param {Array|string} value The list or string
  13. * @return {boolean}
  14. * @see {@link RA.lengthEq|lengthEq}, {@link RA.lengthNotEq|lengthNotEq}, {@link RA.lengthLt|lengthLt}, {@link RA.lengthGt|lengthGt}, {@link RA.lengthGte|lengthGte}, {@link http://ramdajs.com/docs/#lte|lte}, {@link http://ramdajs.com/docs/#length|length}
  15. * @example
  16. *
  17. * RA.lengthLte(3, [1,2]); //=> true
  18. * RA.lengthLte(3, [1,2,3]); //=> true
  19. * RA.lengthLte(3, [1,2,3,4]); //=> false
  20. */
  21. const lengthLte = compareLength(flip(lte));
  22. export default lengthLte;