import { sevenZipVolume } from '../sevenzip/index.js' /** * Files whose first segment says what an archive holds: named first RAR * volumes (.part01.rar, .rar), 7z (.7z, .7z.001) and `.bin`, an extension * uploaders use for archive volumes too (sniffed by content). */ export function isArchiveStart(name: string): boolean { if (/\.bin$/i.test(name)) return true const volume = sevenZipVolume(name) if (volume === 0 || volume === 1) return true return /\.part0*1\.rar$/i.test(name) || (/\.rar$/i.test(name) && !/\.part\d+\.rar$/i.test(name)) }