You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
fixed MIGRATE function when key is array (#2184)
* fix: 2163 push empty string as arg * fix: updated migrate test with keys array
This commit is contained in:
@@ -13,7 +13,7 @@ describe('MIGRATE', () => {
|
|||||||
it('multiple keys', () => {
|
it('multiple keys', () => {
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
transformArguments('127.0.0.1', 6379, ['1', '2'], 0, 10),
|
transformArguments('127.0.0.1', 6379, ['1', '2'], 0, 10),
|
||||||
['MIGRATE', '127.0.0.1', '6379', '""', '0', '10', 'KEYS', '1', '2']
|
['MIGRATE', '127.0.0.1', '6379', '', '0', '10', 'KEYS', '1', '2']
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -19,7 +19,7 @@ export function transformArguments(
|
|||||||
isKeyArray = Array.isArray(key);
|
isKeyArray = Array.isArray(key);
|
||||||
|
|
||||||
if (isKeyArray) {
|
if (isKeyArray) {
|
||||||
args.push('""');
|
args.push('');
|
||||||
} else {
|
} else {
|
||||||
args.push(key);
|
args.push(key);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user