Releases: ketanSaxena/schema-validator
Releases · ketanSaxena/schema-validator
Adds direct object structure comparison
New Features
Compare two objects' schema
If you don't have a schema object built, but you just want to compare if structure of two objects is same, then you can use schemaObj option to pass the expected object:
let person = { name: { first: 'Tom', last: 'Xoman' }, age: 'something' }
let idealPerson = { name: { first: 'Tom', last: 'Xoman' }, age: 45 }
vaidateSchema(person, { // compares the structure of person object against
schemaObj: idealPerson // anotherPerson object.
})Technical Enhancements
- Fixes format of the returned errors to fields
pathandmessageonly - npm audit vulnerability fix
- Externalises
printErrormethod