Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not omit args if value is 0 #435

Merged
merged 1 commit into from
Jun 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading