This commit is contained in:
lalBi94
2023-03-05 13:23:23 +01:00
commit 7bc56c09b5
14034 changed files with 1834369 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
import createHeadTailPlaceholders from './create-head-tail-placeholders'
/**
* Create the template meta object in case of <template> fragments
* @param {TemplateChunk} componentTemplate - template chunk object
* @returns {Object} the meta property that will be passed to the mount function of the TemplateChunk
*/
export default function createTemplateMeta(componentTemplate) {
const fragment = componentTemplate.dom.cloneNode(true)
const {head, tail} = createHeadTailPlaceholders()
return {
avoidDOMInjection: true,
fragment,
head,
tail,
children: [head, ...Array.from(fragment.childNodes), tail]
}
}