encodeWebSocketClosePayload
encodeWebSocketClosePayload(
close):Uint8Array<ArrayBuffer>
Defined in: packages/format-websocket/src/close/websocket-close.ts:44
Encodes a close payload: the status code, then the reason as UTF-8.
Parameters
Section titled “Parameters”code null sends an empty payload, and then reason must be
empty too.
Returns
Section titled “Returns”Uint8Array<ArrayBuffer>
Throws
Section titled “Throws”When the code may not be sent, a reason comes without a code, or the reason exceeds 123 UTF-8 bytes.