API / @aionbuilders/nabu/extend

escapeAttr

Function Stability: stable

Escape a value for a quoted HTML attribute. Same table as escapeHtml; kept as a distinct name so the call sites say what they mean.

Signature

TypeScript
import { escapeAttr } from '@aionbuilders/nabu/extend';
TypeScript
function escapeAttr(value: unknown): string

Parameters

Parameters of escapeAttr
ParameterTypeDescription
valueunknownn/a

Returns

string

Source: src/lib/utils/html.js:31