You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
ref #2565 - fix X[AUTO]CLAIM
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { RedisArgument, TuplesReply, BlobStringReply, ArrayReply, NullReply, UnwrapReply, Command } from '../RESP/types';
|
||||
import { StreamMessageRawReply, isNullReply, transformStreamMessageReply } from './generic-transformers';
|
||||
import { StreamMessageReply, transformStreamMessageNullReply } from './generic-transformers';
|
||||
|
||||
export interface XAutoClaimOptions {
|
||||
COUNT?: number;
|
||||
@@ -7,7 +7,7 @@ export interface XAutoClaimOptions {
|
||||
|
||||
export type XAutoClaimRawReply = TuplesReply<[
|
||||
nextId: BlobStringReply,
|
||||
messages: ArrayReply<StreamMessageRawReply | NullReply>,
|
||||
messages: ArrayReply<StreamMessageReply | NullReply>,
|
||||
deletedMessages: ArrayReply<BlobStringReply>
|
||||
]>;
|
||||
|
||||
@@ -40,9 +40,7 @@ export default {
|
||||
transformReply(reply: UnwrapReply<XAutoClaimRawReply>) {
|
||||
return {
|
||||
nextId: reply[0],
|
||||
messages: (reply[1] as unknown as UnwrapReply<typeof reply[1]>).map(message => {
|
||||
return isNullReply(message) ? null : transformStreamMessageReply(message);
|
||||
}),
|
||||
messages: (reply[1] as unknown as UnwrapReply<typeof reply[1]>).map(transformStreamMessageNullReply),
|
||||
deletedMessages: reply[2]
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user