You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
fix #1724 - fix LINDEX signature
This commit is contained in:
@@ -5,21 +5,21 @@ import { transformArguments } from './LINDEX';
|
|||||||
describe('LINDEX', () => {
|
describe('LINDEX', () => {
|
||||||
it('transformArguments', () => {
|
it('transformArguments', () => {
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
transformArguments('key', 'element'),
|
transformArguments('key', 0),
|
||||||
['LINDEX', 'key', 'element']
|
['LINDEX', 'key', '0']
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
testUtils.testWithClient('client.lIndex', async client => {
|
testUtils.testWithClient('client.lIndex', async client => {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
await client.lIndex('key', 'element'),
|
await client.lIndex('key', 0),
|
||||||
null
|
null
|
||||||
);
|
);
|
||||||
}, GLOBAL.SERVERS.OPEN);
|
}, GLOBAL.SERVERS.OPEN);
|
||||||
|
|
||||||
testUtils.testWithCluster('cluster.lIndex', async cluster => {
|
testUtils.testWithCluster('cluster.lIndex', async cluster => {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
await cluster.lIndex('key', 'element'),
|
await cluster.lIndex('key', 0),
|
||||||
null
|
null
|
||||||
);
|
);
|
||||||
}, GLOBAL.CLUSTERS.OPEN);
|
}, GLOBAL.CLUSTERS.OPEN);
|
||||||
|
@@ -2,8 +2,8 @@ export const FIRST_KEY_INDEX = 1;
|
|||||||
|
|
||||||
export const IS_READ_ONLY = true;
|
export const IS_READ_ONLY = true;
|
||||||
|
|
||||||
export function transformArguments(key: string, element: string): Array<string> {
|
export function transformArguments(key: string, index: number): Array<string> {
|
||||||
return ['LINDEX', key, element];
|
return ['LINDEX', key, index.toString()];
|
||||||
}
|
}
|
||||||
|
|
||||||
export declare function transformReply(): string | null;
|
export declare function transformReply(): string | null;
|
||||||
|
Reference in New Issue
Block a user