Files
agency/.pnpm-store/v3/files/05/b16d40de439ed6b7abf5bb6f7ee117fe509e557c3abc35832fbefab57ad65fb09309eb42733080ee18ce55770d10330e054f83a57856624ed62a830397d11f
hanzo-agent 5af6960b87 run project
Run: sess_f37640604ae254cb4d11dc6217f7b721
2026-09-30 00:04:56 +00:00

20 lines
439 B
Plaintext

var Ajv = require('ajv');
var ajv = new Ajv({allErrors: true});
var schema = {
"properties": {
"foo": { "type": "string" },
"bar": { "type": "number", "maximum": 3 }
}
};
var validate = ajv.compile(schema);
test({"foo": "abc", "bar": 2});
test({"foo": 2, "bar": 4});
function test(data) {
var valid = validate(data);
if (valid) console.log('Valid!');
else console.log('Invalid: ' + ajv.errorsText(validate.errors));
}