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

validator-object

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

validator-object

validator-object is simple object validator with validator module.

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
4
300%
Maintainers
1
Weekly downloads
 
Created
Source

validator-object

Simple object validator with validator module.

Usage

```javascript
const validatorObj = require('./');
const validator = validatorObj.validator;

let formData = {
	email: 'rico345100@gmail.com',
	age: 'hi'
};

const rules = {
	email: validator.isEmail,
	age: validator.isNumeric
};

let validateResults = validatorObj.check(formData, rules);
console.log('Validate-obj results:', validateResults);	
// Validate-obj results: [ { email: true }, { age: true } ]
```

API

array passedFields()

Returns only passed fields

array failedFields()

Returns only passed fields

Returning array

[ { fieldName1: true/false }, { fieldName2: true/false } ]

License

MIT.

Keywords

validation

FAQs

Package last updated on 02 Sep 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