import { basename, extname } from "path"; export interface FileInfo { jpegPath: string; jpegSize: number; rawPath?: string; rawSize?: number; } export const getBasenameWithoutExtension = (path: string): string => { const base = basename(path); const extension = extname(path); return base.slice(0, -extension.length); }; export const getBasenameWithExtension = (path: string): string => { return basename(path); }; export const prepareFiles = async (files: string[]): Promise => { if (files.length > 10) { throw new Error("Up to 10 files are allowed at a time."); } const parsedFiles: FileInfo[] = []; for (const pair of files) { const parts = pair.split(/(?