Project Init

This commit is contained in:
Muluhabt
2026-05-29 15:23:46 +03:00
commit 2fbc557aac
67387 changed files with 6063341 additions and 0 deletions

26
node_modules/es-toolkit/dist/string/escape.mjs generated vendored Normal file
View File

@@ -0,0 +1,26 @@
//#region src/string/escape.ts
const htmlEscapes = {
"&": "&",
"<": "&lt;",
">": "&gt;",
"\"": "&quot;",
"'": "&#39;"
};
/**
* Converts the characters "&", "<", ">", '"', and "'" in `str` to their corresponding HTML entities.
* For example, "<" becomes "&lt;".
*
* @param {string} str The string to escape.
* @returns {string} Returns the escaped string.
*
* @example
* escape('This is a <div> element.'); // returns 'This is a &lt;div&gt; element.'
* escape('This is a "quote"'); // returns 'This is a &quot;quote&quot;'
* escape("This is a 'quote'"); // returns 'This is a &#39;quote&#39;'
* escape('This is a & symbol'); // returns 'This is a &amp; symbol'
*/
function escape(str) {
return str.replace(/[&<>"']/g, (match) => htmlEscapes[match]);
}
//#endregion
export { escape };