1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00
This commit is contained in:
Leibale
2023-06-29 14:39:49 -04:00
parent ea2d9d2a77
commit c109fbf751
36 changed files with 584 additions and 720 deletions

View File

@@ -1,4 +1,5 @@
import { RedisArgument, TuplesReply, BlobStringReply, DoubleReply, Command } from '../RESP/types';
import { RedisArgument, Command } from '../RESP/types';
import ZPOPMAX from './ZPOPMAX';
export default {
FIRST_KEY_INDEX: 1,
@@ -6,22 +7,5 @@ export default {
transformArguments(key: RedisArgument) {
return ['ZPOPMIN', key];
},
transformReply: {
2: (reply: TuplesReply<[]> | TuplesReply<[BlobStringReply, BlobStringReply]>) => {
if (reply.length === 0) return null;
return {
value: reply[0],
score: Number(reply[1])
};
},
3: (reply: TuplesReply<[]> | TuplesReply<[BlobStringReply, DoubleReply]>) => {
if (reply.length === 0) return null;
return {
value: reply[0],
score: reply[1]
};
}
}
transformReply: ZPOPMAX.transformReply
} as const satisfies Command;