You've already forked node-redis
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:
@@ -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);
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user