0.0.4 • Published 9 years ago

validity-or-validator v0.0.4

Weekly downloads
6
License
ISC
Repository
github
Last release
9 years ago

validity-or-validator

Validate that one or both of two validators pass for the current property

Installation

npm install validity-or-validator --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('article')
  , validateMailTo = require('validity-mailto-link')
  , or = require('validity-or-validator')

var schema = schemata(
    { type:
      { type: String
      }
    , callToActionLink:
      { type: String
      , validators: { all: [ or(validity.url, validateMailTo()) ] }
      }
    })

Credits

Ben Parnell

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago