UNPKG

@vendure/ngx-translate-extract

Version:
19 lines (18 loc) 696 B
import { CompilerType } from './compiler.interface.js'; import { JsonCompiler } from './json.compiler.js'; import { NamespacedJsonCompiler } from './namespaced-json.compiler.js'; import { PoCompiler } from './po.compiler.js'; export class CompilerFactory { static create(format, options) { switch (format) { case CompilerType.Pot: return new PoCompiler(options); case CompilerType.Json: return new JsonCompiler(options); case CompilerType.NamespacedJson: return new NamespacedJsonCompiler(options); default: throw new Error(`Unknown format: ${format}`); } } }