MCPcopy
hub / github.com/redis/node-redis / createScriptCommand

Function createScriptCommand

packages/client/lib/sentinel/utils.ts:110–124  ·  view source on GitHub ↗
(script: RedisScript, resp: RespVersions)

Source from the content-addressed store, hash-verified

108};
109
110export function createScriptCommand<T extends ProxySentinel | ProxySentinelClient>(script: RedisScript, resp: RespVersions) {
111 const prefix = scriptArgumentsPrefix(script);
112 const transformReply = getTransformReply(script, resp);
113
114 return async function (this: T, ...args: Array<unknown>) {
115 const parser = new BasicCommandParser(this._self._keyPrefix);
116 parser.push(...prefix);
117 script.parseCommand(parser, ...args);
118
119 return this._self._execute(
120 script.IS_READ_ONLY,
121 client => client._executeScript(script, parser, this.commandOptions, transformReply)
122 );
123 };
124}
125
126/**
127 * Returns the mapped node address for the given host and port using the nodeAddressMap.

Callers 1

attachConfigFunction · 0.85

Calls 5

pushMethod · 0.95
scriptArgumentsPrefixFunction · 0.90
getTransformReplyFunction · 0.90
_executeScriptMethod · 0.80
_executeMethod · 0.45

Tested by

no test coverage detected