@helpdotcom/is

3.0.5 • Public • Published

is

isDate, isUUID, and isEmail for use with help-gen

Install

$ npm install --save @helpdotcom/is

Test

$ npm test

Usage

'use strict'

const is = require('@helpdotcom/is')

isDate(d)

Returns true if d is a valid ISO date string. Otherwise, returns false.

isEmail(s)

Returns true if s is a valid email address. Otherwise, returns false.

isEmailAllowName(s)

Returns true if s is a valid email address with an optional name. Otherwise, returns false.

The following formats are supported:

  • evan.lucas@help.com
  • Evan Lucas <evan.lucas@help.com>
  • "Evan Lucas" <evan.lucas@help.com>
  • "Help.com, LLC" <info@help.com>
  • Help.com, LLC <info@help.com>
  • Jane Doe (maiden name) <jane@doe.com>

isUUID(s)

Returns true if s is a valid v4 UUID. Otherwise, returns false.

isUrl(s)

Returns true if s is a valid URL. Otherwise, returns false.

isIpAllowCIDR(s)

Returns true if s is a valid ip with CIDR notation. Otherwise, returns false.

Author

Evan Lucas

License

MIT (See LICENSE for more info)

Readme

Keywords

none

Package Sidebar

Install

npm i @helpdotcom/is

Weekly Downloads

0

Version

3.0.5

License

MIT

Unpacked Size

15.7 kB

Total Files

7

Last publish

Collaborators

  • roshii
  • afarrar
  • commitbot