1
0
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:
Ștefan Cenușă
2022-07-07 21:33:58 +03:00
committed by GitHub
parent d2bba1de38
commit f9f5e494dd
2 changed files with 2 additions and 2 deletions

View File

@@ -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']
); );
}); });

View File

@@ -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);
} }