Skip to content

Commit

Permalink
feat: throw error for unsupported targetParsers
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiVolland committed Oct 31, 2024
1 parent cd4b625 commit 14bb940
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@ async function writeFile(
let output;
indicator.text = `Writing to ${targetFile}`;
if (targetParser) {
if (targetParser instanceof LyrxParser) {
throw new Error('LyrxParser is not supported as target parser.');
}
if (targetParser instanceof MapfileParser) {
throw new Error('MapfileParser is not supported as target parser.');
}

const {
output: writeOutput,
errors: writeErrors,
Expand Down

0 comments on commit 14bb940

Please sign in to comment.