typesea 0.1.0 → 0.2.0

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 (285) hide show
  1. package/CHANGELOG.md +67 -6
  2. package/README.md +98 -17
  3. package/dist/adapters/index.d.ts +50 -8
  4. package/dist/adapters/index.d.ts.map +1 -1
  5. package/dist/adapters/index.js +169 -48
  6. package/dist/aot/index.d.ts +18 -2
  7. package/dist/aot/index.d.ts.map +1 -1
  8. package/dist/aot/index.js +93 -14
  9. package/dist/async/index.d.ts +28 -56
  10. package/dist/async/index.d.ts.map +1 -1
  11. package/dist/async/index.js +94 -37
  12. package/dist/builders/composite.d.ts +37 -6
  13. package/dist/builders/composite.d.ts.map +1 -1
  14. package/dist/builders/composite.js +84 -10
  15. package/dist/builders/index.d.ts +2 -0
  16. package/dist/builders/index.d.ts.map +1 -1
  17. package/dist/builders/index.js +2 -0
  18. package/dist/builders/modifier.d.ts +30 -5
  19. package/dist/builders/modifier.d.ts.map +1 -1
  20. package/dist/builders/modifier.js +38 -5
  21. package/dist/builders/object/guard.d.ts +18 -22
  22. package/dist/builders/object/guard.d.ts.map +1 -1
  23. package/dist/builders/object/guard.js +26 -26
  24. package/dist/builders/object/index.d.ts +2 -0
  25. package/dist/builders/object/index.d.ts.map +1 -1
  26. package/dist/builders/object/index.js +2 -0
  27. package/dist/builders/object/schema.d.ts +55 -9
  28. package/dist/builders/object/schema.d.ts.map +1 -1
  29. package/dist/builders/object/schema.js +92 -15
  30. package/dist/builders/object/types.d.ts +5 -31
  31. package/dist/builders/object/types.d.ts.map +1 -1
  32. package/dist/builders/object/types.js +2 -0
  33. package/dist/builders/scalar.d.ts +29 -8
  34. package/dist/builders/scalar.d.ts.map +1 -1
  35. package/dist/builders/scalar.js +33 -8
  36. package/dist/builders/table.d.ts +4 -0
  37. package/dist/builders/table.d.ts.map +1 -1
  38. package/dist/builders/table.js +4 -0
  39. package/dist/builders/types.d.ts +14 -4
  40. package/dist/builders/types.d.ts.map +1 -1
  41. package/dist/builders/types.js +2 -0
  42. package/dist/compile/check-composite.d.ts +22 -1
  43. package/dist/compile/check-composite.d.ts.map +1 -1
  44. package/dist/compile/check-composite.js +564 -24
  45. package/dist/compile/check-scalar.d.ts +78 -0
  46. package/dist/compile/check-scalar.d.ts.map +1 -1
  47. package/dist/compile/check-scalar.js +432 -1
  48. package/dist/compile/check.d.ts +12 -0
  49. package/dist/compile/check.d.ts.map +1 -1
  50. package/dist/compile/check.js +37 -0
  51. package/dist/compile/context.d.ts +47 -9
  52. package/dist/compile/context.d.ts.map +1 -1
  53. package/dist/compile/context.js +51 -8
  54. package/dist/compile/graph-predicate.d.ts +4 -2
  55. package/dist/compile/graph-predicate.d.ts.map +1 -1
  56. package/dist/compile/graph-predicate.js +1907 -171
  57. package/dist/compile/guard.d.ts +15 -24
  58. package/dist/compile/guard.d.ts.map +1 -1
  59. package/dist/compile/guard.js +158 -74
  60. package/dist/compile/index.d.ts +3 -1
  61. package/dist/compile/index.d.ts.map +1 -1
  62. package/dist/compile/index.js +2 -0
  63. package/dist/compile/issue.d.ts +110 -0
  64. package/dist/compile/issue.d.ts.map +1 -1
  65. package/dist/compile/issue.js +184 -1
  66. package/dist/compile/names.d.ts +12 -2
  67. package/dist/compile/names.d.ts.map +1 -1
  68. package/dist/compile/names.js +19 -3
  69. package/dist/compile/predicate.d.ts +24 -0
  70. package/dist/compile/predicate.d.ts.map +1 -1
  71. package/dist/compile/predicate.js +131 -5
  72. package/dist/compile/runtime.d.ts +80 -12
  73. package/dist/compile/runtime.d.ts.map +1 -1
  74. package/dist/compile/runtime.js +25 -6
  75. package/dist/compile/source.d.ts +10 -2
  76. package/dist/compile/source.d.ts.map +1 -1
  77. package/dist/compile/source.js +361 -26
  78. package/dist/compile/types.d.ts +20 -0
  79. package/dist/compile/types.d.ts.map +1 -1
  80. package/dist/compile/types.js +2 -0
  81. package/dist/decoder/index.d.ts +32 -46
  82. package/dist/decoder/index.d.ts.map +1 -1
  83. package/dist/decoder/index.js +102 -38
  84. package/dist/evaluate/check-composite.d.ts +59 -0
  85. package/dist/evaluate/check-composite.d.ts.map +1 -1
  86. package/dist/evaluate/check-composite.js +151 -3
  87. package/dist/evaluate/check-scalar.d.ts +16 -0
  88. package/dist/evaluate/check-scalar.d.ts.map +1 -1
  89. package/dist/evaluate/check-scalar.js +32 -0
  90. package/dist/evaluate/check.d.ts +7 -0
  91. package/dist/evaluate/check.d.ts.map +1 -1
  92. package/dist/evaluate/check.js +43 -0
  93. package/dist/evaluate/index.d.ts +2 -0
  94. package/dist/evaluate/index.d.ts.map +1 -1
  95. package/dist/evaluate/index.js +2 -0
  96. package/dist/evaluate/issue.d.ts +11 -1
  97. package/dist/evaluate/issue.d.ts.map +1 -1
  98. package/dist/evaluate/issue.js +15 -1
  99. package/dist/evaluate/predicate.d.ts +16 -5
  100. package/dist/evaluate/predicate.d.ts.map +1 -1
  101. package/dist/evaluate/predicate.js +20 -5
  102. package/dist/evaluate/shared.d.ts +59 -13
  103. package/dist/evaluate/shared.d.ts.map +1 -1
  104. package/dist/evaluate/shared.js +66 -8
  105. package/dist/evaluate/state.d.ts +35 -13
  106. package/dist/evaluate/state.d.ts.map +1 -1
  107. package/dist/evaluate/state.js +35 -2
  108. package/dist/guard/base.d.ts +79 -29
  109. package/dist/guard/base.d.ts.map +1 -1
  110. package/dist/guard/base.js +91 -29
  111. package/dist/guard/error.d.ts +10 -5
  112. package/dist/guard/error.d.ts.map +1 -1
  113. package/dist/guard/error.js +10 -5
  114. package/dist/guard/index.d.ts +2 -0
  115. package/dist/guard/index.d.ts.map +1 -1
  116. package/dist/guard/index.js +2 -0
  117. package/dist/guard/number.d.ts +26 -11
  118. package/dist/guard/number.d.ts.map +1 -1
  119. package/dist/guard/number.js +30 -11
  120. package/dist/guard/props.d.ts +27 -3
  121. package/dist/guard/props.d.ts.map +1 -1
  122. package/dist/guard/props.js +27 -3
  123. package/dist/guard/read.d.ts +62 -9
  124. package/dist/guard/read.d.ts.map +1 -1
  125. package/dist/guard/read.js +83 -10
  126. package/dist/guard/registry.d.ts +12 -2
  127. package/dist/guard/registry.d.ts.map +1 -1
  128. package/dist/guard/registry.js +15 -3
  129. package/dist/guard/string.d.ts +33 -13
  130. package/dist/guard/string.d.ts.map +1 -1
  131. package/dist/guard/string.js +37 -13
  132. package/dist/guard/types.d.ts +92 -40
  133. package/dist/guard/types.d.ts.map +1 -1
  134. package/dist/guard/types.js +2 -0
  135. package/dist/index.d.ts +1 -1
  136. package/dist/index.d.ts.map +1 -1
  137. package/dist/internal/index.d.ts +42 -6
  138. package/dist/internal/index.d.ts.map +1 -1
  139. package/dist/internal/index.js +51 -8
  140. package/dist/ir/builder.d.ts +16 -126
  141. package/dist/ir/builder.d.ts.map +1 -1
  142. package/dist/ir/builder.js +77 -137
  143. package/dist/ir/freeze.d.ts +4 -0
  144. package/dist/ir/freeze.d.ts.map +1 -1
  145. package/dist/ir/freeze.js +59 -0
  146. package/dist/ir/index.d.ts +3 -1
  147. package/dist/ir/index.d.ts.map +1 -1
  148. package/dist/ir/index.js +2 -0
  149. package/dist/ir/regexp.d.ts +2 -0
  150. package/dist/ir/regexp.d.ts.map +1 -1
  151. package/dist/ir/regexp.js +2 -0
  152. package/dist/ir/types.d.ts +90 -55
  153. package/dist/ir/types.d.ts.map +1 -1
  154. package/dist/ir/types.js +2 -0
  155. package/dist/ir/validate.d.ts +8 -1
  156. package/dist/ir/validate.d.ts.map +1 -1
  157. package/dist/ir/validate.js +477 -61
  158. package/dist/issue/index.d.ts +41 -9
  159. package/dist/issue/index.d.ts.map +1 -1
  160. package/dist/issue/index.js +61 -11
  161. package/dist/json-schema/emit-combinator.d.ts +44 -4
  162. package/dist/json-schema/emit-combinator.d.ts.map +1 -1
  163. package/dist/json-schema/emit-combinator.js +44 -4
  164. package/dist/json-schema/emit-composite.d.ts +10 -0
  165. package/dist/json-schema/emit-composite.d.ts.map +1 -1
  166. package/dist/json-schema/emit-composite.js +15 -1
  167. package/dist/json-schema/emit-scalar.d.ts +26 -3
  168. package/dist/json-schema/emit-scalar.d.ts.map +1 -1
  169. package/dist/json-schema/emit-scalar.js +70 -9
  170. package/dist/json-schema/emit-types.d.ts +11 -1
  171. package/dist/json-schema/emit-types.d.ts.map +1 -1
  172. package/dist/json-schema/emit-types.js +2 -0
  173. package/dist/json-schema/emit.d.ts +12 -1
  174. package/dist/json-schema/emit.d.ts.map +1 -1
  175. package/dist/json-schema/emit.js +12 -1
  176. package/dist/json-schema/freeze.d.ts +13 -2
  177. package/dist/json-schema/freeze.d.ts.map +1 -1
  178. package/dist/json-schema/freeze.js +41 -8
  179. package/dist/json-schema/index.d.ts +16 -2
  180. package/dist/json-schema/index.d.ts.map +1 -1
  181. package/dist/json-schema/index.js +23 -3
  182. package/dist/json-schema/issue.d.ts +4 -1
  183. package/dist/json-schema/issue.d.ts.map +1 -1
  184. package/dist/json-schema/issue.js +4 -1
  185. package/dist/json-schema/read.d.ts +24 -3
  186. package/dist/json-schema/read.d.ts.map +1 -1
  187. package/dist/json-schema/read.js +59 -12
  188. package/dist/json-schema/types.d.ts +38 -15
  189. package/dist/json-schema/types.d.ts.map +1 -1
  190. package/dist/json-schema/types.js +2 -0
  191. package/dist/kind/index.d.ts +15 -28
  192. package/dist/kind/index.d.ts.map +1 -1
  193. package/dist/kind/index.js +15 -10
  194. package/dist/lower/index.d.ts +6 -1
  195. package/dist/lower/index.d.ts.map +1 -1
  196. package/dist/lower/index.js +411 -44
  197. package/dist/message/index.d.ts +46 -10
  198. package/dist/message/index.d.ts.map +1 -1
  199. package/dist/message/index.js +88 -17
  200. package/dist/optimize/algebraic.d.ts +54 -0
  201. package/dist/optimize/algebraic.d.ts.map +1 -0
  202. package/dist/optimize/algebraic.js +314 -0
  203. package/dist/optimize/compact.d.ts +8 -1
  204. package/dist/optimize/compact.d.ts.map +1 -1
  205. package/dist/optimize/compact.js +13 -2
  206. package/dist/optimize/domain.d.ts +16 -0
  207. package/dist/optimize/domain.d.ts.map +1 -0
  208. package/dist/optimize/domain.js +615 -0
  209. package/dist/optimize/fold-boolean.d.ts +17 -2
  210. package/dist/optimize/fold-boolean.d.ts.map +1 -1
  211. package/dist/optimize/fold-boolean.js +59 -14
  212. package/dist/optimize/fold-common.d.ts +43 -8
  213. package/dist/optimize/fold-common.d.ts.map +1 -1
  214. package/dist/optimize/fold-common.js +37 -6
  215. package/dist/optimize/fold-constraints.d.ts +33 -0
  216. package/dist/optimize/fold-constraints.d.ts.map +1 -0
  217. package/dist/optimize/fold-constraints.js +484 -0
  218. package/dist/optimize/fold-scalar.d.ts +98 -13
  219. package/dist/optimize/fold-scalar.d.ts.map +1 -1
  220. package/dist/optimize/fold-scalar.js +98 -13
  221. package/dist/optimize/fold.d.ts +8 -1
  222. package/dist/optimize/fold.d.ts.map +1 -1
  223. package/dist/optimize/fold.js +22 -2
  224. package/dist/optimize/index.d.ts +9 -1
  225. package/dist/optimize/index.d.ts.map +1 -1
  226. package/dist/optimize/index.js +18 -3
  227. package/dist/optimize/map-node.d.ts +3 -1
  228. package/dist/optimize/map-node.d.ts.map +1 -1
  229. package/dist/optimize/map-node.js +45 -3
  230. package/dist/optimize/peephole.d.ts +16 -0
  231. package/dist/optimize/peephole.d.ts.map +1 -0
  232. package/dist/optimize/peephole.js +254 -0
  233. package/dist/optimize/remap.d.ts +2 -0
  234. package/dist/optimize/remap.d.ts.map +1 -1
  235. package/dist/optimize/remap.js +2 -0
  236. package/dist/optimize/rewrite.d.ts +13 -8
  237. package/dist/optimize/rewrite.d.ts.map +1 -1
  238. package/dist/optimize/rewrite.js +13 -8
  239. package/dist/plan/cache.d.ts +9 -3
  240. package/dist/plan/cache.d.ts.map +1 -1
  241. package/dist/plan/cache.js +21 -5
  242. package/dist/plan/index.d.ts +2 -0
  243. package/dist/plan/index.d.ts.map +1 -1
  244. package/dist/plan/index.js +2 -0
  245. package/dist/plan/predicate.d.ts +2 -0
  246. package/dist/plan/predicate.d.ts.map +1 -1
  247. package/dist/plan/predicate.js +268 -29
  248. package/dist/plan/schema-predicate.d.ts +6 -0
  249. package/dist/plan/schema-predicate.d.ts.map +1 -1
  250. package/dist/plan/schema-predicate.js +117 -13
  251. package/dist/plan/types.d.ts +2 -0
  252. package/dist/plan/types.d.ts.map +1 -1
  253. package/dist/plan/types.js +2 -0
  254. package/dist/result/index.d.ts +19 -5
  255. package/dist/result/index.d.ts.map +1 -1
  256. package/dist/result/index.js +10 -2
  257. package/dist/schema/common.d.ts +69 -6
  258. package/dist/schema/common.d.ts.map +1 -1
  259. package/dist/schema/common.js +104 -10
  260. package/dist/schema/freeze.d.ts +4 -0
  261. package/dist/schema/freeze.d.ts.map +1 -1
  262. package/dist/schema/freeze.js +18 -0
  263. package/dist/schema/index.d.ts +3 -0
  264. package/dist/schema/index.d.ts.map +1 -1
  265. package/dist/schema/index.js +3 -0
  266. package/dist/schema/lazy.d.ts +4 -0
  267. package/dist/schema/lazy.d.ts.map +1 -1
  268. package/dist/schema/lazy.js +4 -0
  269. package/dist/schema/literal.d.ts +7 -1
  270. package/dist/schema/literal.d.ts.map +1 -1
  271. package/dist/schema/literal.js +7 -1
  272. package/dist/schema/types.d.ts +20 -96
  273. package/dist/schema/types.d.ts.map +1 -1
  274. package/dist/schema/types.js +5 -1
  275. package/dist/schema/undefined.d.ts +17 -0
  276. package/dist/schema/undefined.d.ts.map +1 -0
  277. package/dist/schema/undefined.js +72 -0
  278. package/dist/schema/validate.d.ts +8 -1
  279. package/dist/schema/validate.d.ts.map +1 -1
  280. package/dist/schema/validate.js +146 -55
  281. package/docs/api.md +57 -0
  282. package/docs/assets/benchmark-headline.svg +163 -0
  283. package/docs/engine-notes.md +58 -15
  284. package/docs/index.html +130 -110
  285. package/package.json +65 -65
