import { CodeSection } from "../types/CodeSection"; import { renderHTML } from "./html"; import { renderScript } from "./script"; import { renderStyle } from "./style"; export function render( sections: CodeSection[] ): string { return sections.map( (section: CodeSection) => { switch( section.type ) { case 'html': return renderHTML( section ); case 'script': return renderScript( section ); case 'style': return renderStyle( section ); } }).join('\n\n'); }