mirror of
https://github.com/lynchmarkHQ/lynchmark.com.git
synced 2026-10-18 17:57:55 +00:00
Docs: Update benchmark results
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
const validateJSON = async (d, s) => {
|
||||
const { default: A } = await import('https://esm.sh/ajv@8.17.1')
|
||||
const v = new A({ allErrors: true }).compile(s)
|
||||
const r = v(d)
|
||||
return {
|
||||
valid: r,
|
||||
errors: r ? [] : v.errors.map(e => `${e.instancePath} ${e.message}`.trim())
|
||||
}
|
||||
}
|
||||
export default validateJSON;
|
||||
const validateJSON = async (data, schema) => {
|
||||
const { default: Ajv } = await import('https://esm.sh/ajv@8.17.1');
|
||||
const validate = new Ajv({ allErrors: true }).compile(schema);
|
||||
const valid = validate(data);
|
||||
return { valid, errors: valid ? [] : validate.errors.map(e => `${e.instancePath} ${e.message}`.trim()) };
|
||||
};
|
||||
export default validateJSON;
|
||||
// Generation time: 20.754s
|
||||
// Result: PASS
|
||||
Reference in New Issue
Block a user