1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-03 04:01:40 +03:00
Files
2023-09-05 18:19:31 -04:00

21 lines
577 B
TypeScript

import { RedisArgument, NumberReply, ArrayReply, NullReply, Command } from '@redis/client/dist/lib/RESP/types';
export interface JsonObjLenOptions {
path?: RedisArgument;
}
export default {
FIRST_KEY_INDEX: 1,
IS_READ_ONLY: true,
transformArguments(key: RedisArgument, options?: JsonObjLenOptions) {
const args = ['JSON.OBJLEN', key];
if (options?.path !== undefined) {
args.push(options.path);
}
return args;
},
transformReply: undefined as unknown as () => NumberReply | ArrayReply<NumberReply | NullReply>
} as const satisfies Command;