/* jshint validthis: true
179993
function checkResponse(err, data) {
		if (err) {
			return callback(err);
		}

		responseParser.parse(data,
			{ format: this.format, logger: this.logger }, getTokens);
		function getTokens(err, tokenResponse) {
			var accessToken, accessSecret;

			if (err) {
				return callback(err);
			}

			return callback();
		}
	}
377041
function validateReturn (validateReturn) {
    // set default if value passed
    if (defined(validateReturn)) {
        immutable.defaultValidateReturn = validateReturn ? true : false
        // return immutable
        return ImmutableCore
    }
    // return default value
    return immutable.defaultValidateReturn
}
613729
function validateFileset(fileset, setter) {
    if (Array.isArray(fileset)) {
        async.each(fileset, function(path, callback) {
            if (typeof path === 'string') {
                callback();
            } else {
                callback(util.format('Invalid path: %s', path));
            }
        }, function(err) {
            if (err) {
                console.log(chalk.red(err));
            } else {
                setter(fileset);
            }
        });
    } else {
        console.log(chalk.red('Fileset is not an array: %j'), fileset);
    }
}
854088
function validateProperty(property, validator) {
    let isValid;
    if (!validator) {
        return void 0;
    }
    if (!property) {
        return void 0;
    }
    const {value} = property;
    const {options} = validator;
    const isValueNullOrUndefined = isNull(value) || isUndefined(value );
    isValid = (() => {
        switch (validator.type) {
            case 'required':
                const prevalidString = '' === property.value ? false : true;
                const prevalidDate = true;
                return true === validator.value ? (!isNull(value) && !isUndefined(value) && prevalidString && prevalidDate) : true;
            case 'regex':
                if (isValueNullOrUndefined) {
                    return true;
                }
                return validator.value.test(value);
            case 'email':
                if (isValueNullOrUndefined) {
                    return true;
                }
                return emailValidation(value, options);
            case 'number':
                return numberValidation(value, options);
            case 'string':
                const stringToValidate = value || '';
                return stringLength(stringToValidate, options);
            case 'date':
                return dateValidation(value, options);
            case 'function':
                return validator.value(value, options);
            case 'checkbox':
                return (isUndefined(value) || isNull(value)) ? false : true;
            default:
                return void 0;
        }
    })();
    if (isUndefined(isValid) || isNull(isValid)) {
        console.warn(`The validator of type: ${validator.type} is not defined`);
    } else if (false === isValid) {
        //Add the name of the property.
        return getErrorLabel(validator.type, property.modelName + '.' + property.name, options); //"The property " + property.name + " is invalid.";
    }
}
1132448
function validate(cmd, args, info) {
  AbstractCommand.prototype.validate.apply(this, arguments);
  var withscores;
  if(args.length > 3) {
    withscores = ('' + args[3]).toLowerCase();
    if(withscores !== Constants.ZSET.WITHSCORES) {
      throw CommandSyntax;
    }
    args[3] = withscores;
  }
}
671458
function dethrow(fn)
	{
		try
		{
			/* jshint validthis: true */
			return fn.apply(this, Array.prototype.slice.call(arguments, 1));
		}
		catch (e) {}
	}
1027608
function (f) {
    var self = this;

    if (typeof f !== 'function')
      throw new Error("onInvalidate requires a function");

    if (self.invalidated) {
      Deps.nonreactive(function () {
        callWithNoYieldsAllowed(f, self);
      });
    } else {
      self._onInvalidateCallbacks.push(f);
    }
  }
