0.0.9 • Published 7 years ago

validation-unchained v0.0.9

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

JSON Validation

Example

const validate = require('validation-unchained');

const { errors, data } = model.validate({
  username: 'chris',
  password: 'pass'
}, {
  strict: true,
  rules: {
    username: { type: String },
    password: { type: String, length: { min: 6, max: 255, inclusive: true } }
  }
});
console.log(errors);
// => { password: [ 'Must be between 6 and 255 characters long.' ] }

Features

  1. Type Conversion
    1. Boolean
    2. Date
    3. Number
    4. String
  2. Strict enforcement
  3. Array Values
  4. All Types
    1. Required
  5. Boolean Validation
  6. Date Validation
  7. Number Validation
    1. Min values
    2. Max values
  8. String Validation
    1. Required values
    2. String lengths
    3. Regular Expression
  9. Custom Validation WIP
0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago