function normalizeFrame
Since 0.2.0
normalizeFrame(data: unknown): string | Uint8Array

Normalizes an inbound frame payload to the framework's string | Uint8Array.

Binary frames arrive as ArrayBuffer on Deno and Workers and may arrive as a typed-array view elsewhere; both become a Uint8Array view without copying. Anything else is stringified so a handler never receives an unusable value.

Parameters

data: unknown

The raw event payload

Return Type

string | Uint8Array

The normalized payload

Usage

import { normalizeFrame } from "runtime/src/index.ts";