NodeRedis/node-redis

View on GitHub
packages/client/lib/sentinel/commands/SENTINEL_SET.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { CommandParser } from '../../client/parser';
import { RedisArgument, SimpleStringReply, Command } from '../../RESP/types';

export type SentinelSetOptions = Array<{
  option: RedisArgument;
  value: RedisArgument;
}>;

export default {
  parseCommand(parser: CommandParser, dbname: RedisArgument, options: SentinelSetOptions) {
    parser.push('SENTINEL', 'SET', dbname);

    for (const option of options) {
      parser.push(option.option, option.value);
    }
  },
  transformReply: undefined as unknown as () => SimpleStringReply<'OK'> 
} as const satisfies Command;