Skip to content

Commit 46ade6b

Browse files
committed
fix: remove unused Command#isCustomCommand
1 parent 7b98355 commit 46ade6b

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

Diff for: lib/Command.ts

-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ export default class Command implements Respondable {
140140
isReadOnly?: boolean;
141141

142142
args: CommandParameter[];
143-
isCustomCommand = false;
144143
inTransaction = false;
145144
pipelineIndex?: number;
146145

Diff for: lib/Script.ts

+2-12
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ export default class Script {
1717
const sha = this.sha;
1818
const socketHasScriptLoaded = new WeakSet();
1919
this.Command = class CustomScriptCommand extends Command {
20-
isCustomCommand = true;
21-
2220
toWritable(socket: object): string | Buffer {
2321
const origReject = this.reject;
2422
this.reject = (err) => {
@@ -52,11 +50,7 @@ export default class Script {
5250
options.readOnly = true;
5351
}
5452

55-
const evalsha = new this.Command(
56-
"evalsha",
57-
[this.sha, ...args],
58-
options
59-
);
53+
const evalsha = new this.Command("evalsha", [this.sha, ...args], options);
6054

6155
evalsha.promise = evalsha.promise.catch((err: Error) => {
6256
if (err.message.indexOf("NOSCRIPT") === -1) {
@@ -65,11 +59,7 @@ export default class Script {
6559

6660
// Resend the same custom evalsha command that gets transformed
6761
// to an eval in case it's not loaded yet on the connection.
68-
const resend = new this.Command(
69-
"evalsha",
70-
[this.sha, ...args],
71-
options
72-
);
62+
const resend = new this.Command("evalsha", [this.sha, ...args], options);
7363

7464
const client = container.isPipeline ? container.redis : container;
7565
return client.sendCommand(resend);

0 commit comments

Comments
 (0)