1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

fix #1724 - fix LINDEX signature

This commit is contained in:
leibale
2021-11-16 13:48:56 -05:00
parent 362daf63e4
commit 641d53414f
2 changed files with 6 additions and 6 deletions

View File

@@ -5,21 +5,21 @@ import { transformArguments } from './LINDEX';
describe('LINDEX', () => {
it('transformArguments', () => {
assert.deepEqual(
transformArguments('key', 'element'),
['LINDEX', 'key', 'element']
transformArguments('key', 0),
['LINDEX', 'key', '0']
);
});
testUtils.testWithClient('client.lIndex', async client => {
assert.equal(
await client.lIndex('key', 'element'),
await client.lIndex('key', 0),
null
);
}, GLOBAL.SERVERS.OPEN);
testUtils.testWithCluster('cluster.lIndex', async cluster => {
assert.equal(
await cluster.lIndex('key', 'element'),
await cluster.lIndex('key', 0),
null
);
}, GLOBAL.CLUSTERS.OPEN);

View File

@@ -2,8 +2,8 @@ export const FIRST_KEY_INDEX = 1;
export const IS_READ_ONLY = true;
export function transformArguments(key: string, element: string): Array<string> {
return ['LINDEX', key, element];
export function transformArguments(key: string, index: number): Array<string> {
return ['LINDEX', key, index.toString()];
}
export declare function transformReply(): string | null;