1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

RedisJSON

This commit is contained in:
Leibale
2023-09-05 18:19:31 -04:00
parent 5bab7fa6fd
commit c12dc79950
36 changed files with 271 additions and 308 deletions

View File

@@ -1,4 +1,4 @@
import { RedisArgument, NumberReply, DoubleReply, NullReply, BlobStringReply, UnwrapReply, Command } from '@redis/client/dist/lib/RESP/types';
import { RedisArgument, ArrayReply, NumberReply, DoubleReply, NullReply, BlobStringReply, UnwrapReply, Command } from '@redis/client/dist/lib/RESP/types';
export default {
FIRST_KEY_INDEX: 1,
@@ -8,8 +8,8 @@ export default {
},
transformReply: {
2: (reply: UnwrapReply<BlobStringReply>) => {
return JSON.parse(reply.toString()) as number | Array<number>;
return JSON.parse(reply.toString()) as number | Array<null | number>;
},
3: undefined as unknown as () => NumberReply | DoubleReply | NullReply
3: undefined as unknown as () => ArrayReply<NumberReply | DoubleReply | NullReply>
}
} as const satisfies Command;