Fix bug where template expressions were interpreted as paths.

This commit is contained in:
Alexandre Gigliotti
2015-09-25 13:35:27 -07:00
parent 99eed58f96
commit ff5e4401f7
4 changed files with 27 additions and 2 deletions

View File

@@ -0,0 +1,14 @@
/**
* Tests whether a path is a mustache template expression.
*
* Note: would be best if this was file extension specific
* (i.e. *.hbs => test for `{{ }}` )
*
* @param {String} path
* @return {Boolean}
*/
var isTemplateExpression = function (path) {
return /^{{.*}}$/.test(path);
};
module.exports = isTemplateExpression;