@helpdotcom/is
v3.0.5
Published
isDate, isUUID, and isEmail for use with help-gen
Downloads
191
Readme
is
isDate, isUUID, and isEmail for use with
help-gen
Install
$ npm install --save @helpdotcom/isTest
$ npm testUsage
'use strict'
const is = require('@helpdotcom/is')isDate(d)
Returns true if d is a valid ISO date string. Otherwise, returns false.
isEmail(s)
s<String>The email string
Returns true if s is a valid email address. Otherwise, returns false.
isEmailAllowName(s)
s<String>The email string
Returns true if s is a valid email address with an optional name.
Otherwise, returns false.
The following formats are supported:
[email protected]Evan Lucas <[email protected]>"Evan Lucas" <[email protected]>"Help.com, LLC" <[email protected]>Help.com, LLC <[email protected]>Jane Doe (maiden name) <[email protected]>
isUUID(s)
s<String>The uuid to test.
Returns true if s is a valid v4 UUID. Otherwise, returns false.
isUrl(s)
s<String>The url to test.
Returns true if s is a valid URL. Otherwise, returns false.
isIpAllowCIDR(s)
s<String>The url to test.
Returns true if s is a valid ip with CIDR notation. Otherwise, returns false.
Author
Evan Lucas
License
MIT (See LICENSE for more info)
