index.js
/**
* Verify if a given value is not empty.
*
* @public
* @since 0.1.0
* @param {!Array|Number|String} value - The value to be validated.
* @return {Boolean}
*
* @example
* var isValueProvided = defy.required('Example')
*/
Verify if a given value is not empty.
Verify if a given value is not empty .
function required (value) {
  let inputValue = value
  if (typeof value === 'string') {
    inputValue = cleanValue(inputValue)
  }
  if (inputValue === undefined || inputValue === null) {
    return false
  } else if (typeof inputValue !== 'number' && inputValue.length === 0) {
    return false
  }
  return true
}
function required ( value ) { let inputValue = value if ( typeof value === 'string' ) { inputValue = cleanValue ( inputValue ) } if ( inputValue === undefined || inputValue === null ) { return false } else if ( typeof inputValue !== 'number' && inputValue . length === 0 ) { return false } return true }
Verify if a given value is not empty.
Verify if a given value is not empty .
// Clean up a string before validating it