Skip to content

Commit

Permalink
style(lint): remove remaining usage of semicolons
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanebachelier committed Jan 3, 2016
1 parent 267a9d4 commit 79d1390
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,27 @@

export default function cache (config = {}) {
if (!config.store) {
throw new Error('Cache middleware need to be provided a store.');
throw new Error('Cache middleware need to be provided a store.')
}

const store = config.store;
const cache = config.cache;
const store = config.store
const cache = config.cache

if (!config.cache || typeof config.cache !== 'function') {
throw new Error('Cache middleware need a cache function.');
throw new Error('Cache middleware need a cache function.')
}

return (req, next, service) => {
const useCache = !service.use || (service.use && (service.use.cache !== false))

if (!useCache) {
return next();
return next()
}
}

const promise = next()
promise.then(cache)

return promise;
return promise
}
}

0 comments on commit 79d1390

Please sign in to comment.