1
0
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:
Leibale
2023-07-13 13:42:59 -04:00
parent 54c3a66c72
commit a3e813d3ac
41 changed files with 522 additions and 428 deletions

View File

@@ -1,4 +1,4 @@
import { RedisArgument, Command, NullReply, TuplesReply, BlobStringReply, DoubleReply } from '../RESP/types';
import { RedisArgument, NullReply, TuplesReply, BlobStringReply, DoubleReply, UnwrapReply, Command } from '../RESP/types';
import { RedisVariadicArgument, pushVariadicArguments } from './generic-transformers';
export function transformBZPopArguments(
@@ -20,14 +20,14 @@ export default {
return transformBZPopArguments('BZPOPMAX', ...args);
},
transformReply: {
2: (reply: NullReply | TuplesReply<[BlobStringReply, BlobStringReply, BlobStringReply]>) => {
2(reply: UnwrapReply<NullReply | TuplesReply<[BlobStringReply, BlobStringReply, BlobStringReply]>>) {
return reply === null ? null : {
key: reply[0],
value: reply[1],
score: Number(reply[2])
};
},
3: (reply: NullReply | TuplesReply<[BlobStringReply, BlobStringReply, DoubleReply]>) => {
3(reply: UnwrapReply<NullReply | TuplesReply<[BlobStringReply, BlobStringReply, DoubleReply]>>) {
return reply === null ? null : {
key: reply[0],
value: reply[1],