mirror of
https://github.com/LucasVbr/LucasVbr.git
synced 2026-05-13 17:11:52 +00:00
48bde33a0e
Took 5 hours 7 minutes
22 lines
669 B
TypeScript
22 lines
669 B
TypeScript
import {type Compiler, CompilerType, HandlebarsCompiler} from '.';
|
|
|
|
/**
|
|
* Factory class for creating compiler instances.
|
|
* This class provides a method to get a compiler based on the specified type.
|
|
*/
|
|
export class CompilerFactory {
|
|
|
|
/**
|
|
* Creates a compiler instance based on the specified type.
|
|
* @param type - The type of compiler to create.
|
|
* @returns An instance of the specified compiler.
|
|
*/
|
|
public static getCompiler(type: CompilerType): Compiler {
|
|
switch (type) {
|
|
case CompilerType.HANDLEBARS:
|
|
return HandlebarsCompiler.getInstance();
|
|
default:
|
|
throw new Error(`Unsupported compiler type: ${type}`);
|
|
}
|
|
}
|
|
} |