function checkAndFixValidation(fileValidation) {
  if (!fileValidation) return null;
  if (fileValidation.imageOptions) {
    fileValidation.mimeGroup = "image";
    if (fileValidation.imageOptions.width && fileValidation.imageOptions.height) {
      fileValidation.imageOptions.ratio =
        fileValidation.imageOptions.width / fileValidation.imageOptions.height;
      delete fileValidation.imageOptions.height;
    }
  }
  return fileValidation;
}
// or complete object with default options
or complete object with default options
or complete object with default options
function checkAndFixValidation(fileValidation) {
  if (!fileValidation) return null;
  if (fileValidation.imageOptions) {
    fileValidation.mimeGroup = "image";
    if (fileValidation.imageOptions.width && fileValidation.imageOptions.height) {
      fileValidation.imageOptions.ratio =
        fileValidation.imageOptions.width / fileValidation.imageOptions.height;
      delete fileValidation.imageOptions.height;
    }
  }
  return fileValidation;
}
function checkAndFixValidation ( fileValidation ) { if ( ! fileValidation ) return null ; if ( fileValidation . imageOptions ) { fileValidation . mimeGroup = "image" ; if ( fileValidation . imageOptions . width && fileValidation . imageOptions . height ) { fileValidation . imageOptions . ratio = fileValidation . imageOptions . width / fileValidation . imageOptions . height ; delete fileValidation . imageOptions . height ; } } return fileValidation ; }
or complete object with default options
or complete object with default options