import fs from 'fs' ; import * as Handlebars from 'handlebars' ; import { Options } from './options' ; /**
 * Handlebars manager
 */ export class HandlebarsManager { public instance : typeof Handlebars = Handlebars ; public readCustomJsFile ( options ) { const customDir = options . templates || '' ; const handlerbarsJsFile = customDir ? `${ customDir }/handlebars.js` : null ; if ( handlerbarsJsFile && fs . existsSync ( handlerbarsJsFile ) ) { const handlebarsFn = require ( fs . realpathSync ( handlerbarsJsFile ) ) ; if ( handlebarsFn && typeof handlebarsFn === 'function' ) { handlebarsFn . call ( this . instance , this . instance ) ; } } } }