Documentation / zerotal / view / esc
Function: esc()
esc(
val):string
Defined in: packages/core/src/view/index.ts:74
Escape a raw value for safe use in a context where SafeHtml is not available — e.g. template-literal fallbacks or attribute values built outside JSX. Not needed for normal JSX children (auto-escaped by default).
Parameters
val
unknown
Returns
string
Example
const attr = esc(user.name); // safe inside a raw string template