From 91efa5ab51904667eaf3353008753ea99bf5b17d Mon Sep 17 00:00:00 2001 From: Kevin J Hoerr Date: Thu, 12 Dec 2019 14:30:58 -0500 Subject: Simplify and generalize template processing "For the unit tests. For the unit tests!" --- src/templates.ts | 46 +++++++++++++++++++++------------------------- 1 file changed, 21 insertions(+), 25 deletions(-) (limited to 'src/templates.ts') diff --git a/src/templates.ts b/src/templates.ts index 2ffd0dd..5458a36 100644 --- a/src/templates.ts +++ b/src/templates.ts @@ -1,30 +1,26 @@ -import winston from "winston"; import handlebars from "handlebars"; -import path from "path"; import fs from "fs"; -import loggerConfig from "./util/logger"; -import { configOrError } from "./util/config"; +export interface Template { + inputFile: string; + outputFile: string; + context: object; + data: string | undefined; +} -const logger = winston.createLogger(loggerConfig("TEMPLATE")); +export default (_template: Template): Promise