New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

combine-validators

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

combine-validators

fluent api for validator.js

latest
Source
npmnpm
Version
2.1.1
Version published
Maintainers
1
Created
Source

combine-validators

Travis Codecov npm downloads MIT License

A Validator gives validator.js string validators a common context and allows composition.

const Validator = require('combine-validators');
const validations = Validator.validations;

const v = new Validator();
v.check(validations.isMandatory, validations.isEmail)(req.body, 'email', 'Email not valid');
v.check(validations.isOptional, validations.isIn('a', 'b', 'c'))(req.body, 'type', 'Type not valid');
v.check(validations.isMandatory, validations.isMongoId)(req.body, '_id', 'Id not valid');
if(v.hasErrors()) console.log('Validation rejected');

Keywords

validator

FAQs

Package last updated on 16 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts