Skip to content
Browse files

refactor read() helper

  • Loading branch information...
1 parent 64093dc commit 94a167f829ac13196c820f492e20a545c33b29d1 @tj committed
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/consolidate.js
View
3 lib/consolidate.js
@@ -85,9 +85,10 @@ function cache(options, compiled) {
function read(path, options, fn) {
var str = readCache[path];
+ var cached = options.cache && str && 'string' == typeof str;
// cached (only if cached is a string and not a compiled template function)
- if (options.cache && str && typeof str === 'string') return fn(null, str);
+ if (cached) return fn(null, str);
// read
fs.readFile(path, 'utf8', function(err, str){

0 comments on commit 94a167f

Please sign in to comment.
Something went wrong with that request. Please try again.