Skip to content

Commit

Permalink
fix: do not omit arg if value is 0 (#435)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArturSharapov authored Jun 29, 2024
1 parent 1de1e37 commit dc6c4b3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1825,7 +1825,7 @@ class RedisImpl implements Redis {

xinfoStreamFull(key: string, count?: number) {
const args = [];
if (count) {
if (count !== undefined) {
args.push("COUNT");
args.push(count);
}
Expand Down Expand Up @@ -1941,7 +1941,7 @@ class RedisImpl implements Redis {
count?: number,
) {
const args: (string | number)[] = [key, xidstr(start), xidstr(end)];
if (count) {
if (count !== undefined) {
args.push("COUNT");
args.push(count);
}
Expand All @@ -1957,7 +1957,7 @@ class RedisImpl implements Redis {
count?: number,
) {
const args: (string | number)[] = [key, xidstr(start), xidstr(end)];
if (count) {
if (count !== undefined) {
args.push("COUNT");
args.push(count);
}
Expand All @@ -1972,11 +1972,11 @@ class RedisImpl implements Redis {
) {
const args = [];
if (opts) {
if (opts.count) {
if (opts.count !== undefined) {
args.push("COUNT");
args.push(opts.count);
}
if (opts.block) {
if (opts.block !== undefined) {
args.push("BLOCK");
args.push(opts.block);
}
Expand Down Expand Up @@ -2014,11 +2014,11 @@ class RedisImpl implements Redis {
consumer,
];

if (count) {
if (count !== undefined) {
args.push("COUNT");
args.push(count);
}
if (block) {
if (block !== undefined) {
args.push("BLOCK");
args.push(block);
}
Expand Down

0 comments on commit dc6c4b3

Please sign in to comment.