pi-proactive 0.2.0-beta.2 → 0.2.0-beta.3

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 (243) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +32 -28
  3. package/build/cli.mjs +121 -0
  4. package/build/extensions/proactive.js +47 -6
  5. package/build/src/commands.js +78 -2
  6. package/build/src/config.js +511 -4
  7. package/build/src/daemon-config.js +221 -0
  8. package/build/src/daemon-contact.js +103 -0
  9. package/build/src/daemon-host.js +84 -0
  10. package/build/src/daemon.js +193 -3
  11. package/build/src/health.js +84 -0
  12. package/build/src/lineage.js +41 -2
  13. package/build/src/notify.js +183 -0
  14. package/build/src/progress-eta.js +134 -0
  15. package/build/src/trigger.js +43 -0
  16. package/build/src/trust-loop.js +321 -0
  17. package/build/src/trust-metrics.js +236 -0
  18. package/build/src/trust-notify.js +73 -0
  19. package/build/src/trust-policy.js +58 -0
  20. package/build/src/trust-registry.js +323 -0
  21. package/daemon/launchd.plist +48 -0
  22. package/daemon/pi-proactive-daemon.service +29 -0
  23. package/daemon/run-daemon.sh +84 -0
  24. package/node_modules/typebox/build/compile/code.mjs +2 -1
  25. package/node_modules/typebox/build/compile/validator.mjs +1 -5
  26. package/node_modules/typebox/build/format/date_time.d.mts +1 -2
  27. package/node_modules/typebox/build/format/date_time.mjs +3 -12
  28. package/node_modules/typebox/build/format/duration.d.mts +2 -2
  29. package/node_modules/typebox/build/format/duration.mjs +2 -2
  30. package/node_modules/typebox/build/format/idn_email.d.mts +0 -1
  31. package/node_modules/typebox/build/format/idn_email.mjs +0 -1
  32. package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -1
  33. package/node_modules/typebox/build/format/idn_hostname.mjs +1 -1
  34. package/node_modules/typebox/build/format/ipv4.d.mts +2 -2
  35. package/node_modules/typebox/build/format/ipv4.mjs +2 -2
  36. package/node_modules/typebox/build/format/ipv6.d.mts +1 -1
  37. package/node_modules/typebox/build/format/ipv6.mjs +1 -1
  38. package/node_modules/typebox/build/format/iri.mjs +9 -16
  39. package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
  40. package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
  41. package/node_modules/typebox/build/guard/emit.mjs +2 -2
  42. package/node_modules/typebox/build/guard/guard.d.mts +5 -7
  43. package/node_modules/typebox/build/guard/guard.mjs +9 -14
  44. package/node_modules/typebox/build/guard/index.mjs +0 -6
  45. package/node_modules/typebox/build/guard/{unicode/unicode_segment.mjs → string.mjs} +19 -16
  46. package/node_modules/typebox/build/schema/build.mjs +5 -5
  47. package/node_modules/typebox/build/schema/check.mjs +1 -1
  48. package/node_modules/typebox/build/schema/engine/_context.d.mts +1 -5
  49. package/node_modules/typebox/build/schema/engine/_context.mjs +3 -16
  50. package/node_modules/typebox/build/schema/engine/_functions.d.mts +2 -2
  51. package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -1
  52. package/node_modules/typebox/build/schema/engine/_reducer.d.mts +3 -3
  53. package/node_modules/typebox/build/schema/engine/_refine.d.mts +5 -5
  54. package/node_modules/typebox/build/schema/engine/_refine.mjs +9 -14
  55. package/node_modules/typebox/build/schema/engine/_stack.d.mts +20 -34
  56. package/node_modules/typebox/build/schema/engine/_stack.mjs +202 -143
  57. package/node_modules/typebox/build/schema/engine/_unique.d.mts +2 -4
  58. package/node_modules/typebox/build/schema/engine/_unique.mjs +3 -7
  59. package/node_modules/typebox/build/schema/engine/additionalItems.d.mts +4 -4
  60. package/node_modules/typebox/build/schema/engine/additionalItems.mjs +3 -3
  61. package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +8 -5
  62. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +32 -27
  63. package/node_modules/typebox/build/schema/engine/allOf.d.mts +4 -4
  64. package/node_modules/typebox/build/schema/engine/allOf.mjs +1 -1
  65. package/node_modules/typebox/build/schema/engine/anyOf.d.mts +4 -4
  66. package/node_modules/typebox/build/schema/engine/anyOf.mjs +9 -4
  67. package/node_modules/typebox/build/schema/engine/boolean.d.mts +4 -4
  68. package/node_modules/typebox/build/schema/engine/boolean.mjs +6 -2
  69. package/node_modules/typebox/build/schema/engine/const.d.mts +4 -4
  70. package/node_modules/typebox/build/schema/engine/const.mjs +6 -2
  71. package/node_modules/typebox/build/schema/engine/contains.d.mts +4 -4
  72. package/node_modules/typebox/build/schema/engine/contains.mjs +9 -5
  73. package/node_modules/typebox/build/schema/engine/dependencies.d.mts +4 -4
  74. package/node_modules/typebox/build/schema/engine/dependencies.mjs +7 -5
  75. package/node_modules/typebox/build/schema/engine/dependentRequired.d.mts +4 -4
  76. package/node_modules/typebox/build/schema/engine/dependentRequired.mjs +6 -2
  77. package/node_modules/typebox/build/schema/engine/dependentSchemas.d.mts +4 -4
  78. package/node_modules/typebox/build/schema/engine/dependentSchemas.mjs +1 -2
  79. package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +4 -4
  80. package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +8 -12
  81. package/node_modules/typebox/build/schema/engine/enum.d.mts +4 -4
  82. package/node_modules/typebox/build/schema/engine/enum.mjs +6 -2
  83. package/node_modules/typebox/build/schema/engine/exclusiveMaximum.d.mts +4 -4
  84. package/node_modules/typebox/build/schema/engine/exclusiveMaximum.mjs +6 -2
  85. package/node_modules/typebox/build/schema/engine/exclusiveMinimum.d.mts +4 -4
  86. package/node_modules/typebox/build/schema/engine/exclusiveMinimum.mjs +6 -2
  87. package/node_modules/typebox/build/schema/engine/format.d.mts +4 -4
  88. package/node_modules/typebox/build/schema/engine/format.mjs +8 -11
  89. package/node_modules/typebox/build/schema/engine/if.d.mts +4 -4
  90. package/node_modules/typebox/build/schema/engine/if.mjs +13 -5
  91. package/node_modules/typebox/build/schema/engine/index.d.mts +0 -1
  92. package/node_modules/typebox/build/schema/engine/index.mjs +0 -1
  93. package/node_modules/typebox/build/schema/engine/items.d.mts +4 -4
  94. package/node_modules/typebox/build/schema/engine/items.mjs +5 -8
  95. package/node_modules/typebox/build/schema/engine/maxContains.d.mts +4 -4
  96. package/node_modules/typebox/build/schema/engine/maxContains.mjs +8 -4
  97. package/node_modules/typebox/build/schema/engine/maxItems.d.mts +4 -4
  98. package/node_modules/typebox/build/schema/engine/maxItems.mjs +6 -2
  99. package/node_modules/typebox/build/schema/engine/maxLength.d.mts +4 -4
  100. package/node_modules/typebox/build/schema/engine/maxLength.mjs +6 -2
  101. package/node_modules/typebox/build/schema/engine/maxProperties.d.mts +4 -4
  102. package/node_modules/typebox/build/schema/engine/maxProperties.mjs +6 -2
  103. package/node_modules/typebox/build/schema/engine/maximum.d.mts +4 -4
  104. package/node_modules/typebox/build/schema/engine/maximum.mjs +6 -2
  105. package/node_modules/typebox/build/schema/engine/minContains.d.mts +4 -4
  106. package/node_modules/typebox/build/schema/engine/minContains.mjs +9 -5
  107. package/node_modules/typebox/build/schema/engine/minItems.d.mts +5 -5
  108. package/node_modules/typebox/build/schema/engine/minItems.mjs +6 -2
  109. package/node_modules/typebox/build/schema/engine/minLength.d.mts +4 -4
  110. package/node_modules/typebox/build/schema/engine/minLength.mjs +6 -2
  111. package/node_modules/typebox/build/schema/engine/minProperties.d.mts +4 -4
  112. package/node_modules/typebox/build/schema/engine/minProperties.mjs +6 -2
  113. package/node_modules/typebox/build/schema/engine/minimum.d.mts +4 -4
  114. package/node_modules/typebox/build/schema/engine/minimum.mjs +6 -2
  115. package/node_modules/typebox/build/schema/engine/multipleOf.d.mts +4 -4
  116. package/node_modules/typebox/build/schema/engine/multipleOf.mjs +6 -2
  117. package/node_modules/typebox/build/schema/engine/not.d.mts +4 -4
  118. package/node_modules/typebox/build/schema/engine/not.mjs +8 -4
  119. package/node_modules/typebox/build/schema/engine/oneOf.d.mts +4 -4
  120. package/node_modules/typebox/build/schema/engine/oneOf.mjs +11 -6
  121. package/node_modules/typebox/build/schema/engine/pattern.d.mts +4 -4
  122. package/node_modules/typebox/build/schema/engine/pattern.mjs +7 -3
  123. package/node_modules/typebox/build/schema/engine/patternProperties.d.mts +4 -4
  124. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +5 -6
  125. package/node_modules/typebox/build/schema/engine/prefixItems.d.mts +4 -4
  126. package/node_modules/typebox/build/schema/engine/prefixItems.mjs +1 -1
  127. package/node_modules/typebox/build/schema/engine/properties.d.mts +4 -4
  128. package/node_modules/typebox/build/schema/engine/properties.mjs +3 -4
  129. package/node_modules/typebox/build/schema/engine/propertyNames.d.mts +4 -4
  130. package/node_modules/typebox/build/schema/engine/propertyNames.mjs +10 -7
  131. package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +4 -4
  132. package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +8 -12
  133. package/node_modules/typebox/build/schema/engine/ref.d.mts +4 -4
  134. package/node_modules/typebox/build/schema/engine/ref.mjs +14 -18
  135. package/node_modules/typebox/build/schema/engine/required.d.mts +4 -4
  136. package/node_modules/typebox/build/schema/engine/required.mjs +6 -2
  137. package/node_modules/typebox/build/schema/engine/schema.d.mts +7 -7
  138. package/node_modules/typebox/build/schema/engine/schema.mjs +138 -136
  139. package/node_modules/typebox/build/schema/engine/type.d.mts +4 -4
  140. package/node_modules/typebox/build/schema/engine/type.mjs +6 -2
  141. package/node_modules/typebox/build/schema/engine/unevaluatedItems.d.mts +4 -4
  142. package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +9 -5
  143. package/node_modules/typebox/build/schema/engine/unevaluatedProperties.d.mts +4 -4
  144. package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +9 -5
  145. package/node_modules/typebox/build/schema/engine/uniqueItems.d.mts +4 -4
  146. package/node_modules/typebox/build/schema/engine/uniqueItems.mjs +6 -2
  147. package/node_modules/typebox/build/schema/errors.mjs +1 -1
  148. package/node_modules/typebox/build/schema/intern/intern.d.mts +9 -6
  149. package/node_modules/typebox/build/schema/intern/intern.mjs +56 -90
  150. package/node_modules/typebox/build/schema/parse.mjs +0 -3
  151. package/node_modules/typebox/build/schema/pointer/pointer.d.mts +6 -1
  152. package/node_modules/typebox/build/schema/pointer/pointer.mjs +64 -47
  153. package/node_modules/typebox/build/schema/resolve/resolve.d.mts +32 -6
  154. package/node_modules/typebox/build/schema/resolve/resolve.mjs +227 -231
  155. package/node_modules/typebox/build/schema/schema.d.mts +0 -1
  156. package/node_modules/typebox/build/schema/schema.mjs +0 -1
  157. package/node_modules/typebox/build/system/hashing/hash.mjs +34 -63
  158. package/node_modules/typebox/build/system/locale/en_US.mjs +1 -2
  159. package/node_modules/typebox/build/system/memory/assign.d.mts +8 -2
  160. package/node_modules/typebox/build/system/memory/assign.mjs +6 -13
  161. package/node_modules/typebox/build/system/memory/clone.d.mts +5 -4
  162. package/node_modules/typebox/build/system/memory/clone.mjs +96 -8
  163. package/node_modules/typebox/build/system/memory/create.d.mts +5 -1
  164. package/node_modules/typebox/build/system/memory/create.mjs +13 -18
  165. package/node_modules/typebox/build/system/memory/discard.d.mts +1 -1
  166. package/node_modules/typebox/build/system/memory/discard.mjs +8 -9
  167. package/node_modules/typebox/build/system/memory/freeze.d.mts +4 -0
  168. package/node_modules/typebox/build/system/memory/freeze.mjs +6 -0
  169. package/node_modules/typebox/build/system/memory/update.d.mts +4 -1
  170. package/node_modules/typebox/build/system/memory/update.mjs +16 -43
  171. package/node_modules/typebox/build/system/settings/settings.d.mts +0 -11
  172. package/node_modules/typebox/build/system/settings/settings.mjs +0 -14
  173. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +24 -2
  174. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +29 -2
  175. package/node_modules/typebox/build/type/engine/evaluate/index.d.mts +0 -1
  176. package/node_modules/typebox/build/type/engine/evaluate/index.mjs +0 -1
  177. package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +1 -5
  178. package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +1 -6
  179. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +3 -1
  180. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +4 -1
  181. package/node_modules/typebox/build/type/engine/object/from_intersect.d.mts +2 -2
  182. package/node_modules/typebox/build/type/engine/object/from_intersect.mjs +2 -2
  183. package/node_modules/typebox/build/type/engine/object/from_union.d.mts +2 -2
  184. package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
  185. package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +3 -1
  186. package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +4 -1
  187. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +3 -1
  188. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +4 -1
  189. package/node_modules/typebox/build/type/extends/inference.d.mts +1 -1
  190. package/node_modules/typebox/build/type/extends/inference.mjs +2 -15
  191. package/node_modules/typebox/build/type/extends/tuple.d.mts +1 -2
  192. package/node_modules/typebox/build/type/extends/tuple.mjs +1 -21
  193. package/node_modules/typebox/build/value/clean/from_object.mjs +1 -1
  194. package/node_modules/typebox/build/value/clone/clone.d.mts +3 -4
  195. package/node_modules/typebox/build/value/clone/clone.mjs +7 -5
  196. package/node_modules/typebox/build/value/parse/parse.mjs +4 -10
  197. package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +14 -25
  198. package/node_modules/typebox/package.json +1 -1
  199. package/node_modules/typebox/readme.md +84 -52
  200. package/package.json +11 -3
  201. package/skills/pi-proactive/SKILL.md +27 -24
  202. package/tools/cli.mjs +121 -0
  203. package/tools/daemon-install.sh +397 -0
  204. package/tools/daemon-uninstall.sh +226 -0
  205. package/node_modules/typebox/build/guard/unicode/unicode.d.mts +0 -6
  206. package/node_modules/typebox/build/guard/unicode/unicode.mjs +0 -35
  207. package/node_modules/typebox/build/schema/engine/_pathing.d.mts +0 -1
  208. package/node_modules/typebox/build/schema/engine/_pathing.mjs +0 -11
  209. package/node_modules/typebox/build/schema/meta/draft_2019_09.d.mts +0 -2
  210. package/node_modules/typebox/build/schema/meta/draft_2019_09.mjs +0 -288
  211. package/node_modules/typebox/build/schema/meta/draft_2020_12.d.mts +0 -2
  212. package/node_modules/typebox/build/schema/meta/draft_2020_12.mjs +0 -300
  213. package/node_modules/typebox/build/schema/meta/draft_3.d.mts +0 -2
  214. package/node_modules/typebox/build/schema/meta/draft_3.mjs +0 -143
  215. package/node_modules/typebox/build/schema/meta/draft_4.d.mts +0 -2
  216. package/node_modules/typebox/build/schema/meta/draft_4.mjs +0 -149
  217. package/node_modules/typebox/build/schema/meta/draft_6.d.mts +0 -2
  218. package/node_modules/typebox/build/schema/meta/draft_6.mjs +0 -155
  219. package/node_modules/typebox/build/schema/meta/draft_7.d.mts +0 -2
  220. package/node_modules/typebox/build/schema/meta/draft_7.mjs +0 -172
  221. package/node_modules/typebox/build/schema/meta/index.d.mts +0 -2
  222. package/node_modules/typebox/build/schema/meta/index.mjs +0 -2
  223. package/node_modules/typebox/build/schema/meta/meta.d.mts +0 -9
  224. package/node_modules/typebox/build/schema/meta/meta.mjs +0 -15
  225. package/node_modules/typebox/build/schema/meta/schema.d.mts +0 -6
  226. package/node_modules/typebox/build/schema/meta/schema.mjs +0 -1
  227. package/node_modules/typebox/build/system/memory/deep.d.mts +0 -2
  228. package/node_modules/typebox/build/system/memory/deep.mjs +0 -108
  229. package/node_modules/typebox/build/system/memory/finalize.d.mts +0 -4
  230. package/node_modules/typebox/build/system/memory/finalize.mjs +0 -30
  231. package/node_modules/typebox/build/system/memory/keys.d.mts +0 -2
  232. package/node_modules/typebox/build/system/memory/keys.mjs +0 -8
  233. package/node_modules/typebox/build/system/settings/internal.d.mts +0 -2
  234. package/node_modules/typebox/build/system/settings/internal.mjs +0 -20
  235. package/node_modules/typebox/build/type/engine/call/index.d.mts +0 -1
  236. package/node_modules/typebox/build/type/engine/call/index.mjs +0 -1
  237. package/node_modules/typebox/build/type/engine/evaluate/property.d.mts +0 -30
  238. package/node_modules/typebox/build/type/engine/evaluate/property.mjs +0 -29
  239. package/node_modules/typebox/build/type/engine/this/index.d.mts +0 -1
  240. package/node_modules/typebox/build/type/engine/this/index.mjs +0 -1
  241. package/node_modules/typebox/build/value/repair/from_cyclic.d.mts +0 -2
  242. package/node_modules/typebox/build/value/repair/from_cyclic.mjs +0 -6
  243. /package/node_modules/typebox/build/guard/{unicode/unicode_segment.d.mts → string.d.mts} +0 -0
