Skip to content

Commit

Permalink
#40: expose lib method for schema validation
Browse files Browse the repository at this point in the history
  • Loading branch information
mohit-s96 committed Oct 13, 2023
1 parent db3257e commit 4bb3cef
Show file tree
Hide file tree
Showing 3 changed files with 191 additions and 131 deletions.
8 changes: 5 additions & 3 deletions lib/schema/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const chalk = require('chalk');
const { promises: fs } = require('fs');
const { generateSchema, generateJsonSchema } = require('./generate');
const path = require('path');
const { validatePayload, isValidDdVersion } = require('./validate');
const { validatePayload, isValidDdVersion, validate, combineErrors } = require('./validate');
const { CURRENT_DATA_DICTIONARY_VERSION } = require('../../common');
const { readDirectory } = require('../restore-utils');
const { getReferenceMetadata } = require('reso-certification-etl');
Expand Down Expand Up @@ -109,7 +109,7 @@ const schema = async ({
}
} catch (error) {
console.log(error);
console.log(chalk.redBright('SOmething wen wrong while processing'));
console.log(chalk.redBright('Something went wrong while processing'));
}
};

Expand Down Expand Up @@ -226,5 +226,7 @@ const validatePayloadAndGenerateResults = async ({

module.exports = {
schema,
generateJsonSchema
generateJsonSchema,
validate,
combineErrors
};
4 changes: 2 additions & 2 deletions lib/schema/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const fs = require('fs');
const fsPromises = fs.promises;
const fs = require('fs/promises');
const fsPromises = fs;
const path = require('path');
const { extractFilesFromZip } = require('../../common');

Expand Down
Loading

0 comments on commit 4bb3cef

Please sign in to comment.