1
0
Fork 0
mirror of https://github.com/muerwre/vk-tg-bot.git synced 2025-04-24 22:46:41 +07:00

removed this.processor from template

This commit is contained in:
Fedor Katurov 2021-04-28 15:52:42 +07:00
parent d5228ef146
commit 436a931720

View file

@ -8,7 +8,6 @@ import toVFile from "to-vfile";
import path from "path";
export class Template<T extends Record<string, any>> {
private processor: Processor;
public fields: T = {} as T;
public template: string = "";
@ -18,14 +17,14 @@ export class Template<T extends Record<string, any>> {
return;
}
this.processor = unified()
const processor = unified()
.use(parser)
.use(compiler)
.use(frontmatter)
.use(extract, { yaml: parse });
const file = toVFile.readSync(path.join(__dirname, "../../", filename));
const result = this.processor.processSync(file);
const result = processor.processSync(file);
this.fields = result.data as T;
this.template = result