From 46ade6b8732b112cc5cffb641b1bab51eb96df38 Mon Sep 17 00:00:00 2001 From: Zihua Li Date: Sat, 12 Mar 2022 12:39:29 +0800 Subject: [PATCH] fix: remove unused Command#isCustomCommand --- lib/Command.ts | 1 - lib/Script.ts | 14 ++------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/lib/Command.ts b/lib/Command.ts index 082c955f..5bc5c9e4 100644 --- a/lib/Command.ts +++ b/lib/Command.ts @@ -140,7 +140,6 @@ export default class Command implements Respondable { isReadOnly?: boolean; args: CommandParameter[]; - isCustomCommand = false; inTransaction = false; pipelineIndex?: number; diff --git a/lib/Script.ts b/lib/Script.ts index d13a7680..695097db 100644 --- a/lib/Script.ts +++ b/lib/Script.ts @@ -17,8 +17,6 @@ export default class Script { const sha = this.sha; const socketHasScriptLoaded = new WeakSet(); this.Command = class CustomScriptCommand extends Command { - isCustomCommand = true; - toWritable(socket: object): string | Buffer { const origReject = this.reject; this.reject = (err) => { @@ -52,11 +50,7 @@ export default class Script { options.readOnly = true; } - const evalsha = new this.Command( - "evalsha", - [this.sha, ...args], - options - ); + const evalsha = new this.Command("evalsha", [this.sha, ...args], options); evalsha.promise = evalsha.promise.catch((err: Error) => { if (err.message.indexOf("NOSCRIPT") === -1) { @@ -65,11 +59,7 @@ export default class Script { // Resend the same custom evalsha command that gets transformed // to an eval in case it's not loaded yet on the connection. - const resend = new this.Command( - "evalsha", - [this.sha, ...args], - options - ); + const resend = new this.Command("evalsha", [this.sha, ...args], options); const client = container.isPipeline ? container.redis : container; return client.sendCommand(resend);