aizryu.js 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (343) hide show
  1. package/.cache/replit/__replit_disk_meta.json +1 -0
  2. package/.cache/replit/modules.stamp +0 -0
  3. package/.cache/replit/nix/env.json +1 -0
  4. package/.cache/typescript/5.0/node_modules/.package-lock.json +156 -0
  5. package/.cache/typescript/5.0/node_modules/@types/body-parser/LICENSE +21 -0
  6. package/.cache/typescript/5.0/node_modules/@types/body-parser/README.md +15 -0
  7. package/.cache/typescript/5.0/node_modules/@types/body-parser/index.d.ts +95 -0
  8. package/.cache/typescript/5.0/node_modules/@types/body-parser/package.json +58 -0
  9. package/.cache/typescript/5.0/node_modules/@types/connect/LICENSE +21 -0
  10. package/.cache/typescript/5.0/node_modules/@types/connect/README.md +15 -0
  11. package/.cache/typescript/5.0/node_modules/@types/connect/index.d.ts +91 -0
  12. package/.cache/typescript/5.0/node_modules/@types/connect/package.json +32 -0
  13. package/.cache/typescript/5.0/node_modules/@types/express/LICENSE +21 -0
  14. package/.cache/typescript/5.0/node_modules/@types/express/README.md +15 -0
  15. package/.cache/typescript/5.0/node_modules/@types/express/index.d.ts +128 -0
  16. package/.cache/typescript/5.0/node_modules/@types/express/package.json +45 -0
  17. package/.cache/typescript/5.0/node_modules/@types/express-serve-static-core/LICENSE +21 -0
  18. package/.cache/typescript/5.0/node_modules/@types/express-serve-static-core/README.md +15 -0
  19. package/.cache/typescript/5.0/node_modules/@types/express-serve-static-core/index.d.ts +1261 -0
  20. package/.cache/typescript/5.0/node_modules/@types/express-serve-static-core/package.json +55 -0
  21. package/.cache/typescript/5.0/node_modules/@types/http-errors/LICENSE +21 -0
  22. package/.cache/typescript/5.0/node_modules/@types/http-errors/README.md +15 -0
  23. package/.cache/typescript/5.0/node_modules/@types/http-errors/index.d.ts +77 -0
  24. package/.cache/typescript/5.0/node_modules/@types/http-errors/package.json +30 -0
  25. package/.cache/typescript/5.0/node_modules/@types/jsdom/LICENSE +21 -0
  26. package/.cache/typescript/5.0/node_modules/@types/jsdom/README.md +15 -0
  27. package/.cache/typescript/5.0/node_modules/@types/jsdom/base.d.ts +456 -0
  28. package/.cache/typescript/5.0/node_modules/@types/jsdom/index.d.ts +18 -0
  29. package/.cache/typescript/5.0/node_modules/@types/jsdom/package.json +45 -0
  30. package/.cache/typescript/5.0/node_modules/@types/mime/LICENSE +21 -0
  31. package/.cache/typescript/5.0/node_modules/@types/mime/Mime.d.ts +10 -0
  32. package/.cache/typescript/5.0/node_modules/@types/mime/README.md +15 -0
  33. package/.cache/typescript/5.0/node_modules/@types/mime/index.d.ts +31 -0
  34. package/.cache/typescript/5.0/node_modules/@types/mime/lite.d.ts +7 -0
  35. package/.cache/typescript/5.0/node_modules/@types/mime/package.json +30 -0
  36. package/.cache/typescript/5.0/node_modules/@types/node/LICENSE +21 -0
  37. package/.cache/typescript/5.0/node_modules/@types/node/README.md +15 -0
  38. package/.cache/typescript/5.0/node_modules/@types/node/assert/strict.d.ts +8 -0
  39. package/.cache/typescript/5.0/node_modules/@types/node/assert.d.ts +996 -0
  40. package/.cache/typescript/5.0/node_modules/@types/node/async_hooks.d.ts +539 -0
  41. package/.cache/typescript/5.0/node_modules/@types/node/buffer.d.ts +2362 -0
  42. package/.cache/typescript/5.0/node_modules/@types/node/child_process.d.ts +1540 -0
  43. package/.cache/typescript/5.0/node_modules/@types/node/cluster.d.ts +432 -0
  44. package/.cache/typescript/5.0/node_modules/@types/node/console.d.ts +415 -0
  45. package/.cache/typescript/5.0/node_modules/@types/node/constants.d.ts +19 -0
  46. package/.cache/typescript/5.0/node_modules/@types/node/crypto.d.ts +4456 -0
  47. package/.cache/typescript/5.0/node_modules/@types/node/dgram.d.ts +586 -0
  48. package/.cache/typescript/5.0/node_modules/@types/node/diagnostics_channel.d.ts +191 -0
  49. package/.cache/typescript/5.0/node_modules/@types/node/dns/promises.d.ts +425 -0
  50. package/.cache/typescript/5.0/node_modules/@types/node/dns.d.ts +809 -0
  51. package/.cache/typescript/5.0/node_modules/@types/node/dom-events.d.ts +122 -0
  52. package/.cache/typescript/5.0/node_modules/@types/node/domain.d.ts +170 -0
  53. package/.cache/typescript/5.0/node_modules/@types/node/events.d.ts +879 -0
  54. package/.cache/typescript/5.0/node_modules/@types/node/fs/promises.d.ts +1239 -0
  55. package/.cache/typescript/5.0/node_modules/@types/node/fs.d.ts +4291 -0
  56. package/.cache/typescript/5.0/node_modules/@types/node/globals.d.ts +381 -0
  57. package/.cache/typescript/5.0/node_modules/@types/node/globals.global.d.ts +1 -0
  58. package/.cache/typescript/5.0/node_modules/@types/node/http.d.ts +1888 -0
  59. package/.cache/typescript/5.0/node_modules/@types/node/http2.d.ts +2382 -0
  60. package/.cache/typescript/5.0/node_modules/@types/node/https.d.ts +550 -0
  61. package/.cache/typescript/5.0/node_modules/@types/node/index.d.ts +88 -0
  62. package/.cache/typescript/5.0/node_modules/@types/node/inspector.d.ts +2747 -0
  63. package/.cache/typescript/5.0/node_modules/@types/node/module.d.ts +301 -0
  64. package/.cache/typescript/5.0/node_modules/@types/node/net.d.ts +949 -0
  65. package/.cache/typescript/5.0/node_modules/@types/node/os.d.ts +478 -0
  66. package/.cache/typescript/5.0/node_modules/@types/node/package.json +230 -0
  67. package/.cache/typescript/5.0/node_modules/@types/node/path.d.ts +191 -0
  68. package/.cache/typescript/5.0/node_modules/@types/node/perf_hooks.d.ts +639 -0
  69. package/.cache/typescript/5.0/node_modules/@types/node/process.d.ts +1532 -0
  70. package/.cache/typescript/5.0/node_modules/@types/node/punycode.d.ts +117 -0
  71. package/.cache/typescript/5.0/node_modules/@types/node/querystring.d.ts +141 -0
  72. package/.cache/typescript/5.0/node_modules/@types/node/readline/promises.d.ts +150 -0
  73. package/.cache/typescript/5.0/node_modules/@types/node/readline.d.ts +539 -0
  74. package/.cache/typescript/5.0/node_modules/@types/node/repl.d.ts +430 -0
  75. package/.cache/typescript/5.0/node_modules/@types/node/stream/consumers.d.ts +12 -0
  76. package/.cache/typescript/5.0/node_modules/@types/node/stream/promises.d.ts +83 -0
  77. package/.cache/typescript/5.0/node_modules/@types/node/stream/web.d.ts +350 -0
  78. package/.cache/typescript/5.0/node_modules/@types/node/stream.d.ts +1701 -0
  79. package/.cache/typescript/5.0/node_modules/@types/node/string_decoder.d.ts +67 -0
  80. package/.cache/typescript/5.0/node_modules/@types/node/test.d.ts +1382 -0
  81. package/.cache/typescript/5.0/node_modules/@types/node/timers/promises.d.ts +93 -0
  82. package/.cache/typescript/5.0/node_modules/@types/node/timers.d.ts +240 -0
  83. package/.cache/typescript/5.0/node_modules/@types/node/tls.d.ts +1210 -0
  84. package/.cache/typescript/5.0/node_modules/@types/node/trace_events.d.ts +182 -0
  85. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
  86. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/assert.d.ts +996 -0
  87. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/async_hooks.d.ts +539 -0
  88. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/buffer.d.ts +2362 -0
  89. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/child_process.d.ts +1540 -0
  90. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/cluster.d.ts +432 -0
  91. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/console.d.ts +415 -0
  92. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/constants.d.ts +19 -0
  93. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/crypto.d.ts +4455 -0
  94. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/dgram.d.ts +586 -0
  95. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +191 -0
  96. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/dns/promises.d.ts +425 -0
  97. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/dns.d.ts +809 -0
  98. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/dom-events.d.ts +122 -0
  99. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
  100. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/events.d.ts +879 -0
  101. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/fs/promises.d.ts +1239 -0
  102. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/fs.d.ts +4291 -0
  103. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/globals.d.ts +381 -0
  104. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
  105. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/http.d.ts +1888 -0
  106. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/http2.d.ts +2382 -0
  107. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/https.d.ts +550 -0
  108. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/index.d.ts +88 -0
  109. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/inspector.d.ts +2747 -0
  110. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/module.d.ts +301 -0
  111. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/net.d.ts +949 -0
  112. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/os.d.ts +478 -0
  113. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/path.d.ts +191 -0
  114. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/perf_hooks.d.ts +639 -0
  115. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/process.d.ts +1532 -0
  116. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
  117. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/querystring.d.ts +141 -0
  118. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/readline/promises.d.ts +150 -0
  119. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/readline.d.ts +539 -0
  120. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/repl.d.ts +430 -0
  121. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
  122. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/stream/promises.d.ts +83 -0
  123. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/stream/web.d.ts +350 -0
  124. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/stream.d.ts +1701 -0
  125. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
  126. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/test.d.ts +1382 -0
  127. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/timers/promises.d.ts +93 -0
  128. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/timers.d.ts +240 -0
  129. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/tls.d.ts +1210 -0
  130. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/trace_events.d.ts +182 -0
  131. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/tty.d.ts +208 -0
  132. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/url.d.ts +927 -0
  133. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/util.d.ts +2186 -0
  134. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/v8.d.ts +635 -0
  135. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/vm.d.ts +903 -0
  136. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/wasi.d.ts +158 -0
  137. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/worker_threads.d.ts +691 -0
  138. package/.cache/typescript/5.0/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
  139. package/.cache/typescript/5.0/node_modules/@types/node/tty.d.ts +208 -0
  140. package/.cache/typescript/5.0/node_modules/@types/node/url.d.ts +927 -0
  141. package/.cache/typescript/5.0/node_modules/@types/node/util.d.ts +2186 -0
  142. package/.cache/typescript/5.0/node_modules/@types/node/v8.d.ts +635 -0
  143. package/.cache/typescript/5.0/node_modules/@types/node/vm.d.ts +903 -0
  144. package/.cache/typescript/5.0/node_modules/@types/node/wasi.d.ts +158 -0
  145. package/.cache/typescript/5.0/node_modules/@types/node/worker_threads.d.ts +691 -0
  146. package/.cache/typescript/5.0/node_modules/@types/node/zlib.d.ts +517 -0
  147. package/.cache/typescript/5.0/node_modules/@types/qs/LICENSE +21 -0
  148. package/.cache/typescript/5.0/node_modules/@types/qs/README.md +75 -0
  149. package/.cache/typescript/5.0/node_modules/@types/qs/index.d.ts +56 -0
  150. package/.cache/typescript/5.0/node_modules/@types/qs/package.json +65 -0
  151. package/.cache/typescript/5.0/node_modules/@types/range-parser/LICENSE +21 -0
  152. package/.cache/typescript/5.0/node_modules/@types/range-parser/README.md +53 -0
  153. package/.cache/typescript/5.0/node_modules/@types/range-parser/index.d.ts +34 -0
  154. package/.cache/typescript/5.0/node_modules/@types/range-parser/package.json +25 -0
  155. package/.cache/typescript/5.0/node_modules/@types/send/LICENSE +21 -0
  156. package/.cache/typescript/5.0/node_modules/@types/send/README.md +15 -0
  157. package/.cache/typescript/5.0/node_modules/@types/send/index.d.ts +225 -0
  158. package/.cache/typescript/5.0/node_modules/@types/send/package.json +33 -0
  159. package/.cache/typescript/5.0/node_modules/@types/serve-static/LICENSE +21 -0
  160. package/.cache/typescript/5.0/node_modules/@types/serve-static/README.md +15 -0
  161. package/.cache/typescript/5.0/node_modules/@types/serve-static/index.d.ts +107 -0
  162. package/.cache/typescript/5.0/node_modules/@types/serve-static/package.json +39 -0
  163. package/.cache/typescript/5.0/node_modules/@types/tough-cookie/LICENSE +21 -0
  164. package/.cache/typescript/5.0/node_modules/@types/tough-cookie/README.md +15 -0
  165. package/.cache/typescript/5.0/node_modules/@types/tough-cookie/index.d.ts +321 -0
  166. package/.cache/typescript/5.0/node_modules/@types/tough-cookie/package.json +35 -0
  167. package/.cache/typescript/5.0/node_modules/entities/LICENSE +11 -0
  168. package/.cache/typescript/5.0/node_modules/entities/lib/decode.d.ts +211 -0
  169. package/.cache/typescript/5.0/node_modules/entities/lib/decode.d.ts.map +1 -0
  170. package/.cache/typescript/5.0/node_modules/entities/lib/decode.js +536 -0
  171. package/.cache/typescript/5.0/node_modules/entities/lib/decode.js.map +1 -0
  172. package/.cache/typescript/5.0/node_modules/entities/lib/decode_codepoint.d.ts +19 -0
  173. package/.cache/typescript/5.0/node_modules/entities/lib/decode_codepoint.d.ts.map +1 -0
  174. package/.cache/typescript/5.0/node_modules/entities/lib/decode_codepoint.js +76 -0
  175. package/.cache/typescript/5.0/node_modules/entities/lib/decode_codepoint.js.map +1 -0
  176. package/.cache/typescript/5.0/node_modules/entities/lib/encode.d.ts +22 -0
  177. package/.cache/typescript/5.0/node_modules/entities/lib/encode.d.ts.map +1 -0
  178. package/.cache/typescript/5.0/node_modules/entities/lib/encode.js +77 -0
  179. package/.cache/typescript/5.0/node_modules/entities/lib/encode.js.map +1 -0
  180. package/.cache/typescript/5.0/node_modules/entities/lib/escape.d.ts +43 -0
  181. package/.cache/typescript/5.0/node_modules/entities/lib/escape.d.ts.map +1 -0
  182. package/.cache/typescript/5.0/node_modules/entities/lib/escape.js +122 -0
  183. package/.cache/typescript/5.0/node_modules/entities/lib/escape.js.map +1 -0
  184. package/.cache/typescript/5.0/node_modules/entities/lib/esm/decode.d.ts +211 -0
  185. package/.cache/typescript/5.0/node_modules/entities/lib/esm/decode.d.ts.map +1 -0
  186. package/.cache/typescript/5.0/node_modules/entities/lib/esm/decode.js +496 -0
  187. package/.cache/typescript/5.0/node_modules/entities/lib/esm/decode.js.map +1 -0
  188. package/.cache/typescript/5.0/node_modules/entities/lib/esm/decode_codepoint.d.ts +19 -0
  189. package/.cache/typescript/5.0/node_modules/entities/lib/esm/decode_codepoint.d.ts.map +1 -0
  190. package/.cache/typescript/5.0/node_modules/entities/lib/esm/decode_codepoint.js +71 -0
  191. package/.cache/typescript/5.0/node_modules/entities/lib/esm/decode_codepoint.js.map +1 -0
  192. package/.cache/typescript/5.0/node_modules/entities/lib/esm/encode.d.ts +22 -0
  193. package/.cache/typescript/5.0/node_modules/entities/lib/esm/encode.d.ts.map +1 -0
  194. package/.cache/typescript/5.0/node_modules/entities/lib/esm/encode.js +69 -0
  195. package/.cache/typescript/5.0/node_modules/entities/lib/esm/encode.js.map +1 -0
  196. package/.cache/typescript/5.0/node_modules/entities/lib/esm/escape.d.ts +43 -0
  197. package/.cache/typescript/5.0/node_modules/entities/lib/esm/escape.d.ts.map +1 -0
  198. package/.cache/typescript/5.0/node_modules/entities/lib/esm/escape.js +116 -0
  199. package/.cache/typescript/5.0/node_modules/entities/lib/esm/escape.js.map +1 -0
  200. package/.cache/typescript/5.0/node_modules/entities/lib/esm/generated/decode-data-html.d.ts +3 -0
  201. package/.cache/typescript/5.0/node_modules/entities/lib/esm/generated/decode-data-html.d.ts.map +1 -0
  202. package/.cache/typescript/5.0/node_modules/entities/lib/esm/generated/decode-data-html.js +7 -0
  203. package/.cache/typescript/5.0/node_modules/entities/lib/esm/generated/decode-data-html.js.map +1 -0
  204. package/.cache/typescript/5.0/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts +3 -0
  205. package/.cache/typescript/5.0/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts.map +1 -0
  206. package/.cache/typescript/5.0/node_modules/entities/lib/esm/generated/decode-data-xml.js +7 -0
  207. package/.cache/typescript/5.0/node_modules/entities/lib/esm/generated/decode-data-xml.js.map +1 -0
  208. package/.cache/typescript/5.0/node_modules/entities/lib/esm/generated/encode-html.d.ts +8 -0
  209. package/.cache/typescript/5.0/node_modules/entities/lib/esm/generated/encode-html.d.ts.map +1 -0
  210. package/.cache/typescript/5.0/node_modules/entities/lib/esm/generated/encode-html.js +10 -0
  211. package/.cache/typescript/5.0/node_modules/entities/lib/esm/generated/encode-html.js.map +1 -0
  212. package/.cache/typescript/5.0/node_modules/entities/lib/esm/index.d.ts +96 -0
  213. package/.cache/typescript/5.0/node_modules/entities/lib/esm/index.d.ts.map +1 -0
  214. package/.cache/typescript/5.0/node_modules/entities/lib/esm/index.js +99 -0
  215. package/.cache/typescript/5.0/node_modules/entities/lib/esm/index.js.map +1 -0
  216. package/.cache/typescript/5.0/node_modules/entities/lib/esm/package.json +1 -0
  217. package/.cache/typescript/5.0/node_modules/entities/lib/generated/decode-data-html.d.ts +3 -0
  218. package/.cache/typescript/5.0/node_modules/entities/lib/generated/decode-data-html.d.ts.map +1 -0
  219. package/.cache/typescript/5.0/node_modules/entities/lib/generated/decode-data-html.js +9 -0
  220. package/.cache/typescript/5.0/node_modules/entities/lib/generated/decode-data-html.js.map +1 -0
  221. package/.cache/typescript/5.0/node_modules/entities/lib/generated/decode-data-xml.d.ts +3 -0
  222. package/.cache/typescript/5.0/node_modules/entities/lib/generated/decode-data-xml.d.ts.map +1 -0
  223. package/.cache/typescript/5.0/node_modules/entities/lib/generated/decode-data-xml.js +9 -0
  224. package/.cache/typescript/5.0/node_modules/entities/lib/generated/decode-data-xml.js.map +1 -0
  225. package/.cache/typescript/5.0/node_modules/entities/lib/generated/encode-html.d.ts +8 -0
  226. package/.cache/typescript/5.0/node_modules/entities/lib/generated/encode-html.d.ts.map +1 -0
  227. package/.cache/typescript/5.0/node_modules/entities/lib/generated/encode-html.js +12 -0
  228. package/.cache/typescript/5.0/node_modules/entities/lib/generated/encode-html.js.map +1 -0
  229. package/.cache/typescript/5.0/node_modules/entities/lib/index.d.ts +96 -0
  230. package/.cache/typescript/5.0/node_modules/entities/lib/index.d.ts.map +1 -0
  231. package/.cache/typescript/5.0/node_modules/entities/lib/index.js +126 -0
  232. package/.cache/typescript/5.0/node_modules/entities/lib/index.js.map +1 -0
  233. package/.cache/typescript/5.0/node_modules/entities/package.json +90 -0
  234. package/.cache/typescript/5.0/node_modules/entities/readme.md +122 -0
  235. package/.cache/typescript/5.0/node_modules/parse5/LICENSE +19 -0
  236. package/.cache/typescript/5.0/node_modules/parse5/README.md +38 -0
  237. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/common/doctype.d.ts +5 -0
  238. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/common/doctype.js +120 -0
  239. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/common/error-codes.d.ts +68 -0
  240. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/common/error-codes.js +67 -0
  241. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/common/foreign-content.d.ts +10 -0
  242. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/common/foreign-content.js +239 -0
  243. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/common/html.d.ts +288 -0
  244. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/common/html.js +529 -0
  245. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/common/token.d.ts +85 -0
  246. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/common/token.js +25 -0
  247. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/common/unicode.d.ts +49 -0
  248. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/common/unicode.js +77 -0
  249. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/index.d.ts +60 -0
  250. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/index.js +57 -0
  251. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/package.json +1 -0
  252. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/parser/formatting-element-list.d.ts +37 -0
  253. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/parser/formatting-element-list.js +115 -0
  254. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/parser/index.d.ts +157 -0
  255. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/parser/index.js +3163 -0
  256. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/parser/open-element-stack.d.ts +53 -0
  257. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/parser/open-element-stack.js +316 -0
  258. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/serializer/index.d.ts +61 -0
  259. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/serializer/index.js +173 -0
  260. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/tokenizer/index.d.ts +248 -0
  261. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/tokenizer/index.js +2908 -0
  262. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/tokenizer/preprocessor.d.ts +37 -0
  263. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/tokenizer/preprocessor.js +199 -0
  264. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/tree-adapters/default.d.ts +85 -0
  265. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/tree-adapters/default.js +177 -0
  266. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/tree-adapters/interface.d.ts +250 -0
  267. package/.cache/typescript/5.0/node_modules/parse5/dist/cjs/tree-adapters/interface.js +3 -0
  268. package/.cache/typescript/5.0/node_modules/parse5/dist/common/doctype.d.ts +5 -0
  269. package/.cache/typescript/5.0/node_modules/parse5/dist/common/doctype.js +115 -0
  270. package/.cache/typescript/5.0/node_modules/parse5/dist/common/error-codes.d.ts +68 -0
  271. package/.cache/typescript/5.0/node_modules/parse5/dist/common/error-codes.js +64 -0
  272. package/.cache/typescript/5.0/node_modules/parse5/dist/common/foreign-content.d.ts +10 -0
  273. package/.cache/typescript/5.0/node_modules/parse5/dist/common/foreign-content.js +230 -0
  274. package/.cache/typescript/5.0/node_modules/parse5/dist/common/html.d.ts +288 -0
  275. package/.cache/typescript/5.0/node_modules/parse5/dist/common/html.js +523 -0
  276. package/.cache/typescript/5.0/node_modules/parse5/dist/common/token.d.ts +85 -0
  277. package/.cache/typescript/5.0/node_modules/parse5/dist/common/token.js +21 -0
  278. package/.cache/typescript/5.0/node_modules/parse5/dist/common/unicode.d.ts +49 -0
  279. package/.cache/typescript/5.0/node_modules/parse5/dist/common/unicode.js +69 -0
  280. package/.cache/typescript/5.0/node_modules/parse5/dist/index.d.ts +60 -0
  281. package/.cache/typescript/5.0/node_modules/parse5/dist/index.js +45 -0
  282. package/.cache/typescript/5.0/node_modules/parse5/dist/parser/formatting-element-list.d.ts +37 -0
  283. package/.cache/typescript/5.0/node_modules/parse5/dist/parser/formatting-element-list.js +111 -0
  284. package/.cache/typescript/5.0/node_modules/parse5/dist/parser/index.d.ts +157 -0
  285. package/.cache/typescript/5.0/node_modules/parse5/dist/parser/index.js +3168 -0
  286. package/.cache/typescript/5.0/node_modules/parse5/dist/parser/open-element-stack.d.ts +53 -0
  287. package/.cache/typescript/5.0/node_modules/parse5/dist/parser/open-element-stack.js +312 -0
  288. package/.cache/typescript/5.0/node_modules/parse5/dist/serializer/index.d.ts +61 -0
  289. package/.cache/typescript/5.0/node_modules/parse5/dist/serializer/index.js +168 -0
  290. package/.cache/typescript/5.0/node_modules/parse5/dist/tokenizer/index.d.ts +248 -0
  291. package/.cache/typescript/5.0/node_modules/parse5/dist/tokenizer/index.js +2904 -0
  292. package/.cache/typescript/5.0/node_modules/parse5/dist/tokenizer/preprocessor.d.ts +37 -0
  293. package/.cache/typescript/5.0/node_modules/parse5/dist/tokenizer/preprocessor.js +195 -0
  294. package/.cache/typescript/5.0/node_modules/parse5/dist/tree-adapters/default.d.ts +85 -0
  295. package/.cache/typescript/5.0/node_modules/parse5/dist/tree-adapters/default.js +174 -0
  296. package/.cache/typescript/5.0/node_modules/parse5/dist/tree-adapters/interface.d.ts +250 -0
  297. package/.cache/typescript/5.0/node_modules/parse5/dist/tree-adapters/interface.js +2 -0
  298. package/.cache/typescript/5.0/node_modules/parse5/package.json +50 -0
  299. package/.cache/typescript/5.0/node_modules/types-registry/README.md +2 -0
  300. package/.cache/typescript/5.0/node_modules/types-registry/index.json +1 -0
  301. package/.cache/typescript/5.0/node_modules/types-registry/package.json +20 -0
  302. package/.cache/typescript/5.0/node_modules/undici-types/README.md +6 -0
  303. package/.cache/typescript/5.0/node_modules/undici-types/agent.d.ts +31 -0
  304. package/.cache/typescript/5.0/node_modules/undici-types/api.d.ts +43 -0
  305. package/.cache/typescript/5.0/node_modules/undici-types/balanced-pool.d.ts +18 -0
  306. package/.cache/typescript/5.0/node_modules/undici-types/cache.d.ts +36 -0
  307. package/.cache/typescript/5.0/node_modules/undici-types/client.d.ts +97 -0
  308. package/.cache/typescript/5.0/node_modules/undici-types/connector.d.ts +34 -0
  309. package/.cache/typescript/5.0/node_modules/undici-types/content-type.d.ts +21 -0
  310. package/.cache/typescript/5.0/node_modules/undici-types/cookies.d.ts +28 -0
  311. package/.cache/typescript/5.0/node_modules/undici-types/diagnostics-channel.d.ts +67 -0
  312. package/.cache/typescript/5.0/node_modules/undici-types/dispatcher.d.ts +241 -0
  313. package/.cache/typescript/5.0/node_modules/undici-types/errors.d.ts +128 -0
  314. package/.cache/typescript/5.0/node_modules/undici-types/fetch.d.ts +209 -0
  315. package/.cache/typescript/5.0/node_modules/undici-types/file.d.ts +39 -0
  316. package/.cache/typescript/5.0/node_modules/undici-types/filereader.d.ts +54 -0
  317. package/.cache/typescript/5.0/node_modules/undici-types/formdata.d.ts +108 -0
  318. package/.cache/typescript/5.0/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  319. package/.cache/typescript/5.0/node_modules/undici-types/global-origin.d.ts +7 -0
  320. package/.cache/typescript/5.0/node_modules/undici-types/handlers.d.ts +9 -0
  321. package/.cache/typescript/5.0/node_modules/undici-types/header.d.ts +4 -0
  322. package/.cache/typescript/5.0/node_modules/undici-types/index.d.ts +63 -0
  323. package/.cache/typescript/5.0/node_modules/undici-types/interceptors.d.ts +5 -0
  324. package/.cache/typescript/5.0/node_modules/undici-types/mock-agent.d.ts +50 -0
  325. package/.cache/typescript/5.0/node_modules/undici-types/mock-client.d.ts +25 -0
  326. package/.cache/typescript/5.0/node_modules/undici-types/mock-errors.d.ts +12 -0
  327. package/.cache/typescript/5.0/node_modules/undici-types/mock-interceptor.d.ts +93 -0
  328. package/.cache/typescript/5.0/node_modules/undici-types/mock-pool.d.ts +25 -0
  329. package/.cache/typescript/5.0/node_modules/undici-types/package.json +55 -0
  330. package/.cache/typescript/5.0/node_modules/undici-types/patch.d.ts +71 -0
  331. package/.cache/typescript/5.0/node_modules/undici-types/pool-stats.d.ts +19 -0
  332. package/.cache/typescript/5.0/node_modules/undici-types/pool.d.ts +28 -0
  333. package/.cache/typescript/5.0/node_modules/undici-types/proxy-agent.d.ts +30 -0
  334. package/.cache/typescript/5.0/node_modules/undici-types/readable.d.ts +61 -0
  335. package/.cache/typescript/5.0/node_modules/undici-types/webidl.d.ts +220 -0
  336. package/.cache/typescript/5.0/node_modules/undici-types/websocket.d.ts +131 -0
  337. package/.cache/typescript/5.0/package-lock.json +166 -0
  338. package/.cache/typescript/5.0/package.json +1 -0
  339. package/.replit +14 -0
  340. package/.upm/store.json +1 -0
  341. package/README.md +24 -0
  342. package/index.js +1 -0
  343. package/package.json +21 -0
