source: node_modules/es-toolkit/dist/string/unescape.mjs

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 261 bytes
RevLine 
[a762898]1const htmlUnescapes = {
2 '&amp;': '&',
3 '&lt;': '<',
4 '&gt;': '>',
5 '&quot;': '"',
6 '&#39;': "'",
7};
8function unescape(str) {
9 return str.replace(/&(?:amp|lt|gt|quot|#(0+)?39);/g, match => htmlUnescapes[match] || "'");
10}
11
12export { unescape };
Note: See TracBrowser for help on using the repository browser.