1 | ;
|
2 | const htmlEntityMap = {
|
3 | '&': '&',
|
4 | '<': '<',
|
5 | '>': '>',
|
6 | '"': '"',
|
7 | ''': '\'',
|
8 | '`': '`',
|
9 | '/': '/',
|
10 | '=': '='
|
11 | };
|
12 | const regexHtml = new RegExp(Object.keys(htmlEntityMap).join('|'), 'g');
|
13 | const unescapeHTML = (str) => {
|
14 | if (typeof str !== 'string')
|
15 | throw new TypeError('str must be a string!');
|
16 | return str.replace(regexHtml, a => htmlEntityMap[a]);
|
17 | };
|
18 | module.exports = unescapeHTML;
|
19 | //# sourceMappingURL=unescape_html.js.map |
\ | No newline at end of file |