@openclaw/slack 2026.10.10 → 2026.11.5-beta.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 (222) hide show
  1. package/dist/.setup/{account-inspect-Bc7TVU8F.mjs → account-inspect-DgQgj0wk.mjs} +11 -8
  2. package/dist/.setup/{accounts-CEgdyqoW.mjs → accounts-EaPP0fFY.mjs} +10 -1
  3. package/dist/.setup/{action-runtime-DPoxYao5.mjs → action-runtime-CK9QZgQl.mjs} +38 -45
  4. package/dist/.setup/action-runtime.runtime-CpZktret.mjs +1 -0
  5. package/dist/.setup/{actions-PF2cP6to.mjs → actions-s3CcFO45.mjs} +89 -76
  6. package/dist/.setup/{approval-handler.runtime-BtRklemy.mjs → approval-handler.runtime-Ch7BecYK.mjs} +26 -30
  7. package/dist/.setup/{approval-message-updates-CpwbsEj6.mjs → approval-message-updates-CqcRoa28.mjs} +1 -1
  8. package/dist/.setup/{channel-B6bRmYmX.mjs → channel-CAvo_WNZ.mjs} +566 -338
  9. package/dist/.setup/{channel-type-Dh4vwh1Y.mjs → channel-type-9Lw6yLf2.mjs} +4 -8
  10. package/dist/.setup/{channel.setup-BBzT6uKA.mjs → channel.setup-BlgXNuCJ.mjs} +13 -13
  11. package/dist/.setup/{config-schema-Cz3uId-c.mjs → config-schema-Bx1tCZB0.mjs} +3 -7
  12. package/dist/.setup/cursor-pages-jVn3Vkfi.mjs +309 -0
  13. package/dist/.setup/{directory-config-BEPra1E2.mjs → directory-config-CGvKYg9F.mjs} +3 -3
  14. package/dist/.setup/{directory-live-BkUwPrS0.mjs → directory-live-DNdw97LA.mjs} +4 -4
  15. package/dist/.setup/{doctor-contract-HK8aedwU.mjs → doctor-contract-BB2KJ9Ni.mjs} +37 -45
  16. package/dist/.setup/{message-tool-api-DeiQJoRV.mjs → message-tool-api-B38BpEaE.mjs} +4 -3
  17. package/dist/.setup/{monitor-DsZUQtTM.mjs → monitor-BD86SotB.mjs} +3397 -3672
  18. package/dist/.setup/{outbound-adapter-C0R5jz6S.mjs → outbound-adapter-BH6iPWBj.mjs} +30 -36
  19. package/dist/.setup/paths-CQZI_5WY.mjs +7 -0
  20. package/dist/.setup/{pipeline.runtime-CIFVL0kf.mjs → pipeline.runtime-C4ELxaRU.mjs} +415 -534
  21. package/dist/.setup/{policy-Bp1FvE6m.mjs → policy-C6_DdlSf.mjs} +1 -2
  22. package/dist/.setup/{session-status-CHkEn3HM.mjs → probe-B_Ax1vS1.mjs} +985 -622
  23. package/dist/.setup/question-delivery-D3qAIwuv.mjs +38 -0
  24. package/dist/.setup/{relay-source-DFBDTA5Z.mjs → relay-source-a8jodKuO.mjs} +11 -4
  25. package/dist/.setup/{replies-7DRN46EL.mjs → replies-Bq7n0gfM.mjs} +34 -19
  26. package/dist/.setup/{reply-blocks-DOjiDr44.mjs → reply-blocks-DyYYRrP_.mjs} +200 -205
  27. package/dist/.setup/{resolve-channels-BNQ1KZXh.mjs → resolve-channels-CF2JME9q.mjs} +4 -7
  28. package/dist/.setup/{resolve-users-C4dC8Z7D.mjs → resolve-users-DDcCAjH1.mjs} +8 -16
  29. package/dist/.setup/{scopes-C1aeCBa6.mjs → scopes-CzHC_dwV.mjs} +2 -1
  30. package/dist/.setup/{secret-contract-D0UY2JWF.mjs → secret-contract-CqVqR7MP.mjs} +4 -2
  31. package/dist/.setup/{secret-contract-api-BhzGpUb0.mjs → secret-contract-api-DaCXZ47j.mjs} +1 -1
  32. package/dist/.setup/{send-C5uXkmZV.mjs → send-WJZ73VSf.mjs} +297 -333
  33. package/dist/.setup/{send-results-D-o6PgtS.mjs → send-results-Bm6V1ekL.mjs} +3 -4
  34. package/dist/.setup/setup-plugin-api-DJXIB8CF.mjs +2 -0
  35. package/dist/.setup/{setup-surface-CtM1pm-9.mjs → setup-surface-uIqP2B0Y.mjs} +5 -6
  36. package/dist/.setup/{slash-dispatch.runtime-Bnn9a5qB.mjs → slash-dispatch.runtime-Cwuwv7FL.mjs} +2 -2
  37. package/dist/.setup/{target-parsing-0pRZtahO.mjs → target-parsing-DwYAP3ts.mjs} +1 -2
  38. package/dist/.setup/{targets-BqXz7CpG.mjs → targets-eeOxA_b_.mjs} +1 -1
  39. package/dist/.source-module-urls/c5ffd0957b234c7c12090e7de4eca2482ef339b8561e078da55b734211b0ba58.json +1 -0
  40. package/dist/account-inspect-api.js +1 -1
  41. package/dist/api.js +16 -17
  42. package/dist/channel-config-api.js +1 -1
  43. package/dist/channel-plugin-api.js +1 -1
  44. package/dist/directory-contract-api.js +1 -1
  45. package/dist/doctor-contract-api.js +1 -1
  46. package/dist/index.js +0 -6
  47. package/dist/message-tool-api.js +1 -1
  48. package/dist/runtime-api.js +10 -12
  49. package/dist/secret-contract-api.js +1 -1
  50. package/dist/setup-entry.js +2 -2
  51. package/dist/setup-plugin-api.js +1 -1
  52. package/node_modules/@slack/bolt/node_modules/@types/node/README.md +1 -1
  53. package/node_modules/@slack/bolt/node_modules/@types/node/package.json +2 -2
  54. package/node_modules/@slack/bolt/node_modules/@types/node/util.d.ts +6 -3
  55. package/node_modules/@slack/bolt/node_modules/body-parser/README.md +13 -17
  56. package/node_modules/@slack/bolt/node_modules/body-parser/lib/read.js +57 -74
  57. package/node_modules/@slack/bolt/node_modules/body-parser/lib/types/json.js +11 -11
  58. package/node_modules/@slack/bolt/node_modules/body-parser/lib/types/urlencoded.js +5 -5
  59. package/node_modules/@slack/bolt/node_modules/body-parser/lib/utils.js +15 -0
  60. package/node_modules/@slack/bolt/node_modules/body-parser/package.json +12 -7
  61. package/node_modules/@slack/bolt/node_modules/content-disposition/README.md +105 -35
  62. package/node_modules/@slack/bolt/node_modules/content-disposition/dist/index.d.ts +72 -0
  63. package/node_modules/@slack/bolt/node_modules/content-disposition/dist/index.js +388 -0
  64. package/node_modules/@slack/bolt/node_modules/content-disposition/dist/index.js.map +1 -0
  65. package/node_modules/@slack/bolt/node_modules/content-disposition/package.json +31 -19
  66. package/node_modules/@slack/bolt/node_modules/content-type/README.md +34 -57
  67. package/node_modules/@slack/bolt/node_modules/content-type/package.json +35 -25
  68. package/node_modules/@slack/bolt/node_modules/express/Readme.md +15 -9
  69. package/node_modules/@slack/bolt/node_modules/express/lib/application.js +2 -2
  70. package/node_modules/@slack/bolt/node_modules/express/lib/request.js +32 -19
  71. package/node_modules/@slack/bolt/node_modules/express/lib/response.js +27 -30
  72. package/node_modules/@slack/bolt/node_modules/express/package.json +10 -10
  73. package/node_modules/@slack/bolt/node_modules/qs/.github/THREAT_MODEL.md +4 -2
  74. package/node_modules/@slack/bolt/node_modules/qs/CHANGELOG.md +38 -14
  75. package/node_modules/@slack/bolt/node_modules/qs/README.md +31 -3
  76. package/node_modules/@slack/bolt/node_modules/qs/dist/qs.js +20 -20
  77. package/node_modules/@slack/bolt/node_modules/qs/lib/parse.js +94 -4
  78. package/node_modules/@slack/bolt/node_modules/qs/lib/stringify.js +4 -4
  79. package/node_modules/@slack/bolt/node_modules/qs/lib/utils.js +130 -6
  80. package/node_modules/@slack/bolt/node_modules/qs/package.json +4 -4
  81. package/node_modules/@slack/bolt/node_modules/qs/test/parse.js +174 -0
  82. package/node_modules/@slack/bolt/node_modules/qs/test/stringify.js +263 -33
  83. package/node_modules/@slack/bolt/node_modules/qs/test/utils.js +184 -0
  84. package/node_modules/@slack/web-api/node_modules/@types/node/README.md +1 -1
  85. package/node_modules/@slack/web-api/node_modules/@types/node/package.json +2 -2
  86. package/node_modules/@slack/web-api/node_modules/@types/node/util.d.ts +6 -3
  87. package/node_modules/typebox/build/format/duration.d.mts +2 -2
  88. package/node_modules/typebox/build/format/duration.mjs +2 -2
  89. package/node_modules/typebox/build/format/idn_email.d.mts +1 -0
  90. package/node_modules/typebox/build/format/idn_email.mjs +1 -0
  91. package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -1
  92. package/node_modules/typebox/build/format/idn_hostname.mjs +1 -1
  93. package/node_modules/typebox/build/format/ipv4.d.mts +2 -2
  94. package/node_modules/typebox/build/format/ipv4.mjs +2 -2
  95. package/node_modules/typebox/build/format/ipv6.d.mts +1 -1
  96. package/node_modules/typebox/build/format/ipv6.mjs +1 -1
  97. package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
  98. package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
  99. package/node_modules/typebox/build/schema/build.mjs +1 -0
  100. package/node_modules/typebox/build/schema/engine/_unique.d.mts +4 -2
  101. package/node_modules/typebox/build/schema/engine/_unique.mjs +7 -3
  102. package/node_modules/typebox/build/schema/engine/additionalItems.mjs +3 -3
  103. package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +0 -3
  104. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +15 -17
  105. package/node_modules/typebox/build/schema/engine/contains.mjs +3 -3
  106. package/node_modules/typebox/build/schema/engine/index.d.mts +1 -0
  107. package/node_modules/typebox/build/schema/engine/index.mjs +1 -0
  108. package/node_modules/typebox/build/schema/engine/items.mjs +7 -4
  109. package/node_modules/typebox/build/schema/engine/maxContains.mjs +2 -2
  110. package/node_modules/typebox/build/schema/engine/minContains.mjs +3 -3
  111. package/node_modules/typebox/build/schema/engine/oneOf.mjs +2 -2
  112. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +2 -2
  113. package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -2
  114. package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +2 -2
  115. package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +2 -2
  116. package/node_modules/typebox/build/system/hashing/hash.mjs +63 -34
  117. package/node_modules/typebox/build/system/locale/en_US.mjs +2 -1
  118. package/node_modules/typebox/build/system/memory/assign.d.mts +2 -8
  119. package/node_modules/typebox/build/system/memory/assign.mjs +13 -6
  120. package/node_modules/typebox/build/system/memory/clone.d.mts +4 -5
  121. package/node_modules/typebox/build/system/memory/clone.mjs +8 -96
  122. package/node_modules/typebox/build/system/memory/create.d.mts +1 -5
  123. package/node_modules/typebox/build/system/memory/create.mjs +18 -13
  124. package/node_modules/typebox/build/system/memory/deep.d.mts +2 -0
  125. package/node_modules/typebox/build/system/memory/deep.mjs +108 -0
  126. package/node_modules/typebox/build/system/memory/discard.d.mts +1 -1
  127. package/node_modules/typebox/build/system/memory/discard.mjs +9 -8
  128. package/node_modules/typebox/build/system/memory/finalize.d.mts +4 -0
  129. package/node_modules/typebox/build/system/memory/finalize.mjs +30 -0
  130. package/node_modules/typebox/build/system/memory/keys.d.mts +2 -0
  131. package/node_modules/typebox/build/system/memory/keys.mjs +8 -0
  132. package/node_modules/typebox/build/system/memory/update.d.mts +1 -4
  133. package/node_modules/typebox/build/system/memory/update.mjs +43 -16
  134. package/node_modules/typebox/build/type/engine/call/index.d.mts +1 -0
  135. package/node_modules/typebox/build/type/engine/call/index.mjs +1 -0
  136. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +2 -24
  137. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +2 -29
  138. package/node_modules/typebox/build/type/engine/evaluate/index.d.mts +1 -0
  139. package/node_modules/typebox/build/type/engine/evaluate/index.mjs +1 -0
  140. package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +5 -1
  141. package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +6 -1
  142. package/node_modules/typebox/build/type/engine/evaluate/property.d.mts +30 -0
  143. package/node_modules/typebox/build/type/engine/evaluate/property.mjs +29 -0
  144. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +1 -3
  145. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +1 -4
  146. package/node_modules/typebox/build/type/engine/object/from_intersect.d.mts +2 -2
  147. package/node_modules/typebox/build/type/engine/object/from_intersect.mjs +2 -2
  148. package/node_modules/typebox/build/type/engine/object/from_union.d.mts +2 -2
  149. package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
  150. package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +1 -3
  151. package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +1 -4
  152. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +1 -3
  153. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +1 -4
  154. package/node_modules/typebox/build/type/engine/this/index.d.mts +1 -0
  155. package/node_modules/typebox/build/type/engine/this/index.mjs +1 -0
  156. package/node_modules/typebox/build/value/clone/clone.d.mts +4 -3
  157. package/node_modules/typebox/build/value/clone/clone.mjs +5 -7
  158. package/node_modules/typebox/build/value/repair/from_cyclic.d.mts +2 -0
  159. package/node_modules/typebox/build/value/repair/from_cyclic.mjs +6 -0
  160. package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +25 -14
  161. package/node_modules/typebox/package.json +1 -1
  162. package/node_modules/typebox/readme.md +1 -1
  163. package/node_modules/undici/docs/docs/api/Interceptors.md +15 -2
  164. package/node_modules/undici/lib/dispatcher/client-h2.js +78 -3
  165. package/node_modules/undici/lib/dispatcher/pool-base.js +20 -3
  166. package/node_modules/undici/package.json +3 -3
  167. package/node_modules/undici/types/api.d.ts +1 -1
  168. package/node_modules/undici/types/utility.d.ts +4 -4
  169. package/node_modules/zod/package.json +1 -1
  170. package/node_modules/zod/src/v4/classic/tests/array.test.ts +27 -0
  171. package/node_modules/zod/src/v4/classic/tests/map.test.ts +7 -0
  172. package/node_modules/zod/src/v4/classic/tests/set.test.ts +6 -0
  173. package/node_modules/zod/src/v4/core/compile.ts +9 -0
  174. package/node_modules/zod/src/v4/core/schemas.ts +35 -1
  175. package/node_modules/zod/src/v4/core/util.ts +13 -0
  176. package/node_modules/zod/src/v4/core/versions.ts +1 -1
  177. package/node_modules/zod/v4/core/compile.cjs +8 -0
  178. package/node_modules/zod/v4/core/compile.js +8 -0
  179. package/node_modules/zod/v4/core/schemas.cjs +30 -0
  180. package/node_modules/zod/v4/core/schemas.d.cts +3 -1
  181. package/node_modules/zod/v4/core/schemas.d.ts +3 -1
  182. package/node_modules/zod/v4/core/schemas.js +30 -0
  183. package/node_modules/zod/v4/core/util.cjs +15 -0
  184. package/node_modules/zod/v4/core/util.d.cts +2 -0
  185. package/node_modules/zod/v4/core/util.d.ts +2 -0
  186. package/node_modules/zod/v4/core/util.js +14 -0
  187. package/node_modules/zod/v4/core/versions.cjs +1 -1
  188. package/node_modules/zod/v4/core/versions.js +1 -1
  189. package/openclaw.plugin.json +6 -30
  190. package/package.json +7 -7
  191. package/dist/.setup/action-runtime.runtime-DWKWaKgC.mjs +0 -1
  192. package/dist/.setup/http-GpAVKwSX.mjs +0 -2
  193. package/dist/.setup/plugin-routes-lXsy_bNV.mjs +0 -21
  194. package/dist/.setup/probe-C5VWf3sz.mjs +0 -686
  195. package/dist/.setup/registry-1G0f1zuZ.mjs +0 -34
  196. package/dist/.setup/setup-plugin-api-D7DoueEh.mjs +0 -2
  197. package/dist/.setup/shared-CohTHxM1.mjs +0 -255
  198. package/dist/.source-module-urls/562d694877afe9d9dcbb3b32a8883c16974738f2aa892c48d45572cdc9a62529.json +0 -1
  199. package/dist/http-routes-api.js +0 -1
  200. package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/LICENSE +0 -22
  201. package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/README.md +0 -71
  202. package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/package.json +0 -52
  203. package/node_modules/@slack/bolt/node_modules/content-disposition/index.js +0 -536
  204. package/node_modules/@slack/bolt/node_modules/content-type/HISTORY.md +0 -29
  205. package/node_modules/@slack/bolt/node_modules/content-type/index.js +0 -225
  206. package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/LICENSE +0 -22
  207. package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/README.md +0 -71
  208. package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.d.ts +0 -46
  209. package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.js +0 -176
  210. package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.js.map +0 -1
  211. package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/package.json +0 -52
  212. package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/LICENSE +0 -22
  213. package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/README.md +0 -71
  214. package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/dist/index.d.ts +0 -46
  215. package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/dist/index.js +0 -176
  216. package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/dist/index.js.map +0 -1
  217. package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/package.json +0 -52
  218. package/node_modules/typebox/build/system/memory/freeze.d.mts +0 -4
  219. package/node_modules/typebox/build/system/memory/freeze.mjs +0 -6
  220. /package/node_modules/@slack/bolt/node_modules/{body-parser/node_modules/content-type → content-type}/dist/index.d.ts +0 -0
  221. /package/node_modules/@slack/bolt/node_modules/{body-parser/node_modules/content-type → content-type}/dist/index.js +0 -0
  222. /package/node_modules/@slack/bolt/node_modules/{body-parser/node_modules/content-type → content-type}/dist/index.js.map +0 -0
