Skip to content

Commit

Permalink
fix(template): validation
Browse files Browse the repository at this point in the history
  • Loading branch information
djalmajr committed Mar 10, 2022
1 parent 334107f commit ef1e3c3
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 @@ -10,7 +10,7 @@ interface FnTemplate {
}

export const template: FnTemplate = curry((str: string, obj: any) => {
return str.replace(regex, (_, k) => get(k, obj) || '');
return str.replace(regex, (_, k) => get(k, obj) ?? '');
}) as FnTemplate;

template.test = (str: string) => regex.test(str);

0 comments on commit ef1e3c3

Please sign in to comment.