@@ -1,16 +1,16 @@
1
1
  // deno-fmt-ignore-file
2
2
  import { Unreachable } from '../unreachable/index.mjs';
3
- import { GlobalsGuard, Guard } from '../../guard/index.mjs';
3
+ import { Guard, GlobalsGuard } 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,57 +40,38 @@ function IsIEEE754(value) {
40
40
  // ------------------------------------------------------------------
41
41
  // ByteMarker
42
42
  // ------------------------------------------------------------------
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
- };
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 = {}));
59
60
  // ------------------------------------------------------------------
60
61
  // State
61
62
  // ------------------------------------------------------------------
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;
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));
71
66
  const F64 = new Float64Array(1);
72
67
  const F64In = new DataView(F64.buffer);
73
68
  const F64Out = new Uint8Array(F64.buffer);
74
69
  // ------------------------------------------------------------------
75
70
  // 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
- //
83
71
  // ------------------------------------------------------------------
84
72
  function FNV1A64_OP(byte) {
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;
73
+ Accumulator = Accumulator ^ Bytes[byte];
74
+ Accumulator = (Accumulator * Prime) % Size;
94
75
  }
95
76
  // ------------------------------------------------------------------
96
77
  // Array
@@ -178,15 +159,8 @@ function FromRegExp(value) {
178
159
  const encoder = new TextEncoder();
179
160
  function FromString(value) {
180
161
  FNV1A64_OP(ByteMarker.String);
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);
162
+ for (const byte of encoder.encode(value)) {
163
+ FNV1A64_OP(byte);
190
164
  }
191
165
  }
