module internal Validation open System.IO let validateFilePath path = match File.Exists path with | true -> () | false -> raise (new FileNotFoundException (path + " could not be found.")) let validateSaveFileType file = match Path.GetExtension file with | ".jpg" -> () | ".JPG" -> () | ".png" -> () | ".PNG" -> () | _ -> invalidArg "savePath" "The file type must be a .jpg or .png file." let validateIO iPath oPath = validateFilePath iPath validateSaveFileType oPath