Server IP : 92.205.26.207 / Your IP : 216.73.216.16 Web Server : Apache System : Linux 207.26.205.92.host.secureserver.net 4.18.0-553.60.1.el8_10.x86_64 #1 SMP Thu Jul 10 04:01:16 EDT 2025 x86_64 User : zikryat ( 1002) PHP Version : 8.3.23 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/zikryat/public_html/node_modules/universalify/../ent/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
var punycode = require('punycode'); var revEntities = require('./reversed.json'); module.exports = encode; function encode (str, opts) { if (typeof str !== 'string') { throw new TypeError('Expected a String'); } if (!opts) opts = {}; var numeric = true; if (opts.named) numeric = false; if (opts.numeric !== undefined) numeric = opts.numeric; var special = opts.special || { '"': true, "'": true, '<': true, '>': true, '&': true }; var codePoints = punycode.ucs2.decode(str); var chars = []; for (var i = 0; i < codePoints.length; i++) { var cc = codePoints[i]; var c = punycode.ucs2.encode([ cc ]); var e = revEntities[cc]; if (e && (cc >= 127 || special[c]) && !numeric) { chars.push('&' + (/;$/.test(e) ? e : e + ';')); } else if (cc < 32 || cc >= 127 || special[c]) { chars.push('&#' + cc + ';'); } else { chars.push(c); } } return chars.join(''); }