Skip to content

Commit

Permalink
fix: fallback to empty string if there are no attributes (#397)
Browse files Browse the repository at this point in the history
Fixes #396

Co-authored-by: Simon Holthausen <simon.holthausen@accso.de>
  • Loading branch information
dummdidumm and Simon Holthausen authored Sep 5, 2021
1 parent 3a020e9 commit b25838f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function getScriptContent(markup: string, module: boolean): string {
let match: RegExpMatchArray | null;

while ((match = regex.exec(markup)) !== null) {
const { context } = parseAttributes(match[1]);
const { context } = parseAttributes(match[1] || '');

if ((context !== 'module' && !module) || (context === 'module' && module)) {
return match[2];
Expand Down

0 comments on commit b25838f

Please sign in to comment.