import template from './node.html' ; import parseTemplate , { TEMPLATE_COMPONENTS } from '@/common/template' ; param html const injectNodeTemplate = ( html ) : string => { const sections = parseTemplate ( html ) ; let injectedTemplate = template ; for ( const section of sections ) { const pattern = TEMPLATE_COMPONENTS . filter ( p => p . id === section . id ) [ 0 ] ; injectedTemplate = injectedTemplate . replace ( pattern . regex , section . html ) ; } return injectedTemplate ; } ; export default injectNodeTemplate ;