unescape
Converts the HTML entities & < > " ' back to their original characters. It is the inverse of escape.
Only the five entities produced by escape are converted, and leading 0s in numeric references are ignored. (''' → "'") Other entities ( , ', etc.) are left untouched.
Code
Interface
typescript
function unescape(str: string): string;
Usage
typescript
import { unescape } from '@modern-kit/utils';
unescape('This is a <div> element.'); // 'This is a <div> element.'
unescape('This is a "quote"'); // 'This is a "quote"'
unescape('This is a 'quote''); // "This is a 'quote'"
unescape('This is a & symbol'); // 'This is a & symbol'
// Scans the string only once, so converted results are not converted again
unescape('&lt;'); // '<'