import { Command } from "./command.js";
/**
 * @see https://redis.io/commands/json.set
 */
export class JsonSetCommand extends Command {
    constructor(cmd, opts) {
        const command = ["JSON.SET", cmd[0], cmd[1], cmd[2]];
        if (cmd[3]) {
            if (cmd[3].nx) {
                command.push("NX");
            }
            else if (cmd[3].xx) {
                command.push("XX");
            }
        }
        super(command, opts);
    }
}
