diff --git a/src/storages/inRedis/RedisAdapter.ts b/src/storages/inRedis/RedisAdapter.ts index dcdadb4a..81a2b4fd 100644 --- a/src/storages/inRedis/RedisAdapter.ts +++ b/src/storages/inRedis/RedisAdapter.ts @@ -91,9 +91,9 @@ export class RedisAdapter extends ioredis { const wrapCommand = (originalMethod: Function, methodName: string) => { // The value of "this" in this function should be the instance actually executing the method. It might be the instance referred (the base one) // or it can be the instance of a Pipeline object. - return function () { + return function (this: RedisAdapter | Pipeline) { const params = arguments; - const caller: (Pipeline | RedisAdapter) = this; // Need to change this crap to have TypeScript stop complaining + const caller: (Pipeline | RedisAdapter) = this; const commandWrapper = () => { instance.log.debug(`${LOG_PREFIX}Executing ${methodName}.`); diff --git a/src/storages/inRedis/SplitsCacheInRedis.ts b/src/storages/inRedis/SplitsCacheInRedis.ts index 70abd74b..a9370ea3 100644 --- a/src/storages/inRedis/SplitsCacheInRedis.ts +++ b/src/storages/inRedis/SplitsCacheInRedis.ts @@ -10,7 +10,7 @@ import type { RedisAdapter } from './RedisAdapter'; /** * Discard errors for an answer of multiple operations. */ -function processPipelineAnswer(results: Array<[Error | null, string]>): (string | string[])[] { +function processPipelineAnswer(results: Array<[Error | null, string]>): string[] { return results.reduce((accum: string[], errValuePair: [Error | null, string]) => { if (errValuePair[0] === null) accum.push(errValuePair[1]); return accum;