source: node_modules/es-toolkit/dist/string/escape.mjs@ ba17441

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

Added visualizations

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