Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Commit

Permalink
Merge pull request #100 from makky3939/clean_up_template_js
Browse files Browse the repository at this point in the history
Refactored 'template.js'
  • Loading branch information
contra committed Sep 3, 2015
2 parents 7e1336e + 878c95b commit 4656163
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/template.js
Expand Up @@ -9,11 +9,13 @@ var forcedSettings = {
interpolate: reInterpolate
};

module.exports = function(tmpl, data){
module.exports = function(tmpl, data) {
var fn = template(tmpl, forcedSettings);

var wrapped = function(o) {
if (typeof o === 'undefined' || typeof o.file === 'undefined') throw new Error('Failed to provide the current file as "file" to the template');
if (typeof o === 'undefined' || typeof o.file === 'undefined') {
throw new Error('Failed to provide the current file as "file" to the template');
}
return fn(o);
};

Expand Down

0 comments on commit 4656163

Please sign in to comment.