@@ -1,41 +1,32 @@
1
1
  /**
2
2
  * @file compile/guard.ts
3
3
  * @brief Compiled guard construction and receiver validation.
4
+ * @details Generated-source helpers keep the side-table ABI and JavaScript source shape
5
+ * stable across runtime and AOT emission.
4
6
  */
5
7
  import { BaseGuard, type Guard, type Presence, type RuntimeValue } from "../guard/index.js";
6
8
  import type { CheckResult } from "../issue/index.js";
7
9
  import { type Schema } from "../schema/index.js";
8
- import { type BooleanPredicate, type IssueCollectorRoot } from "./runtime.js";
10
+ import { type BooleanPredicate, type CheckResultRoot, type IssueCollectorRoot } from "./runtime.js";
9
11
  import type { CompileOptions, CompiledGuard } from "./types.js";
10
12
  /**
11
- * @brief compiled base guard.
12
- * @details Owns its state directly; methods expose receiver checks and explicit result flow.
13
- * @invariant Construction leaves the instance in a fully usable state before it escapes.
13
+ * @brief Guard backed by generated predicate and diagnostic collectors.
14
+ * @details The boolean predicate is the hot path; the collector is only entered
15
+ * after a failed predicate so successful validation does not allocate issues.
16
+ * @invariant test, collect, and source are immutable after construction.
14
17
  */
