import _ from 'lodash' ; import { ITemplate } from '../interfaces' ; export class TemplateBuilder { private readonly defaultTemplate = { Resources : { } , } ; constructor ( private template ? ) { this . template = _ . merge ( this . defaultTemplate , template || { } ) ; } public withResource ( logicalId , template ) { this . template ! . Resources [ logicalId ] = template ; return this ; } public build ( ) { return this . template as ITemplate ; } }