UNPKG

html-dom-parser

Version:
1 lines 2.68 kB
{"version":3,"file":"decode-codepoint.mjs","sources":["../../../../node_modules/entities/dist/decode-codepoint.js"],"sourcesContent":["// Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134\nconst decodeMap = new Map([\n [0, 65_533],\n // C1 Unicode control character reference replacements\n [128, 8364],\n [130, 8218],\n [131, 402],\n [132, 8222],\n [133, 8230],\n [134, 8224],\n [135, 8225],\n [136, 710],\n [137, 8240],\n [138, 352],\n [139, 8249],\n [140, 338],\n [142, 381],\n [145, 8216],\n [146, 8217],\n [147, 8220],\n [148, 8221],\n [149, 8226],\n [150, 8211],\n [151, 8212],\n [152, 732],\n [153, 8482],\n [154, 353],\n [155, 8250],\n [156, 339],\n [158, 382],\n [159, 376],\n]);\n/**\n * Replace the given code point with a replacement character if it is a\n * surrogate or is outside the valid range. Otherwise return the code\n * point unchanged.\n * @param codePoint Unicode code point to convert.\n */\nexport function replaceCodePoint(codePoint) {\n if ((codePoint >= 0xd8_00 && codePoint <= 0xdf_ff) ||\n codePoint > 0x10_ff_ff) {\n return 0xff_fd;\n }\n return decodeMap.get(codePoint) ?? codePoint;\n}\n//# sourceMappingURL=decode-codepoint.js.map"],"names":[],"mappings":"AAAA;AACA,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC;AAC1B,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC;AACf;AACA,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC;AACf,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC;AACf,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC;AACd,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC;AACf,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC;AACf,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC;AACf,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC;AACf,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC;AACd,IA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