packages/json/lib/commands/ARRLEN.ts
import { CommandParser } from '@redis/client/lib/client/parser';
import { RedisArgument, ArrayReply, NumberReply, NullReply, Command } from '@redis/client/lib/RESP/types';
export interface JsonArrLenOptions {
path?: RedisArgument;
}
export default {
IS_READ_ONLY: true,
parseCommand(parser: CommandParser, key: RedisArgument, options?: JsonArrLenOptions) {
parser.push('JSON.ARRLEN');
parser.pushKey(key);
if (options?.path !== undefined) {
parser.push(options.path);
}
},
transformReply: undefined as unknown as () => NumberReply | ArrayReply<NumberReply | NullReply>
} as const satisfies Command;