source: node_modules/es-toolkit/dist/string/escape.js

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

Added visualizations

  • Property mode set to 100644
File size: 319 bytes
RevLine 
[a762898]1'use strict';
2
3Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
5const htmlEscapes = {
6 '&': '&amp;',
7 '<': '&lt;',
8 '>': '&gt;',
9 '"': '&quot;',
10 "'": '&#39;',
11};
12function escape(str) {
13 return str.replace(/[&<>"']/g, match => htmlEscapes[match]);
14}
15
16exports.escape = escape;
Note: See TracBrowser for help on using the repository browser.