@@ -0,0 +1,496 @@
1
+ import htmlDecodeTree from "./generated/decode-data-html.js";
2
+ import xmlDecodeTree from "./generated/decode-data-xml.js";
3
+ import decodeCodePoint, { replaceCodePoint, fromCodePoint, } from "./decode_codepoint.js";
4
+ // Re-export for use by eg. htmlparser2
5
+ export { htmlDecodeTree, xmlDecodeTree, decodeCodePoint };
6
+ export { replaceCodePoint, fromCodePoint } from "./decode_codepoint.js";
7
+ var CharCodes;
8
+ (function (CharCodes) {
9
+ CharCodes[CharCodes["NUM"] = 35] = "NUM";
10
+ CharCodes[CharCodes["SEMI"] = 59] = "SEMI";
11
+ CharCodes[CharCodes["EQUALS"] = 61] = "EQUALS";
12
+ CharCodes[CharCodes["ZERO"] = 48] = "ZERO";
13
+ CharCodes[CharCodes["NINE"] = 57] = "NINE";
14
+ CharCodes[CharCodes["LOWER_A"] = 97] = "LOWER_A";
15
+ CharCodes[CharCodes["LOWER_F"] = 102] = "LOWER_F";
16
+ CharCodes[CharCodes["LOWER_X"] = 120] = "LOWER_X";
17
+ CharCodes[CharCodes["LOWER_Z"] = 122] = "LOWER_Z";
18
+ CharCodes[CharCodes["UPPER_A"] = 65] = "UPPER_A";
19
+ CharCodes[CharCodes["UPPER_F"] = 70] = "UPPER_F";
20
+ CharCodes[CharCodes["UPPER_Z"] = 90] = "UPPER_Z";
21
+ })(CharCodes || (CharCodes = {}));
22
+ /** Bit that needs to be set to convert an upper case ASCII character to lower case */
23
+ const TO_LOWER_BIT = 0b100000;
24
+ export var BinTrieFlags;
25
+ (function (BinTrieFlags) {
26
+ BinTrieFlags[BinTrieFlags["VALUE_LENGTH"] = 49152] = "VALUE_LENGTH";
27
+ BinTrieFlags[BinTrieFlags["BRANCH_LENGTH"] = 16256] = "BRANCH_LENGTH";
28
+ BinTrieFlags[BinTrieFlags["JUMP_TABLE"] = 127] = "JUMP_TABLE";
29
+ })(BinTrieFlags || (BinTrieFlags = {}));
30
+ function isNumber(code) {
31
+ return code >= CharCodes.ZERO && code <= CharCodes.NINE;
32
+ }
33
+ function isHexadecimalCharacter(code) {
34
+ return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F) ||
35
+ (code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F));
36
+ }
37
+ function isAsciiAlphaNumeric(code) {
38
+ return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z) ||
39
+ (code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z) ||
40
+ isNumber(code));
41
+ }
42
+ /**
43
+ * Checks if the given character is a valid end character for an entity in an attribute.
44
+ *
45
+ * Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error.
46
+ * See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state
47
+ */
48
+ function isEntityInAttributeInvalidEnd(code) {
49
+ return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code);
50
+ }
51
+ var EntityDecoderState;
52
+ (function (EntityDecoderState) {
53
+ EntityDecoderState[EntityDecoderState["EntityStart"] = 0] = "EntityStart";
54
+ EntityDecoderState[EntityDecoderState["NumericStart"] = 1] = "NumericStart";
55
+ EntityDecoderState[EntityDecoderState["NumericDecimal"] = 2] = "NumericDecimal";
56
+ EntityDecoderState[EntityDecoderState["NumericHex"] = 3] = "NumericHex";
57
+ EntityDecoderState[EntityDecoderState["NamedEntity"] = 4] = "NamedEntity";
58
+ })(EntityDecoderState || (EntityDecoderState = {}));
59
+ export var DecodingMode;
60
+ (function (DecodingMode) {
61
+ /** Entities in text nodes that can end with any character. */
62
+ DecodingMode[DecodingMode["Legacy"] = 0] = "Legacy";
63
+ /** Only allow entities terminated with a semicolon. */
64
+ DecodingMode[DecodingMode["Strict"] = 1] = "Strict";
65
+ /** Entities in attributes have limitations on ending characters. */
66
+ DecodingMode[DecodingMode["Attribute"] = 2] = "Attribute";
67
+ })(DecodingMode || (DecodingMode = {}));
68
+ /**
69
+ * Token decoder with support of writing partial entities.
70
+ */
71
+ export class EntityDecoder {
72
+ constructor(
73
+ /** The tree used to decode entities. */
74
+ decodeTree,
75
+ /**
76
+ * The function that is called when a codepoint is decoded.
77
+ *
78
+ * For multi-byte named entities, this will be called multiple times,
79
+ * with the second codepoint, and the same `consumed` value.
80
+ *
81
+ * @param codepoint The decoded codepoint.
82
+ * @param consumed The number of bytes consumed by the decoder.
83
+ */
84
+ emitCodePoint,
85
+ /** An object that is used to produce errors. */
86
+ errors) {
87
+ this.decodeTree = decodeTree;
88
+ this.emitCodePoint = emitCodePoint;
89
+ this.errors = errors;
90
+ /** The current state of the decoder. */
91
+ this.state = EntityDecoderState.EntityStart;
92
+ /** Characters that were consumed while parsing an entity. */
93
+ this.consumed = 1;
94
+ /**
95
+ * The result of the entity.
96
+ *
97
+ * Either the result index of a numeric entity, or the codepoint of a
98
+ * numeric entity.
99
+ */
100
+ this.result = 0;
101
+ /** The current index in the decode tree. */
102
+ this.treeIndex = 0;
103
+ /** The number of characters that were consumed in excess. */
104
+ this.excess = 1;
105
+ /** The mode in which the decoder is operating. */
106
+ this.decodeMode = DecodingMode.Strict;
107
+ }
108
+ /** Resets the instance to make it reusable. */
109
+ startEntity(decodeMode) {
110
+ this.decodeMode = decodeMode;
111
+ this.state = EntityDecoderState.EntityStart;
112
+ this.result = 0;
113
+ this.treeIndex = 0;
114
+ this.excess = 1;
115
+ this.consumed = 1;
116
+ }
117
+ /**
118
+ * Write an entity to the decoder. This can be called multiple times with partial entities.
119
+ * If the entity is incomplete, the decoder will return -1.
120
+ *
121
+ * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the
122
+ * entity is incomplete, and resume when the next string is written.
123
+ *
124
+ * @param string The string containing the entity (or a continuation of the entity).
125
+ * @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
126
+ * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
127
+ */
128
+ write(str, offset) {
129
+ switch (this.state) {
130
+ case EntityDecoderState.EntityStart: {
131
+ if (str.charCodeAt(offset) === CharCodes.NUM) {
132
+ this.state = EntityDecoderState.NumericStart;
133
+ this.consumed += 1;
134
+ return this.stateNumericStart(str, offset + 1);
135
+ }
136
+ this.state = EntityDecoderState.NamedEntity;
137
+ return this.stateNamedEntity(str, offset);
138
+ }
139
+ case EntityDecoderState.NumericStart: {
140
+ return this.stateNumericStart(str, offset);
141
+ }
142
+ case EntityDecoderState.NumericDecimal: {
143
+ return this.stateNumericDecimal(str, offset);
144
+ }
145
+ case EntityDecoderState.NumericHex: {
146
+ return this.stateNumericHex(str, offset);
147
+ }
148
+ case EntityDecoderState.NamedEntity: {
149
+ return this.stateNamedEntity(str, offset);
150
+ }
151
+ }
152
+ }
153
+ /**
154
+ * Switches between the numeric decimal and hexadecimal states.
155
+ *
156
+ * Equivalent to the `Numeric character reference state` in the HTML spec.
157
+ *
158
+ * @param str The string containing the entity (or a continuation of the entity).
159
+ * @param offset The current offset.
160
+ * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
161
+ */
162
+ stateNumericStart(str, offset) {
163
+ if (offset >= str.length) {
164
+ return -1;
165
+ }
166
+ if ((str.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) {
167
+ this.state = EntityDecoderState.NumericHex;
168
+ this.consumed += 1;
169
+ return this.stateNumericHex(str, offset + 1);
170
+ }
171
+ this.state = EntityDecoderState.NumericDecimal;
172
+ return this.stateNumericDecimal(str, offset);
173
+ }
174
+ addToNumericResult(str, start, end, base) {
175
+ if (start !== end) {
176
+ const digitCount = end - start;
177
+ this.result =
178
+ this.result * Math.pow(base, digitCount) +
179
+ parseInt(str.substr(start, digitCount), base);
180
+ this.consumed += digitCount;
181
+ }
182
+ }
183
+ /**
184
+ * Parses a hexadecimal numeric entity.
185
+ *
186
+ * Equivalent to the `Hexademical character reference state` in the HTML spec.
187
+ *
188
+ * @param str The string containing the entity (or a continuation of the entity).
189
+ * @param offset The current offset.
190
+ * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
191
+ */
192
+ stateNumericHex(str, offset) {
193
+ const startIdx = offset;
194
+ while (offset < str.length) {
195
+ const char = str.charCodeAt(offset);
196
+ if (isNumber(char) || isHexadecimalCharacter(char)) {
197
+ offset += 1;
198
+ }
199
+ else {
200
+ this.addToNumericResult(str, startIdx, offset, 16);
201
+ return this.emitNumericEntity(char, 3);
202
+ }
203
+ }
204
+ this.addToNumericResult(str, startIdx, offset, 16);
205
+ return -1;
206
+ }
207
+ /**
208
+ * Parses a decimal numeric entity.
209
+ *
210
+ * Equivalent to the `Decimal character reference state` in the HTML spec.
211
+ *
212
+ * @param str The string containing the entity (or a continuation of the entity).
213
+ * @param offset The current offset.
214
+ * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
215
+ */
216
+ stateNumericDecimal(str, offset) {
217
+ const startIdx = offset;
218
+ while (offset < str.length) {
219
+ const char = str.charCodeAt(offset);
220
+ if (isNumber(char)) {
221
+ offset += 1;
222
+ }
223
+ else {
224
+ this.addToNumericResult(str, startIdx, offset, 10);
225
+ return this.emitNumericEntity(char, 2);
226
+ }
227
+ }
228
+ this.addToNumericResult(str, startIdx, offset, 10);
229
+ return -1;
230
+ }
231
+ /**
232
+ * Validate and emit a numeric entity.
233
+ *
234
+ * Implements the logic from the `Hexademical character reference start
235
+ * state` and `Numeric character reference end state` in the HTML spec.
236
+ *
237
+ * @param lastCp The last code point of the entity. Used to see if the
238
+ * entity was terminated with a semicolon.
239
+ * @param expectedLength The minimum number of characters that should be
240
+ * consumed. Used to validate that at least one digit
241
+ * was consumed.
242
+ * @returns The number of characters that were consumed.
243
+ */
244
+ emitNumericEntity(lastCp, expectedLength) {
245
+ var _a;
246
+ // Ensure we consumed at least one digit.
247
+ if (this.consumed <= expectedLength) {
248
+ (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
249
+ return 0;
250
+ }
251
+ // Figure out if this is a legit end of the entity
252
+ if (lastCp === CharCodes.SEMI) {
253
+ this.consumed += 1;
254
+ }
255
+ else if (this.decodeMode === DecodingMode.Strict) {
256
+ return 0;
257
+ }
258
+ this.emitCodePoint(replaceCodePoint(this.result), this.consumed);
259
+ if (this.errors) {
260
+ if (lastCp !== CharCodes.SEMI) {
261
+ this.errors.missingSemicolonAfterCharacterReference();
262
+ }
263
+ this.errors.validateNumericCharacterReference(this.result);
264
+ }
265
+ return this.consumed;
266
+ }
267
+ /**
268
+ * Parses a named entity.
269
+ *
270
+ * Equivalent to the `Named character reference state` in the HTML spec.
271
+ *
272
+ * @param str The string containing the entity (or a continuation of the entity).
273
+ * @param offset The current offset.
274
+ * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
275
+ */
276
+ stateNamedEntity(str, offset) {
277
+ const { decodeTree } = this;
278
+ let current = decodeTree[this.treeIndex];
279
+ // The mask is the number of bytes of the value, including the current byte.
280
+ let valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
281
+ for (; offset < str.length; offset++, this.excess++) {
282
+ const char = str.charCodeAt(offset);
283
+ this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char);
284
+ if (this.treeIndex < 0) {
285
+ return this.result === 0 ||
286
+ // If we are parsing an attribute
287
+ (this.decodeMode === DecodingMode.Attribute &&
288
+ // We shouldn't have consumed any characters after the entity,
289
+ (valueLength === 0 ||
290
+ // And there should be no invalid characters.
291
+ isEntityInAttributeInvalidEnd(char)))
292
+ ? 0
293
+ : this.emitNotTerminatedNamedEntity();
294
+ }
295
+ current = decodeTree[this.treeIndex];
296
+ valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
297
+ // If the branch is a value, store it and continue
298
+ if (valueLength !== 0) {
299
+ // If the entity is terminated by a semicolon, we are done.
300
+ if (char === CharCodes.SEMI) {
301
+ return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);
302
+ }
303
+ // If we encounter a non-terminated (legacy) entity while parsing strictly, then ignore it.
304
+ if (this.decodeMode !== DecodingMode.Strict) {
305
+ this.result = this.treeIndex;
306
+ this.consumed += this.excess;
307
+ this.excess = 0;
308
+ }
309
+ }
310
+ }
311
+ return -1;
312
+ }
313
+ /**
314
+ * Emit a named entity that was not terminated with a semicolon.
315
+ *
316
+ * @returns The number of characters consumed.
317
+ */
318
+ emitNotTerminatedNamedEntity() {
319
+ var _a;
320
+ const { result, decodeTree } = this;
321
+ const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;
322
+ this.emitNamedEntityData(result, valueLength, this.consumed);
323
+ (_a = this.errors) === null || _a === void 0 ? void 0 : _a.missingSemicolonAfterCharacterReference();
324
+ return this.consumed;
325
+ }
326
+ /**
327
+ * Emit a named entity.
328
+ *
329
+ * @param result The index of the entity in the decode tree.
330
+ * @param valueLength The number of bytes in the entity.
331
+ * @param consumed The number of characters consumed.
332
+ *
333
+ * @returns The number of characters consumed.
334
+ */
335
+ emitNamedEntityData(result, valueLength, consumed) {
336
+ const { decodeTree } = this;
337
+ this.emitCodePoint(valueLength === 1
338
+ ? decodeTree[result] & ~BinTrieFlags.VALUE_LENGTH
339
+ : decodeTree[result + 1], consumed);
340
+ if (valueLength === 3) {
341
+ // For multi-byte values, we need to emit the second byte.
342
+ this.emitCodePoint(decodeTree[result + 2], consumed);
343
+ }
344
+ return consumed;
345
+ }
346
+ /**
347
+ * Signal to the parser that the end of the input was reached.
348
+ *
349
+ * Remaining data will be emitted and relevant errors will be produced.
350
+ *
351
+ * @returns The number of characters consumed.
352
+ */
353
+ end() {
354
+ var _a;
355
+ switch (this.state) {
356
+ case EntityDecoderState.NamedEntity: {
357
+ // Emit a named entity if we have one.
358
+ return this.result !== 0 &&
359
+ (this.decodeMode !== DecodingMode.Attribute ||
360
+ this.result === this.treeIndex)
361
+ ? this.emitNotTerminatedNamedEntity()
362
+ : 0;
363
+ }
364
+ // Otherwise, emit a numeric entity if we have one.
365
+ case EntityDecoderState.NumericDecimal: {
366
+ return this.emitNumericEntity(0, 2);
367
+ }
368
+ case EntityDecoderState.NumericHex: {
369
+ return this.emitNumericEntity(0, 3);
370
+ }
371
+ case EntityDecoderState.NumericStart: {
372
+ (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
373
+ return 0;
374
+ }
375
+ case EntityDecoderState.EntityStart: {
376
+ // Return 0 if we have no entity.
377
+ return 0;
378
+ }
379
+ }
380
+ }
381
+ }
382
+ /**
383
+ * Creates a function that decodes entities in a string.
384
+ *
385
+ * @param decodeTree The decode tree.
386
+ * @returns A function that decodes entities in a string.
387
+ */
388
+ function getDecoder(decodeTree) {
389
+ let ret = "";
390
+ const decoder = new EntityDecoder(decodeTree, (str) => (ret += fromCodePoint(str)));
391
+ return function decodeWithTrie(str, decodeMode) {
392
+ let lastIndex = 0;
393
+ let offset = 0;
394
+ while ((offset = str.indexOf("&", offset)) >= 0) {
395
+ ret += str.slice(lastIndex, offset);
396
+ decoder.startEntity(decodeMode);
397
+ const len = decoder.write(str,
398
+ // Skip the "&"
399
+ offset + 1);
400
+ if (len < 0) {
401
+ lastIndex = offset + decoder.end();
402
+ break;
403
+ }
404
+ lastIndex = offset + len;
405
+ // If `len` is 0, skip the current `&` and continue.
406
+ offset = len === 0 ? lastIndex + 1 : lastIndex;
407
+ }
408
+ const result = ret + str.slice(lastIndex);
409
+ // Make sure we don't keep a reference to the final string.
410
+ ret = "";
411
+ return result;
412
+ };
413
+ }
414
+ /**
415
+ * Determines the branch of the current node that is taken given the current
416
+ * character. This function is used to traverse the trie.
417
+ *
418
+ * @param decodeTree The trie.
419
+ * @param current The current node.
420
+ * @param nodeIdx The index right after the current node and its value.
421
+ * @param char The current character.
422
+ * @returns The index of the next node, or -1 if no branch is taken.
423
+ */
424
+ export function determineBranch(decodeTree, current, nodeIdx, char) {
425
+ const branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;
426
+ const jumpOffset = current & BinTrieFlags.JUMP_TABLE;
427
+ // Case 1: Single branch encoded in jump offset
428
+ if (branchCount === 0) {
429
+ return jumpOffset !== 0 && char === jumpOffset ? nodeIdx : -1;
430
+ }
431
+ // Case 2: Multiple branches encoded in jump table
432
+ if (jumpOffset) {
433
+ const value = char - jumpOffset;
434
+ return value < 0 || value >= branchCount
435
+ ? -1
436
+ : decodeTree[nodeIdx + value] - 1;
437
+ }
438
+ // Case 3: Multiple branches encoded in dictionary
439
+ // Binary search for the character.
440
+ let lo = nodeIdx;
441
+ let hi = lo + branchCount - 1;
442
+ while (lo <= hi) {
443
+ const mid = (lo + hi) >>> 1;
444
+ const midVal = decodeTree[mid];
445
+ if (midVal < char) {
446
+ lo = mid + 1;
447
+ }
448
+ else if (midVal > char) {
449
+ hi = mid - 1;
450
+ }
451
+ else {
452
+ return decodeTree[mid + branchCount];
453
+ }
454
+ }
455
+ return -1;
456
+ }
457
+ const htmlDecoder = getDecoder(htmlDecodeTree);
458
+ const xmlDecoder = getDecoder(xmlDecodeTree);
459
+ /**
460
+ * Decodes an HTML string.
461
+ *
462
+ * @param str The string to decode.
463
+ * @param mode The decoding mode.
464
+ * @returns The decoded string.
465
+ */
466
+ export function decodeHTML(str, mode = DecodingMode.Legacy) {
467
+ return htmlDecoder(str, mode);
468
+ }
469
+ /**
470
+ * Decodes an HTML string in an attribute.
471
+ *
472
+ * @param str The string to decode.
473
+ * @returns The decoded string.
474
+ */
475
+ export function decodeHTMLAttribute(str) {
476
+ return htmlDecoder(str, DecodingMode.Attribute);
477
+ }
478
+ /**
479
+ * Decodes an HTML string, requiring all entities to be terminated by a semicolon.
480
+ *
481
+ * @param str The string to decode.
482
+ * @returns The decoded string.
483
+ */
484
+ export function decodeHTMLStrict(str) {
485
+ return htmlDecoder(str, DecodingMode.Strict);
486
+ }
487
+ /**
488
+ * Decodes an XML string, requiring all entities to be terminated by a semicolon.
489
+ *
490
+ * @param str The string to decode.
491
+ * @returns The decoded string.
492
+ */
493
+ export function decodeXML(str) {
494
+ return xmlDecoder(str, DecodingMode.Strict);
495
+ }
496
+ //# sourceMappingURL=decode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decode.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["decode.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,iCAAiC,CAAC;AAC7D,OAAO,aAAa,MAAM,gCAAgC,CAAC;AAC3D,OAAO,eAAe,EAAE,EACpB,gBAAgB,EAChB,aAAa,GAChB,MAAM,uBAAuB,CAAC;AAE/B,uCAAuC;AACvC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAExE,IAAW,SAaV;AAbD,WAAW,SAAS;IAChB,wCAAQ,CAAA;IACR,0CAAS,CAAA;IACT,8CAAW,CAAA;IACX,0CAAS,CAAA;IACT,0CAAS,CAAA;IACT,gDAAY,CAAA;IACZ,iDAAa,CAAA;IACb,iDAAa,CAAA;IACb,iDAAa,CAAA;IACb,gDAAY,CAAA;IACZ,gDAAY,CAAA;IACZ,gDAAY,CAAA;AAChB,CAAC,EAbU,SAAS,KAAT,SAAS,QAanB;AAED,sFAAsF;AACtF,MAAM,YAAY,GAAG,QAAQ,CAAC;AAE9B,MAAM,CAAN,IAAY,YAIX;A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AC;AACpD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAW;IACxC,OAAO,WAAW,CAAC,GAAG,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;AACjD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW;IACjC,OAAO,UAAU,CAAC,GAAG,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point.
3
+ */
4
+ export declare const fromCodePoint: (...codePoints: number[]) => string;
5
+ /**
6
+ * Replace the given code point with a replacement character if it is a
7
+ * surrogate or is outside the valid range. Otherwise return the code
8
+ * point unchanged.
9
+ */
10
+ export declare function replaceCodePoint(codePoint: number): number;
11
+ /**
12
+ * Replace the code point if relevant, then convert it to a string.
13
+ *
14
+ * @deprecated Use `fromCodePoint(replaceCodePoint(codePoint))` instead.
15
+ * @param codePoint The code point to decode.
16
+ * @returns The decoded code point.
17
+ */
18
+ export default function decodeCodePoint(codePoint: number): string;
19
+ //# sourceMappingURL=decode_codepoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decode_codepoint.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["decode_codepoint.ts"],"names":[],"mappings":"AAkCA;;GAEG;AACH,eAAO,MAAM,aAAa,qCAgBrB,CAAC;AAEN;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,UAMjD;AAED;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEjE"}
@@ -0,0 +1,71 @@
1
+ // Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134
2
+ var _a;
3
+ const decodeMap = new Map([
4
+ [0, 65533],
5
+ // C1 Unicode control character reference replacements
6
+ [128, 8364],
7
+ [130, 8218],
8
+ [131, 402],
9
+ [132, 8222],
10
+ [133, 8230],
11
+ [134, 8224],
12
+ [135, 8225],
13
+ [136, 710],
14
+ [137, 8240],
15
+ [138, 352],
16
+ [139, 8249],
17
+ [140, 338],
18
+ [142, 381],
19
+ [145, 8216],
20
+ [146, 8217],
21
+ [147, 8220],
22
+ [148, 8221],
23
+ [149, 8226],
24
+ [150, 8211],
25
+ [151, 8212],
26
+ [152, 732],
27
+ [153, 8482],
28
+ [154, 353],
29
+ [155, 8250],
30
+ [156, 339],
31
+ [158, 382],
32
+ [159, 376],
33
+ ]);
34
+ /**
35
+ * Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point.
36
+ */
37
+ export const fromCodePoint =
38
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins
39
+ (_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : function (codePoint) {
40
+ let output = "";
41
+ if (codePoint > 0xffff) {
42
+ codePoint -= 0x10000;
43
+ output += String.fromCharCode(((codePoint >>> 10) & 0x3ff) | 0xd800);
44
+ codePoint = 0xdc00 | (codePoint & 0x3ff);
45
+ }
46
+ output += String.fromCharCode(codePoint);
47
+ return output;
48
+ };
49
+ /**
50
+ * Replace the given code point with a replacement character if it is a
51
+ * surrogate or is outside the valid range. Otherwise return the code
52
+ * point unchanged.
53
+ */
54
+ export function replaceCodePoint(codePoint) {
55
+ var _a;
56
+ if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) {
57
+ return 0xfffd;
58
+ }
59
+ return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint;
60
+ }
61
+ /**
62
+ * Replace the code point if relevant, then convert it to a string.
63
+ *
64
+ * @deprecated Use `fromCodePoint(replaceCodePoint(codePoint))` instead.
65
+ * @param codePoint The code point to decode.
66
+ * @returns The decoded code point.
67
+ */
68
+ export default function decodeCodePoint(codePoint) {
69
+ return fromCodePoint(replaceCodePoint(codePoint));
70
+ }
71
+ //# sourceMappingURL=decode_codepoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decode_codepoint.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["decode_codepoint.ts"],"names":[],"mappings":"AAAA,qHAAqH;;AAErH,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC;IACtB,CAAC,CAAC,EAAE,KAAK,CAAC;IACV,sDAAsD;IACtD,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;CACb,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa;AACtB,iHAAiH;AACjH,MAAA,MAAM,CAAC,aAAa,mCACpB,UAAU,SAAiB;IACvB,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,IAAI,SAAS,GAAG,MAAM,EAAE;QACpB,SAAS,IAAI,OAAO,CAAC;QACrB,MAAM,IAAI,MAAM,CAAC,YAAY,CACzB,CAAC,CAAC,SAAS,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,GAAG,MAAM,CACxC,CAAC;QACF,SAAS,GAAG,MAAM,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC,CAAC;KAC5C;IAED,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACzC,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAEN;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAAiB;;IAC9C,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,SAAS,IAAI,MAAM,CAAC,IAAI,SAAS,GAAG,QAAQ,EAAE;QACtE,OAAO,MAAM,CAAC;KACjB;IAED,OAAO,MAAA,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,mCAAI,SAAS,CAAC;AACjD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,SAAiB;IACrD,OAAO,aAAa,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC;AACtD,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Encodes all characters in the input using HTML entities. This includes
3
+ * characters that are valid ASCII characters in HTML documents, such as `#`.
4
+ *
5
+ * To get a more compact output, consider using the `encodeNonAsciiHTML`
6
+ * function, which will only encode characters that are not valid in HTML
7
+ * documents, as well as non-ASCII characters.
8
+ *
9
+ * If a character has no equivalent entity, a numeric hexadecimal reference
10
+ * (eg. `&#xfc;`) will be used.
11
+ */
12
+ export declare function encodeHTML(data: string): string;
13
+ /**
14
+ * Encodes all non-ASCII characters, as well as characters not valid in HTML
15
+ * documents using HTML entities. This function will not encode characters that
16
+ * are valid in HTML documents, such as `#`.
17
+ *
18
+ * If a character has no equivalent entity, a numeric hexadecimal reference
19
+ * (eg. `&#xfc;`) will be used.
20
+ */
21
+ export declare function encodeNonAsciiHTML(data: string): string;
22
+ //# sourceMappingURL=encode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encode.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["encode.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AACD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvD"}