Initial commit: ERP system with advance verification fixes

This commit is contained in:
System Administrator
2026-03-25 23:55:36 +07:00
commit 563ca12d76
5920 changed files with 828689 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
const Ajv = require("ajv").default
const ajv = new Ajv({allErrors: true})
const schema = {
properties: {
foo: {type: "string"},
bar: {type: "number", maximum: 3},
},
}
const validate = ajv.compile(schema)
test({foo: "abc", bar: 2})
test({foo: 2, bar: 4})
function test(data) {
const valid = validate(data)
if (valid) console.log("Valid!")
else console.log("Invalid: " + ajv.errorsText(validate.errors))
}