diff --git a/package.json b/package.json index dc70ccf..db2f934 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "memoredis", - "version": "1.0.5", + "version": "1.0.6", "description": "Redis memoization library with good Typescript generics, locking, and argument-wide bulk invalidation", "main": "build/main/index.js", "typings": "build/main/index.d.ts", diff --git a/src/lib/memoizer.ts b/src/lib/memoizer.ts index e28fe71..1e58ae0 100644 --- a/src/lib/memoizer.ts +++ b/src/lib/memoizer.ts @@ -72,6 +72,7 @@ export const createMemoizer = (instanceOpts: MemoizerOpts) => { }); const psetex = (key: string, milliseconds: number, value: any) => + // tslint:disable-next-line: variable-name new Promise((resolve, _reject) => { let jsonValue; try { @@ -94,13 +95,16 @@ export const createMemoizer = (instanceOpts: MemoizerOpts) => { }); const get = (key: string): Promise => + // tslint:disable-next-line: variable-name new Promise((resolve, _reject) => client.get(key, (err, reply) => { if (err) { logger.error(`memoredis: redis error getting key ${key}.`, err); return resolve(null); } - if (reply === null) return resolve(null); + if (reply === null) { + return resolve(null); + } try { return resolve(JSON.parse(reply, jsonDateParser) as T);