Skip to content

Commit

Permalink
fix(cache): only load cache code if cache opt is a string
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Mar 30, 2017
1 parent 19186c5 commit 250fcd5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = cachingFetch
function cachingFetch (uri, _opts) {
const opts = {}
Object.keys(_opts || {}).forEach(k => { opts[k] = _opts[k] })
if (opts.cache && !Cache) { Cache = require('./cache') }
if (opts.cache === 'string' && !Cache) { Cache = require('./cache') }
opts.cache = opts.cache && (
typeof opts.cache === 'string'
? new Cache(opts.cache, opts.cacheOpts)
Expand Down

0 comments on commit 250fcd5

Please sign in to comment.