You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
convert "resp types" to interfaces to allow circular references
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { RedisArgument, TuplesReply, BlobStringReply, DoubleReply, Command } from '../RESP/types';
|
||||
import { RedisArgument, TuplesReply, BlobStringReply, DoubleReply, UnwrapReply, Command } from '../RESP/types';
|
||||
|
||||
export default {
|
||||
FIRST_KEY_INDEX: 1,
|
||||
@@ -7,7 +7,7 @@ export default {
|
||||
return ['ZPOPMAX', key];
|
||||
},
|
||||
transformReply: {
|
||||
2: (reply: TuplesReply<[]> | TuplesReply<[BlobStringReply, BlobStringReply]>) => {
|
||||
2: (reply: UnwrapReply<TuplesReply<[] | [BlobStringReply, BlobStringReply]>>) => {
|
||||
if (reply.length === 0) return null;
|
||||
|
||||
return {
|
||||
@@ -15,7 +15,7 @@ export default {
|
||||
score: Number(reply[1])
|
||||
};
|
||||
},
|
||||
3: (reply: TuplesReply<[]> | TuplesReply<[BlobStringReply, DoubleReply]>) => {
|
||||
3: (reply: UnwrapReply<TuplesReply<[] | [BlobStringReply, DoubleReply]>>) => {
|
||||
if (reply.length === 0) return null;
|
||||
|
||||
return {
|
||||
|
Reference in New Issue
Block a user