redis-mock icon indicating copy to clipboard operation
redis-mock copied to clipboard

fix: ensure exists works with array of values

Open iamstuartwilson opened this issue 4 years ago • 1 comments

Overview

When working with this lib I noticed that the exist method was double-wrapping an array of keys due to the way getKeysVarArgs was merging args. This adds a fix and test case to ensure users can use all of the following invocations:

client.exists('key', cb)
client.exists('key', 'key2', cb)
client.exists(['key', 'key2'], cb)

iamstuartwilson avatar Sep 15 '21 11:09 iamstuartwilson

@kamiljano We have a workaround for this by shimming the exposed exists methods in our tests, but it would be great if you have time to review this PR. Cheers!

iamstuartwilson avatar Sep 15 '21 11:09 iamstuartwilson