399026
function isValid(name, value) {
    var tests = {
        indent: function (value) {
            return (/^(\s*|\d*)$/).test(value);
        },
        openbrace: function (value) {
            return (['end-of-line', 'separate-line']).indexOf(value) !== -1;
        },
        autosemicolon: function (value) {
            return typeof value === 'boolean';
        }
    };

    return Boolean(tests[name] && tests[name](value));
}
155355
function () {
    /*jshint loopfunc:true */
    var checks = asyncTrigger();
    var token;


    function isReserved(token, isProperty) {
      if (!token.reserved) {
        return false;
      }
      var meta = token.meta;

      if (meta && meta.isFutureReservedWord && state.option.inES5()) {
        // ES3 FutureReservedWord in an ES5 environment.
        if (!meta.es5) {
          return false;
        }

        // Some ES5 FutureReservedWord identifiers are active only
        // within a strict mode environment.
        if (meta.strictOnly) {
          if (!state.option.strict && !state.directive["use strict"]) {
            return false;
          }
        }

        if (isProperty) {
          return false;
        }
      }

      return true;
    }

    // Produce a token object.
    var create = function (type, value, isProperty) {
      /*jshint validthis:true */
      var obj;

      if (type !== "(endline)" && type !== "(end)") {
        this.prereg = false;
      }

      if (type === "(punctuator)") {
        switch (value) {
        case ".":
        case ")":
        case "~":
        case "#":
        case "]":
          this.prereg = false;
          break;
        default:
          this.prereg = true;
        }

        obj = Object.create(state.syntax[value] || state.syntax["(error)"]);
      }

      if (type === "(identifier)") {
        if (value === "return" || value === "case" || value === "typeof") {
          this.prereg = true;
        }

        if (_.has(state.syntax, value)) {
          obj = Object.create(state.syntax[value] || state.syntax["(error)"]);

          // If this can't be a reserved keyword, reset the object.
          if (!isReserved(obj, isProperty && type === "(identifier)")) {
            obj = null;
          }
        }
      }

      if (!obj) {
        obj = Object.create(state.syntax[type]);
      }

      obj.identifier = (type === "(identifier)");
      obj.type = obj.type || type;
      obj.value = value;
      obj.line = this.line;
      obj.character = this.char;
      obj.from = this.from;

      if (isProperty && obj.identifier) {
        obj.isProperty = isProperty;
      }

      obj.check = checks.check;

      return obj;
    }.bind(this);

    for (;;) {
      if (!this.input.length) {
        return create(this.nextLine() ? "(endline)" : "(end)", "");
      }

      token = this.next(checks);

      if (!token) {
        if (this.input.length) {
          // Unexpected character.
          this.trigger("error", {
            code: "E024",
            line: this.line,
            character: this.char,
            data: [ this.peek() ]
          });

          this.input = "";
        }

        continue;
      }

      switch (token.type) {
      case Token.StringLiteral:
        this.triggerAsync("String", {
          line: this.line,
          char: this.char,
          from: this.from,
          value: token.value,
          quote: token.quote
        }, checks, function () { return true; });

        return create("(string)", token.value);

      case Token.TemplateLiteral:
        this.trigger("Template", {
          line: this.line,
          char: this.char,
          from: this.from,
          value: token.value
        });
        return create("(template)", token.value);

      case Token.Identifier:
        this.trigger("Identifier", {
          line: this.line,
          char: this.char,
          from: this.form,
          name: token.value,
          isProperty: state.tokens.curr.id === "."
        });

        /* falls through */
      case Token.Keyword:
      case Token.NullLiteral:
      case Token.BooleanLiteral:
        return create("(identifier)", token.value, state.tokens.curr.id === ".");

      case Token.NumericLiteral:
        if (token.isMalformed) {
          this.trigger("warning", {
            code: "W045",
            line: this.line,
            character: this.char,
            data: [ token.value ]
          });
        }

        this.triggerAsync("warning", {
          code: "W114",
          line: this.line,
          character: this.char,
          data: [ "0x-" ]
        }, checks, function () { return token.base === 16 && state.jsonMode; });

        this.triggerAsync("warning", {
          code: "W115",
          line: this.line,
          character: this.char
        }, checks, function () {
          return state.directive["use strict"] && token.base === 8;
        });

        this.trigger("Number", {
          line: this.line,
          char: this.char,
          from: this.from,
          value: token.value,
          base: token.base,
          isMalformed: token.malformed
        });

        return create("(number)", token.value);

      case Token.RegExp:
        return create("(regexp)", token.value);

      case Token.Comment:
        state.tokens.curr.comment = true;

        if (token.isSpecial) {
          return {
            id: '(comment)',
            value: token.value,
            body: token.body,
            type: token.commentType,
            isSpecial: token.isSpecial,
            line: this.line,
            character: this.char,
            from: this.from
          };
        }

        break;

      case "":
        break;

      default:
        return create("(punctuator)", token.value);
      }
    }
  }
1269684
function error(utils) {
  const target = this._obj;
  isValidation(target);
  const error = target.error || null,
      json = JSON.stringify(target, null, '\t');
  this.assert(null !== error,
      '#{this} should have error but does not: ' + json,
      '#{this} should not not have error but does: ' + json
  );
  utils.flag(this, 'object', error);
}
812987
function booleanFalse(validatedObject, errorText) {
  if (!_.isBoolean(validatedObject) || validatedObject) {
    throw new ValidationError(errorText || 'Validated object is not False');
  }
  return validatedObject;
}
578407
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);
  }
}
783231
function parseAndAutoValidate(json) {
  try {
    const obj = JSON.parse(json);
    return autoValidate(obj);
  } catch (error) {
    return { isValid: false, error: error };
  }
}
708054
function _isValid(position, activeMaskset, c, strict) {
                    var testPos = determineTestPosition(position), loopend = c ? 1 : 0, chrs = '', buffer = activeMaskset["buffer"];
                    for (var i = activeMaskset['tests'][testPos].cardinality; i > loopend; i--) {
                        chrs += getBufferElement(buffer, testPos - (i - 1));
                    }

                    if (c) {
                        chrs += c;
                    }

                    //return is false or a json object => { pos: ??, c: ??} or true
                    return activeMaskset['tests'][testPos].fn != null ?
                        activeMaskset['tests'][testPos].fn.test(chrs, buffer, position, strict, opts)
                        : (c == getBufferElement(activeMaskset['_buffer'], position, true) || c == opts.skipOptionalPartCharacter) ?
                            { "refresh": true, c: getBufferElement(activeMaskset['_buffer'], position, true), pos: position }
                            : false;
                }
935783
function _fnCheck(callback, data) {
                if (angular.isUndefinedOrNull(data) || angular.isArray(data)) {
                    return; // jmp out
                }

                if (angular.isFunction(callback)) {
                    return callback(data, $filter);
                } else {
                    if (typeof callback === 'boolean') {
                        data = !!data;
                        return data === callback;
                    } else if (angular.isDefined(callback)) {
                        try {
                            var _regex = new RegExp(callback);
                            return _regex.test(data);
                        }
                        catch (err) {
                            if (typeof data === 'string') {
                                return data.indexOf(callback) > -1;
                            } else {
                                return; // jmp out
                            }
                        }
                    } else {
                        return; // jmp out
                    }
                }
            }
266864
function isValidId(value :any) :boolean {

  return Object.prototype.toString.call(value) === STRING_TAG && value.length > 0;
}
984587
function validation() {
  const target = this._obj;
  this.assert(_.isObject(target), '#{this} is not a Joi validation because it must be an object');
  this.assert(!_.isEmpty(target), '#{this} is not a Joi validation because it is an empty object');
  const fields = _.keys(target);
  const allFieldsPresent = _.every(FIELDS_TO_VALIDATE.map(field => _.includes(fields, field)));

  this.assert(
    allFieldsPresent,
    `${this} is not a validation because it does not contain expected keys`
  );
}