es-toolkit
Version:
A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.
17 lines • 689 B
TypeScript
//#region src/compat/string/unescape.d.ts
/**
* Converts the HTML entities `&`, `<`, `>`, `"`, and `'` in `str` to their corresponding characters.
* It is the inverse of `escape`.
*
* @param str The string to unescape.
* @returns Returns the unescaped string.
*
* @example
* unescape('This is a <div> element.'); // returns 'This is a <div> element.'
* unescape('This is a "quote"'); // returns 'This is a "quote"'
* unescape('This is a 'quote''); // returns 'This is a 'quote''
* unescape('This is a & symbol'); // returns 'This is a & symbol'
*/
declare function unescape(str?: string): string;
//#endregion
export { unescape };