isFatal(reply: Reply): reply is FatalReply
Checks if a reply is a fatal reply
Type guard function that narrows the Reply type to FatalReply.
Handle fatal errors
Handle fatal errors
import { assertEquals } from "@std/assert"; import { parseReply, isFatal } from "@hertzg/routeros-api/protocol/reply"; const reply = parseReply(["!fatal", "=message=connection terminated"]); if (isFatal(reply)) { // TypeScript knows reply has message property here assertEquals(reply.message, "connection terminated"); }
reply: Reply
The reply to check
reply is FatalReply
True if the reply is a FatalReply