You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
28 lines
764 B
TypeScript
28 lines
764 B
TypeScript
import { NumberReply, Command } from '../RESP/types';
|
|
import { RedisVariadicArgument, pushVariadicArgument } from './generic-transformers';
|
|
|
|
export interface ZInterCardOptions {
|
|
LIMIT?: number;
|
|
}
|
|
|
|
export default {
|
|
FIRST_KEY_INDEX: 2,
|
|
IS_READ_ONLY: true,
|
|
transformArguments(
|
|
keys: RedisVariadicArgument,
|
|
options?: ZInterCardOptions['LIMIT'] | ZInterCardOptions
|
|
) {
|
|
const args = pushVariadicArgument(['ZINTERCARD'], keys);
|
|
|
|
// backwards compatibility
|
|
if (typeof options === 'number') {
|
|
args.push('LIMIT', options.toString());
|
|
} else if (options?.LIMIT) {
|
|
args.push('LIMIT', options.LIMIT.toString());
|
|
}
|
|
|
|
return args;
|
|
},
|
|
transformReply: undefined as unknown as () => NumberReply
|
|
} as const satisfies Command;
|