192
166
  // ------------------------------------------------------------------
@@ -246,16 +220,13 @@ function FromValue(value) {
246
220
  // ------------------------------------------------------------------
247
221
  // Hash
248
222
  // ------------------------------------------------------------------
249
- function Hex(limb) {
250
- return limb.toString(16).padStart(4, '0');
251
- }
252
223
  /** Generates a FNV1A-64 non cryptographic hash of the given value */
253
224
  export function HashCode(value) {
254
- return BigInt(`0x${Hash(value)}`);
225
+ Accumulator = BigInt('14695981039346656037');
226
+ FromValue(value);
227
+ return Accumulator;
255
228
  }
256
229
  /** Generates a FNV1A-64 non cryptographic hash of the given value */
257
230
  export function Hash(value) {
258
- A0 = 0x2325, A1 = 0x8422, A2 = 0x9CE4, A3 = 0xCBF2;
259
- FromValue(value);
260
- return `${Hex(A3)}${Hex(A2)}${Hex(A1)}${Hex(A0)}`;
231
+ return HashCode(value).toString(16).padStart(16, '0');
261
232
  }
@@ -33,8 +33,7 @@ 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-start - unreachable
36
+ // deno-coverage-ignore - unreachable
37
37
  default: return 'an unknown validation error occurred';
38
- // deno-coverage-ignore-stop
39
38
  }
