index.js
/**
* Verify if a given value's length is at least the given minimum length.
* For strings this will validate the number of characters.
* For numbers, this will validate the number of digits, including the decimal places, and the decimal mark.
*
* @public
* @since 0.1.0
* @param {!Number|String} value - The value to be validated.
* @param {!Number} minLen - The minimum length allowed for the given value.
* @return {Boolean}
*
* @example
* var isValueLongEnough = defy.minlength('Example', 2)
*/
Verify if a given value's length is at least the given minimum length.
For strings this will validate the number of characters.
For numbers, this will validate the number of digits, including the decimal places, and the decimal mark.
Verify if a given value ' s length is at least the given minimum length . For strings this will validate the number of characters . For numbers this will validate the number of digits including the decimal places and the decimal mark .
function minlength (value, minLen) {
  let val = value
  if (typeof value === 'number') {
    val = normalizeValue(value)
  }
  const mnLength = parseInt(minLen, 10)
  if (val.length < mnLength) {
    return false
  }
  return true
}
function minlength ( value , minLen ) { let val = value if ( typeof value === 'number' ) { val = normalizeValue ( value ) } const mnLength = parseInt ( minLen , 10 ) if ( val . length < mnLength ) { return false } return true }
Verify if a given value's length is at least the given minimum length.
Verify if a given value ' s length is at least the given minimum length .