From 7a117de5b9e541e80646307747de6670babea7f4 Mon Sep 17 00:00:00 2001 From: Leibale Eidelman Date: Wed, 26 Apr 2023 13:03:00 -0400 Subject: [PATCH] fix #2481 - fix "falsy" arguments in TS.ALTER --- packages/time-series/lib/commands/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/time-series/lib/commands/index.ts b/packages/time-series/lib/commands/index.ts index 19cd075ba49..356b0416648 100644 --- a/packages/time-series/lib/commands/index.ts +++ b/packages/time-series/lib/commands/index.ts @@ -128,7 +128,7 @@ export function transformTimestampArgument(timestamp: Timestamp): string { } export function pushRetentionArgument(args: RedisCommandArguments, retention?: number): RedisCommandArguments { - if (retention) { + if (retention !== undefined) { args.push( 'RETENTION', retention.toString() @@ -144,7 +144,7 @@ export enum TimeSeriesEncoding { } export function pushEncodingArgument(args: RedisCommandArguments, encoding?: TimeSeriesEncoding): RedisCommandArguments { - if (encoding) { + if (encoding !== undefined) { args.push( 'ENCODING', encoding @@ -155,7 +155,7 @@ export function pushEncodingArgument(args: RedisCommandArguments, encoding?: Tim } export function pushChunkSizeArgument(args: RedisCommandArguments, chunkSize?: number): RedisCommandArguments { - if (chunkSize) { + if (chunkSize !== undefined) { args.push( 'CHUNK_SIZE', chunkSize.toString() @@ -166,7 +166,7 @@ export function pushChunkSizeArgument(args: RedisCommandArguments, chunkSize?: n } export function pushDuplicatePolicy(args: RedisCommandArguments, duplicatePolicy?: TimeSeriesDuplicatePolicies): RedisCommandArguments { - if (duplicatePolicy) { + if (duplicatePolicy !== undefined) { args.push( 'DUPLICATE_POLICY', duplicatePolicy