Skip to content

Commit 5b29444

Browse files
committed
allow ${undefined} in DocumentComponent.tag
1 parent 977e694 commit 5b29444

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/DocumentComponent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ export class DocumentComponent extends NodeComponent<DocumentFragment> {
3232
const idPrefix = `tag-${crypto.randomUUID()}-`;
3333
const nodes: NodeComponent<any>[] = [];
3434
const doc = new DocumentComponent(strings.reduce((acc, str, index) => {
35+
if (index >= components.length) return acc + str;
3536
const component = components[index - 1];
36-
if (component === undefined) return acc + str;
3737
if (component instanceof NodeComponent) {
3838
nodes.push(component);
3939
return acc + `${str}<slot name="${idPrefix}${nodes.length - 1}"></slot>`;

0 commit comments

Comments
 (0)