@openclaw/slack 2026.8.1-beta.2 → 2026.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/dist/account-configured-sUohAxZr.js +33 -0
  2. package/dist/account-inspect-CN2hBsim.js +87 -0
  3. package/dist/account-inspect-api.js +1 -1
  4. package/dist/{accounts-CK4AVI2_.js → accounts-Dm_H77gH.js} +12 -11
  5. package/dist/{accounts.runtime-Cb7QwWBz.js → accounts.runtime-DRuEK6mL.js} +1 -1
  6. package/dist/{action-runtime-BkGe7ny_.js → action-runtime-044ldvNL.js} +80 -79
  7. package/dist/action-runtime.runtime-BL3KzX13.js +2 -0
  8. package/dist/{actions-BTDXwwE3.js → actions-BI7JkfVm.js} +273 -263
  9. package/dist/api.js +14 -14
  10. package/dist/{approval-handler.runtime-CJaNzAq2.js → approval-handler.runtime-DYv0UIZS.js} +53 -174
  11. package/dist/{channel-D_tovcUL.js → channel-1vIJOzPx.js} +134 -160
  12. package/dist/channel-config-api.js +1 -1
  13. package/dist/channel-plugin-api.js +1 -1
  14. package/dist/{channel-type-B9MSdoGN.js → channel-type-DlFSKeIZ.js} +3 -7
  15. package/dist/{channel.setup-Bch9dYmA.js → channel.setup-ofDi3_Pu.js} +34 -49
  16. package/dist/{config-schema-xto5jFIx.js → config-schema-BVIMyiDN.js} +42 -19
  17. package/dist/configured-state.js +34 -0
  18. package/dist/conversation-binding-route-DFVLUdYF.js +115 -0
  19. package/dist/{directory-config-CNBz8lJa.js → directory-config-DqfQ42OV.js} +1 -1
  20. package/dist/directory-contract-api.js +1 -1
  21. package/dist/{directory-live-CFKUtW9E.js → directory-live-BPaNHjmP.js} +2 -2
  22. package/dist/{group-policy-c4RP9bjc.js → group-policy-BdwszjYn.js} +625 -773
  23. package/dist/{message-tool-api-BykQB4AU.js → message-tool-api-CJ0kjcg5.js} +23 -5
  24. package/dist/message-tool-api.js +1 -1
  25. package/dist/{monitor-1nF1NtqT.js → monitor-Dq5Cmrvp.js} +3 -3
  26. package/dist/{outbound-adapter-S81tsswN.js → outbound-adapter-DYaI8ThX.js} +101 -66
  27. package/dist/{pipeline.runtime-BvYsM5JO.js → pipeline.runtime-Bd22U0ga.js} +494 -474
  28. package/dist/{policy-TapwbeaT.js → policy-CtQVbde1.js} +2 -1
  29. package/dist/{probe-HoEg_WxB.js → probe-0usmAb0i.js} +209 -22
  30. package/dist/{provider-CDNvBXUi.js → provider-CN_8hFv2.js} +296 -178
  31. package/dist/{relay-source-C9leF11u.js → relay-source-BNGpsdwV.js} +1 -1
  32. package/dist/{replies-CeOfv82I.js → replies-BSiRQOJ1.js} +48 -27
  33. package/dist/{resolve-channels-CNPrxaXY.js → resolve-channels-Czheznc8.js} +1 -1
  34. package/dist/{resolve-users-Dzomuwnr.js → resolve-users-BAOlNimr.js} +1 -1
  35. package/dist/runtime-api.js +11 -11
  36. package/dist/{scopes-cYXKkrRD.js → scopes-COSlmhnH.js} +1 -1
  37. package/dist/security-contract-api.js +1 -1
  38. package/dist/{send-Nor0iBwY.js → send-DS9ICrBI.js} +88 -100
  39. package/dist/send-results-eeOu_HYm.js +23 -0
  40. package/dist/{send.runtime-BmgNe6S9.js → send.runtime-D_Bb6IuH.js} +1 -1
  41. package/dist/setup-plugin-api.js +1 -1
  42. package/dist/{setup-surface-CbX1-Knh.js → setup-surface-BGnd2pSe.js} +6 -6
  43. package/dist/{shared-zdT5AMp-.js → shared-D5B-5hBg.js} +35 -9
  44. package/dist/{slash-dispatch.runtime-Bnr9GR1S.js → slash-dispatch.runtime-CilDmI0c.js} +2 -2
  45. package/node_modules/@slack/bolt/node_modules/@types/node/README.md +1 -1
  46. package/node_modules/@slack/bolt/node_modules/@types/node/child_process.d.ts +0 -1
  47. package/node_modules/@slack/bolt/node_modules/@types/node/crypto.d.ts +6 -6
  48. package/node_modules/@slack/bolt/node_modules/@types/node/dns/promises.d.ts +5 -5
  49. package/node_modules/@slack/bolt/node_modules/@types/node/dns.d.ts +5 -5
  50. package/node_modules/@slack/bolt/node_modules/@types/node/fs.d.ts +7 -0
  51. package/node_modules/@slack/bolt/node_modules/@types/node/http.d.ts +30 -0
  52. package/node_modules/@slack/bolt/node_modules/@types/node/http2.d.ts +4 -4
  53. package/node_modules/@slack/bolt/node_modules/@types/node/os.d.ts +30 -30
  54. package/node_modules/@slack/bolt/node_modules/@types/node/package.json +2 -2
  55. package/node_modules/@slack/bolt/node_modules/@types/node/perf_hooks.d.ts +2 -1
  56. package/node_modules/@slack/bolt/node_modules/@types/node/process.d.ts +42 -43
  57. package/node_modules/@slack/bolt/node_modules/@types/node/quic.d.ts +1049 -84
  58. package/node_modules/@slack/bolt/node_modules/@types/node/sqlite.d.ts +14 -1
  59. package/node_modules/@slack/bolt/node_modules/@types/node/stream/iter.d.ts +3 -2
  60. package/node_modules/@slack/bolt/node_modules/@types/node/test.d.ts +61 -0
  61. package/node_modules/@slack/bolt/node_modules/@types/node/v8.d.ts +20 -23
  62. package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/README.md +2 -0
  63. package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/dist/index.d.ts +20 -0
  64. package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/dist/index.js +20 -14
  65. package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/dist/index.js.map +1 -1
  66. package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/package.json +1 -1
  67. package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/README.md +2 -0
  68. package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/dist/index.d.ts +20 -0
  69. package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/dist/index.js +20 -14
  70. package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/dist/index.js.map +1 -1
  71. package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/package.json +1 -1
  72. package/node_modules/@slack/socket-mode/node_modules/@types/node/README.md +1 -1
  73. package/node_modules/@slack/socket-mode/node_modules/@types/node/child_process.d.ts +0 -1
  74. package/node_modules/@slack/socket-mode/node_modules/@types/node/crypto.d.ts +6 -6
  75. package/node_modules/@slack/socket-mode/node_modules/@types/node/dns/promises.d.ts +5 -5
  76. package/node_modules/@slack/socket-mode/node_modules/@types/node/dns.d.ts +5 -5
  77. package/node_modules/@slack/socket-mode/node_modules/@types/node/fs.d.ts +7 -0
  78. package/node_modules/@slack/socket-mode/node_modules/@types/node/http.d.ts +30 -0
  79. package/node_modules/@slack/socket-mode/node_modules/@types/node/http2.d.ts +4 -4
  80. package/node_modules/@slack/socket-mode/node_modules/@types/node/os.d.ts +30 -30
  81. package/node_modules/@slack/socket-mode/node_modules/@types/node/package.json +2 -2
  82. package/node_modules/@slack/socket-mode/node_modules/@types/node/perf_hooks.d.ts +2 -1
  83. package/node_modules/@slack/socket-mode/node_modules/@types/node/process.d.ts +42 -43
  84. package/node_modules/@slack/socket-mode/node_modules/@types/node/quic.d.ts +1049 -84
  85. package/node_modules/@slack/socket-mode/node_modules/@types/node/sqlite.d.ts +14 -1
  86. package/node_modules/@slack/socket-mode/node_modules/@types/node/stream/iter.d.ts +3 -2
  87. package/node_modules/@slack/socket-mode/node_modules/@types/node/test.d.ts +61 -0
  88. package/node_modules/@slack/socket-mode/node_modules/@types/node/v8.d.ts +20 -23
  89. package/node_modules/@slack/web-api/node_modules/@types/node/README.md +1 -1
  90. package/node_modules/@slack/web-api/node_modules/@types/node/child_process.d.ts +0 -1
  91. package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +6 -6
  92. package/node_modules/@slack/web-api/node_modules/@types/node/dns/promises.d.ts +5 -5
  93. package/node_modules/@slack/web-api/node_modules/@types/node/dns.d.ts +5 -5
  94. package/node_modules/@slack/web-api/node_modules/@types/node/fs.d.ts +7 -0
  95. package/node_modules/@slack/web-api/node_modules/@types/node/http.d.ts +30 -0
  96. package/node_modules/@slack/web-api/node_modules/@types/node/http2.d.ts +4 -4
  97. package/node_modules/@slack/web-api/node_modules/@types/node/os.d.ts +30 -30
  98. package/node_modules/@slack/web-api/node_modules/@types/node/package.json +2 -2
  99. package/node_modules/@slack/web-api/node_modules/@types/node/perf_hooks.d.ts +2 -1
  100. package/node_modules/@slack/web-api/node_modules/@types/node/process.d.ts +42 -43
  101. package/node_modules/@slack/web-api/node_modules/@types/node/quic.d.ts +1049 -84
  102. package/node_modules/@slack/web-api/node_modules/@types/node/sqlite.d.ts +14 -1
  103. package/node_modules/@slack/web-api/node_modules/@types/node/stream/iter.d.ts +3 -2
  104. package/node_modules/@slack/web-api/node_modules/@types/node/test.d.ts +61 -0
  105. package/node_modules/@slack/web-api/node_modules/@types/node/v8.d.ts +20 -23
  106. package/node_modules/typebox/build/format/date.d.mts +1 -1
  107. package/node_modules/typebox/build/format/date.mjs +1 -1
  108. package/node_modules/typebox/build/format/date_time.d.mts +2 -2
  109. package/node_modules/typebox/build/format/date_time.mjs +3 -3
  110. package/node_modules/typebox/build/format/email.d.mts +1 -1
  111. package/node_modules/typebox/build/format/email.mjs +2 -2
  112. package/node_modules/typebox/build/format/hostname.mjs +2 -10
  113. package/node_modules/typebox/build/format/idn_email.d.mts +1 -1
  114. package/node_modules/typebox/build/format/idn_email.mjs +3 -3
  115. package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -0
  116. package/node_modules/typebox/build/format/idn_hostname.mjs +3 -11
  117. package/node_modules/typebox/build/format/idna/format/bidi.d.mts +3 -0
  118. package/node_modules/typebox/build/format/idna/format/bidi.mjs +98 -0
  119. package/node_modules/typebox/build/format/idna/format/puny.d.mts +3 -0
  120. package/node_modules/typebox/build/format/idna/format/puny.mjs +144 -0
  121. package/node_modules/typebox/build/format/idna/hostname.d.mts +1 -0
  122. package/node_modules/typebox/build/format/idna/hostname.mjs +16 -0
  123. package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +1 -0
  124. package/node_modules/typebox/build/format/idna/idn-hostname.mjs +23 -0
  125. package/node_modules/typebox/build/format/idna/index.d.mts +2 -0
  126. package/node_modules/typebox/build/format/idna/index.mjs +2 -0
  127. package/node_modules/typebox/build/format/idna/label/ascii.d.mts +1 -0
  128. package/node_modules/typebox/build/format/idna/label/ascii.mjs +9 -0
  129. package/node_modules/typebox/build/format/idna/label/puny.d.mts +1 -0
  130. package/node_modules/typebox/build/format/idna/label/puny.mjs +28 -0
  131. package/node_modules/typebox/build/format/idna/label/unicode.d.mts +1 -0
  132. package/node_modules/typebox/build/format/idna/label/unicode.mjs +106 -0
  133. package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +30 -0
  134. package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +70 -0
  135. package/node_modules/typebox/build/format/ipv4.d.mts +0 -1
  136. package/node_modules/typebox/build/format/ipv4.mjs +2 -32
  137. package/node_modules/typebox/build/format/ipv6.mjs +2 -61
  138. package/node_modules/typebox/build/format/iri.d.mts +2 -2
  139. package/node_modules/typebox/build/format/iri.mjs +26 -8
  140. package/node_modules/typebox/build/format/iri_reference.d.mts +2 -2
  141. package/node_modules/typebox/build/format/iri_reference.mjs +9 -55
  142. package/node_modules/typebox/build/format/regex.d.mts +1 -2
  143. package/node_modules/typebox/build/format/regex.mjs +2 -6
  144. package/node_modules/typebox/build/format/time.d.mts +2 -2
  145. package/node_modules/typebox/build/format/time.mjs +19 -14
  146. package/node_modules/typebox/build/format/uri.d.mts +1 -1
  147. package/node_modules/typebox/build/format/uri.mjs +3 -130
  148. package/node_modules/typebox/build/format/uri_reference.d.mts +1 -1
  149. package/node_modules/typebox/build/format/uri_reference.mjs +2 -3
  150. package/node_modules/typebox/build/format/uri_template.d.mts +2 -3
  151. package/node_modules/typebox/build/format/uri_template.mjs +4 -5
  152. package/node_modules/typebox/build/format/url.d.mts +3 -3
  153. package/node_modules/typebox/build/format/url.mjs +4 -5
  154. package/node_modules/typebox/build/guard/emit.d.mts +3 -1
  155. package/node_modules/typebox/build/guard/emit.mjs +12 -5
  156. package/node_modules/typebox/build/guard/guard.d.mts +8 -2
  157. package/node_modules/typebox/build/guard/guard.mjs +25 -4
  158. package/node_modules/typebox/build/guard/string.d.mts +2 -2
  159. package/node_modules/typebox/build/guard/string.mjs +7 -7
  160. package/node_modules/typebox/build/schema/engine/_context.mjs +3 -3
  161. package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -2
  162. package/node_modules/typebox/build/schema/engine/_regexp.d.mts +2 -0
  163. package/node_modules/typebox/build/schema/engine/_regexp.mjs +4 -0
  164. package/node_modules/typebox/build/schema/engine/_stack.mjs +12 -13
  165. package/node_modules/typebox/build/schema/engine/additionalItems.mjs +17 -7
  166. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -3
  167. package/node_modules/typebox/build/schema/engine/contains.mjs +18 -6
  168. package/node_modules/typebox/build/schema/engine/enum.mjs +1 -1
  169. package/node_modules/typebox/build/schema/engine/items.mjs +26 -6
  170. package/node_modules/typebox/build/schema/engine/maxContains.mjs +3 -3
  171. package/node_modules/typebox/build/schema/engine/minContains.mjs +14 -4
  172. package/node_modules/typebox/build/schema/engine/not.mjs +4 -2
  173. package/node_modules/typebox/build/schema/engine/oneOf.mjs +7 -6
  174. package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -2
  175. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +4 -3
  176. package/node_modules/typebox/build/schema/engine/ref.mjs +1 -7
  177. package/node_modules/typebox/build/schema/engine/schema.mjs +13 -4
  178. package/node_modules/typebox/build/schema/engine/type.mjs +1 -1
  179. package/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
  180. package/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
  181. package/node_modules/typebox/build/schema/static/propertyNames.d.mts +5 -0
  182. package/node_modules/typebox/build/schema/static/propertyNames.mjs +3 -0
  183. package/node_modules/typebox/build/schema/static/schema.d.mts +3 -0
  184. package/node_modules/typebox/build/schema/types/index.d.mts +0 -2
  185. package/node_modules/typebox/build/schema/types/index.mjs +0 -2
  186. package/node_modules/typebox/build/system/memory/clone.mjs +14 -11
  187. package/node_modules/typebox/build/system/memory/discard.mjs +6 -5
  188. package/node_modules/typebox/build/system/settings/settings.d.mts +9 -0
  189. package/node_modules/typebox/build/system/settings/settings.mjs +2 -0
  190. package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +6 -1
  191. package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +16 -3
  192. package/node_modules/typebox/build/type/engine/call/instantiate.mjs +34 -4
  193. package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +5 -5
  194. package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +20 -26
  195. package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +6 -10
  196. package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +9 -13
  197. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +7 -4
  198. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +12 -19
  199. package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +4 -20
  200. package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +8 -20
  201. package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +4 -4
  202. package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +11 -8
  203. package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +1 -1
  204. package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +3 -4
  205. package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +17 -2
  206. package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +26 -6
  207. package/node_modules/typebox/build/type/engine/exclude/operation.mjs +3 -4
  208. package/node_modules/typebox/build/type/engine/extract/operation.d.mts +1 -1
  209. package/node_modules/typebox/build/type/engine/extract/operation.mjs +3 -4
  210. package/node_modules/typebox/build/type/engine/priority/priority.d.mts +2 -2
  211. package/node_modules/typebox/build/type/engine/priority/priority.mjs +3 -4
  212. package/node_modules/typebox/build/type/script/mapping.d.mts +32 -29
  213. package/node_modules/typebox/build/type/script/mapping.mjs +18 -25
  214. package/node_modules/typebox/build/type/script/parser.d.mts +19 -25
  215. package/node_modules/typebox/build/type/script/parser.mjs +27 -23
  216. package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
  217. package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
  218. package/node_modules/typebox/package.json +27 -27
  219. package/node_modules/typebox/readme.md +79 -82
  220. package/node_modules/ws/lib/permessage-deflate.js +3 -1
  221. package/node_modules/ws/package.json +1 -1
  222. package/openclaw.plugin.json +57 -7
  223. package/package.json +9 -9
  224. package/dist/account-configured-BwfXBo_F.js +0 -14
  225. package/dist/account-inspect-Drw2gAiN.js +0 -89
  226. package/dist/account-reply-mode-DrUXogvO.js +0 -14
  227. package/dist/action-runtime.runtime-D9I6uc0Q.js +0 -2
  228. package/dist/actions.runtime-DLFyUkvg.js +0 -2
  229. package/dist/block-text-YtiNkqmx.js +0 -79
  230. package/dist/runtime-api-Cj9nxBNv.js +0 -10
  231. package/node_modules/p-map/index.d.ts +0 -155
  232. package/node_modules/p-map/index.js +0 -285
  233. package/node_modules/p-map/license +0 -9
  234. package/node_modules/p-map/package.json +0 -57
  235. package/node_modules/p-map/readme.md +0 -190
  236. package/node_modules/typebox/build/format/_idna.d.mts +0 -2
  237. package/node_modules/typebox/build/format/_idna.mjs +0 -246
  238. package/node_modules/typebox/build/format/_puny.d.mts +0 -1
  239. package/node_modules/typebox/build/format/_puny.mjs +0 -77
  240. package/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -3
  241. package/node_modules/typebox/build/schema/resolve/ref.mjs +0 -146
  242. package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +0 -9
  243. package/node_modules/typebox/build/schema/types/contentEncoding.mjs +0 -13
  244. package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +0 -9
  245. package/node_modules/typebox/build/schema/types/contentMediaType.mjs +0 -13
  246. package/dist/{security-audit-DR097212.js → security-audit-B_yKr7MW.js} +1 -1