40
39
  }
@@ -1,8 +1,14 @@
1
1
  type ObjectLike = Record<PropertyKey, any>;
2
- /** Performs an Object assign using the Left and Right object types. */
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
+ */
3
6
  export type TAssign<Left extends ObjectLike, Right extends ObjectLike, Assigned extends ObjectLike = Omit<Left, keyof Right> & Right> = {
4
7
  [Key in keyof Assigned]: Assigned[Key];
5
8
  } & {};
6
- /** Performs an Object assign using the Left and Right object types. */
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
+ */
7
13
  export declare function Assign<Left extends ObjectLike, Right extends ObjectLike>(left: Left, right: Right): TAssign<Left, Right>;
8
14
  export {};
@@ -1,19 +1,12 @@
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 { Finalize } from './finalize.mjs';
5
- import { Keys } from './keys.mjs';
6
- /** Performs an Object assign using the Left and Right object types. */
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
+ */
7
9
  export function Assign(left, right) {
8
10
  Metrics.assign += 1;
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);
11
+ return Freeze({ ...left, ...right });
19
12
  }
@@ -1,4 +1,5 @@
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 {};
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,19 +1,34 @@
1
- // deno-lint-ignore-file no-explicit-any
2
1
  // deno-fmt-ignore-file
3
- import { Guard } from '../../guard/index.mjs';
2
+ import { Guard, GlobalsGuard } from '../../guard/index.mjs';
4
3
  import { Metrics } from './metrics.mjs';
