REFACTOR: create builder for parser reporterand fix pdf

This commit is contained in:
marcos-silva-rodrigues
2025-04-29 15:18:46 -03:00
parent 04accb6689
commit 36997403e1
9 changed files with 129 additions and 76 deletions
+3 -2
View File
@@ -1,9 +1,10 @@
import { readFileSync } from 'fs';
import Handlebars from 'handlebars';
import { Parser } from './parser.interface';
export class HtmlParser<T> {
export class HtmlParser<T> implements Parser<T> {
constructor(private readonly templatePath: string) {}
parse(data: T[]) {
async parse(data: T[]) {
const templateSource = readFileSync(this.templatePath, 'utf8');
const template = Handlebars.compile(templateSource);