* @internal
(
script: RedisScript,
parser: CommandParser,
options: CommandOptions | undefined,
transformReply: TransformReply | undefined,
)
| 1248 | * @internal |
| 1249 | */ |
| 1250 | async _executeScript( |
| 1251 | script: RedisScript, |
| 1252 | parser: CommandParser, |
| 1253 | options: CommandOptions | undefined, |
| 1254 | transformReply: TransformReply | undefined, |
| 1255 | ) { |
| 1256 | const args = parser.redisArgs as Array<RedisArgument>; |
| 1257 | |
| 1258 | let reply: ReplyUnion; |
| 1259 | try { |
| 1260 | reply = await this.sendCommand(args, options); |
| 1261 | } catch (err) { |
| 1262 | if (!(err as Error)?.message?.startsWith?.('NOSCRIPT')) throw err; |
| 1263 | |
| 1264 | args[0] = 'EVAL'; |
| 1265 | args[1] = script.SCRIPT; |
| 1266 | reply = await this.sendCommand(args, options); |
| 1267 | } |
| 1268 | |
| 1269 | return transformReply ? |
| 1270 | transformReply(reply, parser.preserve, options?.typeMapping) : |
| 1271 | reply; |
| 1272 | } |
| 1273 | |
| 1274 | sendCommand<T = ReplyUnion>( |
| 1275 | args: ReadonlyArray<RedisArgument>, |
no test coverage detected