lib/command/server/slowlog.js
function validate(cmd, args, info) {
  AbstractCommand.prototype.validate.apply(this, arguments);
  var sub = info.command.sub
    , scmd = ('' + sub.cmd)
    , args = sub.args
    , amount;

  if(scmd === Constants.SUBCOMMAND.slowlog.get.name && args.length) {
    if(args.length > 1) {
      throw new CommandArgLength(cmd, scmd);
    }
    amount = parseInt('' + args[0]);
    if(isNaN(amount)) {
      throw IntegerRange;
    }
    args[0] = amount;
  }
}
function validate(cmd, args, info) {
  AbstractCommand.prototype.validate.apply(this, arguments);
  var sub = info.command.sub
    , scmd = ('' + sub.cmd)
    , args = sub.args
    , amount;

  if(scmd === Constants.SUBCOMMAND.slowlog.get.name && args.length) {
    if(args.length > 1) {
      throw new CommandArgLength(cmd, scmd);
    }
    amount = parseInt('' + args[0]);
    if(isNaN(amount)) {
      throw IntegerRange;
    }
    args[0] = amount;
  }
}
function validate ( cmd , args , info ) { AbstractCommand . prototype . validate . apply ( this , arguments ) ; var sub = info . command . sub , scmd = ( '' + sub . cmd ) , args = sub . args , amount ; if ( scmd === Constants . SUBCOMMAND . slowlog . get . name && args . length ) { if ( args . length > 1 ) { throw new CommandArgLength ( cmd , scmd ) ; } amount = parseInt ( '' + args [ 0 ] ) ; if ( isNaN ( amount ) ) { throw IntegerRange ; } args [ 0 ] = amount ; } }
Validate the SLOWLOG subcommands.
Validate the SLOWLOG subcommands .