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

Method #createFunctionCommand

packages/client/lib/client/pool.ts:140–150  ·  view source on GitHub ↗
(name: string, fn: RedisFunction, resp: RespVersions)

Source from the content-addressed store, hash-verified

138 }
139
140 static #createFunctionCommand(name: string, fn: RedisFunction, resp: RespVersions) {
141 const prefix = functionArgumentsPrefix(name, fn);
142 const transformReply = getTransformReply(fn, resp);
143
144 return async function (this: NamespaceProxyPool, ...args: Array<unknown>) {
145 const parser = new BasicCommandParser(this._self._keyPrefix);
146 parser.push(...prefix);
147 fn.parseCommand(parser, ...args);
148
149 return this._self.execute(client => client._executeCommand(fn, parser, this._self._commandOptions, transformReply)) };
150 }
151
152 static #createScriptCommand(script: RedisScript, resp: RespVersions) {
153 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