Skip to content

Commit

Permalink
Change defaulting beahvior for empty matches.
Browse files Browse the repository at this point in the history
Part of #50.
  • Loading branch information
jkomoros committed Jul 23, 2023
1 parent bbbd4c2 commit 268e581
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ const _extractForTemplate = (input : string, pieces : TemplatePart[], loop : boo
const match = matches[i + 1];
//If it had a default, it was already set at result initalization,
//and if it doesn't we're supposed to skip anyway.
if (match == undefined) continue;
if (match == undefined || match == '') continue;
//If it's '_' then we're told to drop it on the floor.
if (v.var == IGNORE_VAR) continue;
result[v.var] = extractForPiece(match, v);
Expand Down

0 comments on commit 268e581

Please sign in to comment.