1.0.6 • Published 3 years ago

@defriction/is_a v1.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

is_a

Utility function to help determine value types

Installation

Example usage

// ... 

if( is_a('email', 'foobar@foo.com') ){
    console.log('This is a valid email address!');
}else{
    console.log('This email addres is not valid!');
}

Value Check Types

  • Email is_a('email', value);
  • Email Charactersis_a('email_character', value);
  • Domain is_a('domain', value);
  • Domain Characters is_a('domain_character', value);
  • URL is_a('url', value);
  • Phone is_a('phone', value); // +1(555) 555-5555 and 555.555.5555 and 555-555-5555 are true
  • Strong Password is_a('strong_password', value); // Min 8 characters, Uppercase letter, Lowercase Letter, Special Character (@$!%*?&)
  • Truthy is_a('truthy', value);
  • Falsy is_a('falsy', value);
  • String is_a('string', value);
  • Number is_a('number', value); // false against NaN