papi-dts
    Preparing search index...

    Function isCleanCloseEvent

    • Whether a close event represents an orderly shutdown rather than a connection that died.

      wasClean is the authoritative answer — it reports whether a closing handshake completed — so it wins whenever the event carries it. Both Chromium and the ws library always set it; the isCleanCloseCode fallback covers a partial or foreign event shape that does not.

      Deciding on the code alone would misreport a close frame that carried no status: that arrives as 1005 with wasClean true, which a plain close() produces on every window close and page reload. Marking those abnormal would bury a genuine socket death under routine noise.

      Parameters

      • ev: unknown

        A WebSocket close event, or anything at all — a non-event is reported as not clean

      Returns boolean

      Whether a closing handshake completed