Skip to content

Commit 93538f4

Browse files
committed
tweak to make functions internal
1 parent 64dd0b3 commit 93538f4

File tree

4 files changed

+25
-19
lines changed

4 files changed

+25
-19
lines changed

packages/client/lib/client/index.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export default class RedisClient<
157157
const parser = new BasicCommandParser(resp);
158158
command.parseCommand(parser, ...args);
159159

160-
return this._self.executeCommand(parser, this._commandOptions, transformReply);
160+
return this._self._executeCommand(parser, this._commandOptions, transformReply);
161161
}
162162
}
163163

@@ -168,7 +168,7 @@ export default class RedisClient<
168168
const parser = new BasicCommandParser(resp);
169169
command.parseCommand(parser, ...args);
170170

171-
return this._self.executeCommand(parser, this._self._commandOptions, transformReply);
171+
return this._self._executeCommand(parser, this._self._commandOptions, transformReply);
172172
};
173173
}
174174

@@ -181,7 +181,7 @@ export default class RedisClient<
181181
parser.pushVariadic(prefix);
182182
fn.parseCommand(parser, ...args);
183183

184-
return this._self.executeCommand(parser, this._self._commandOptions, transformReply);
184+
return this._self._executeCommand(parser, this._self._commandOptions, transformReply);
185185
};
186186
}
187187

@@ -192,9 +192,9 @@ export default class RedisClient<
192192
return async function (this: ProxyClient, ...args: Array<unknown>) {
193193
const parser = new BasicCommandParser(resp);
194194
parser.pushVariadic(prefix);
195-
script.parseCommand(parser, ...args);
195+
script.parseCommand(parser, ...args)
196196

197-
return this.executeScript(script, parser, this._commandOptions, transformReply);
197+
return this._executeScript(script, parser, this._commandOptions, transformReply);
198198
}
199199
}
200200

@@ -572,7 +572,10 @@ export default class RedisClient<
572572
return this as unknown as RedisClientType<M, F, S, RESP, TYPE_MAPPING>;
573573
}
574574

575-
async executeCommand<T = ReplyUnion>(
575+
/**
576+
* @internal
577+
*/
578+
async _executeCommand(
576579
parser: CommandParser,
577580
commandOptions: CommandOptions<TYPE_MAPPING> | undefined,
578581
transformReply: TransformReply | undefined,
@@ -586,7 +589,10 @@ export default class RedisClient<
586589
return reply;
587590
}
588591

589-
async executeScript(
592+
/**
593+
* @internal
594+
*/
595+
async _executeScript(
590596
script: RedisScript,
591597
parser: CommandParser,
592598
options: CommandOptions | undefined,

packages/client/lib/client/pool.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class RedisClientPool<
7070
const parser = new BasicCommandParser(resp);
7171
command.parseCommand(parser, ...args);
7272

73-
return this.execute(client => client.executeCommand(parser, this._commandOptions, transformReply))
73+
return this.execute(client => client._executeCommand(parser, this._commandOptions, transformReply))
7474
};
7575
}
7676

@@ -81,7 +81,7 @@ export class RedisClientPool<
8181
const parser = new BasicCommandParser(resp);
8282
command.parseCommand(parser, ...args);
8383

84-
return this._self.execute(client => client.executeCommand(parser, this._self._commandOptions, transformReply))
84+
return this._self.execute(client => client._executeCommand(parser, this._self._commandOptions, transformReply))
8585
};
8686
}
8787

@@ -94,7 +94,7 @@ export class RedisClientPool<
9494
parser.pushVariadic(prefix);
9595
fn.parseCommand(parser, ...args);
9696

97-
return this._self.execute(client => client.executeCommand(parser, this._self._commandOptions, transformReply)) };
97+
return this._self.execute(client => client._executeCommand(parser, this._self._commandOptions, transformReply)) };
9898
}
9999

100100
static #createScriptCommand(script: RedisScript, resp: RespVersions) {
@@ -106,7 +106,7 @@ export class RedisClientPool<
106106
parser.pushVariadic(prefix);
107107
script.parseCommand(parser, ...args);
108108

109-
return this.execute(client => client.executeScript(script, parser, this._commandOptions, transformReply))
109+
return this.execute(client => client._executeScript(script, parser, this._commandOptions, transformReply))
110110
};
111111
}
112112

packages/client/lib/cluster/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export default class RedisCluster<
160160
parser.firstKey,
161161
command.IS_READ_ONLY,
162162
this._commandOptions,
163-
(client, opts) => client.executeCommand(parser, opts, transformReply)
163+
(client, opts) => client._executeCommand(parser, opts, transformReply)
164164
);
165165
};
166166
}
@@ -176,7 +176,7 @@ export default class RedisCluster<
176176
parser.firstKey,
177177
command.IS_READ_ONLY,
178178
this._self._commandOptions,
179-
(client, opts) => client.executeCommand(parser, opts, transformReply)
179+
(client, opts) => client._executeCommand(parser, opts, transformReply)
180180
);
181181
};
182182
}
@@ -194,7 +194,7 @@ export default class RedisCluster<
194194
parser.firstKey,
195195
fn.IS_READ_ONLY,
196196
this._self._commandOptions,
197-
(client, opts) => client.executeCommand(parser, opts, transformReply)
197+
(client, opts) => client._executeCommand(parser, opts, transformReply)
198198
);
199199
};
200200
}
@@ -212,7 +212,7 @@ export default class RedisCluster<
212212
parser.firstKey,
213213
script.IS_READ_ONLY,
214214
this._commandOptions,
215-
(client, opts) => client.executeScript(script, parser, opts, transformReply)
215+
(client, opts) => client._executeScript(script, parser, opts, transformReply)
216216
);
217217
};
218218
}

packages/client/lib/sentinel/utils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function createCommand<T extends ProxySentinel | ProxySentinelClient>(com
4646

4747
return this._self._execute(
4848
command.IS_READ_ONLY,
49-
client => client.executeCommand(parser, this.commandOptions, transformReply)
49+
client => client._executeCommand(parser, this.commandOptions, transformReply)
5050
);
5151
};
5252
}
@@ -62,7 +62,7 @@ export function createFunctionCommand<T extends NamespaceProxySentinel | Namespa
6262

6363
return this._self._execute(
6464
fn.IS_READ_ONLY,
65-
client => client.executeCommand(parser, this._self.commandOptions, transformReply)
65+
client => client._executeCommand(parser, this._self.commandOptions, transformReply)
6666
);
6767
}
6868
};
@@ -76,7 +76,7 @@ export function createModuleCommand<T extends NamespaceProxySentinel | Namespace
7676

7777
return this._self._execute(
7878
command.IS_READ_ONLY,
79-
client => client.executeCommand(parser, this._self.commandOptions, transformReply)
79+
client => client._executeCommand(parser, this._self.commandOptions, transformReply)
8080
);
8181
}
8282
};
@@ -92,7 +92,7 @@ export function createScriptCommand<T extends ProxySentinel | ProxySentinelClien
9292

9393
return this._self._execute(
9494
script.IS_READ_ONLY,
95-
client => client.executeScript(script, parser, this.commandOptions, transformReply)
95+
client => client._executeScript(script, parser, this.commandOptions, transformReply)
9696
);
9797
};
9898
}

0 commit comments

Comments
 (0)