1 |
- {"ast":null,"code":"// Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134\nvar _a;\nconst decodeMap = new Map([[0, 65533],\n// C1 Unicode control character reference replacements\n[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]]);\n/**\n * Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point.\n */\nexport const fromCodePoint =\n// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins\n(_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : function (codePoint) {\n let output = \"\";\n if (codePoint > 0xffff) {\n codePoint -= 0x10000;\n output += String.fromCharCode(codePoint >>> 10 & 0x3ff | 0xd800);\n codePoint = 0xdc00 | codePoint & 0x3ff;\n }\n output += String.fromCharCode(codePoint);\n return output;\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 */\nexport function replaceCodePoint(codePoint) {\n var _a;\n if (codePoint >= 0xd800 && codePoint <= 0xdfff || codePoint > 0x10ffff) {\n return 0xfffd;\n }\n return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint;\n}\n/**\n * Replace the code point if relevant, then convert it to a string.\n *\n * @deprecated Use `fromCodePoint(replaceCodePoint(codePoint))` instead.\n * @param codePoint The code point to decode.\n * @returns The decoded code point.\n */\nexport default function decodeCodePoint(codePoint) {\n return fromCodePoint(replaceCodePoint(codePoint));\n}","map":{"version":3,"names":["_a","decodeMap","Map","fromCodePoint","String","codePoint","output","fromCharCode","replaceCodePoint","get","decodeCodePoint"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/entities/lib/esm/decode_codepoint.js"],"sourcesContent":["// Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134\nvar _a;\nconst decodeMap = new Map([\n [0, 65533],\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 * Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point.\n */\nexport const fromCodePoint = \n// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins\n(_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : function (codePoint) {\n let output = \"\";\n if (codePoint > 0xffff) {\n codePoint -= 0x10000;\n output += String.fromCharCode(((codePoint >>> 10) & 0x3ff) | 0xd800);\n codePoint = 0xdc00 | (codePoint & 0x3ff);\n }\n output += String.fromCharCode(codePoint);\n return output;\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 */\nexport function replaceCodePoint(codePoint) {\n var _a;\n if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) {\n return 0xfffd;\n }\n return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint;\n}\n/**\n * Replace the code point if relevant, then convert it to a string.\n *\n * @deprecated Use `fromCodePoint(replaceCodePoint(codePoint))` instead.\n * @param codePoint The code point to decode.\n * @returns The decoded code point.\n */\nexport default function decodeCodePoint(codePoint) {\n return fromCodePoint(replaceCodePoint(codePoint));\n}\n"],"mappings":"AAAA;AACA,IAAIA,E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