mirror of
https://github.com/kmitresse/Compo-Service-Log-Project.git
synced 2026-05-13 17:11:49 +00:00
13 lines
401 B
TypeScript
13 lines
401 B
TypeScript
import { Archive, ZipArchive, ArchiveType, GzipArchive } from "./";
|
|
|
|
class ArchiveFactory {
|
|
static getArchive(archiveType: ArchiveType): Archive {
|
|
if (archiveType === ArchiveType.ZIP) return ZipArchive.instance;
|
|
if ([ArchiveType.GZIP, ArchiveType.GZ].includes(archiveType)) return GzipArchive.instance;
|
|
|
|
throw new Error("Unsupported archive type");
|
|
}
|
|
}
|
|
|
|
export default ArchiveFactory;
|