Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
potatowagon committed Sep 19, 2024
1 parent 3c00c3a commit da5fa35
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/lexical/src/LexicalUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1686,6 +1686,17 @@ export function isHTMLElement(x: Node | EventTarget): x is HTMLElement {
return x.nodeType === 1;
}

/**
* @param x - The element being testing
* @returns Returns true if x is a document fragment, false otherwise.
*/
export function isDocumentFragment(
x: Node | EventTarget,
): x is DocumentFragment {
// @ts-ignore-next-line - strict check on nodeType here should filter out non-Element EventTarget implementors
return x.nodeType === 11;
}

/**
*
* @param node - the Dom Node to check
Expand Down

0 comments on commit da5fa35

Please sign in to comment.