json-scheme-tools
v1.0.2
Published
Purpose: Create, validate and fix objects according scheme object
Downloads
7
Readme
JSON Scheme Tools
Purpose: Create, validate and fix objects according scheme object
Example scheme object: { "item": { "property": "value" } }
Allowed properties:
- type: text/array/object/boolean
- allow: array
- regexp: string
- props: object
- default: text/array/object/boolean
Rules:
- Item must contain exact one property of type, allow, regexp or props
- Props must contain a scheme object itself
- Default is optional, must be valid itself and is allowed together with type, allow and regexp
- Default is required for allow and regexp
- Other props are not allowed
Functions:
- create(scheme, saveToFile)
- validate(scheme, objectSource)
- fix(scheme, objectSource)
