Skip to content

Commit

Permalink
fix: update script
Browse files Browse the repository at this point in the history
Changes:
- applied suggestion from: #1059 (comment)
- applied suggestion from: #1059 (comment)
  • Loading branch information
AnimeshKumar923 committed Jul 5, 2024
1 parent b60d353 commit 5c5d91a
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions scripts/validation/embedded-examples-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,9 @@ async function validateParser(document, name) {

if (diagnostics.length > 0) {
diagnostics.forEach(diagnostic => {
if (diagnostic.level === 'error') {
console.error(`\x1b[31mError in ${name}: ${diagnostic.message}\x1b[0m`);
process.exit(1);
} else {
console.log(`\x1b[31mError in ${name}: ${diagnostic.message}\x1b[0m`);
process.exit(1);
}
const errorMessage = `\x1b[31mError in ${name}: ${diagnostic.message}\x1b[0m`
console.log(errorMessage);
process.exit(1);
});
} else {
console.log(`${name} is valid.`);
Expand All @@ -112,7 +108,7 @@ const validationPromises = combinedData.map(async (item) => {

const updatedDocument = applyUpdates([item], baseDocument);

const documentString = JSON.stringify(updatedDocument, null, 2);
const documentString = updatedDocument;
await validateParser(documentString, `${item.name}-${item.format}-format`);
});

Expand Down

0 comments on commit 5c5d91a

Please sign in to comment.