function checkValueTypesAndFormat(value, types, format) {
  let typesNotInMap = [],
    typesArray = Array.isArray(types) ? types : [types],
    found = typesArray.find((type) => {
      let defaultValue;
      if (typesMap.hasOwnProperty(type)) {
        defaultValue = getDefaultFromTypeAndFormat(type, format);

        // in case the format is a custom format (email, hostname etc.)
        // https://swagger.io/docs/specification/data-models/data-types/#string
        if (!defaultValue && format) {
          defaultValue = '<' + format + '>';
        }
      }
      else {
        typesNotInMap.push(type);
      }
      return defaultValue === value;
    });

  if (found) {
    return true;
  }

  found = typesNotInMap.find((type) => {
    let defaultValue;
    defaultValue = '<' + type + (format ? ('-' + format) : '') + '>';
    return defaultValue === value;
  });

  return found !== undefined;
}
Checks if value is the representation of its type like:
"<integer>"
Works in array types
@param {string} value - Value to check for
@param {*} types - The types in the schema
@param {*} format - format from the schema
@returns {Boolean} the value is the representation of its type