You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-12-12 21:21:15 +03:00
* (docs) bloom: add jsdocs for all commands * (docs) json: add jsdocs * (docs) search: add jsdocs for all commands * (docs) jsdocs for std commands * (docs) jsdoc comments to time series commands
29 lines
1.1 KiB
TypeScript
29 lines
1.1 KiB
TypeScript
import { CommandParser } from '@redis/client/dist/lib/client/parser';
|
|
import { RedisArgument, MapReply, BlobStringReply, ArrayReply, UnwrapReply, Command } from '@redis/client/dist/lib/RESP/types';
|
|
|
|
export default {
|
|
NOT_KEYED_COMMAND: true,
|
|
IS_READ_ONLY: true,
|
|
/**
|
|
* Dumps the contents of a synonym group.
|
|
* @param parser - The command parser
|
|
* @param index - Name of the index that contains the synonym group
|
|
*/
|
|
parseCommand(parser: CommandParser, index: RedisArgument) {
|
|
parser.push('FT.SYNDUMP', index);
|
|
},
|
|
transformReply: {
|
|
2: (reply: UnwrapReply<ArrayReply<BlobStringReply | ArrayReply<BlobStringReply>>>) => {
|
|
const result: Record<string, ArrayReply<BlobStringReply>> = {};
|
|
let i = 0;
|
|
while (i < reply.length) {
|
|
const key = (reply[i++] as unknown as UnwrapReply<BlobStringReply>).toString(),
|
|
value = reply[i++] as unknown as ArrayReply<BlobStringReply>;
|
|
result[key] = value;
|
|
}
|
|
return result;
|
|
},
|
|
3: undefined as unknown as () => MapReply<BlobStringReply, ArrayReply<BlobStringReply>>
|
|
}
|
|
} as const satisfies Command;
|