(name: string, fn: RedisFunction, resp: RespVersions)
| 78 | } |
| 79 | |
| 80 | export function createFunctionCommand<T extends NamespaceProxySentinel | NamespaceProxySentinelClient>(name: string, fn: RedisFunction, resp: RespVersions) { |
| 81 | const prefix = functionArgumentsPrefix(name, fn); |
| 82 | const transformReply = getTransformReply(fn, resp); |
| 83 | |
| 84 | return async function (this: T, ...args: Array<unknown>) { |
| 85 | const parser = new BasicCommandParser(this._self._keyPrefix); |
| 86 | parser.push(...prefix); |
| 87 | fn.parseCommand(parser, ...args); |
| 88 | |
| 89 | return this._self._execute( |
| 90 | fn.IS_READ_ONLY, |
| 91 | client => client._executeCommand(fn, parser, this._self.commandOptions, transformReply) |
| 92 | ); |
| 93 | } |
| 94 | }; |
| 95 | |
| 96 | export function createModuleCommand<T extends NamespaceProxySentinel | NamespaceProxySentinelClient>(command: Command, resp: RespVersions) { |
| 97 | const transformReply = getTransformReply(command, resp); |
no test coverage detected