Code example of javascript object schema validation

Job ID: 35008488

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
Related categories: JavaScript jQuery