Skip to content
Myr

< 78 cols in view.js so people stop complaining :D

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 7dce7a8 · Browse files · 1 file+26 added−19 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+26 added−19 removed

  • other:+26 added−19 removed

1 file+26 added−19 removed

modified:lib/express/view.js+26 added-19 removed
94 unmodified lines
95exports.watcher = function(interval){96 interval = interval === true97 ? 50098 : interval;99100 function watch(file) {101 fs.watchFile(file, { interval: interval }, function(curr, prev){102 if (curr.mtime > prev.mtime) {103 cacheView(file);104 }105 });106 }10799 (function cache(dir){108 (function traverse(dir){109 fs.readdir(dir, function(err, files){101 if (!err) {102 files.forEach(function(file){103 file = dir + '/' + file;104 fs.stat(file, function(err, stats){105 if (!err) {106 if (stats.isFile()) {107 fs.watchFile(file, { interval: interval }, function(curr, prev){108 if (curr.mtime > prev.mtime) {109 cacheView(file);110 }111 });112 } else if (stats.isDirectory()) {113 cache(file);114 }115 }116 });110 if (err) return;111 files.forEach(function(file){112 file = dir + '/' + file;113 fs.stat(file, function(err, stats){114 if (err) return;115 if (stats.isFile()) {116 watch(file);117 } else if (stats.isDirectory()) {118 traverse(file);119 }120 });118 }121 });122 });123 })(viewRoot(this));124};125
138 unmodified lines
264 for (var i = 0, len = keys.length; i < len; ++i) {265 var key = keys[i],266 val = dynamicHelpers[key];267 if (typeof val === 'function') {265 helpers[key] = val.call(this.app, this.req, this, this.req.params.path);268 helpers[key] = val.call(269 this.app, 270 this.req, 271 this, 272 this.req.params.path);273 }274 }275276 // Always expose partial() as a local
45 unmodified lines