/var/www/verywell.gr/server/delivery/node_modules/ent
NameSizeModeActions
examples/-0755rm
test/-0755rm
.npmignore60644editdlrm
.travis.yml430644editdlrm
decode.js10590644editdlrm
encode.js10510644editdlrm
entities.json578740644editdlrm
index.js760644editdlrm
LICENSE10730644editdlrm
package.json8310644editdlrm
readme.markdown13880644editdlrm
reversed.json306840644editdlrm
Edit: /var/www/verywell.gr/server/delivery/node_modules/ent/decode.js (1059B)
var punycode = require('punycode'); var entities = require('./entities.json'); module.exports = decode; function decode (str) { if (typeof str !== 'string') { throw new TypeError('Expected a String'); } return str.replace(/&(#?[^;\W]+;?)/g, function (_, match) { var m; if (m = /^#(\d+);?$/.exec(match)) { return punycode.ucs2.encode([ parseInt(m[1], 10) ]); } else if (m = /^#[Xx]([A-Fa-f0-9]+);?/.exec(match)) { return punycode.ucs2.encode([ parseInt(m[1], 16) ]); } else { // named entity var hasSemi = /;$/.test(match); var withoutSemi = hasSemi ? match.replace(/;$/, '') : match; var target = entities[withoutSemi] || (hasSemi && entities[match]); if (typeof target === 'number') { return punycode.ucs2.encode([ target ]); } else if (typeof target === 'string') { return target; } else { return '&' + match; } } }); }