5
- import { Keys } from './keys.mjs';
6
4
  // ------------------------------------------------------------------
7
- // Clone
5
+ // ClassInstance
6
+ //
7
+ // TypeBox does not clone arbitrary class instances. Class instances
8
+ // cannot be safely cloned without potentially breaking private
9
+ // members of the instance.
10
+ //
8
11
  // ------------------------------------------------------------------
9
- /** Returns a shallow clone of the given object. */
10
- export function Clone(value) {
11
- Metrics.clone += 1;
12
+ function FromClassInstance(value) {
13
+ return value; // atomic
14
+ }
15
+ // ------------------------------------------------------------------
16
+ // SchemaObject
17
+ //
18
+ // Schema objects have non-enumerable properties that MUST be preserved
19
+ // on Clone. The following is the optimal path these objects.
20
+ // ------------------------------------------------------------------
21
+ function IsSchemaObject(value) {
22
+ return (Guard.HasPropertyKey(value, '~kind') ||
23
+ Guard.HasPropertyKey(value, '~unsafe'));
24
+ }
25
+ function FromSchemaObject(value) {
12
26
  const result = {};
13
- for (const key of Keys(value)) {
27
+ for (const key of Guard.Keys(value)) {
14
28
  if (Guard.IsUnsafePropertyKey(key))
15
29
  continue; // (ignore: prototype-pollution)
16
30
  const descriptor = Object.getOwnPropertyDescriptor(value, key); // safe-name!
31
+ descriptor.value = FromValue(descriptor.value);
17
32
  if (Guard.IsEqual(descriptor.enumerable, true)) {
18
33
  result[key] = descriptor.value;
19
34
  }
@@ -23,3 +38,76 @@ export function Clone(value) {
23
38
  }
24
39
  return result;
25
40
  }
41
+ // ------------------------------------------------------------------
42
+ // PlainObject
43
+ // ------------------------------------------------------------------
44
+ function FromPlainObject(value) {
45
+ const result = {};
46
+ for (const key of Guard.Keys(value)) {
47
+ if (Guard.IsUnsafePropertyKey(key))
48
+ continue; // (ignore: prototype-pollution)
49
+ result[key] = FromValue(value[key]);
50
+ }
51
+ for (const key of Guard.Symbols(value)) {
52
+ result[key] = FromValue(value[key]);
53
+ }
54
+ return result;
55
+ }
56
+ // ------------------------------------------------------------------
57
+ // Object
58
+ // ------------------------------------------------------------------
59
+ function FromObject(value) {
60
+ return (Guard.IsClassInstance(value) ? FromClassInstance(value) :
61
+ IsSchemaObject(value) ? FromSchemaObject(value) :
62
+ FromPlainObject(value));
63
+ }
64
+ // ------------------------------------------------------------------
65
+ // Array
66
+ // ------------------------------------------------------------------
67
+ function FromArray(value) {
68
+ return value.map((element) => FromValue(element));
69
+ }
70
+ // ------------------------------------------------------------------
71
+ // TypeArray
72
+ // ------------------------------------------------------------------
73
+ function FromTypedArray(value) {
74
+ return value.slice();
75
+ }
76
+ // ------------------------------------------------------------------
77
+ // RegExp
78
+ // ------------------------------------------------------------------
79
+ function FromRegExp(value) {
80
+ return new RegExp(value.source, value.flags);
81
+ }
82
+ // ------------------------------------------------------------------
83
+ // Map
84
+ // ------------------------------------------------------------------
85
+ function FromMap(value) {
86
+ return new Map(FromValue([...value.entries()]));
87
+ }
88
+ // ------------------------------------------------------------------
89
+ // Set
90
+ // ------------------------------------------------------------------
91
+ function FromSet(value) {
92
+ return new Set(FromValue([...value.values()]));
93
+ }
94
+ function FromValue(value) {
95
+ return (GlobalsGuard.IsTypeArray(value) ? FromTypedArray(value) :
96
+ GlobalsGuard.IsRegExp(value) ? FromRegExp(value) :
97
+ GlobalsGuard.IsMap(value) ? FromMap(value) :
98
+ GlobalsGuard.IsSet(value) ? FromSet(value) :
99
+ Guard.IsArray(value) ? FromArray(value) :
100
+ Guard.IsObject(value) ? FromObject(value) :
101
+ value);
102
+ }
103
+ // ------------------------------------------------------------------
104
+ // Clone
105
+ // ------------------------------------------------------------------
106
+ /**
107
+ * Returns a Clone of the given value. This function is similar to structuredClone()
108
+ * but also supports deep cloning instances of Map, Set and TypeArray.
109
+ */
110
+ export function Clone(value) {
111
+ Metrics.clone += 1;
112
+ return FromValue(value);
113
+ }
@@ -1,4 +1,8 @@
1
1
  type ObjectLike = Record<PropertyKey, any>;
2
- /** Creates an object with hidden, enumerable, and optional property sets. */
2
+ /**
3
+ * Creates an object with hidden, enumerable, and optional property sets. This function
4
+ * ensures types are instantiated according to configuration rules for enumerable and
5
+ * non-enumerable properties.
6
+ */
3
7
  export declare function Create(hidden: ObjectLike, enumerable: ObjectLike, options?: ObjectLike): ObjectLike;
4
8
  export {};
@@ -1,17 +1,8 @@
1
1
  // deno-lint-ignore-file no-explicit-any
2
2
  import { Settings } from '../settings/index.mjs';
3
3
  import { Metrics } from './metrics.mjs';
4
- import { Finalize } from './finalize.mjs';
5
- // ------------------------------------------------------------------
6
- // WithEnumerable
7
- // ------------------------------------------------------------------
8
- function WithEnumerable(left, right) {
9
- return { ...left, ...right };
10
- }
11
- // ------------------------------------------------------------------
12
- // WithHidden
13
- // ------------------------------------------------------------------
14
- function WithHidden(left, right) {
4
+ import { Freeze } from './freeze.mjs';
5
+ function MergeHidden(left, right) {
15
6
  for (const key of Object.keys(right)) {
16
7
  Object.defineProperty(left, key, {
17
8
  configurable: true,
@@ -22,13 +13,17 @@ function WithHidden(left, right) {
22
13
  }
23
14
  return left;
24
15
  }
25
- // ------------------------------------------------------------------
26
- // Create
27
- // ------------------------------------------------------------------
28
- /** Creates an object with hidden, enumerable, and optional property sets. */
16
+ function Merge(left, right) {
17
+ return { ...left, ...right };
18
+ }
19
+ /**
20
+ * Creates an object with hidden, enumerable, and optional property sets. This function
21
+ * ensures types are instantiated according to configuration rules for enumerable and
22
+ * non-enumerable properties.
23
+ */
29
24
  export function Create(hidden, enumerable, options = {}) {
30
25
  Metrics.create += 1;
31
- const withEnumerable = WithEnumerable(enumerable, options);
32
- const withHidden = Settings.Get().enumerableKind ? WithEnumerable(withEnumerable, hidden) : WithHidden(withEnumerable, hidden);
33
- return Finalize(withHidden);
26
+ const withOptions = Merge(enumerable, options);
27
+ const withHidden = Settings.Get().enumerableKind ? Merge(withOptions, hidden) : MergeHidden(withOptions, hidden);
28
+ return Freeze(withHidden);
34
29
  }
@@ -1,4 +1,4 @@
1
1
  type ObjectLike = Record<PropertyKey, any>;
2
- /** Discards property keys from the given object. */
2
+ /** Discards multiple property keys from the given object value */
3
3
  export declare function Discard(value: ObjectLike, propertyKeys: PropertyKey[]): ObjectLike;
4
4
  export {};
@@ -1,19 +1,18 @@
1
1
  // deno-lint-ignore-file no-explicit-any
2
+ import { Guard } from '../../guard/index.mjs';
2
3
  import { Metrics } from './metrics.mjs';
3
- import { Finalize } from './finalize.mjs';
4
- import { Keys } from './keys.mjs';
5
- // ------------------------------------------------------------------
6
- // Discard
7
- // ------------------------------------------------------------------
8
- /** Discards property keys from the given object. */
4
+ import { Freeze } from './freeze.mjs';
5
+ import { Clone } from './clone.mjs';
6
+ /** Discards multiple property keys from the given object value */
9
7
  export function Discard(value, propertyKeys) {
10
8
  Metrics.discard += 1;
11
9
  const result = {};
12
- for (const key of Keys(value)) {
10
+ for (const key of Guard.Keys(value)) {
13
11
  if (propertyKeys.includes(key))
14
12
  continue;
15
- const descriptor = Object.getOwnPropertyDescriptor(value, key);
13
+ const descriptor = Object.getOwnPropertyDescriptor(value, key); // safe-name!
14
+ descriptor.value = Clone(descriptor.value);
16
15
  Object.defineProperty(result, key, descriptor);
17
16
  }
18
- return Finalize(result);
17
+ return Freeze(result);
19
18
  }
@@ -0,0 +1,4 @@
1
+ type ObjectLike = Record<PropertyKey, any>;
2
+ /** Conditionally freezes the value if `immutableTypes` is true, otherwise no action. */
3
+ export declare function Freeze(value: ObjectLike): ObjectLike;
4
+ export {};
@@ -0,0 +1,6 @@
1
+ // deno-lint-ignore-file no-explicit-any
2
+ import { Settings } from '../settings/index.mjs';
3
+ /** Conditionally freezes the value if `immutableTypes` is true, otherwise no action. */
4
+ export function Freeze(value) {
5
+ return Settings.Get().immutableTypes ? Object.freeze(value) : value;
6
+ }
@@ -1,4 +1,7 @@
1
1
  type ObjectLike = Record<PropertyKey, any>;
2
- /** Updates an existing type with additional hidden and enumerable properties while preserving property configuration. */
2
+ /**
3
+ * Updates a value with new properties while preserving property enumerability. Use this function to modify
4
+ * existing types without altering their configuration.
5
+ */
3
6
  export declare function Update(current: ObjectLike, hidden: ObjectLike, enumerable: ObjectLike): ObjectLike;
4
7
  export {};
@@ -1,43 +1,27 @@
1
1
  // deno-lint-ignore-file no-explicit-any
2
- import { Guard } from '../../guard/index.mjs';
3
2
  import { Settings } from '../settings/index.mjs';
4
3
  import { Metrics } from './metrics.mjs';
5
- import { Finalize } from './finalize.mjs';
6
- import { Keys } from './keys.mjs';
7
- // ------------------------------------------------------------------
8
- // WithCurrent
9
- // ------------------------------------------------------------------
10
- function WithCurrent(current, hiddenKeys, enumerableKeys, result) {
11
- for (const key of Keys(current)) {
12
- if (Guard.IsUnsafePropertyKey(key) || hiddenKeys.includes(key) || enumerableKeys.includes(key))
13
- continue; // (ignore: prototype-pollution)
14
- const descriptor = Object.getOwnPropertyDescriptor(current, key); // safe-name!
15
- Object.defineProperty(result, key, descriptor);
16
- }
17
- }
18
- // ------------------------------------------------------------------
19
- // WithHidden
20
- // ------------------------------------------------------------------
21
- function WithHidden(hidden, keys, result) {
22
- const enumerableKind = Settings.Get().enumerableKind;
23
- for (const key of keys) {
24
- if (Guard.IsUnsafePropertyKey(key))
25
- continue; // (ignore: prototype-pollution)
4
+ import { Freeze } from './freeze.mjs';
5
+ import { Clone } from './clone.mjs';
6
+ /**
7
+ * Updates a value with new properties while preserving property enumerability. Use this function to modify
8
+ * existing types without altering their configuration.
9
+ */
10
+ export function Update(current, hidden, enumerable) {
11
+ Metrics.update += 1;
12
+ const settings = Settings.Get();
13
+ const result = Clone(current);
14
+ // hidden
15
+ for (const key of Object.keys(hidden)) {
26
16
  Object.defineProperty(result, key, {
27
17
  configurable: true,
28
18
  writable: true,
29
- enumerable: enumerableKind,
19
+ enumerable: settings.enumerableKind,
30
20
  value: hidden[key]
31
21
  });
32
22
  }
33
- }
34
- // ------------------------------------------------------------------
35
- // WithEnumerable
36
- // ------------------------------------------------------------------
37
- function WithEnumerable(enumerable, keys, result) {
38
- for (const key of keys) {
39
- if (Guard.IsUnsafePropertyKey(key))
40
- continue; // (ignore: prototype-pollution)
23
+ // enumerable
24
+ for (const key of Object.keys(enumerable)) {
41
25
  Object.defineProperty(result, key, {
42
26
  configurable: true,
43
27
  enumerable: true,
@@ -45,16 +29,5 @@ function WithEnumerable(enumerable, keys, result) {
45
29
  value: enumerable[key]
46
30
  });
47
31
  }
48
- }
49
- // ------------------------------------------------------------------
50
- // Update
51
- // ------------------------------------------------------------------
52
- /** Updates an existing type with additional hidden and enumerable properties while preserving property configuration. */
53
- export function Update(current, hidden, enumerable) {
54
- Metrics.update += 1;
55
- const result = {}, hiddenKeys = Keys(hidden), enumerableKeys = Keys(enumerable);
56
- WithCurrent(current, hiddenKeys, enumerableKeys, result);
57
- WithHidden(hidden, hiddenKeys, result);
58
- WithEnumerable(enumerable, enumerableKeys, result);
59
- return Finalize(result);
32
+ return Freeze(result);
60
33
  }
@@ -16,17 +16,6 @@ export interface TSettings {
16
16
  * @default 8
17
17
  */
18
18
  maxErrors: number;
19
- /**
20
- * Specifies the maximum number of errors to gather for failed Parse operations. TypeBox will
21
- * automatically run an error-gathering pass on failed Parses to attach diagnostics to the
22
- * thrown exception. This setting controls the number of errors gathered in that pass. Higher
23
- * values will reduce throughput on failure cases, so a maximum of 4 is recommended if more
24
- * errors are needed. The default setting of 1 will terminate on the first error, while a
25
- * setting of 0 will skip error gathering entirely.
26
- *
27
- * @default 1
28
- */
29
- maxParseErrors: number;
30
19
  /**
31
20
  * Specifies the maximum number of instantiations allowed within a top-level generic instantiation
32
21
  * context. This setting can be used to bound generic calls to a fixed count, which can be useful if
@@ -1,12 +1,8 @@
1
1
  import { Guard } from '../../guard/index.mjs';
2
- // -------------------------------------------------------------------
3
- // State
4
- // -------------------------------------------------------------------
5
2
  // Internal mutable state
6
3
  const settings = {
7
4
  immutableTypes: false,
8
5
  maxErrors: 8,
9
- maxParseErrors: 1,
10
6
  maxInstantiationCount: 128,
11
7
  useAcceleration: true,
12
8
  exactOptionalPropertyTypes: false,
@@ -14,14 +10,10 @@ const settings = {
14
10
  correctiveParse: false,
15
11
  unionPrioritySort: true
16
12
  };
17
- // -------------------------------------------------------------------
18
- // Reset
19
- // -------------------------------------------------------------------
20
13
  /** Resets system settings to defaults */
21
14
  export function Reset() {
22
15
  settings.immutableTypes = false;
23
16
  settings.maxErrors = 8;
24
- settings.maxParseErrors = 1;
25
17
  settings.maxInstantiationCount = 128;
26
18
  settings.useAcceleration = true;
27
19
  settings.exactOptionalPropertyTypes = false;
@@ -29,9 +21,6 @@ export function Reset() {
29
21
  settings.correctiveParse = false;
30
22
  settings.unionPrioritySort = true;
31
23
  }
32
- // -------------------------------------------------------------------
33
- // Set
34
- // -------------------------------------------------------------------
35
24
  /** Sets system settings */
36
25
  export function Set(options) {
37
26
  for (const key of Guard.Keys(options)) {
@@ -41,9 +30,6 @@ export function Set(options) {
41
30
  }
42
31
  }
43
32
  }
44
- // -------------------------------------------------------------------
45
- // Get
46
- // -------------------------------------------------------------------
47
33
  /** Gets current system settings */
48
34
  export function Get() {
49
35
  return settings;
@@ -1,11 +1,33 @@
1
+ import { type TReadonly } from '../../types/_readonly.mjs';
2
+ import { type TOptional } from '../../types/_optional.mjs';
1
3
  import { type TSchema } from '../../types/schema.mjs';
2
4
  import { type TProperties } from '../../types/properties.mjs';
3
5
  import { type TObject } from '../../types/object.mjs';
4
6
  import { type TNever } from '../../types/never.mjs';
5
7
  import { type TTuple } from '../../types/tuple.mjs';
8
+ import { type TAddReadonly } from '../../action/_add_readonly.mjs';
9
+ import { type TAddOptional } from '../../action/_add_optional.mjs';
10
+ import { type TRemoveReadonly } from '../../action/_remove_readonly.mjs';
11
+ import { type TRemoveOptional } from '../../action/_remove_optional.mjs';
6
12
  import { type TTupleElementsToProperties } from '../tuple/to_object.mjs';
7
- import { type TEvaluatePropertyIntersect } from './property.mjs';
8
- type TCompositePropertyKey<Left extends TProperties, Right extends TProperties, Key extends PropertyKey, Result extends TSchema = (Key extends keyof Left ? Key extends keyof Right ? TEvaluatePropertyIntersect<Left[Key], Right[Key]> : Left[Key] : Key extends keyof Right ? Right[Key] : TNever)> = Result;
13
+ import { type TEvaluateIntersect } from './evaluate.mjs';
14
+ /** Returns true if the type is a valid operand to Composite. */
15
+ export type TCanComposite<Type extends TSchema> = (Type extends TObject<infer _ extends TProperties> ? true : Type extends TTuple<infer _ extends TSchema[]> ? true : false);
16
+ /** Returns true if the type is a valid operand to Composite. */
17
+ export declare function CanComposite<Type extends TSchema>(type: Type): TCanComposite<Type>;
18
+ type TIsReadonlyProperty<Left extends TSchema, Right extends TSchema> = (Left extends TReadonly<Left> ? Right extends TReadonly<Right> ? true : false : false);
19
+ type TIsOptionalProperty<Left extends TSchema, Right extends TSchema> = (Left extends TOptional<Left> ? Right extends TOptional<Right> ? true : false : false);
20
+ type TCompositeProperty<Left extends TSchema, Right extends TSchema, IsReadonly extends boolean = TIsReadonlyProperty<Left, Right>, IsOptional extends boolean = TIsOptionalProperty<Left, Right>, Evaluated extends TSchema = TEvaluateIntersect<[Left, Right]>, Property extends TSchema = TRemoveReadonly<TRemoveOptional<Evaluated>>> = ([
21
+ IsReadonly,
22
+ IsOptional
23
+ ] extends [true, true] ? TAddReadonly<TAddOptional<Property>> : [
24
+ IsReadonly,
25
+ IsOptional
26
+ ] extends [true, false] ? TAddReadonly<Property> : [
27
+ IsReadonly,
28
+ IsOptional
29
+ ] extends [false, true] ? TAddOptional<Property> : Property);
30
+ type TCompositePropertyKey<Left extends TProperties, Right extends TProperties, Key extends PropertyKey, Result extends TSchema = (Key extends keyof Left ? Key extends keyof Right ? TCompositeProperty<Left[Key], Right[Key]> : Left[Key] : Key extends keyof Right ? Right[Key] : TNever)> = Result;
9
31
  type TCompositeProperties<Left extends TProperties, Right extends TProperties, Keys extends PropertyKey = keyof (Left & Right), Result extends TProperties = {
10
32
  [Key in Keys]: TCompositePropertyKey<Left, Right, Key>;
11
33
  }> = Result;