mirror of
https://github.com/kmitresse/Compo-Service-Log-Project.git
synced 2026-05-13 17:11:49 +00:00
feat: Use container for the API service
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { Parser, CsvParser } from "./index";
|
||||
import { ParserType } from "./index";
|
||||
|
||||
class ParserFactory {
|
||||
/**
|
||||
* Get the parser corresponding to the dataset type
|
||||
* @param fileType The type of the dataset
|
||||
* @returns The parser corresponding to the dataset type
|
||||
*/
|
||||
static getParser(fileType: ParserType): Parser {
|
||||
if (fileType === ParserType.CSV) return CsvParser.instance;
|
||||
throw new Error("Unsupported file type");
|
||||
}
|
||||
}
|
||||
|
||||
export default ParserFactory;
|
||||
Reference in New Issue
Block a user