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

Function createModuleCommand

packages/client/lib/sentinel/utils.ts:96–108  ·  view source on GitHub ↗
(command: Command, resp: RespVersions)

Source from the content-addressed store, hash-verified

94};
95
96export function createModuleCommand<T extends NamespaceProxySentinel | NamespaceProxySentinelClient>(command: Command, resp: RespVersions) {
97 const transformReply = getTransformReply(command, resp);
98
99 return async function (this: T, ...args: Array<unknown>) {
100 const parser = new BasicCommandParser(this._self._keyPrefix);
101 command.parseCommand(parser, ...args);
102
103 return this._self._execute(
104 command.IS_READ_ONLY,
105 client => client._executeCommand(command, parser, this._self.commandOptions, transformReply)
106 );
107 }
108};
109
110export function createScriptCommand<T extends ProxySentinel | ProxySentinelClient>(script: RedisScript, resp: RespVersions) {
111 const prefix = scriptArgumentsPrefix(script);

Callers 1

attachConfigFunction · 0.85

Calls 3

getTransformReplyFunction · 0.90
_executeCommandMethod · 0.80
_executeMethod · 0.45

Tested by

no test coverage detected