mirror of
https://github.com/lynchmarkHQ/lynchmark.com.git
synced 2026-10-19 10:14:51 +00:00
Docs: Update benchmark results
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const validateJSON = async (data, schema) => {
|
||||
const { default: Ajv } = await import('https://cdn.jsdelivr.net/npm/ajv@8.12.0/dist/2020.min.js');
|
||||
const { default: Ajv } = await import('https://cdn.jsdelivr.net/npm/ajv@8/dist/ajv.bundle.js');
|
||||
|
||||
const ajv = new Ajv({ allErrors: true, verbose: true });
|
||||
const validate = ajv.compile(schema);
|
||||
@@ -7,12 +7,9 @@ const validateJSON = async (data, schema) => {
|
||||
|
||||
return {
|
||||
valid,
|
||||
errors: valid ? [] : validate.errors.map(e => ({
|
||||
path: e.instancePath || '/',
|
||||
message: e.message,
|
||||
keyword: e.keyword,
|
||||
params: e.params
|
||||
}))
|
||||
errors: valid ? [] : validate.errors.map(e =>
|
||||
`${e.instancePath || '/'} ${e.message}${e.params ? ': ' + JSON.stringify(e.params) : ''}`
|
||||
)
|
||||
};
|
||||
};
|
||||
export default validateJSON;
|
||||
Reference in New Issue
Block a user