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