Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

refactor read() helper

  • Loading branch information...
commit 94a167f829ac13196c820f492e20a545c33b29d1 1 parent 64093dc
@tj authored
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){
Please sign in to comment.
Something went wrong with that request. Please try again.