Bump production dependencies with open CVEs

This commit is contained in:
Tom Moor
2019-03-12 23:54:35 -07:00
parent 680a9245bd
commit 7b7ec52eee
3 changed files with 24 additions and 45 deletions

View File

@ -2,7 +2,7 @@
import debug from 'debug';
import { type Context } from 'koa';
const debugCache = debug('cache');
const log = debug('cache');
export default function cache() {
return async function cacheMiddleware(ctx: Context, next: () => Promise<*>) {
@ -14,9 +14,9 @@ export default function cache() {
ctx.cache.get = async (id, def) => {
if (ctx.cache[id]) {
debugCache(`hit: ${id}`);
log(`hit: ${id}`);
} else {
debugCache(`miss: ${id}`);
log(`miss: ${id}`);
ctx.cache.set(id, await def());
}
return ctx.cache[id];