Skip to content

Commit 02387d3

Browse files
committed
fix: Allow Document to be a ChildNode
Projects such as `parse5` use `Document` for document fragments, which can be the children of DOM nodes.
1 parent 297e440 commit 02387d3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/node.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ export type ChildNode =
2626
| Comment
2727
| ProcessingInstruction
2828
| Element
29-
| CDATA;
29+
| CDATA
30+
// `Document` is also used for document fragments, and can be a child node.
31+
| Document;
3032
export type AnyNode = ParentNode | ChildNode;
3133

3234
/**

0 commit comments

Comments
 (0)