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 { NullReply, TuplesReply, NumberReply, BlobStringReply, DoubleReply, Command } from '../RESP/types';
import { NullReply, TuplesReply, NumberReply, BlobStringReply, DoubleReply, UnwrapReply, Command } from '../RESP/types';
import ZRANK from './ZRANK';
export default {
@@ -10,7 +10,7 @@ export default {
return redisArgs;
},
transformReply: {
2: (reply: NullReply | TuplesReply<[NumberReply, BlobStringReply]>) => {
2: (reply: UnwrapReply<NullReply | TuplesReply<[NumberReply, BlobStringReply]>>) => {
if (reply === null) return null;
return {
@@ -18,7 +18,7 @@ export default {
score: Number(reply[1])
};
},
3: (reply: NullReply | TuplesReply<[BlobStringReply, DoubleReply]>) => {
3: (reply: UnwrapReply<NullReply | TuplesReply<[BlobStringReply, DoubleReply]>>) => {
if (reply === null) return null;
return {