function / @typed/template

isSerializableSpreadKey

Reports whether a dynamic spread key may be serialized into SSR HTML.

Package version
1.0.0-beta.13
Category
Spread serialization
Since
1.0.0

Import

import { isSerializableSpreadKey } from "@typed/template";

Signatures

export declare function isSerializableSpreadKey(key: string): boolean;

Why

DOM properties, event handlers, refs, on* attributes, invalid names, and prototype-sensitive keys are not HTML attributes. Rejecting them here keeps server output aligned with the web platform and avoids treating object data as trusted markup.

Ownership and lifetime

This pure predicate retains neither the key nor any application value.

Examples

import { isSerializableSpreadKey } from "@typed/template/HtmlChunk"

isSerializableSpreadKey("aria-label") // true
isSerializableSpreadKey("onclick") // false

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source