Skip to content

RikhartBekkevold/validate-object

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

validator-object

Validate objects with a schema object.

Basic Example

var { validateObject } = require('validate-object')

var obj = {
  name: "Ben",
  age: 30,
  born: 1990
}

var schema = {
  keys: {
    name: "String",  // uses libs own provided built in test function
    age: Number      // uses instanceof check
  }
}

console.log(validateObject(obj, schema)) // -> true

About

Validate javascript objects with a schema object.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published