Skip to content

Commit 986a510

Browse files
authored
fix #2481 - fix "falsy" arguments in TS.ALTER (#2483)
1 parent ba31c8a commit 986a510

File tree

1 file changed

+4
-4
lines changed
  • packages/time-series/lib/commands

1 file changed

+4
-4
lines changed

packages/time-series/lib/commands/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export function transformTimestampArgument(timestamp: Timestamp): string {
128128
}
129129

130130
export function pushRetentionArgument(args: RedisCommandArguments, retention?: number): RedisCommandArguments {
131-
if (retention) {
131+
if (retention !== undefined) {
132132
args.push(
133133
'RETENTION',
134134
retention.toString()
@@ -144,7 +144,7 @@ export enum TimeSeriesEncoding {
144144
}
145145

146146
export function pushEncodingArgument(args: RedisCommandArguments, encoding?: TimeSeriesEncoding): RedisCommandArguments {
147-
if (encoding) {
147+
if (encoding !== undefined) {
148148
args.push(
149149
'ENCODING',
150150
encoding
@@ -155,7 +155,7 @@ export function pushEncodingArgument(args: RedisCommandArguments, encoding?: Tim
155155
}
156156

157157
export function pushChunkSizeArgument(args: RedisCommandArguments, chunkSize?: number): RedisCommandArguments {
158-
if (chunkSize) {
158+
if (chunkSize !== undefined) {
159159
args.push(
160160
'CHUNK_SIZE',
161161
chunkSize.toString()
@@ -166,7 +166,7 @@ export function pushChunkSizeArgument(args: RedisCommandArguments, chunkSize?: n
166166
}
167167

168168
export function pushDuplicatePolicy(args: RedisCommandArguments, duplicatePolicy?: TimeSeriesDuplicatePolicies): RedisCommandArguments {
169-
if (duplicatePolicy) {
169+
if (duplicatePolicy !== undefined) {
170170
args.push(
171171
'DUPLICATE_POLICY',
172172
duplicatePolicy

0 commit comments

Comments
 (0)