couch-kit
    Preparing search index...

    Function frameByteLength

    • Compute the UTF-8 byte length of a raw WebSocket frame payload.

      For binary frames the ArrayBuffer.byteLength is exact. For text frames the UTF-8 size is counted directly from the JS string without allocating an encoder buffer, so an oversized frame can be rejected cheaply.

      Parameters

      • data: string | ArrayBuffer

      Returns number