15
18
  export declare class CompiledBaseGuard<TValue, TPresence extends Presence = "required"> extends BaseGuard<TValue, TPresence> implements CompiledGuard<TValue, TPresence> {
19
+ #private;
16
20
  readonly source: string;
17
- private readonly test;
18
- private readonly collect;
19
- /**
20
- * @brief constructor.
21
- * @post The receiver is initialized according to the class invariant before it can be observed.
22
- */
23
- constructor(schema: Schema, test: BooleanPredicate, collect: IssueCollectorRoot, source: string);
24
- /**
25
- * @brief is.
26
- */
27
- is(this: unknown, value: unknown): value is RuntimeValue<TValue, TPresence>;
28
- /**
29
- * @brief check.
30
- */
31
- check(this: unknown, value: unknown): CheckResult<RuntimeValue<TValue, TPresence>>;
32
- /**
33
- * @brief assert.
34
- */
35
- assert(this: unknown, value: unknown): asserts value is RuntimeValue<TValue, TPresence>;
21
+ constructor(schema: Schema, test: BooleanPredicate, collect: IssueCollectorRoot, source: string, trustedCollector?: boolean, checkResult?: CheckResultRoot);
22
+ is(this: CompiledBaseGuard<TValue, TPresence>, value: unknown): value is RuntimeValue<TValue, TPresence>;
23
+ check(this: CompiledBaseGuard<TValue, TPresence>, value: unknown): CheckResult<RuntimeValue<TValue, TPresence>>;
24
+ assert(this: CompiledBaseGuard<TValue, TPresence>, value: unknown): asserts value is RuntimeValue<TValue, TPresence>;
36
25
  }
