function / @typed/template

isComment

Checks if a rendered node is a Comment node.

Package version
1.0.0-beta.13
Category
Native node recognition
Since
1.0.0

Import

import { isComment } from "@typed/template";

Signatures

export declare function isComment(node: Rendered): node is Comment;

Why

Typed uses native comments as transparent dynamic and hydration boundaries.

Ownership and lifetime

The check borrows the native Comment node and does not treat it as a renderer-owned boundary merely because it is a comment.

Examples

import { isComment } from "@typed/template/Wire"

const result = isComment(document.createComment("boundary"))

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source