lib/definitions/command.js
function (validator) {
    if (!_.isFunction(validator)) {
      var err = new Error('Please pass in a function');
      debug(err);
      throw err;
    }
    if (validator.length == 2) {
      return this.validator = validator;
    }

    this.validator = function (data, callback) {
      callback(validator(data));
    };

    return this.validator;
  }
function (validator) {
    if (!_.isFunction(validator)) {
      var err = new Error('Please pass in a function');
      debug(err);
      throw err;
    }
    if (validator.length == 2) {
      return this.validator = validator;
    }

    this.validator = function (data, callback) {
      callback(validator(data));
    };

    return this.validator;
  }
function ( validator ) { if ( ! _ . isFunction ( validator ) ) { var err = new Error ( 'Please pass in a function' ) ; debug ( err ) ; throw err ; } if ( validator . length == 2 ) { return this . validator = validator ; } this . validator = function ( data , callback ) { callback ( validator ( data ) ) ; } ; return this . validator ; }
Injects the validator function.
@param {Function} validator The validator function that should be injected
Injects the validator function .