JSON Schema Proxy for validation any object on read and write

Ivan Asmer db15f42980 readme fixes 3 lat temu
.gitignore efcb2fbb88 readme and initial 3 lat temu
README.md db15f42980 readme fixes 3 lat temu
index.js efcb2fbb88 readme and initial 3 lat temu
package-lock.json efcb2fbb88 readme and initial 3 lat temu
package.json efcb2fbb88 readme and initial 3 lat temu

README.md

Pretty Simple JSON-Schema Javascript Proxy validator.

API:

const jsonSchemaProxy = require('json-schema-proxy')

const proxiedObject = jsonSchemaProxy(objectToProxy, inputJsonSchema, outputJsonSchema)

proxiedObject.foo = 'some value' will cause exception in case of failed inSchema validation. Object remains untouched

let variable = proxiedObject.foo will give undefined in case of failed outSchema validation.

outSchema can be omitted if you don't need output validation.

outSchema filters wrong fields or additionalProperties not listed in outSchema