Skip to content

Commit

Permalink
fix: Allow Document to be a ChildNode
Browse files Browse the repository at this point in the history
Projects such as `parse5` use `Document` for document fragments, which can be the children of DOM nodes.
  • Loading branch information
fb55 committed Apr 30, 2022
1 parent 297e440 commit 02387d3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export type ChildNode =
| Comment
| ProcessingInstruction
| Element
| CDATA;
| CDATA
// `Document` is also used for document fragments, and can be a child node.
| Document;
export type AnyNode = ParentNode | ChildNode;

/**
Expand Down

0 comments on commit 02387d3

Please sign in to comment.