Skip to content

Commit

Permalink
Fix up output from OAD, it does not output valid JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Siegel committed Aug 20, 2018
1 parent fa1156d commit af3571c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/breaking-change.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,16 @@ async function runOad(oldSpec, newSpec) {
console.log(`New Spec: "${newSpec}"`);
console.log(`>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`);

const result = await oad.compare(oldSpec, newSpec, { consoleLogLevel: 'warn', json: true });
let result = await oad.compare(oldSpec, newSpec, { consoleLogLevel: 'warn', json: true });
console.log(result);

if (!result) {
return;
}

// fix up output from OAD, it does not output valid JSON
result = '[' + result.replace(/}\s+{/gi,"},{") + ']'

return JSON.parse(result);
}

Expand Down

0 comments on commit af3571c

Please sign in to comment.