@web3r/flowerkit
Version:
Tree-shakable JavaScript and TypeScript utility library for frontend/browser apps: DOM, events, arrays, objects, strings, date, JSON, and network helpers (ESM/CJS, SSR-friendly).
14 lines (13 loc) • 559 B
text/typescript
export type TGetStrEscapedArgs = Parameters<typeof getStrEscaped>;
export type TGetStrEscapedReturn = ReturnType<typeof getStrEscaped>;
/**
* Escapes special HTML characters to their corresponding entities.
* Escaped: `& < > " '`
* @param {string} str Source string
* @returns {string} Escaped string safe for HTML text context
* @throws {TypeError} If str is not a string
* @example
* getStrEscaped('<b>Hello & "world"</b>');
* // => "<b>Hello & "world"</b>"
*/
export declare const getStrEscaped: (str: string) => string;