@@ -298,10 +298,23 @@ declare module "node:sqlite" {
298
298
  * Loads a shared library into the database connection. This method is a wrapper
299
299
  * around [`sqlite3_load_extension()`](https://www.sqlite.org/c3ref/load_extension.html). It is required to enable the
300
300
  * `allowExtension` option when constructing the `DatabaseSync` instance.
301
+ *
302
+ * ```js
303
+ * import { DatabaseSync } from 'node:sqlite';
304
+ * const database = new DatabaseSync(':memory:', { allowExtension: true });
305
+ *
306
+ * // Load using the entry point derived from the filename.
307
+ * database.loadExtension('./decimal.dylib');
308
+ *
309
+ * // Override the entry point when the derived name does not match.
310
+ * database.loadExtension('./base64.dylib', 'sqlite3_base64_init');
301
311
  * @since v22.13.0
302
312
  * @param path The path to the shared library to load.
313
+ * @param entryPoint The name of the extension's entry-point function. When
314
+ * omitted, SQLite derives the entry point from the shared library's filename;
315
+ * pass this argument explicitly when the derived name does not match.
303
316
  */
304
- loadExtension(path: string): void;
317
+ loadExtension(path: string, entryPoint?: string): void;
305
318
  /**
306
319
  * Enables or disables the `loadExtension` SQL function, and the `loadExtension()`
307
320
  * method. When `allowExtension` is `false` when constructing, you cannot enable
@@ -311,8 +311,9 @@ declare module "node:stream/iter" {
311
311
  * return `false` or `-1`, deferring to the async path. The per-write
312
312
  * `options.signal` parameter from the Writer interface is also ignored.
313
313
  *
314
- * The result is cached per instance -- calling `fromWritable()` twice with the
315
- * same stream returns the same Writer.
314
+ * The result is cached per instance and backpressure policy -- calling
315
+ * `fromWritable()` twice with the same stream and `backpressure` option returns
316
+ * the same Writer.
316
317
  *
317
318
  * For duck-typed streams that do not expose `writableHighWaterMark`,
318
319
  * `writableLength`, or similar properties, sensible defaults are used.
@@ -264,6 +264,15 @@ declare module "node:test" {
264
264
  * @since v22.1.0
265
265
  */
266
266
  testSkipPatterns?: string | RegExp | ReadonlyArray<string | RegExp> | undefined;
267
+ /**
268
+ * A tag name, or an array of tag names,
269
+ * used to filter tests by their declared tags. Tests must contain every
270
+ * listed tag to run. Equivalent to passing `--experimental-test-tag-filter`
271
+ * on the command line. See [Test tags](https://nodejs.org/docs/latest-v26.x/api/test.html#test-tags).
272
+ * @default undefined
273
+ * @since v26.2.0
274
+ */
275
+ testTagFilters?: string | readonly string[] | undefined;
267
276
  /**
268
277
  * The number of milliseconds after which the test execution will fail.
269
278
  * If unspecified, subtests inherit this value from their parent.
@@ -668,6 +677,12 @@ declare module "node:test" {
668
677
  * The nesting level of the test.
669
678
  */
670
679
  nesting: number;
680
+ /**
681
+ * The flattened lowercased tags declared on the test
682
+ * and its ancestor suites, in declaration order. Empty for untagged tests.
683
+ * See [Test tags](https://nodejs.org/docs/latest-v26.x/api/test.html#test-tags).
684
+ */
685
+ tags: string[];
671
686
  /**
672
687
  * A numeric identifier for this test instance, unique
673
688
  * within the test file's process. Consistent across all events for the same
@@ -696,6 +711,12 @@ declare module "node:test" {
696
711
  * The nesting level of the test.
697
712
  */
698
713
  nesting: number;
714
+ /**
715
+ * The flattened lowercased tags declared on the test
716
+ * and its ancestor suites, in declaration order. Empty for untagged tests.
717
+ * See [Test tags](https://nodejs.org/docs/latest-v26.x/api/test.html#test-tags).
718
+ */
719
+ tags: string[];
699
720
  /**
700
721
  * A numeric identifier for this test instance, unique
701
722
  * within the test file's process. Consistent across all events for the same
@@ -717,6 +738,12 @@ declare module "node:test" {
717
738
  * The nesting level of the test.
718
739
  */
719
740
  nesting: number;
741
+ /**
742
+ * The flattened lowercased tags declared on the test
743
+ * and its ancestor suites, in declaration order. Empty for untagged tests.
744
+ * See [Test tags](https://nodejs.org/docs/latest-v26.x/api/test.html#test-tags).
745
+ */
746
+ tags: string[];
720
747
  /**
721
748
  * A numeric identifier for this test instance, unique
722
749
  * within the test file's process. Consistent across all events for the same
@@ -762,6 +789,12 @@ declare module "node:test" {
762
789
  * The nesting level of the test.
763
790
  */
764
791
  nesting: number;
792
+ /**
793
+ * The flattened lowercased tags declared on the test
794
+ * and its ancestor suites, in declaration order. Empty for untagged tests.
795
+ * See [Test tags](https://nodejs.org/docs/latest-v26.x/api/test.html#test-tags).
796
+ */
797
+ tags: string[];
765
798
  /**
766
799
  * A numeric identifier for this test instance, unique
767
800
  * within the test file's process. Consistent across all events for the same
@@ -823,6 +856,12 @@ declare module "node:test" {
823
856
  * The nesting level of the test.
824
857
  */
825
858
  nesting: number;
859
+ /**
860
+ * The flattened lowercased tags declared on the test
861
+ * and its ancestor suites, in declaration order. Empty for untagged tests.
862
+ * See [Test tags](https://nodejs.org/docs/latest-v26.x/api/test.html#test-tags).
863
+ */
864
+ tags: string[];
826
865
  /**
827
866
  * A numeric identifier for this test instance, unique
828
867
  * within the test file's process. Consistent across all events for the same
@@ -861,6 +900,12 @@ declare module "node:test" {
861
900
  * The nesting level of the test.
862
901
  */
863
902
  nesting: number;
903
+ /**
904
+ * The flattened lowercased tags declared on the test
905
+ * and its ancestor suites, in declaration order. Empty for untagged tests.
906
+ * See [Test tags](https://nodejs.org/docs/latest-v26.x/api/test.html#test-tags).
907
+ */
908
+ tags: string[];
864
909
  /**
865
910
  * A numeric identifier for this test instance, unique
866
911
  * within the test file's process. Consistent across all events for the same
@@ -1082,6 +1127,13 @@ declare module "node:test" {
1082
1127
  * @since v21.7.0, v20.12.0
1083
1128
  */
1084
1129
  readonly attempt: number;
1130
+ /**
1131
+ * A frozen array of the test's flattened lowercased tags, in declaration
1132
+ * order, including any tags inherited from ancestor suites. Empty when the
1133
+ * test has no tags. See [Test tags](https://nodejs.org/docs/latest-v26.x/api/test.html#test-tags).
1134
+ * @since v26.2.0
1135
+ */
1136
+ readonly tags: readonly string[];
1085
1137
  /**
1086
1138
  * The unique identifier of the worker running the current test file. This value is
1087
1139
  * derived from the `NODE_TEST_WORKER_ID` environment variable. When running tests
@@ -1443,6 +1495,15 @@ declare module "node:test" {
1443
1495
  * @default false
1444
1496
  */
1445
1497
  skip?: boolean | string | undefined;
1498
+ /**
1499
+ * An array of string labels associated with the test.
1500
+ * Used together with `--experimental-test-tag-filter` to filter which
1501
+ * tests run. Tags inherit from suites to nested tests by union. See
1502
+ * [Test tags](https://nodejs.org/docs/latest-v26.x/api/test.html#test-tags).
1503
+ * @default []
1504
+ * @since v26.2.0
1505
+ */
1506
+ tags?: readonly string[] | undefined;
1446
1507
  /**
1447
1508
  * A number of milliseconds the test will fail after. If unspecified, subtests inherit this
1448
1509
  * value from their parent.
@@ -89,23 +89,22 @@ declare module "node:v8" {
89
89
  * `total_allocated_bytes` The value of total allocated bytes since the Isolate
90
90
  * creation.
91
91
  *
92
- * ```js
92
+ * ```json
93
93
  * {
94
- * total_heap_size: 7326976,
95
- * total_heap_size_executable: 4194304,
96
- * total_physical_size: 7326976,
97
- * total_available_size: 1152656,
98
- * used_heap_size: 3476208,
99
- * heap_size_limit: 1535115264,
100
- * malloced_memory: 16384,
101
- * peak_malloced_memory: 1127496,
102
- * does_zap_garbage: 0,
103
- * number_of_native_contexts: 1,
104
- * number_of_detached_contexts: 0,
105
- * total_global_handles_size: 8192,
106
- * used_global_handles_size: 3296,
107
- * external_memory: 318824,
108
- * total_allocated_bytes: 45224088
94
+ * "total_heap_size": 7326976,
95
+ * "total_heap_size_executable": 4194304,
96
+ * "total_physical_size": 7326976,
97
+ * "total_available_size": 1152656,
98
+ * "used_heap_size": 3476208,
99
+ * "heap_size_limit": 1535115264,
100
+ * "malloced_memory": 16384,
101
+ * "peak_malloced_memory": 1127496,
102
+ * "does_zap_garbage": 0,
103
+ * "number_of_native_contexts": 1,
104
+ * "number_of_detached_contexts": 0,
105
+ * "total_global_handles_size": 8192,
106
+ * "used_global_handles_size": 3296,
107
+ * "external_memory": 318824
109
108
  * }
110
109
  * ```
111
110
  * @since v1.0.0
@@ -386,12 +385,12 @@ declare module "node:v8" {
386
385
  * V8 [`GetHeapCodeAndMetadataStatistics`](https://v8docs.nodesource.com/node-13.2/d5/dda/classv8_1_1_isolate.html#a6079122af17612ef54ef3348ce170866) API. Returns an object with the
387
386
  * following properties:
388
387
  *
389
- * ```js
388
+ * ```json
390
389
  * {
391
- * code_and_metadata_size: 212208,
392
- * bytecode_and_metadata_size: 161368,
393
- * external_script_source_size: 1410794,
394
- * cpu_profiler_metadata_size: 0,
390
+ * "code_and_metadata_size": 212208,
391
+ * "bytecode_and_metadata_size": 161368,
392
+ * "external_script_source_size": 1410794,
393
+ * "cpu_profiler_metadata_size": 0
395
394
  * }
396
395
  * ```
397
396
  * @since v12.8.0
@@ -963,8 +962,6 @@ declare module "node:v8" {
963
962
  * For example, if the `entry.js` contains the following script:
964
963
  *
965
964
  * ```js
966
- * 'use strict';
967
- *
968
965
  * import fs from 'node:fs';
969
966
  * import zlib from 'node:zlib';
970
967
  * import path from 'node:path';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Returns true if the value is a ISO8601 Date component string
3
- * @source ajv-formats
3
+ * @description https://datatracker.ietf.org/doc/html/rfc3339
4
4
  * @example `2020-12-12`
5
5
  */
6
6
  export declare function IsDate(value: string): boolean;
@@ -5,7 +5,7 @@ function IsLeapYear(year) {
5
5
  }
6
6
  /**
7
7
  * Returns true if the value is a ISO8601 Date component string
8
- * @source ajv-formats
8
+ * @description https://datatracker.ietf.org/doc/html/rfc3339
9
9
  * @example `2020-12-12`
10
10
  */
11
11
  export function IsDate(value) {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Returns true if the value is a ISO8601 DateTime string
3
- * @source ajv-formats
3
+ * @specification https://datatracker.ietf.org/doc/html/rfc3339
4
4
  * @example `2020-12-12T20:20:40+00:00`
5
5
  */
6
- export declare function IsDateTime(value: string, strictTimeZone?: boolean): boolean;
6
+ export declare function IsDateTime(value: string): boolean;
@@ -2,10 +2,10 @@ import { IsDate } from './date.mjs';
2
2
  import { IsTime } from './time.mjs';
3
3
  /**
4
4
  * Returns true if the value is a ISO8601 DateTime string
5
- * @source ajv-formats
5
+ * @specification https://datatracker.ietf.org/doc/html/rfc3339
6
6
  * @example `2020-12-12T20:20:40+00:00`
7
7
  */
8
- export function IsDateTime(value, strictTimeZone = true) {
8
+ export function IsDateTime(value) {
9
9
  const dateTime = value.split(/T/i);
10
- return dateTime.length === 2 && IsDate(dateTime[0]) && IsTime(dateTime[1], strictTimeZone);
10
+ return dateTime.length === 2 && IsDate(dateTime[0]) && IsTime(dateTime[1]);
11
11
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * Returns true if the value is an Email
3
- * @specification ajv-formats
3
+ * @specification https://datatracker.ietf.org/doc/html/rfc5322
4
4
  */
5
5
  export declare function IsEmail(value: string): boolean;
@@ -1,7 +1,7 @@
1
- const Email = /^(?!.*\.\.)[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i;
1
+ const Email = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[^"\\]|\\.)*")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\[(?:IPv6:[a-f0-9:]+|(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\])$/i;
2
2
  /**
3
3
  * Returns true if the value is an Email
4
- * @specification ajv-formats
4
+ * @specification https://datatracker.ietf.org/doc/html/rfc5322
5
5
  */
6
6
  export function IsEmail(value) {
7
7
  return Email.test(value);
@@ -1,4 +1,4 @@
1
- import * as Idna from './_idna.mjs';
1
+ import * as Idna from './idna/index.mjs';
2
2
  /**
3
3
  * Returns true if the value is a valid hostname.
4
4
  * @specification https://tools.ietf.org/html/rfc1123
@@ -6,13 +6,5 @@ import * as Idna from './_idna.mjs';
6
6
  * @specification https://tools.ietf.org/html/rfc5892
7
7
  */
8
8
  export function IsHostname(value) {
9
- if (value.length === 0 || value.length > 253)
10
- return false;
11
- if (value.charCodeAt(value.length - 1) === 46)
12
- return false;
13
- for (const label of value.split('.')) {
14
- if (!Idna.IsLabel(label))
15
- return false;
16
- }
17
- return true;
9
+ return Idna.IsHostname(value);
18
10
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * Returns true if the value is an IdnEmail
3
- * @specification ajv-formats (unicode-extension)
3
+ * @specification https://datatracker.ietf.org/doc/html/rfc4952
4
4
  */
5
5
  export declare function IsIdnEmail(value: string): boolean;
@@ -1,8 +1,8 @@
1
- const IdnEmail = /^(?!.*\.\.)[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+(?:\.[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]+)*@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?)*$/iu;
1
+ const IdnEmail = /^(?:[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+(?:\.[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+)*|"(?:[^"\\]|\\.)*")@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-)(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-))*$/iu;
2
2
  /**
3
3
  * Returns true if the value is an IdnEmail
4
- * @specification ajv-formats (unicode-extension)
4
+ * @specification https://datatracker.ietf.org/doc/html/rfc4952
5
5
  */
6
6
  export function IsIdnEmail(value) {
7
- return IdnEmail.test(value);
7
+ return IdnEmail.test(value.normalize('NFC'));
8
8
  }
@@ -3,5 +3,6 @@
3
3
  * @specification https://tools.ietf.org/html/rfc3490
4
4
  * @specification https://tools.ietf.org/html/rfc5891
5
5
  * @specification https://tools.ietf.org/html/rfc5892
6
+ * @specification https://tools.ietf.org/html/rfc5893
6
7
  */
7
8
  export declare function IsIdnHostname(value: string): boolean;
@@ -1,19 +1,11 @@
1
- import { IsIdnLabel } from './_idna.mjs';
1
+ import * as Idna from './idna/index.mjs';
2
2
  /**
3
3
  * Returns true if the value is a valid internationalized (IDN) hostname.
4
4
  * @specification https://tools.ietf.org/html/rfc3490
5
5
  * @specification https://tools.ietf.org/html/rfc5891
6
6
  * @specification https://tools.ietf.org/html/rfc5892
7
+ * @specification https://tools.ietf.org/html/rfc5893
7
8
  */
8
9
  export function IsIdnHostname(value) {
9
- if (value.length === 0 || value.includes(' '))
10
- return false;
11
- const canonical = value.normalize('NFC').replace(/[\u002E\u3002\uFF0E\uFF61]/g, '.');
12
- if (canonical.length > 253)
13
- return false;
14
- for (const label of canonical.split('.')) {
15
- if (!IsIdnLabel(label))
16
- return false;
17
- }
18
- return true;
10
+ return Idna.IsIdnHostname(value);
19
11
  }
@@ -0,0 +1,3 @@
1
+ export declare function HasBidiChars(value: string): boolean;
2
+ export declare function HasRightToLeftCharacters(value: string): boolean;
3
+ export declare function SatisfiesBidiRule(value: string): boolean;
@@ -0,0 +1,98 @@
1
+ // deno-fmt-ignore-file
2
+ import * as FormatPuny from './puny.mjs';
3
+ import * as Pattern from '../pattern/pattern.mjs';
4
+ // ------------------------------------------------------------------
5
+ // LOCAL REGEX: Allowed Bidi classes per direction (RFC 5893)
6
+ // ------------------------------------------------------------------
7
+ const RE_RTL_ALLOWED = /^(?:R|AL|AN|EN|ES|CS|ET|ON|BN|NSM)$/;
8
+ const RE_LTR_ALLOWED = /^(?:L|EN|ES|CS|ET|ON|BN|NSM)$/;
9
+ const RE_RTL_CLASSES = /^(?:R|AL|AN)$/;
10
+ // ------------------------------------------------------------------
11
+ // HasBidiChars
12
+ //
13
+ // Decodes a punycode label to its Unicode form (if it is one) and
14
+ // checks whether the result is an RTL label per RFC 5893 §1.4.
15
+ // ------------------------------------------------------------------
16
+ export function HasBidiChars(value) {
17
+ if (FormatPuny.IsAcePrefixed(value)) {
18
+ try {
19
+ return HasRightToLeftCharacters(FormatPuny.Decode(value.slice(4).toLowerCase()));
20
+ }
21
+ catch {
22
+ return false;
23
+ }
24
+ }
25
+ return HasRightToLeftCharacters(value);
26
+ }
27
+ // ------------------------------------------------------------------
28
+ // GetBidiClass
29
+ // ------------------------------------------------------------------
30
+ function GetBidiClass(codePoint) {
31
+ const char = String.fromCodePoint(codePoint);
32
+ return (Pattern.RE_EUROPEAN_NUMBER.test(char) ? 'EN' :
33
+ Pattern.RE_ARABIC_INDIC_DIGIT.test(char) ? 'AN' :
34
+ // Pattern.RE_EUROPEAN_SEPARATOR.test(char) ? 'ES' : // (no-spec-coverage)
35
+ // Pattern.RE_COMMON_SEPARATOR.test(char) ? 'CS' : // (no-spec-coverage)
36
+ Pattern.RE_MARK_NONSPACING.test(char) ? 'NSM' :
37
+ Pattern.RE_SCRIPT_HEBREW.test(char) ? 'R' :
38
+ Pattern.RE_SCRIPT_ARABIC_LETTER.test(char) ? 'AL' :
39
+ Pattern.RE_LETTER.test(char) ? 'L' :
40
+ 'ON');
41
+ }
42
+ // ------------------------------------------------------------------
43
+ // HasRightToLeftCharacters
44
+ //
45
+ // Per RFC 5893 §1.4: "An RTL label is a label that contains at least
46
+ // one character of type R, AL, or AN." Used to determine whether a
47
+ // domain name is a "Bidi domain name" (RFC 5893 §1.4), in which case
48
+ // the Bidi Rule applies to every label in the domain.
49
+ // ------------------------------------------------------------------
50
+ export function HasRightToLeftCharacters(value) {
51
+ for (const ch of value)
52
+ if (RE_RTL_CLASSES.test(GetBidiClass(ch.codePointAt(0))))
53
+ return true;
54
+ return false;
55
+ }
56
+ // ------------------------------------------------------------------
57
+ // SatisfiesBidiRule
58
+ // ------------------------------------------------------------------
59
+ export function SatisfiesBidiRule(value) {
60
+ let isRtl = false;
61
+ let allowed = RE_LTR_ALLOWED;
62
+ let sawEN = false;
63
+ let sawAN = false;
64
+ let isFirst = true;
65
+ // let lastClass: string | null = null // (no-spec-coverage)
66
+ for (const ch of value) {
67
+ const bidiClass = GetBidiClass(ch.codePointAt(0));
68
+ if (isFirst) {
69
+ // 1. The first character must be a character with Bidi property L, R, or AL.
70
+ if (bidiClass !== 'L' && bidiClass !== 'R' && bidiClass !== 'AL')
71
+ return false;
72
+ isRtl = bidiClass === 'R' || bidiClass === 'AL';
73
+ allowed = isRtl ? RE_RTL_ALLOWED : RE_LTR_ALLOWED;
74
+ isFirst = false;
75
+ }
76
+ // 2 / 5. Only characters in the allowed set for this direction may appear.
77
+ if (!allowed.test(bidiClass))
78
+ return false;
79
+ if (bidiClass === 'EN')
80
+ sawEN = true;
81
+ else if (bidiClass === 'AN')
82
+ sawAN = true;
83
+ // if (bidiClass !== 'NSM') lastClass = bidiClass // (no-spec-coverage)
84
+ }
85
+ if (isRtl && sawEN && sawAN)
86
+ return false; // spec coverage path
87
+ // (no-spec-coverage)
88
+ // if (isRtl) {
89
+ // // 3. The end of the label must be R, AL, EN, or AN (ignoring trailing NSM).
90
+ // // if (lastClass !== 'R' && lastClass !== 'AL' && lastClass !== 'EN' && lastClass !== 'AN') return false
91
+ // // 4. If an EN is present, no AN may be present, and vice versa.
92
+ // if (sawEN && sawAN) return false
93
+ // } else {
94
+ // // 6. The end of the label must be L or EN (ignoring trailing NSM).
95
+ // // if (lastClass !== 'L' && lastClass !== 'EN') return false
96
+ // }
97
+ return true;
98
+ }
@@ -0,0 +1,3 @@
1
+ export declare function IsAcePrefixed(value: string): boolean;
2
+ export declare function Decode(value: string): string;
3
+ export declare function Encode(input: string): string;
@@ -0,0 +1,144 @@
1
+ import * as Pattern from '../pattern/pattern.mjs';
2
+ // ------------------------------------------------------------------
3
+ // PunyCode (RFC 3492)
4
+ // ------------------------------------------------------------------
5
+ const PUNYCODE_BASE = 36;
6
+ const PUNYCODE_TMIN = 1;
7
+ const PUNYCODE_TMAX = 26;
8
+ const PUNYCODE_SKEW = 38;
9
+ const PUNYCODE_DAMP = 700;
10
+ const PUNYCODE_INITIAL_BIAS = 72;
11
+ const PUNYCODE_INITIAL_N = 128;
12
+ // ------------------------------------------------------------------
13
+ // ThrowDontCare
14
+ // ------------------------------------------------------------------
15
+ function ThrowDontCare() {
16
+ throw null;
17
+ }
18
+ // ------------------------------------------------------------------
19
+ // IsAcePrefixed
20
+ // ------------------------------------------------------------------
21
+ export function IsAcePrefixed(value) {
22
+ return value.toLowerCase().startsWith('xn--');
23
+ }
24
+ // ------------------------------------------------------------------
25
+ // Adapt
26
+ // ------------------------------------------------------------------
27
+ function Adapt(delta, numPoints, firstTime) {
28
+ delta = firstTime ? Math.floor(delta / PUNYCODE_DAMP) : delta >> 1;
29
+ delta += Math.floor(delta / numPoints);
30
+ let k = 0;
31
+ while (delta > (((PUNYCODE_BASE - PUNYCODE_TMIN) * PUNYCODE_TMAX) >> 1)) {
32
+ delta = Math.floor(delta / (PUNYCODE_BASE - PUNYCODE_TMIN));
33
+ k += PUNYCODE_BASE;
34
+ }
35
+ return k + Math.floor(((PUNYCODE_BASE - PUNYCODE_TMIN + 1) * delta) / (delta + PUNYCODE_SKEW));
36
+ }
37
+ // ------------------------------------------------------------------
38
+ // Decode
39
+ // ------------------------------------------------------------------
40
+ export function Decode(value) {
41
+ const output = [];
42
+ let n = PUNYCODE_INITIAL_N;
43
+ let i = 0;
44
+ let bias = PUNYCODE_INITIAL_BIAS;
45
+ const delimIdx = value.lastIndexOf('-');
46
+ if (delimIdx > 0) {
47
+ for (let j = 0; j < delimIdx; j++) {
48
+ const cp = value.charCodeAt(j);
49
+ if (cp >= 128)
50
+ ThrowDontCare(); // throw new Error('Invalid punycode: non-basic before delimiter')
51
+ output.push(cp);
52
+ }
53
+ }
54
+ let inIdx = delimIdx < 0 ? 0 : delimIdx + 1;
55
+ while (inIdx < value.length) {
56
+ const oldi = i;
57
+ let w = 1;
58
+ let k = PUNYCODE_BASE;
59
+ while (true) {
60
+ if (inIdx >= value.length)
61
+ ThrowDontCare(); // throw new Error('Invalid punycode: unexpected end of input')
62
+ const ch = value.charCodeAt(inIdx++);
63
+ let digit;
64
+ if (ch >= 0x61 && ch <= 0x7a)
65
+ digit = ch - 0x61; // a-z => 0-25
66
+ else if (ch >= 0x30 && ch <= 0x39)
67
+ digit = ch - 0x30 + 26; // 0-9 => 26-35
68
+ // else if (ch >= 0x41 && ch <= 0x5a) digit = ch - 0x41 // A-Z => 0-25 // (no-spec-coverage)
69
+ else
70
+ ThrowDontCare(); // throw new Error('Invalid punycode: bad digit character')
71
+ i += digit * w;
72
+ const t = k <= bias ? PUNYCODE_TMIN : k >= bias + PUNYCODE_TMAX ? PUNYCODE_TMAX : k - bias;
73
+ if (digit < t)
74
+ break;
75
+ w *= PUNYCODE_BASE - t;
76
+ k += PUNYCODE_BASE;
77
+ }
78
+ const outLen = output.length + 1;
79
+ bias = Adapt(i - oldi, outLen, oldi === 0);
80
+ n += Math.floor(i / outLen);
81
+ i %= outLen;
82
+ output.splice(i, 0, n);
83
+ i++;
84
+ }
85
+ return String.fromCodePoint(...output);
86
+ }
87
+ // ------------------------------------------------------------------
88
+ // DigitToChar
89
+ // ------------------------------------------------------------------
90
+ function DigitToChar(digit) {
91
+ return digit < 26 ? String.fromCharCode(digit + 0x61) : String.fromCharCode(digit - 26 + 0x30);
92
+ }
93
+ // ------------------------------------------------------------------
94
+ // Encode
95
+ //
96
+ // Encodes a Unicode string into its Punycode payload (the part that
97
+ // follows the 'xn--' ACE prefix). Used to compute the true A-label
98
+ // length of a U-label, since the 63-octet label length limit (RFC
99
+ // 5891 §4.2.4) applies to the encoded form, not the code point count.
100
+ // ------------------------------------------------------------------
101
+ const RE_REPLACE_NON_ASCII = new RegExp(Pattern.RE_NON_ASCII.source, 'gu');
102
+ export function Encode(input) {
103
+ // Extract basic ASCII characters and set initial output array state
104
+ const basic = input.replace(RE_REPLACE_NON_ASCII, '');
105
+ const basicLength = basic.length;
106
+ const result = basicLength > 0 ? [basic, '-'] : [];
107
+ // Extract unicode codepoints
108
+ const codePoints = Array.from(input, (char) => char.codePointAt(0));
109
+ let n = PUNYCODE_INITIAL_N;
110
+ let delta = 0;
111
+ let bias = PUNYCODE_INITIAL_BIAS;
112
+ let handledCPCount = basicLength;
113
+ while (handledCPCount < codePoints.length) {
114
+ let m = Infinity;
115
+ for (const cp of codePoints) {
116
+ if (cp >= n && cp < m)
117
+ m = cp;
118
+ }
119
+ delta += (m - n) * (handledCPCount + 1);
120
+ n = m;
121
+ for (const cp of codePoints) {
122
+ if (cp < n)
123
+ delta++;
124
+ if (cp === n) {
125
+ let q = delta;
126
+ for (let k = PUNYCODE_BASE;; k += PUNYCODE_BASE) {
127
+ const t = k <= bias ? PUNYCODE_TMIN : k >= bias + PUNYCODE_TMAX ? PUNYCODE_TMAX : k - bias;
128
+ if (q < t)
129
+ break;
130
+ const digit = t + ((q - t) % (PUNYCODE_BASE - t));
131
+ result.push(DigitToChar(digit));
132
+ q = Math.floor((q - t) / (PUNYCODE_BASE - t));
133
+ }
134
+ result.push(DigitToChar(q));
135
+ bias = Adapt(delta, handledCPCount + 1, handledCPCount === basicLength);
136
+ delta = 0;
137
+ handledCPCount++;
138
+ }
139
+ }
140
+ delta++;
141
+ n++;
142
+ }
143
+ return result.join('');
144
+ }
@@ -0,0 +1 @@
1
+ export declare function IsHostname(value: string): boolean;
@@ -0,0 +1,16 @@
1
+ import * as LabelAscii from './label/ascii.mjs';
2
+ import * as LabelPuny from './label/puny.mjs';
3
+ function IsValidLabelLength(value) {
4
+ return value.length > 0 && value.length <= 63;
5
+ }
6
+ function IsLabel(value) {
7
+ return IsValidLabelLength(value) && (LabelPuny.IsPunyLabel(value) ||
8
+ LabelAscii.IsAsciiLabel(value));
9
+ }
10
+ export function IsHostname(value) {
11
+ if (value.length === 0 || value.length > 253)
12
+ return false;
13
+ if (value.charCodeAt(value.length - 1) === 46)
14
+ return false;
15
+ return value.split('.').every((label) => IsLabel(label));
16
+ }
@@ -0,0 +1 @@
1
+ export declare function IsIdnHostname(value: string): boolean;