You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
WIP
This commit is contained in:
@@ -1,13 +1,38 @@
|
||||
import { RedisCommandArguments } from '.';
|
||||
import { transformArguments as transformZInterArguments } from './ZINTER';
|
||||
// import { RedisCommandArguments } from '.';
|
||||
// import { transformArguments as transformZInterArguments } from './ZINTER';
|
||||
|
||||
export { FIRST_KEY_INDEX, IS_READ_ONLY } from './ZINTER';
|
||||
// export { FIRST_KEY_INDEX, IS_READ_ONLY } from './ZINTER';
|
||||
|
||||
export function transformArguments(...args: Parameters<typeof transformZInterArguments>): RedisCommandArguments {
|
||||
return [
|
||||
...transformZInterArguments(...args),
|
||||
'WITHSCORES'
|
||||
];
|
||||
}
|
||||
// export function transformArguments(...args: Parameters<typeof transformZInterArguments>): RedisCommandArguments {
|
||||
// return [
|
||||
// ...transformZInterArguments(...args),
|
||||
// 'WITHSCORES'
|
||||
// ];
|
||||
// }
|
||||
|
||||
export { transformSortedSetWithScoresReply as transformReply } from './generic-transformers';
|
||||
|
||||
|
||||
// // transformSortedSetWithScoresReply
|
||||
|
||||
import { ArrayReply, BlobStringReply, Command, DoubleReply } from '../RESP/types';
|
||||
import ZINTER from './ZINTER';
|
||||
import { transformSortedSetWithScoresReply } from './generic-transformers';
|
||||
|
||||
export default {
|
||||
FIRST_KEY_INDEX: ZINTER.FIRST_KEY_INDEX,
|
||||
IS_READ_ONLY: ZINTER.IS_READ_ONLY,
|
||||
transformArguments(...args: Parameters<typeof ZINTER.transformArguments>) {
|
||||
const redisArgs = ZINTER.transformArguments(...args);
|
||||
redisArgs.push('WITHSCORES');
|
||||
return redisArgs;
|
||||
},
|
||||
transformReply: {
|
||||
2: transformSortedSetWithScoresReply,
|
||||
3: (reply: ArrayReply<[BlobStringReply, DoubleReply]>) => {
|
||||
return reply.map(([member, score]) => ({
|
||||
member,
|
||||
score
|
||||
}));
|
||||
}
|
||||
}
|
||||
} as const satisfies Command;
|
||||
|
Reference in New Issue
Block a user