1 var decodeMap = require("../maps/decode.json");
3 module.exports = decodeCodePoint;
5 // modified version of https://github.com/mathiasbynens/he/blob/master/src/he.js#L94-L119
6 function decodeCodePoint(codePoint) {
7 if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) {
11 if (codePoint in decodeMap) {
12 codePoint = decodeMap[codePoint];
17 if (codePoint > 0xffff) {
19 output += String.fromCharCode(((codePoint >>> 10) & 0x3ff) | 0xd800);
20 codePoint = 0xdc00 | (codePoint & 0x3ff);
23 output += String.fromCharCode(codePoint);