Skip to content

Commit f5d151a

Browse files
author
vvo
committed
fix(template): throw when no way to deal with the template type
1 parent 32ccd93 commit f5d151a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/utils.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ function renderTemplate(template, data) {
1515
content = hogan.compile(template).render(data);
1616
} else if (typeof template === 'function') {
1717
content = template(data);
18+
} else {
19+
throw new Error('Template must be `string` or `function`');
1820
}
1921

2022
return content;

0 commit comments

Comments
 (0)