Code example of javascript object schema validation
Budget: $10 – $30 USD
I need something to help my validate an object data (required fields, valid values).
It will run in the browser using <script> tag, so cant use npm/typescript based validators.
E.g:
const myScheme = {
field1: "text",
obj : {
field2: "number"
}
}
const objExample : {}
Now code something that will validate that objExample.field1 is text, and objExample.obj.field2 exists and numeric.
And if validation is false, tell me why..
I thought of using:
https://github.com/korzio/djv
Buy i'm open to suggestions
It will run in the browser using <script> tag, so cant use npm/typescript based validators.
E.g:
const myScheme = {
field1: "text",
obj : {
field2: "number"
}
}
const objExample : {}
Now code something that will validate that objExample.field1 is text, and objExample.obj.field2 exists and numeric.
And if validation is false, tell me why..
I thought of using:
https://github.com/korzio/djv
Buy i'm open to suggestions