lib/command/server/shutdown.js
function validate(cmd, args, info) {
  AbstractCommand.prototype.validate.apply(this, arguments);
  if(args[0]) {
    var arg = ('' + args[0]).toLowerCase();
    if(arg !== Constants.SHUTDOWN.SAVE && arg !== Constants.SHUTDOWN.NOSAVE) {
      throw CommandSyntax;
    }

    // rewrite with boolean
    args[0] = (arg === Constants.SHUTDOWN.SAVE);
  }
}
function validate(cmd, args, info) {
  AbstractCommand.prototype.validate.apply(this, arguments);
  if(args[0]) {
    var arg = ('' + args[0]).toLowerCase();
    if(arg !== Constants.SHUTDOWN.SAVE && arg !== Constants.SHUTDOWN.NOSAVE) {
      throw CommandSyntax;
    }

    // rewrite with boolean
    args[0] = (arg === Constants.SHUTDOWN.SAVE);
  }
}
function validate ( cmd , args , info ) { AbstractCommand . prototype . validate . apply ( this , arguments ) ; if ( args [ 0 ] ) { var arg = ( '' + args [ 0 ] ) . toLowerCase ( ) ; if ( arg !== Constants . SHUTDOWN . SAVE && arg !== Constants . SHUTDOWN . NOSAVE ) { throw CommandSyntax ; } // rewrite with boolean args [ 0 ] = ( arg === Constants . SHUTDOWN . SAVE ) ; } }
Validate the SHUTDOWN command.
Validate the SHUTDOWN command .