From 986a510237a44780a358e59d1512a4a3beabd5b2 Mon Sep 17 00:00:00 2001 From: Leibale Eidelman Date: Wed, 26 Apr 2023 14:29:39 -0400 Subject: [PATCH] fix #2481 - fix "falsy" arguments in TS.ALTER (#2483) --- 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 19cd075ba4..356b041664 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