Skip to content

taymoor89/strummer-plus

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Strummer+ Strummer+ is a collection of common matchers for Strummer.

##Matchers

  • ObjectId: Validates ObjectIds.
  • Email : Validates valid email addresses.
  • Coordinates: Validates an array of two members [longitude, latitude].
  • DateString: Validates a string for the date can be parsed from it.
  • Timezone: Validates a string to be a timezone, based on the IANA Time Zone Database.

##Installation npm install strummer-plus --save

##Example

var s = require('strummer');
var matchers = require('strummer-plus');

var matcher = s.object({
    email: new matchers.Email(),
    id   : new matchers.ObjectId()
});

var errors = matcher.match(req.body);

##Releases

  • 2015-07-06 - 0.0.1

    • Initial release
    • Matchers for ObjectId and Email
  • 2015-07-10 - 0.0.2

    • Development of Coordinates matcher

About

A collection of matchers for Strummer

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%