(script: RedisScript, resp: RespVersions)
| 108 | }; |
| 109 | |
| 110 | export 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. |
no test coverage detected