UNPKG

html-dom-parser

Version:
45 lines (44 loc) • 976 B
//#region node_modules/entities/dist/decode-codepoint.js const decodeMap = /* @__PURE__ */ new Map([ [0, 65533], [128, 8364], [130, 8218], [131, 402], [132, 8222], [133, 8230], [134, 8224], [135, 8225], [136, 710], [137, 8240], [138, 352], [139, 8249], [140, 338], [142, 381], [145, 8216], [146, 8217], [147, 8220], [148, 8221], [149, 8226], [150, 8211], [151, 8212], [152, 732], [153, 8482], [154, 353], [155, 8250], [156, 339], [158, 382], [159, 376] ]); /** * Replace the given code point with a replacement character if it is a * surrogate or is outside the valid range. Otherwise return the code * point unchanged. * @param codePoint Unicode code point to convert. */ function replaceCodePoint(codePoint) { if (codePoint >= 55296 && codePoint <= 57343 || codePoint > 1114111) return 65533; return decodeMap.get(codePoint) ?? codePoint; } //#endregion exports.replaceCodePoint = replaceCodePoint; //# sourceMappingURL=decode-codepoint.js.map