Skip to content

Commit

Permalink
text and html options are not allowed in templates.
Browse files Browse the repository at this point in the history
  • Loading branch information
eoussama committed Dec 10, 2018
1 parent 009270e commit 084785b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
6 changes: 5 additions & 1 deletion dist/temme.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ function _typeof(obj) {
if ('templates' in hierarchy) {
// Looping through the children.
hierarchy['templates'].forEach(function(template) {
checkOptions(template, hierarchy['temmeIds'], ['name', 'children', 'templates']);
checkOptions(template, hierarchy['temmeIds'], ['name', 'children', 'templates', 'text', 'html']);
});
} // Checking if the element has children.

Expand All @@ -377,6 +377,10 @@ function _typeof(obj) {
hierarchy['templates'].forEach(function(template) {
if ('name' in template) {
throw new TemmeError('InvalidTemplate', "Templates must not have a `name` option.");
} else if ('text' in template) {
throw new TemmeError('InvalidTemplate', "Templates must not have a `text` option.");
} else if ('html' in template) {
throw new TemmeError('InvalidTemplate', "Templates must not have a `html` option.");
} else if ('children' in template) {
throw new TemmeError('InvalidTemplate', "Templates must not have a `children` option.");
} else if ('templates' in template) {
Expand Down
Loading

0 comments on commit 084785b

Please sign in to comment.