Skip to content

Commit 4bee30f

Browse files
committed
unwrap json.type in resp3 from extra array
1 parent f0af1eb commit 4bee30f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/json/lib/commands/TYPE.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NullReply, BlobStringReply, ArrayReply, Command, RedisArgument } from '@redis/client/dist/lib/RESP/types';
1+
import { NullReply, BlobStringReply, ArrayReply, Command, RedisArgument, UnwrapReply } from '@redis/client/dist/lib/RESP/types';
22

33
export interface JsonTypeOptions {
44
path?: RedisArgument;
@@ -18,8 +18,9 @@ export default {
1818
},
1919
transformReply: {
2020
2: undefined as unknown as () => NullReply | BlobStringReply | ArrayReply<BlobStringReply | NullReply>,
21-
3: undefined as unknown as () => ArrayReply<NullReply | BlobStringReply | ArrayReply<BlobStringReply | NullReply>>
21+
3: (reply: UnwrapReply<ArrayReply<NullReply | BlobStringReply | ArrayReply<BlobStringReply | NullReply>>>) => {
22+
return reply[0];
23+
}
2224
},
23-
unstableResp3Module: true
2425
} as const satisfies Command;
2526

0 commit comments

Comments
 (0)