From b19f881deb2b16eda9c8ae8ee7385a9ce5041f76 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Sat, 9 Jul 2022 13:36:14 +1000 Subject: [PATCH] added: echo parameter --- mod.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mod.ts b/mod.ts index 3c632d4..3bbb6ce 100644 --- a/mod.ts +++ b/mod.ts @@ -99,14 +99,17 @@ function toTpReader(redisConn: Deno.Conn): TextProtoReader { * ``` * @param redisConn Redis connection to the server. * @param command Redis command, which is an array of arguments. + * @param echo If `true`, a reply is read. Defaults to true. * @returns Parsed Redis reply */ export async function sendCommand( redisConn: Deno.Conn, command: Command, -): Promise { + echo = true, +): Promise { await writeRequest(redisConn, stringifyRequest(command)); - return await readReply(toTpReader(redisConn)); + if (echo) { + return await readReply(toTpReader(redisConn)); } }