function allFilesAccepted({
  files,
  accept,
  minSize,
  maxSize,
  multiple,
  maxFiles,
  validator,
}) {
  if (
    (!multiple && files.length > 1) ||
    (multiple && maxFiles >= 1 && files.length > maxFiles)
  ) {
    return false;
  }

  return files.every((file) => {
    const [accepted] = fileAccepted(file, accept);
    const [sizeMatch] = fileMatchSize(file, minSize, maxSize);
    const customErrors = validator ? validator(file) : null;
    return accepted && sizeMatch && !customErrors;
  });
}
@param {object} options
@param {File[]} options.files
@param {string} [options.accept]
@param {number} [options.minSize]
@param {number} [options.maxSize]
@param {boolean} [options.multiple]
@param {number} [options.maxFiles]
@param {(f: File) => FileError|FileError[]|null} [options.validator]
@returns