mirror of
https://github.com/lynchmarkHQ/lynchmark.com.git
synced 2026-10-19 02:07:52 +00:00
Docs: Update benchmark results
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
const validateJSON = async (data, schema) => {
|
||||
const { default: Ajv } = await import('https://cdn.jsdelivr.net/npm/ajv@8/dist/ajv.bundle.js');
|
||||
|
||||
const { default: Ajv } = await import('https://esm.sh/ajv@8.12.0');
|
||||
const ajv = new Ajv({ allErrors: true });
|
||||
const validate = ajv.compile(schema);
|
||||
const valid = validate(data);
|
||||
|
||||
return {
|
||||
valid,
|
||||
errors: valid ? [] : validate.errors.map(e =>
|
||||
`${e.instancePath || 'root'} ${e.message}`
|
||||
errors: valid ? [] : validate.errors.map(err =>
|
||||
`${err.instancePath || '/'} ${err.message}`.trim()
|
||||
)
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user