Skip to content

balaclark/validity-validate-each

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

validity-validate-each

Validate each value of an array.

Installation

npm install validity-validate-each --save

Usage

Below is a simple example for usage with schemata and save:

var validity = require('validity')
  , schemata = require('schemata')
  , save = require('save')
  , collection = save('author')
  , validateEach = require('validity-validate-each')

var schema = schemata(
    { emailAddresses:
      { type: Array
      , validators:
        { all:
          [ validateEach(validity.required)
          , validateEach(validity.email)
          ]
        }
      }
    })

Releases

No releases published

Packages

No packages published