Skip to content
HomePagesHomePages template kit

serializeIslandProps

Validate + encode island props for the `<script type="application/json">` payload.

Validate + encode island props for the <script type="application/json"> payload. Throws IslandPropsError naming the offending path. Every < is emitted as its unicode escape so a string value containing a closing script tag cannot break out.

Import from @homepages/template-kit or @homepages/template-kit/island-runtime.

function serializeIslandProps(props: IslandProps): string
Name Type Required Description
props IslandProps required

string