isComment

import { isComment } from "jsr:@ende/xml";

function

function isComment(node: XmlNode): node is XmlCommentNode

Type guard to check if a node is a comment.

node: XmlNode

The XML node to check.

Returns

true if the node is a comment, false otherwise.

Example: Usage

import { isComment } from "@ende/xml/types";
import { assertEquals } from "@ende/assert";

const node = { type: "comment" as const, text: "A comment" };
assertEquals(isComment(node), true);

Source