@@ -1,7 +1,7 @@
1
1
  import * as Idna from './idna/index.mjs';
2
2
  /**
3
3
  * Returns true if the value is a valid internationalized (IDN) hostname.
4
- * @specification https://tools.ietf.org/html/rfc3490
4
+ * @specification https://datatracker.ietf.org/doc/html/rfc5890
5
5
  * @specification https://tools.ietf.org/html/rfc5891
6
6
  * @specification https://tools.ietf.org/html/rfc5892
7
7
  * @specification https://tools.ietf.org/html/rfc5893
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Returns true if the value is a IPV4 address
3
- * @specification http://tools.ietf.org/html/rfc2673#section-3.2
2
+ * Returns true if the value is an IPv4 address
3
+ * @specification https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2
4
4
  */
5
5
  export declare function IsIPv4(value: string): boolean;
@@ -1,7 +1,7 @@
1
1
  const IPv4 = /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;
2
2
  /**
3
- * Returns true if the value is a IPV4 address
4
- * @specification http://tools.ietf.org/html/rfc2673#section-3.2
3
+ * Returns true if the value is an IPv4 address
4
+ * @specification https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2
5
5
  */
6
6
  export function IsIPv4(value) {
7
7
  return IPv4.test(value);
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * Returns true if the value is an IPv6 address
3
- * @specification http://tools.ietf.org/html/rfc2373#section-2.2
3
+ * @specification https://datatracker.ietf.org/doc/html/rfc4291#section-2.2
4
4
  */
5
5
  export declare function IsIPv6(value: string): boolean;
@@ -1,7 +1,7 @@
1
1
  const IPv6 = /^(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:)?[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)$/i;
2
2
  /**
3
3
  * Returns true if the value is an IPv6 address
4
- * @specification http://tools.ietf.org/html/rfc2373#section-2.2
4
+ * @specification https://datatracker.ietf.org/doc/html/rfc4291#section-2.2
5
5
  */
6
6
  export function IsIPv6(value) {
7
7
  return IPv6.test(value);
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Returns true if the value is a relative json pointer
3
- * @specification https://datatracker.ietf.org/doc/html/rfc6901
2
+ * Returns true if the value is a relative JSON Pointer
3
+ * @specification https://datatracker.ietf.org/doc/html/draft-handrews-relative-json-pointer/
4
4
  * @source https://github.com/ajv-validator/ajv-formats
5
5
  */
6
6
  export declare function IsRelativeJsonPointer(value: string): boolean;
@@ -1,7 +1,7 @@
1
1
  const RelativeJsonPointer = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;
2
2
  /**
3
- * Returns true if the value is a relative json pointer
4
- * @specification https://datatracker.ietf.org/doc/html/rfc6901
3
+ * Returns true if the value is a relative JSON Pointer
4
+ * @specification https://datatracker.ietf.org/doc/html/draft-handrews-relative-json-pointer/
5
5
  * @source https://github.com/ajv-validator/ajv-formats
6
6
  */
7
7
  export function IsRelativeJsonPointer(value) {
@@ -106,6 +106,7 @@ export function Build(...args) {
106
106
  2: (context, schema) => [context, schema],
107
107
  1: (schema) => [{}, schema]
108
108
  });
109
+ Engine.ResetUnique();
109
110
  Engine.ResetExternal();
110
111
  Engine.ResetFunctions();
111
112
  const stack = Engine.Stack(context, schema);
@@ -1,2 +1,4 @@
1
- /** Returns a Unique Variable Name */
2
- export declare function Unique(): string;
1
+ /** Creates a unique variable name */
2
+ export declare function CreateUnique(): string;
3
+ /** Resets the unique variable name counter */
4
+ export declare function ResetUnique(): void;
@@ -1,5 +1,9 @@
1
1
  let index = 0;
2
- /** Returns a Unique Variable Name */
3
- export function Unique() {
4
- return `var_${index++}`;
2
+ /** Creates a unique variable name */
3
+ export function CreateUnique() {
4
+ return `unique_${index++}`;
5
+ }
6
+ /** Resets the unique variable name counter */
7
+ export function ResetUnique() {
8
+ index = 0;
5
9
  }
@@ -1,6 +1,6 @@
1
1
  // deno-fmt-ignore-file
2
2
  import * as Schema from '../types/index.mjs';
3
- import { Unique } from './_unique.mjs';
3
+ import * as Unique from './_unique.mjs';
4
4
  import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
5
5
  import { BuildSchemaPushStack, CheckSchemaPushStack, ErrorSchemaPushStack } from './schema.mjs';
6
6
  // ------------------------------------------------------------------
@@ -13,14 +13,14 @@ function IsValid(schema) {
13
13
  // Build
14
14
  // ------------------------------------------------------------------
15
15
  function BuildAdditionalItemsStandard(stack, context, schema, value) {
16
- const [item, index] = [Unique(), Unique()];
16
+ const [item, index] = [Unique.CreateUnique(), Unique.CreateUnique()];
17
17
  const isSchema = BuildSchemaPushStack(stack, context, schema.additionalItems, item);
18
18
  const isLength = E.IsLessThan(index, E.Constant(schema.items.length));
19
19
  const addIndex = context.AddIndex(index);
20
20
  return E.Every(value, E.Constant(0), [item, index], E.Or(isLength, E.And(isSchema, addIndex)));
21
21
  }
22
22
  function BuildAdditionalItemsFast(stack, context, schema, value) {
23
- const [item, index] = [Unique(), Unique()];
23
+ const [item, index] = [Unique.CreateUnique(), Unique.CreateUnique()];
24
24
  const isSchema = BuildSchemaPushStack(stack, context, schema.additionalItems, item);
25
25
  const isLength = E.IsLessThan(index, E.Constant(schema.items.length));
26
26
  return E.Every(value, E.Constant(0), [item, index], E.Or(isLength, isSchema));
@@ -1,9 +1,6 @@
1
1
  import * as Schema from '../types/index.mjs';
2
2
  import * as Stack from './_stack.mjs';
3
3
  import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
4
- export declare function CanAdditionalPropertiesFast(_context: BuildContext, schema: Schema.XAdditionalProperties, _value: string): schema is Schema.XAdditionalProperties & Schema.XRequired;
5
- export declare function BuildAdditionalPropertiesFast(_context: BuildContext, schema: Schema.XAdditionalProperties & Schema.XRequired, value: string): string;
6
- export declare function BuildAdditionalPropertiesStandard(stack: Stack.XStack, context: BuildContext, schema: Schema.XAdditionalProperties, value: string): string;
7
4
  export declare function BuildAdditionalProperties(stack: Stack.XStack, context: BuildContext, schema: Schema.XAdditionalProperties, value: string): string;
8
5
  export declare function CheckAdditionalProperties(stack: Stack.XStack, context: CheckContext, schema: Schema.XAdditionalProperties, value: Record<PropertyKey, unknown>): boolean;
9
6
  export declare function ErrorAdditionalProperties(stack: Stack.XStack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XAdditionalProperties, value: Record<PropertyKey, unknown>): boolean;
@@ -1,8 +1,8 @@
1
1
  // deno-fmt-ignore-file
2
2
  import * as Schema from '../types/index.mjs';
3
+ import * as Unique from './_unique.mjs';
3
4
  import * as Externals from './_externals.mjs';
4
5
  import * as Pathing from './_pathing.mjs';
5
- import { Unique } from './_unique.mjs';
6
6
  import { UnicodeRegExp } from './_regexp.mjs';
7
7
  import { EmitGuard as E, Guard as G } from '../../guard/index.mjs';
8
8
  import { BuildSchemaPushStack, CheckSchemaPushStack, ErrorSchemaPushStack } from './schema.mjs';
@@ -42,35 +42,33 @@ function GetPropertiesPattern(schema) {
42
42
  return G.IsEqual(patterns.length, 0) ? '(?!)' : `(${patterns.join('|')})`;
43
43
  }
44
44
  // ------------------------------------------------------------------
45
- // BuildAdditionalPropertiesFast
45
+ // BuildAdditionalPropertiesFast (AdditionalProperties False)
46
46
  //
47
- // Optimized logic for schemas with `additionalProperties: false`.
48
- //
49
- // This fast-path applies only when:
50
- // - `additionalProperties` is explicitly set to false,
51
- // - the schema uses only `properties` (no `patternProperties`),
52
- // - and all defined properties are required (i.e., no optional keys).
53
- //
54
- // This constraint is common when enforcing strict object shapes
55
- // with only known, fixed keys. When all these conditions are met,
56
- // we can generate a simplified and efficient runtime check.
47
+ // - AdditionalProperties is explicitly set to false,
48
+ // - The schema uses only Properties (no PatternProperties),
49
+ // - Required contains exactly the keys in Properties.
57
50
  //
58
51
  // ------------------------------------------------------------------
59
- export function CanAdditionalPropertiesFast(_context, schema, _value) {
52
+ function HasExactRequiredProperties(schema) {
53
+ const keys = G.Keys(schema.properties);
54
+ return G.IsEqual(keys.length, schema.required.length)
55
+ && G.Every(keys, 0, (key) => schema.required.includes(key));
56
+ }
57
+ function CanAdditionalPropertiesFast(_context, schema, _value) {
60
58
  return Schema.IsRequired(schema)
61
59
  && Schema.IsProperties(schema)
62
60
  && !Schema.IsPatternProperties(schema)
63
61
  && G.IsEqual(schema.additionalProperties, false)
64
- && G.IsEqual(G.Keys(schema.properties).length, schema.required.length);
62
+ && HasExactRequiredProperties(schema);
65
63
  }
66
- export function BuildAdditionalPropertiesFast(_context, schema, value) {
64
+ function BuildAdditionalPropertiesFast(_context, schema, value) {
67
65
  return E.IsEqual(E.Member(E.Call(E.Member('Object', 'getOwnPropertyNames'), [value]), 'length'), E.Constant(schema.required.length));
68
66
  }
69
67
  // ------------------------------------------------------------------
70
68
  // BuildAdditionalPropertiesStandard
71
69
  // ------------------------------------------------------------------
72
- export function BuildAdditionalPropertiesStandard(stack, context, schema, value) {
73
- const [key, _index] = [Unique(), Unique()];
70
+ function BuildAdditionalPropertiesStandard(stack, context, schema, value) {
71
+ const [key, _index] = [Unique.CreateUnique(), Unique.CreateUnique()];
74
72
  const regexp = Externals.CreateVariable(UnicodeRegExp(GetPropertiesPattern(schema)));
75
73
  const isSchema = BuildSchemaPushStack(stack, context, schema.additionalProperties, `${value}[${key}]`);
76
74
  const isKey = E.Call(E.Member(regexp, 'test'), [key]);
@@ -1,6 +1,6 @@
1
1
  // deno-fmt-ignore-file
2
2
  import * as Schema from '../types/index.mjs';
3
- import { Unique } from './_unique.mjs';
3
+ import * as Unique from './_unique.mjs';
4
4
  import { EmitGuard as E, Guard as G } from '../../guard/index.mjs';
5
5
  import { BuildSchema, CheckSchema } from './schema.mjs';
6
6
  // ------------------------------------------------------------------
@@ -13,13 +13,13 @@ function IsValid(schema) {
13
13
  // Build
14
14
  // ------------------------------------------------------------------
15
15
  function BuildContainsStandard(stack, context, schema, value) {
16
- const [item, index] = [Unique(), Unique()];
16
+ const [item, index] = [Unique.CreateUnique(), Unique.CreateUnique()];
17
17
  const isLength = E.Not(E.IsEqual(E.Member(value, 'length'), E.Constant(0)));
18
18
  const isSome = E.SomeAll(value, [item, index], E.And(BuildSchema(stack, context, schema.contains, item), context.AddIndex(index)));
19
19
  return E.And(isLength, isSome);
20
20
  }
21
21
  function BuildContainsFast(stack, context, schema, value) {
22
- const [item] = [Unique()];
22
+ const [item] = [Unique.CreateUnique()];
23
23
  const isLength = E.Not(E.IsEqual(E.Member(value, 'length'), E.Constant(0)));
24
24
  const isSome = E.Some(value, [item, '_'], BuildSchema(stack, context, schema.contains, item));
25
25
  return E.And(isLength, isSome);
@@ -4,6 +4,7 @@ export * from './_functions.mjs';
4
4
  export * from './_reducer.mjs';
5
5
  export * from './_refine.mjs';
6
6
  export * from './_stack.mjs';
7
+ export * from './_unique.mjs';
7
8
  export * from './additionalItems.mjs';
8
9
  export * from './additionalProperties.mjs';
9
10
  export * from './allOf.mjs';
@@ -7,6 +7,7 @@ export * from './_functions.mjs';
7
7
  export * from './_reducer.mjs';
8
8
  export * from './_refine.mjs';
9
9
  export * from './_stack.mjs';
10
+ export * from './_unique.mjs';
10
11
  // ------------------------------------------------------------------
11
12
  // Schematics
12
13
  // ------------------------------------------------------------------
@@ -1,5 +1,6 @@
1
1
  // deno-fmt-ignore-file
2
2
  import * as Schema from '../types/index.mjs';
3
+ import * as Unique from './_unique.mjs';
3
4
  import { BuildSchemaPushStack, CheckSchemaPushStack, ErrorSchemaPushStack } from './schema.mjs';
4
5
  import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
5
6
  // ------------------------------------------------------------------
@@ -44,14 +45,16 @@ function ErrorItemsSized(stack, context, schemaPath, instancePath, schema, value
44
45
  // ------------------------------------------------------------------
45
46
  function BuildItemsUnsizedStandard(stack, context, schema, value) {
46
47
  const offset = Schema.IsPrefixItems(schema) ? schema.prefixItems.length : 0;
47
- const isSchema = BuildSchemaPushStack(stack, context, schema.items, 'element');
48
+ const [item] = [Unique.CreateUnique()];
49
+ const isSchema = BuildSchemaPushStack(stack, context, schema.items, item);
48
50
  const addIndex = context.AddIndex('index');
49
- return E.Every(value, E.Constant(offset), ['element', 'index'], E.And(isSchema, addIndex));
51
+ return E.Every(value, E.Constant(offset), [item, 'index'], E.And(isSchema, addIndex));
50
52
  }
51
53
  function BuildItemsUnsizedFast(stack, context, schema, value) {
52
54
  const offset = Schema.IsPrefixItems(schema) ? schema.prefixItems.length : 0;
53
- const isSchema = BuildSchemaPushStack(stack, context, schema.items, 'element');
54
- return E.Every(value, E.Constant(offset), ['element', 'index'], isSchema);
55
+ const [item] = [Unique.CreateUnique()];
56
+ const isSchema = BuildSchemaPushStack(stack, context, schema.items, item);
57
+ return E.Every(value, E.Constant(offset), [item, 'index'], isSchema);
55
58
  }
56
59
  function BuildItemsUnsized(stack, context, schema, value) {
57
60
  return context.UseUnevaluated()
@@ -1,6 +1,6 @@
1
1
  // deno-fmt-ignore-file
2
2
  import * as Schema from '../types/index.mjs';
3
- import { Unique } from './_unique.mjs';
3
+ import * as Unique from './_unique.mjs';
4
4
  import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
5
5
  import { BuildSchema, CheckSchema } from './schema.mjs';
6
6
  // ------------------------------------------------------------------
@@ -15,7 +15,7 @@ function IsValid(schema) {
15
15
  export function BuildMaxContains(stack, context, schema, value) {
16
16
  if (!IsValid(schema))
17
17
  return E.Constant(true);
18
- const [item] = [Unique()];
18
+ const [item] = [Unique.CreateUnique()];
19
19
  const count = E.Counted(value, [item, '_'], BuildSchema(stack, context, schema.contains, item));
20
20
  return E.IsLessEqualThan(count, E.Constant(schema.maxContains));
21
21
  }
@@ -1,6 +1,6 @@
1
1
  // deno-fmt-ignore-file
2
2
  import * as Schema from '../types/index.mjs';
3
- import { Unique } from './_unique.mjs';
3
+ import * as Unique from './_unique.mjs';
4
4
  import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
5
5
  import { BuildSchema, CheckSchema } from './schema.mjs';
6
6
  // ------------------------------------------------------------------
@@ -13,12 +13,12 @@ function IsValid(schema) {
13
13
  // Build
14
14
  // ------------------------------------------------------------------
15
15
  function BuildMinContainsStandard(stack, context, schema, value) {
16
- const [item, index] = [Unique(), Unique()];
16
+ const [item, index] = [Unique.CreateUnique(), Unique.CreateUnique()];
17
17
  const count = E.Counted(value, [item, index], E.And(BuildSchema(stack, context, schema.contains, item), context.AddIndex(index)));
18
18
  return E.IsGreaterEqualThan(count, E.Constant(schema.minContains));
19
19
  }
20
20
  function BuildMinContainsFast(stack, context, schema, value) {
21
- const [item] = [Unique()];
21
+ const [item] = [Unique.CreateUnique()];
22
22
  const count = E.Counted(value, [item, '_'], BuildSchema(stack, context, schema.contains, item));
23
23
  return E.IsGreaterEqualThan(count, E.Constant(schema.minContains));
24
24
  }
@@ -1,6 +1,6 @@
1
1
  // deno-fmt-ignore-file
2
2
  import { Reducer } from './_reducer.mjs';
3
- import { Unique } from './_unique.mjs';
3
+ import * as Unique from './_unique.mjs';
4
4
  import { CheckContext, ErrorContext } from './_context.mjs';
5
5
  import { BuildSchema, CheckSchema, ErrorSchema } from './schema.mjs';
6
6
  import { EmitGuard as E, Guard as G } from '../../guard/index.mjs';
@@ -11,7 +11,7 @@ function BuildOneOfStandard(stack, context, schema, value) {
11
11
  return Reducer(stack, context, schema.oneOf, value, E.IsEqual(E.Member('results', 'length'), E.Constant(1)));
12
12
  }
13
13
  function BuildOneOfFast(stack, context, schema, value) {
14
- const [result] = [Unique()];
14
+ const [result] = [Unique.CreateUnique()];
15
15
  const results = E.ArrayLiteral(schema.oneOf.map((schema) => BuildSchema(stack, context, schema, value)));
16
16
  const count = E.Counted(results, [result, '_'], E.IsEqual(result, E.Constant(true)));
17
17
  return E.IsEqual(count, E.Constant(1));
@@ -1,7 +1,7 @@
1
1
  // deno-fmt-ignore-file
2
+ import * as Unique from './_unique.mjs';
2
3
  import * as Externals from './_externals.mjs';
3
4
  import * as Pathing from './_pathing.mjs';
4
- import { Unique } from './_unique.mjs';
5
5
  import { UnicodeRegExp } from './_regexp.mjs';
6
6
  import { BuildSchemaPushStack, CheckSchemaPushStack, ErrorSchemaPushStack } from './schema.mjs';
7
7
  import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
@@ -10,7 +10,7 @@ import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
10
10
  // ------------------------------------------------------------------
11
11
  export function BuildPatternProperties(stack, context, schema, value) {
12
12
  return E.ReduceAnd(G.Entries(schema.patternProperties).map(([pattern, schema]) => {
13
- const [key, prop] = [Unique(), Unique()];
13
+ const [key, prop] = [Unique.CreateUnique(), Unique.CreateUnique()];
14
14
  const regexp = Externals.CreateVariable(UnicodeRegExp(pattern));
15
15
  const notKey = E.Not(E.Call(E.Member(regexp, 'test'), [key]));
16
16
  const isSchema = BuildSchemaPushStack(stack, context, schema, prop);
@@ -1,13 +1,13 @@
1
1
  // deno-fmt-ignore-file
2
2
  import * as Pathing from './_pathing.mjs';
3
- import { Unique } from './_unique.mjs';
3
+ import * as Unique from './_unique.mjs';
4
4
  import { BuildSchema, CheckSchema, ErrorSchema } from './schema.mjs';
5
5
  import { EmitGuard as E, Guard as G } from '../../guard/index.mjs';
6
6
  // ------------------------------------------------------------------
7
7
  // Build
8
8
  // ------------------------------------------------------------------
9
9
  export function BuildPropertyNames(stack, context, schema, value) {
10
- const [key, _index] = [Unique(), Unique()];
10
+ const [key, _index] = [Unique.CreateUnique(), Unique.CreateUnique()];
11
11
  return E.Every(E.Keys(value), E.Constant(0), [key, _index], BuildSchema(stack, context, schema.propertyNames, key));
12
12
  }
13
13
  // ------------------------------------------------------------------
@@ -1,5 +1,5 @@
1
1
  // deno-fmt-ignore-file
2
- import { Unique } from './_unique.mjs';
2
+ import * as Unique from './_unique.mjs';
3
3
  import { ErrorContext } from './_context.mjs';
4
4
  import { BuildSchema, CheckSchema, ErrorSchema } from './schema.mjs';
5
5
  import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
@@ -7,7 +7,7 @@ import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
7
7
  // Build
8
8
  // ------------------------------------------------------------------
9
9
  export function BuildUnevaluatedItems(stack, context, schema, value) {
10
- const [index, item] = [Unique(), Unique()];
10
+ const [index, item] = [Unique.CreateUnique(), Unique.CreateUnique()];
11
11
  const indices = E.Call(E.Member('context', 'GetIndices'), []);
12
12
  const hasIndex = E.Call(E.Member('indices', 'has'), [index]);
13
13
  const isSchema = BuildSchema(stack, context, schema.unevaluatedItems, item);
@@ -1,5 +1,5 @@
1
1
  // deno-fmt-ignore-file
2
- import { Unique } from './_unique.mjs';
2
+ import * as Unique from './_unique.mjs';
3
3
  import { ErrorContext } from './_context.mjs';
4
4
  import { BuildSchema, CheckSchema, ErrorSchema } from './schema.mjs';
5
5
  import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
@@ -7,7 +7,7 @@ import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
7
7
  // Build
8
8
  // ------------------------------------------------------------------
9
9
  export function BuildUnevaluatedProperties(stack, context, schema, value) {
10
- const [key, prop] = [Unique(), Unique()];
10
+ const [key, prop] = [Unique.CreateUnique(), Unique.CreateUnique()];
11
11
  const keys = E.Call(E.Member('context', 'GetKeys'), []);
12
12
  const hasKey = E.Call(E.Member('keys', 'has'), [key]);
13
13
  const addKey = E.Call(E.Member('context', 'AddKey'), [key]);
@@ -1,16 +1,16 @@
1
1
  // deno-fmt-ignore-file
2
2
  import { Unreachable } from '../unreachable/index.mjs';
3
- import { Guard, GlobalsGuard } from '../../guard/index.mjs';
3
+ import { GlobalsGuard, Guard } from '../../guard/index.mjs';
4
4
  // ------------------------------------------------------------------
5
5
  // InstanceKeys
6
6
  //
7
- // Retrieves all enumerable and non-enumerable own property keys
8
- // and inherited prototype keys (excluding symbols and the 'constructor')
7
+ // Retrieves all enumerable and non-enumerable own property keys
8
+ // and inherited prototype keys (excluding symbols and the 'constructor')
9
9
  // from an object instance.
10
10
  //
11
- // This function is useful for differentiating between class instances
12
- // based on their structural keys rather than relying on the
13
- // constructor name. It provides a more reliable structural comparison
11
+ // This function is useful for differentiating between class instances
12
+ // based on their structural keys rather than relying on the
13
+ // constructor name. It provides a more reliable structural comparison
14
14
  // by capturing both own and prototype properties.
15
15
  //
16
16
  // ------------------------------------------------------------------
@@ -40,38 +40,57 @@ function IsIEEE754(value) {
40
40
  // ------------------------------------------------------------------
41
41
  // ByteMarker
42
42
  // ------------------------------------------------------------------
43
- var ByteMarker;
44
- (function (ByteMarker) {
45
- ByteMarker[ByteMarker["Array"] = 0] = "Array";
46
- ByteMarker[ByteMarker["BigInt"] = 1] = "BigInt";
47
- ByteMarker[ByteMarker["Boolean"] = 2] = "Boolean";
48
- ByteMarker[ByteMarker["Date"] = 3] = "Date";
49
- ByteMarker[ByteMarker["Constructor"] = 4] = "Constructor";
50
- ByteMarker[ByteMarker["Function"] = 5] = "Function";
51
- ByteMarker[ByteMarker["Null"] = 6] = "Null";
52
- ByteMarker[ByteMarker["Number"] = 7] = "Number";
53
- ByteMarker[ByteMarker["Object"] = 8] = "Object";
54
- ByteMarker[ByteMarker["RegExp"] = 9] = "RegExp";
55
- ByteMarker[ByteMarker["String"] = 10] = "String";
56
- ByteMarker[ByteMarker["Symbol"] = 11] = "Symbol";
57
- ByteMarker[ByteMarker["TypeArray"] = 12] = "TypeArray";
58
- ByteMarker[ByteMarker["Undefined"] = 13] = "Undefined";
59
- })(ByteMarker || (ByteMarker = {}));
43
+ const ByteMarker = {
44
+ Array: 0x0,
45
+ BigInt: 0x1,
46
+ Boolean: 0x2,
47
+ Date: 0x3,
48
+ Constructor: 0x4,
49
+ Function: 0x5,
50
+ Null: 0x6,
51
+ Number: 0x7,
52
+ Object: 0x8,
53
+ RegExp: 0x9,
54
+ String: 0xA,
55
+ Symbol: 0xB,
56
+ TypeArray: 0xC,
57
+ Undefined: 0xD
58
+ };
60
59
  // ------------------------------------------------------------------
61
60
  // State
62
61
  // ------------------------------------------------------------------
63
- let Accumulator = BigInt('14695981039346656037');
64
- const [Prime, Size] = [BigInt('1099511628211'), BigInt('18446744073709551616' /* 2 ^ 64 */)];
65
- const Bytes = Array.from({ length: 256 }).map((_, i) => BigInt(i));
62
+ //
63
+ // The 64-bit accumulator is held as four 16-bit limbs (A0 is the least
64
+ // significant) so the FNV1A64 operation can be computed with number
65
+ // arithmetic, avoiding a BigInt multiply and modulo for every byte.
66
+ //
67
+ // Offset: 14695981039346656037 (0xCBF29CE484222325)
68
+ //
69
+ // ------------------------------------------------------------------
70
+ let A0 = 0x2325, A1 = 0x8422, A2 = 0x9CE4, A3 = 0xCBF2;
66
71
  const F64 = new Float64Array(1);
67
72
  const F64In = new DataView(F64.buffer);
68
73
  const F64Out = new Uint8Array(F64.buffer);
69
74
  // ------------------------------------------------------------------
70
75
  // Operation
76
+ //
77
+ // Prime: 1099511628211 (0x100000001B3 = 2^40 + 0x1B3)
78
+ //
79
+ // The multiply is computed as (A * 0x1B3) + (A << 40) modulo 2^64,
80
+ // where (A << 40) adds (A0 << 8) to the third limb and (A1 << 8)
81
+ // to the fourth.
82
+ //
71
83
  // ------------------------------------------------------------------
72
84
  function FNV1A64_OP(byte) {
73
- Accumulator = Accumulator ^ Bytes[byte];
74
- Accumulator = (Accumulator * Prime) % Size;
85
+ const L0 = A0 ^ byte;
86
+ const T0 = L0 * 0x1B3;
87
+ const T1 = A1 * 0x1B3 + (T0 >>> 16);
88
+ const T2 = A2 * 0x1B3 + (T1 >>> 16) + (L0 << 8);
89
+ const T3 = A3 * 0x1B3 + (T2 >>> 16) + (A1 << 8);
90
+ A0 = T0 & 0xFFFF;
91
+ A1 = T1 & 0xFFFF;
92
+ A2 = T2 & 0xFFFF;
93
+ A3 = T3 & 0xFFFF;
75
94
  }
76
95
  // ------------------------------------------------------------------
77
96
  // Array
@@ -159,8 +178,15 @@ function FromRegExp(value) {
159
178
  const encoder = new TextEncoder();
160
179
  function FromString(value) {
161
180
  FNV1A64_OP(ByteMarker.String);
162
- for (const byte of encoder.encode(value)) {
163
- FNV1A64_OP(byte);
181
+ for (let i = 0; i < value.length; i++) {
182
+ const code = value.charCodeAt(i);
183
+ if (code > 0x7F) {
184
+ for (const byte of encoder.encode(value.slice(i))) {
185
+ FNV1A64_OP(byte);
186
+ }
187
+ return;
188
+ }
189
+ FNV1A64_OP(code);
164
190
  }
165
191
  }
166
192
  // ------------------------------------------------------------------
@@ -220,13 +246,16 @@ function FromValue(value) {
220
246
  // ------------------------------------------------------------------
221
247
  // Hash
222
248
  // ------------------------------------------------------------------
249
+ function Hex(limb) {
250
+ return limb.toString(16).padStart(4, '0');
251
+ }
223
252
  /** Generates a FNV1A-64 non cryptographic hash of the given value */
224
253
  export function HashCode(value) {
225
- Accumulator = BigInt('14695981039346656037');
226
- FromValue(value);
227
- return Accumulator;
254
+ return BigInt(`0x${Hash(value)}`);
228
255
  }
229
256
  /** Generates a FNV1A-64 non cryptographic hash of the given value */
230
257
  export function Hash(value) {
231
- return HashCode(value).toString(16).padStart(16, '0');
258
+ A0 = 0x2325, A1 = 0x8422, A2 = 0x9CE4, A3 = 0xCBF2;
259
+ FromValue(value);
260
+ return `${Hex(A3)}${Hex(A2)}${Hex(A1)}${Hex(A0)}`;
232
261
  }
@@ -33,7 +33,8 @@ export function en_US(error) {
33
33
  case 'unevaluatedProperties': return 'must not have unevaluated properties';
34
34
  case 'uniqueItems': return `must not have duplicate items`;
35
35
  case '~refine': return error.params.message;
36
- // deno-coverage-ignore - unreachable
36
+ // deno-coverage-ignore-start - unreachable
37
37
  default: return 'an unknown validation error occurred';
38
+ // deno-coverage-ignore-stop
38
39
  }
39
40
  }
@@ -1,14 +1,8 @@
1
1
  type ObjectLike = Record<PropertyKey, any>;
2
- /**
3
- * Performs an Object assign using the Left and Right object types. We track this operation as it
4
- * creates a new GC handle per assignment.
5
- */
2
+ /** Performs an Object assign using the Left and Right object types. */
6
3
  export type TAssign<Left extends ObjectLike, Right extends ObjectLike, Assigned extends ObjectLike = Omit<Left, keyof Right> & Right> = {
7
4
  [Key in keyof Assigned]: Assigned[Key];
8
5
  } & {};
9
- /**
10
- * Performs an Object assign using the Left and Right object types. We track this operation as it
11
- * creates a new GC handle per assignment.
12
- */
6
+ /** Performs an Object assign using the Left and Right object types. */
13
7
  export declare function Assign<Left extends ObjectLike, Right extends ObjectLike>(left: Left, right: Right): TAssign<Left, Right>;
14
8
  export {};
@@ -1,12 +1,19 @@
1
1
  // deno-lint-ignore-file ban-types no-explicit-any
2
2
  // deno-fmt-ignore-file
3
3
  import { Metrics } from './metrics.mjs';
4
- import { Freeze } from './freeze.mjs';
5
- /**
6
- * Performs an Object assign using the Left and Right object types. We track this operation as it
7
- * creates a new GC handle per assignment.
8
- */
4
+ import { Finalize } from './finalize.mjs';
5
+ import { Keys } from './keys.mjs';
6
+ /** Performs an Object assign using the Left and Right object types. */
9
7
  export function Assign(left, right) {
10
8
  Metrics.assign += 1;
11
- return Freeze({ ...left, ...right });
9
+ const result = {}, rightKeys = Keys(right), leftKeys = Keys(left);
10
+ for (const key of leftKeys) {
11
+ if (rightKeys.includes(key))
12
+ continue;
13
+ Object.defineProperty(result, key, Object.getOwnPropertyDescriptor(left, key));
14
+ }
15
+ for (const key of rightKeys) {
16
+ Object.defineProperty(result, key, Object.getOwnPropertyDescriptor(right, key));
17
+ }
18
+ return Finalize(result);
12
19
  }
@@ -1,5 +1,4 @@
1
- /**
2
- * Returns a Clone of the given value. This function is similar to structuredClone()
3
- * but also supports deep cloning instances of Map, Set and TypeArray.
4
- */
5
- export declare function Clone<Value extends unknown = unknown>(value: Value): Value;
1
+ type ObjectLike = Record<PropertyKey, any>;
2
+ /** Returns a shallow clone of the given object. */
3
+ export declare function Clone<Value extends ObjectLike = ObjectLike>(value: Value): Value;
4
+ export {};