Skip to content

Commit

Permalink
refactor: eliminate a branch
Browse files Browse the repository at this point in the history
  • Loading branch information
gas1cent committed Jan 17, 2024
1 parent 6e2d8a8 commit 75d54fe
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,18 @@ import { Validator } from './validator';
const processor = new Processor(validator);
const warnings = await processor.processSources(sourceUnits);

if (warnings.length) {
warnings.forEach(({ location, messages }) => {
console.warn(location);
messages.forEach((message) => {
console.warn(` ${message}`);
});
console.warn();
});
} else {
if (!warnings.length) {
console.warn('No issues found');
return;
}

warnings.forEach(({ location, messages }) => {
console.warn(location);
messages.forEach((message) => {
console.warn(` ${message}`);
});
console.warn();
});
})().catch(console.error);

function getArguments(): Config {
Expand Down

0 comments on commit 75d54fe

Please sign in to comment.