1.0.1 • Published 10 years ago

customs v1.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
10 years ago

customs

Build Status Coverage Status

Type validator for node.js and the browser through browserify.

Installation

With node installed:

npm i --save customs

Usage

var validate = require('customs');

validate('string', 'Dad jokes');
// -> 'true'

validate('string', 1337);
// -> 'false'

validate(/d(b+)d/g, 'cdbbdbsbz');
// -> 'true'

Supported types

  • array
  • string
  • number
  • boolean
  • object
  • email
  • any RegExp

Date-time types are not supported because there's too much variation. Just provide your own definition as a RegExp.

License

MIT © Yoshua Wuyts

1.0.1

10 years ago

1.0.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.2

10 years ago

0.0.0

10 years ago