refac tools part 1

This commit is contained in:
Brian Madison
2025-12-22 13:12:25 +08:00
parent 1e721f7fd0
commit 34cfdddd3a
8 changed files with 36 additions and 56 deletions

View File

@@ -1,13 +0,0 @@
/**
* Escape XML special characters in a string
* @param {string} text - The text to escape
* @returns {string} The escaped text
*/
function escapeXml(text) {
if (!text) return '';
return text.replaceAll('&', '&amp;').replaceAll('<', '&lt;').replaceAll('>', '&gt;').replaceAll('"', '&quot;').replaceAll("'", '&apos;');
}
module.exports = {
escapeXml,
};