37
26
  /**
38
- * @brief compile.
27
+ * @brief Emit a V8-visible validator function for a guard schema.
28
+ * @details The generated function keeps literals and dynamic schema fallbacks in
29
+ * side tables so the source body remains monomorphic and easy to inline.
39
30
  */
40
31
  export declare function compile<TValue, TPresence extends Presence>(guard: Guard<TValue, TPresence>, options?: Partial<CompileOptions>): CompiledBaseGuard<TValue, TPresence>;
41
32
  //# sourceMappingURL=guard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"guard.d.ts","sourceRoot":"","sources":["../../src/compile/guard.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,SAAS,EAET,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,OAAO,EAGL,KAAK,MAAM,EACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAIL,KAAK,gBAAgB,EAErB,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACd,MAAM,YAAY,CAAC;AAOpB;;;;GAIG;AACH,qBAAa,iBAAiB,CAC5B,MAAM,EACN,SAAS,SAAS,QAAQ,GAAG,UAAU,CACvC,SAAQ,SAAS,CAAC,MAAM,EAAE,SAAS,CAAE,YAAW,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC;IAChF,SAAwB,MAAM,EAAE,MAAM,CAAC;IACvC,iBAAyB,IAAI,CAAmB;IAChD,iBAAyB,OAAO,CAAqB;IAErD;;;OAGG;gBAED,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,gBAAgB,EACtB,OAAO,EAAE,kBAAkB,EAC3B,MAAM,EAAE,MAAM;IAmBhB;;eAEW;IACK,EAAE,CAChB,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,OAAO,GACb,KAAK,I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BAGnC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,gBAAgB,EACtB,OAAO,EAAE,kBAAkB,EAC3B,MAAM,EAAE,MAAM,EACd,gBAAgB,UAAQ,EACxB,WAAW,CAAC,EAAE,eAAe;IA8BjB,EAAE,CACd,IAAI,EAAE,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,EAC1C,KAAK,EAAE,OAAO,GACf,KAAK,IAAI,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC;IAI3B,KAAK,CACjB,IAAI,EAAE,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,EAC1C,KAAK,EAAE,OAAO,GACf,WAAW,CAAC,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAW/B,MAAM,CAClB,IAAI,EAAE,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,EAC1C,KAAK,EAAE,OAAO,GACf,OAAO,CAAC,KAAK,IAAI,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC;CAYtD;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,SAAS,SAAS,QAAQ,EACtD,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,EAC/B,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAClC,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,CAsCtC"}
@@ -1,6 +1,8 @@
1
1
  /**
2
2
  * @file compile/guard.ts
3
3
  * @brief Compiled guard construction and receiver validation.
4
+ * @details Generated-source helpers keep the side-table ABI and JavaScript source shape
5
+ * stable across runtime and AOT emission.
4
6
  */
5
7
  import { BaseGuard, TypeSeaAssertionError } from "../guard/index.js";
6
8
  import { finalizeIssueArray } from "../issue/index.js";
@@ -8,21 +10,21 @@ import { err, ok } from "../result/index.js";
8
10
  import { freezeSchema, isSchemaValue } from "../schema/index.js";
9
11
  import { makeDynamicCheck, makeDynamicIssueCheck, strictKeys } from "./runtime.js";
