MCPcopy
hub / github.com/redis/node-redis / #createFunctionCommand

Method #createFunctionCommand

packages/client/lib/cluster/index.ts:208–224  ·  view source on GitHub ↗
(name: string, fn: RedisFunction, resp: RespVersions)

Source from the content-addressed store, hash-verified

206 }
207
208 static #createFunctionCommand(name: string, fn: RedisFunction, resp: RespVersions) {
209 const prefix = functionArgumentsPrefix(name, fn);
210 const transformReply = getTransformReply(fn, resp);
211
212 return async function (this: NamespaceProxyCluster, ...args: Array<unknown>) {
213 const parser = new BasicCommandParser(this._self._keyPrefix);
214 parser.push(...prefix);
215 fn.parseCommand(parser, ...args);
216
217 return this._self._execute(
218 parser.firstKey,
219 fn.IS_READ_ONLY,
220 this._self._commandOptions,
221 (client, opts) => client._executeCommand(fn, parser, opts, transformReply)
222 );
223 };
224 }
225
226 static #createScriptCommand(script: RedisScript, resp: RespVersions) {
227 const prefix = scriptArgumentsPrefix(script);

Callers

nothing calls this directly

Calls 5

pushMethod · 0.95
functionArgumentsPrefixFunction · 0.90
getTransformReplyFunction · 0.90
_executeCommandMethod · 0.80
_executeMethod · 0.45

Tested by

no test coverage detected