The core JSON Schema and UI Schema parser.
Contains iterators and validators for traversing and verifying json data. This library can be used for any Javscript project, and UI Schema is purely optional. This library can also be used as a simple validation library for any javscript data.
You do not need to install this if you are using one of the form components such as vue-shapeshift or the shapeshift-server.
npm i --save @shapeshift/core
shapeshift(schema, uiSchema).forEach(ss => {
/// Child Property
ss.schema()
})
validate string for length and pattern.
import { Validators } from '@shapeshift/core';
Validators.validate({
type: 'string',
minLength: 2,
maxLength: 5,
pattern: '^12345$'
}, '12345')
validate number for min max
import { Validators } from '@shapeshift/core';
Validators.validate({
type: 'number',
minimum: 2,
maximum: 5,
}, 4.5)