10
12
  import { emitCompiledSourceBundle } from "./source.js";
13
+ const trustedCollectors = new WeakSet();
14
+ const trustedCheckResults = new WeakSet();
15
+ const trustedPredicates = new WeakSet();
11
16
  /**
12
- * @brief constructed compiled guards.
13
- */
14
- const constructedCompiledGuards = new WeakSet();
15
- /**
16
- * @brief compiled base guard.
17
- * @details Owns its state directly; methods expose receiver checks and explicit result flow.
18
- * @invariant Construction leaves the instance in a fully usable state before it escapes.
17
+ * @brief Guard backed by generated predicate and diagnostic collectors.
18
+ * @details The boolean predicate is the hot path; the collector is only entered
19
+ * after a failed predicate so successful validation does not allocate issues.
20
+ * @invariant test, collect, and source are immutable after construction.
19
21
  */
20
22
  export class CompiledBaseGuard extends BaseGuard {
21
- /**
22
- * @brief constructor.
23
- * @post The receiver is initialized according to the class invariant before it can be observed.
24
- */
25
- constructor(schema, test, collect, source) {
23
+ #test;
24
+ #collect;
25
+ #trustedCollector;
26
+ #checkResult;
27
+ constructor(schema, test, collect, source, trustedCollector = false, checkResult) {
26
28
  if (typeof test !== "function") {
27
29
  throw new TypeError("compiled guard test must be a function");
28
30
  }
@@ -33,111 +35,177 @@ export class CompiledBaseGuard extends BaseGuard {
33
35
  throw new TypeError("compiled guard source must be a string");
34
36
  }
35
37
  super(schema);
36
- defineReadonlyProperty(this, "test", test, false);
37
- defineReadonlyProperty(this, "collect", collect, false);
38
+ this.#test = test;
39
+ this.#collect = collect;
40
+ this.#trustedCollector = trustedCollector && trustedCollectors.has(collect);
41
+ this.#checkResult = checkResult !== undefined &&
42
+ trustedCheckResults.has(checkResult)
43
+ ? checkResult
44
+ : undefined;
38
45
  defineReadonlyProperty(this, "source", source, true);
39
- constructedCompiledGuards.add(this);
46
+ if (trustedPredicates.has(test) && this.#checkResult !== undefined) {
47
+ defineTrustedHotMethods(this, test, this.#checkResult);
48
+ }
40
49
  Object.freeze(this);
41
50
  }
42
- /**
43
- * @brief is.
44
- */
45
51
  is(value) {
46
- return isStrictTrue(readCompiledTest(this)(value));
52
+ return isStrictTrue(this.#test(value));
47
53
  }
48
- /**
49
- * @brief check.
50
- */
51
54
  check(value) {
52
- return runCompiledCheck(this, value);
55
+ if (this.#checkResult !== undefined) {
56
+ return this.#checkResult(value);
57
+ }
58
+ return runCompiledCheck(this.#collect, this.#trustedCollector, value);
53
59
  }
54
- /**
55
- * @brief assert.
56
- */
57
60
  assert(value) {
58
- const result = runCompiledCheck(this, value);
61
+ const result = this.#checkResult === undefined
62
+ ? runCompiledCheck(this.#collect, this.#trustedCollector, value)
63
+ : this.#checkResult(value);
59
64
  if (!result.ok) {
60
65
  throw new TypeSeaAssertionError(result.error);
61
66
  }
62
67
  }
63
68
  }
64
69
  /**
65
- * @brief compile.
70
+ * @brief Emit a V8-visible validator function for a guard schema.
71
+ * @details The generated function keeps literals and dynamic schema fallbacks in
72
+ * side tables so the source body remains monomorphic and easy to inline.
66
73
  */
67
74
  export function compile(guard, options) {
68
75
  const schema = readCompileSchema(guard);
69
76
  const name = readCompileName(options);
70
- const bundle = emitCompiledSourceBundle(schema, name);
77
+ const mode = readCompileMode(options);
78
+ const bundle = emitCompiledSourceBundle(schema, name, mode);
71
79
  // compile() intentionally emits source so V8 can optimize the validator body.
72
80
  // eslint-disable-next-line @typescript-eslint/no-implied-eval
73
81
  const factory = new Function("l", "r", "k", "u", "d", "m", "sk", bundle.source);
74
82
  const dynamicCheck = makeDynamicCheck(bundle.dynamicSchemas);
75
83
  const runtime = factory(bundle.literals, bundle.regexps, bundle.keysets, bundle.strings, dynamicCheck, makeDynamicIssueCheck(bundle.dynamicSchemas), strictKeys);
76
- return new CompiledBaseGuard(schema, runtime.is, runtime.check, bundle.source);
84
+ trustedPredicates.add(runtime.is);
85
+ trustedCollectors.add(runtime.check);
86
+ trustedCheckResults.add(runtime.result);
87
+ return new CompiledBaseGuard(schema, runtime.is, runtime.check, bundle.source, true, runtime.result);
88
+ }
89
+ /**
90
+ * @brief Execute define trusted hot methods.
91
+ * @details Code generation helpers keep emitted JavaScript shape stable across runtime and AOT paths.
92
+ */
93
+ function defineTrustedHotMethods(guard, test, checkResult) {
94
+ const self = guard;
95
+ /*
96
+ * Compiled guards receive own methods after construction. The closure over
97
+ * `self` keeps detached calls from reaching optimized validators with a
98
+ * forged receiver while preserving a tiny call shape for V8.
99
+ */
100
+ defineReadonlyProperty(guard, "is",
101
+ /**
102
+ * @brief Execute compiled trusted is.
103
+ * @details Code generation helpers keep emitted JavaScript shape stable across runtime and AOT paths.
104
+ */
105
+ function compiledTrustedIs(value) {
106
+ if (this !== self) {
107
+ throw new TypeError("compiled guard method receiver is invalid");
108
+ }
109
+ return test(value);
110
+ }, false);
111
+ defineReadonlyProperty(guard, "check",
112
+ /**
113
+ * @brief Execute compiled trusted check.
114
+ * @details Code generation helpers keep emitted JavaScript shape stable across runtime and AOT paths.
115
+ */
116
+ function compiledTrustedCheck(value) {
117
+ if (this !== self) {
118
+ throw new TypeError("compiled guard method receiver is invalid");
119
+ }
120
+ return checkResult(value);
121
+ }, false);
122
+ defineReadonlyProperty(guard, "assert",
123
+ /**
124
+ * @brief Execute compiled trusted assert.
125
+ * @details Code generation helpers keep emitted JavaScript shape stable across runtime and AOT paths.
126
+ */
127
+ function compiledTrustedAssert(value) {
128
+ if (this !== self) {
129
+ throw new TypeError("compiled guard method receiver is invalid");
130
+ }
131
+ const result = checkResult(value);
132
+ if (!result.ok) {
133
+ throw new TypeSeaAssertionError(result.error);
134
+ }
135
+ }, false);
77
136
  }
78
137
  /**
79
- * @brief read compile schema.
138
+ * @brief Normalize the guard input for runtime compilation.
139
+ * @param guard Candidate guard-like value.
140
+ * @returns Frozen schema passed to source emission.
141
+ * @throws TypeError when the input does not expose a valid TypeSea schema.
142
+ * @details Runtime compilation may be called with structural guard-like values.
143
+ * The schema is descriptor-read so inherited getters cannot influence emitted
144
+ * code or mutate the schema between validation and codegen.
80
145
  */
81
146
  function readCompileSchema(guard) {
82
147
  if (!isRecord(guard)) {
83
148
  throw new TypeError("compile guard must be a TypeSea guard");
84
149
  }
85
- const schema = guard["schema"];
150
+ const schema = readOwnDataProperty(guard, "schema");
86
151
  if (!isSchemaValue(schema)) {
87
152
  throw new TypeError("compile guard must contain a valid TypeSea schema");
88
153
  }
89
154
  return freezeSchema(schema);
90
155
  }
91
156
  /**
92
- * @brief is strict true.
157
+ * @brief Accept only the literal boolean success value from compiled predicates.
158
+ * @details Generated-source helpers keep the side-table ABI and JavaScript source shape
159
+ * stable across runtime and AOT emission.
160
+ * @param value Predicate return value.
161
+ * @returns True only for `true`.
93
162
  */
94
163
  function isStrictTrue(value) {
95
164
  return value === true;
96
165
  }
97
166
  /**
98
- * @brief run compiled check.
99
- */
100
- function runCompiledCheck(guard, value) {
101
- const issues = finalizeIssueArray(readCompiledCollect(guard)(value));
102
- if (issues.length === 0) {
103
- return ok(value);
104
- }
105
- return err(issues);
106
- }
107
- /**
108
- * @brief read compiled test.
167
+ * @brief Read one own data slot from a compile input object.
168
+ * @details Generated-source helpers keep the side-table ABI and JavaScript source shape
169
+ * stable across runtime and AOT emission.
170
+ * @param value Object being normalized.
171
+ * @param key Field name or symbol.
172
+ * @returns Stored field value, or undefined when absent.
109
173
  */
110
- function readCompiledTest(guard) {
111
- if (isConstructedCompiledGuard(guard)) {
112
- return guard["test"];
174
+ function readOwnDataProperty(value, key) {
175
+ const descriptor = Object.getOwnPropertyDescriptor(value, key);
176
+ if (descriptor === undefined ||
177
+ !Object.prototype.hasOwnProperty.call(descriptor, "value")) {
178
+ return undefined;
113
179
  }
114
- if (!isRecord(guard)) {
115
- throw new TypeError("compiled guard receiver must be a TypeSea guard");
116
- }
117
- const test = guard["test"];
118
- if (typeof test !== "function") {
119
- throw new TypeError("compiled guard receiver must contain a test function");
120
- }
121
- return test;
180
+ return descriptor.value;
122
181
  }
123
182
  /**
124
- * @brief read compiled collect.
183
+ * @brief Convert a generated issue collector result into a public Result.
184
+ * @param collect Generated collector function.
185
+ * @param trustedCollector Whether the collector came from TypeSea codegen.
186
+ * @param value Candidate runtime value.
187
+ * @returns Success result or frozen diagnostic issue result.
188
+ * @details Trusted collectors already emit internal issue records, so the fast
189
+ * path freezes only the final vector. Untrusted collectors are normalized
190
+ * through finalizeIssueArray before publication.
125
191
  */
126
- function readCompiledCollect(guard) {
127
- if (isConstructedCompiledGuard(guard)) {
128
- return guard["collect"];
129
- }
130
- if (!isRecord(guard)) {
131
- throw new TypeError("compiled guard receiver must be a TypeSea guard");
192
+ function runCompiledCheck(collect, trustedCollector, value) {
193
+ const rawIssues = collect(value);
194
+ if (trustedCollector) {
195
+ if (rawIssues === undefined || rawIssues.length === 0) {
196
+ return ok(value);
197
+ }
198
+ return err(Object.freeze(rawIssues));
132
199
  }
133
- const collect = guard["collect"];
134
- if (typeof collect !== "function") {
135
- throw new TypeError("compiled guard receiver must contain a collector function");
200
+ const issues = finalizeIssueArray(rawIssues);
201
+ if (issues.length === 0) {
202
+ return ok(value);
136
203
  }
137
- return collect;
204
+ return err(issues);
138
205
  }
139
206
  /**
140
- * @brief define readonly property.
207
+ * @brief Execute define readonly property.
208
+ * @details Code generation helpers keep emitted JavaScript shape stable across runtime and AOT paths.
141
209
  */
142
210
  function defineReadonlyProperty(target, key, value, enumerable) {
143
211
  Object.defineProperty(target, key, {
@@ -148,7 +216,8 @@ function defineReadonlyProperty(target, key, value, enumerable) {
148
216
  });
149
217
  }
150
218
  /**
151
- * @brief read compile name.
219
+ * @brief Read compile name.
220
+ * @details Code generation helpers keep emitted JavaScript shape stable across runtime and AOT paths.
152
221
  */
153
222
  function readCompileName(options) {
154
223
  if (options === undefined) {
@@ -167,14 +236,29 @@ function readCompileName(options) {
167
236
  return name;
168
237
  }
169
238
  /**
170
- * @brief is record.
239
+ * @brief Read compile mode.
240
+ * @details Code generation helpers keep emitted JavaScript shape stable across runtime and AOT paths.
171
241
  */
172
- function isRecord(value) {
173
- return typeof value === "object" && value !== null && !Array.isArray(value);
242
+ function readCompileMode(options) {
243
+ if (options === undefined) {
244
+ return "safe";
245
+ }
246
+ if (!isRecord(options)) {
247
+ throw new TypeError("compile options must be an object");
248
+ }
249
+ const mode = options["mode"];
250
+ if (mode === undefined) {
251
+ return "safe";
252
+ }
253
+ if (mode === "safe" || mode === "unsafe" || mode === "unchecked") {
254
+ return mode;
255
+ }
256
+ throw new TypeError("compile mode must be \"safe\", \"unsafe\", or \"unchecked\"");
174
257
  }
175
258
  /**
176
- * @brief is constructed compiled guard.
259
+ * @brief Check record.
260
+ * @details Code generation helpers keep emitted JavaScript shape stable across runtime and AOT paths.
177
261
  */
178
- function isConstructedCompiledGuard(value) {
179
- return isRecord(value) && constructedCompiledGuards.has(value);
262
+ function isRecord(value) {
263
+ return typeof value === "object" && value !== null && !Array.isArray(value);
180
264
  }
@@ -1,8 +1,10 @@
1
1
  /**
2
2
  * @file compile/index.ts
3
3
  * @brief Public compile module barrel.
4
+ * @details This barrel keeps public import paths stable while implementation files remain
5
+ * split by responsibility.
4
6
  */
5
7
  export { CompiledBaseGuard, compile } from "./guard.js";
6
8
  export { emitCompiledSourceBundle } from "./source.js";
7
- export type { CompileOptions, CompiledGuard, CompiledSourceBundle } from "./types.js";
9
+ export type { CompileMode, CompileOptions, CompiledGuard, CompiledSourceBundle } from "./types.js";
8
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/compile/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,iBAAiB,EACjB,OAAO,EACR,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,wBAAwB,EACzB,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,cAAc,EACd,aAAa,EACb,oBAAoB,EACrB,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/compile/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACH,iBAAiB,EACjB,OAAO,EACV,MAAM,YAAY,CAAC;AAEpB,OAAO,EACH,wBAAwB,EAC3B,MAAM,aAAa,CAAC;AAErB,YAAY,EACR,WAAW,EACX,cAAc,EACd,aAAa,EACb,oBAAoB,EACvB,MAAM,YAAY,CAAC"}
@@ -1,6 +1,8 @@
1
1
  /**
2
2
  * @file compile/index.ts
3
3
  * @brief Public compile module barrel.
4
+ * @details This barrel keeps public import paths stable while implementation files remain
5
+ * split by responsibility.
4
6
  */
5
7
  export { CompiledBaseGuard, compile } from "./guard.js";
6
8
  export { emitCompiledSourceBundle } from "./source.js";
@@ -1,18 +1,128 @@
1
1
  /**
2
2
  * @file compile/issue.ts
3
3
  * @brief Diagnostic issue source snippets.
4
+ * @details Generated-source helpers keep the side-table ABI and JavaScript source shape
5
+ * stable across runtime and AOT emission.
4
6
  */
5
7
  import type { EmitContext } from "./types.js";
6
8
  /**
7
9
  * @brief emit pattern issue.
10
+ * @details Generated-source helpers keep the side-table ABI and JavaScript source shape
11
+ * stable across runtime and AOT emission.
12
+ * @param value Generated expression for the string value.
13
+ * @param path Generated expression for the current diagnostic path.
14
+ * @param issues Generated expression for the diagnostic buffer.
15
+ * @param regex Pattern used by the schema check.
16
+ * @param name Human-readable pattern name stored in the issue.
17
+ * @param context Shared code-generation context.
18
+ * @returns JavaScript source that appends a pattern issue when the test fails.
8
19
  */
9
20
  export declare function emitPatternIssue(value: string, path: string, issues: string, regex: RegExp, name: string, context: EmitContext): string;
21
+ /**
22
+ * @brief emit pattern issue at one appended path segment.
23
+ * @details Generated-source helpers keep the side-table ABI and JavaScript source shape
24
+ * stable across runtime and AOT emission.
25
+ * @param value Generated expression for the string value.
26
+ * @param path Generated expression for the current diagnostic path.
27
+ * @param segmentExpression Generated expression for the appended segment.
28
+ * @param issues Generated expression for the diagnostic buffer.
29
+ * @param regex Pattern used by the schema check.
30
+ * @param name Human-readable pattern name stored in the issue.
31
+ * @param context Shared code-generation context.
32
+ * @returns JavaScript source that appends a one-segment pattern issue.
33
+ */
34
+ export declare function emitPatternIssueAtSegment(value: string, path: string, segmentExpression: string, issues: string, regex: RegExp, name: string, context: EmitContext): string;
35
+ /**
36
+ * @brief emit pattern issue at two appended path segments.
37
+ * @details Generated-source helpers keep the side-table ABI and JavaScript source shape
38
+ * stable across runtime and AOT emission.
39
+ * @param value Generated expression for the string value.
40
+ * @param path Generated expression for the current diagnostic path.
41
+ * @param firstSegmentExpression Generated expression for the first appended segment.
42
+ * @param secondSegmentExpression Generated expression for the second appended segment.
43
+ * @param issues Generated expression for the diagnostic buffer.
44
+ * @param regex Pattern used by the schema check.
45
+ * @param name Human-readable pattern name stored in the issue.
46
+ * @param context Shared code-generation context.
47
+ * @returns JavaScript source that appends a two-segment pattern issue.
48
+ */
49
+ export declare function emitPatternIssueAtTwoSegments(value: string, path: string, firstSegmentExpression: string, secondSegmentExpression: string, issues: string, regex: RegExp, name: string, context: EmitContext): string;
10
50
  /**
11
51
  * @brief emit issue.
52
+ * @details Generated-source helpers keep the side-table ABI and JavaScript source shape
53
+ * stable across runtime and AOT emission.
54
+ * @param issues Generated expression for the diagnostic buffer.
55
+ * @param path Generated expression for the current diagnostic path.
56
+ * @param code Issue code string.
57
+ * @param expected Expected type or condition text.
58
+ * @param actualExpression Generated expression for actual type text.
59
+ * @returns JavaScript source that appends an issue at the current path.
12
60
  */
13
61
  export declare function emitIssue(issues: string, path: string, code: string, expected: string, actualExpression: string): string;
62
+ /**
63
+ * @brief emit issue at one appended path segment.
64
+ * @details Generated-source helpers keep the side-table ABI and JavaScript source shape
65
+ * stable across runtime and AOT emission.
66
+ * @param issues Generated expression for the diagnostic buffer.
67
+ * @param path Generated expression for the current diagnostic path.
68
+ * @param segmentExpression Generated expression for the appended segment.
69
+ * @param code Issue code string.
70
+ * @param expected Expected type or condition text.
71
+ * @param actualExpression Generated expression for actual type text.
72
+ * @returns JavaScript source that appends an issue under one extra segment.
73
+ */
74
+ export declare function emitIssueAtSegment(issues: string, path: string, segmentExpression: string, code: string, expected: string, actualExpression: string): string;
75
+ /**
76
+ * @brief emit issue at two appended path segments.
77
+ * @details Generated-source helpers keep the side-table ABI and JavaScript source shape
78
+ * stable across runtime and AOT emission.
79
+ * @param issues Generated expression for the diagnostic buffer.
80
+ * @param path Generated expression for the current diagnostic path.
81
+ * @param firstSegmentExpression Generated expression for the first appended segment.
82
+ * @param secondSegmentExpression Generated expression for the second appended segment.
83
+ * @param code Issue code string.
84
+ * @param expected Expected type or condition text.
85
+ * @param actualExpression Generated expression for actual type text.
86
+ * @returns JavaScript source that appends an issue under two extra segments.
87
+ */
88
+ export declare function emitIssueAtTwoSegments(issues: string, path: string, firstSegmentExpression: string, secondSegmentExpression: string, code: string, expected: string, actualExpression: string): string;
14
89
  /**
15
90
  * @brief emit issue expr.
91
+ * @details Generated-source helpers keep the side-table ABI and JavaScript source shape
92
+ * stable across runtime and AOT emission.
93
+ * @param issues Generated expression for the diagnostic buffer.
94
+ * @param path Generated expression for the current diagnostic path.
95
+ * @param code Issue code string.
96
+ * @param expectedExpression Generated expression for expected text.
97
+ * @param actualExpression Generated expression for actual type text.
98
+ * @returns JavaScript source that appends an issue using expression operands.
16
99
  */
17
100
  export declare function emitIssueExpr(issues: string, path: string, code: string, expectedExpression: string, actualExpression: string): string;
101
+ /**
102
+ * @brief emit issue expr at one appended path segment.
103
+ * @details Generated-source helpers keep the side-table ABI and JavaScript source shape
104
+ * stable across runtime and AOT emission.
105
+ * @param issues Generated expression for the diagnostic buffer.
106
+ * @param path Generated expression for the current diagnostic path.
107
+ * @param segmentExpression Generated expression for the appended segment.
108
+ * @param code Issue code string.
109
+ * @param expectedExpression Generated expression for expected text.
110
+ * @param actualExpression Generated expression for actual type text.
111
+ * @returns JavaScript source using the most compact one-segment issue helper.
112
+ */
113
+ export declare function emitIssueExprAtSegment(issues: string, path: string, segmentExpression: string, code: string, expectedExpression: string, actualExpression: string): string;
114
+ /**
115
+ * @brief emit issue expr at two appended path segments.
116
+ * @details Generated-source helpers keep the side-table ABI and JavaScript source shape
117
+ * stable across runtime and AOT emission.
118
+ * @param issues Generated expression for the diagnostic buffer.
119
+ * @param path Generated expression for the current diagnostic path.
120
+ * @param firstSegmentExpression Generated expression for the first appended segment.
121
+ * @param secondSegmentExpression Generated expression for the second appended segment.
122
+ * @param code Issue code string.
123
+ * @param expectedExpression Generated expression for expected text.
124
+ * @param actualExpression Generated expression for actual type text.
125
+ * @returns JavaScript source using the two-segment issue helper.
126
+ */
127
+ export declare function emitIssueExprAtTwoSegments(issues: string, path: string, firstSegmentExpression: string, secondSegmentExpression: string, code: string, expectedExpression: string, actualExpression: string): string;
18
128
  //# sourceMappingURL=issue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"issue.d.ts","sourceRoot":"","sources":["../../src/compile/issue.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,WAAW,GACnB,MAAM,CAWR;AAED;;GAEG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,GACvB,MAAM,CAQR;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,kBAAkB,EAAE,MAAM,EAC1B,gBAAgB,EAAE,MAAM,GACvB,MAAM,CAER"}
1
+ {"version":3,"file":"issue.d.ts","sourceRoot":"","sources":["../../src/compile/issue.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAC5B,KAAK,EAAE,M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