Skip to content

Commit

Permalink
Fixed up som tabs and formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
nufyoot committed Nov 6, 2013
1 parent 0ab4167 commit 671a6af
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions lib/main.js
Expand Up @@ -6,12 +6,12 @@ var Parser = require('./parser.js');
var parser = new Parser();

var ViewBag = {};
var Url = {
baseUrl: '',
Content : function(url) {
return url.replace('~',Url.baseUrl).toLowerCase();
}
};
var Url = {
baseUrl: '',
Content : function(url) {
return url.replace('~',Url.baseUrl).toLowerCase();
}
};

module.exports = function (config) {
config = config || {
Expand All @@ -24,9 +24,9 @@ module.exports = function (config) {
var cachedFiles = {};

return {
renderCached: function(view, usecache) {
return this.render(view, undefined, undefined, undefined, 0, usecache);
},
renderCached: function(view, usecache) {
return this.render(view, undefined, undefined, undefined, 0, usecache);
},

render: function(view, model, body, sections, depth, usecache) {
if (!view) {
Expand Down Expand Up @@ -64,14 +64,13 @@ module.exports = function (config) {
}

if (usecache) {
var r = cachedFiles[fileName];
if (!r) {
r = this.renderFromString(fs.readFileSync(fileName).toString(), model, body, sections, depth);
cachedFiles[fileName] = r;
}
return r;
}

var r = cachedFiles[fileName];
if (!r) {
r = this.renderFromString(fs.readFileSync(fileName).toString(), model, body, sections, depth);
cachedFiles[fileName] = r;
}
return r;
}

return this.renderFromString(fs.readFileSync(fileName).toString(), model, body, sections, depth);
},
Expand Down

0 comments on commit 671a6af

Please sign in to comment.