ts_temp/string/unescape.js
const unescapeRegExp = /&(?:amp|lt|gt|quot|#39);/g;
const htmlUnescapes = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
''': "'",
};
const unescape = (char) => htmlUnescapes[char];
/**
* The inverse of `escape`; this method converts the HTML entities
* `&`, `<`, `>`, `"`, and `'` in `string` to
* their corresponding characters.
*
* @param {string} str The string to unescape.
* @returns {string} Returns the unescaped string.
* @example
*
* unescape('fred, barney, & pebbles'); // => 'fred, barney, & pebbles'
*/
export default (str = '') => str.replace(unescapeRegExp, unescape);