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

Method #createFunctionCommand

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

Source from the content-addressed store, hash-verified

328 }
329
330 static #createFunctionCommand(name: string, fn: RedisFunction, resp: RespVersions) {
331 const prefix = functionArgumentsPrefix(name, fn);
332 const transformReply = getTransformReply(fn, resp);
333
334 return async function (this: NamespaceProxyClient, ...args: Array<unknown>) {
335 const parser = new BasicCommandParser(this._self._keyPrefix);
336 parser.push(...prefix);
337 fn.parseCommand(parser, ...args);
338
339 return this._self._executeCommand(fn, parser, this._self._commandOptions, transformReply);
340 };
341 }
342
343 static #createScriptCommand(script: RedisScript, resp: RespVersions) {
344 const prefix = scriptArgumentsPrefix(script);

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected