forked from cerc-io/registry-sdk
Increment package version
This commit is contained in:
parent
4169788b7d
commit
71d6201852
25
validate.ts
Normal file
25
validate.ts
Normal file
@ -0,0 +1,25 @@
|
||||
// import Ajv from 'ajv';
|
||||
// import fs from 'fs';
|
||||
|
||||
// async function main2 () {
|
||||
// const schema = JSON.parse(fs.readFileSync('record-schemas/WatcherDeploymentRecordSchema.json', 'utf8'));
|
||||
// const data = JSON.parse(fs.readFileSync('records/watcher-deployments/AjnaWatcherDeploymentRecord.json', 'utf8'));
|
||||
|
||||
// const { isValid, validationErrors } = validateRecord(schema, data);
|
||||
// if (!isValid) {
|
||||
// console.error('Validation errors:', validationErrors);
|
||||
// } else {
|
||||
// console.log('Data is valid');
|
||||
// }
|
||||
// }
|
||||
|
||||
// function validateRecord (schema: any, data: any): { isValid: boolean, validationErrors: null | any } {
|
||||
// // Create an instance of Ajv
|
||||
// const ajv = new Ajv();
|
||||
|
||||
// // Validate data against schema
|
||||
// const validate = ajv.compile(schema);
|
||||
// const valid = validate(data);
|
||||
|
||||
// return { isValid: valid, validationErrors: validate.errors };
|
||||
// }
|
||||
Loading…
Reference in New Issue
Block a user