1.0.2 • Published 7 years ago
json-scheme-tools v1.0.2
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: 1. Item must contain exact one property of type, allow, regexp or props 2. Props must contain a scheme object itself 3. Default is optional, must be valid itself and is allowed together with type, allow and regexp 4. Default is required for allow and regexp 5. Other props are not allowed
Functions:
- create(scheme, saveToFile)
- validate(scheme, objectSource)
- fix(scheme, objectSource)