arktype 2.0.0-dev.8 → 2.0.0-rc.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 (562) hide show
  1. package/LICENSE +7 -0
  2. package/out/config.d.ts +25 -9
  3. package/out/config.js +2 -18
  4. package/out/generic.d.ts +154 -19
  5. package/out/generic.js +37 -24
  6. package/out/index.d.ts +7 -0
  7. package/out/index.js +6 -0
  8. package/out/intersect.d.ts +28 -0
  9. package/out/intersect.js +1 -0
  10. package/out/keys.d.ts +16 -0
  11. package/out/keys.js +1 -0
  12. package/out/keywords/ark.d.ts +29 -66
  13. package/out/keywords/ark.js +18 -29
  14. package/out/keywords/ast.d.ts +193 -0
  15. package/out/keywords/ast.js +2 -0
  16. package/out/keywords/builtin.d.ts +13 -0
  17. package/out/keywords/builtin.js +10 -0
  18. package/out/keywords/constructors/Array.d.ts +16 -0
  19. package/out/keywords/constructors/Array.js +19 -0
  20. package/out/keywords/constructors/FormData.d.ts +9 -0
  21. package/out/keywords/constructors/FormData.js +25 -0
  22. package/out/keywords/constructors/TypedArray.d.ts +15 -0
  23. package/out/keywords/constructors/TypedArray.js +14 -0
  24. package/out/keywords/constructors/constructors.d.ts +41 -0
  25. package/out/keywords/constructors/constructors.js +31 -0
  26. package/out/keywords/number/epoch.d.ts +10 -0
  27. package/out/keywords/number/epoch.js +26 -0
  28. package/out/keywords/number/integer.d.ts +3 -0
  29. package/out/keywords/number/integer.js +5 -0
  30. package/out/keywords/number/number.d.ts +26 -0
  31. package/out/keywords/number/number.js +9 -0
  32. package/out/keywords/string/alpha.d.ts +7 -0
  33. package/out/keywords/string/alpha.js +2 -0
  34. package/out/keywords/string/alphanumeric.d.ts +7 -0
  35. package/out/keywords/string/alphanumeric.js +2 -0
  36. package/out/keywords/string/capitalize.d.ts +14 -0
  37. package/out/keywords/string/capitalize.js +12 -0
  38. package/out/keywords/string/creditCard.d.ts +8 -0
  39. package/out/keywords/string/creditCard.js +37 -0
  40. package/out/keywords/string/date.d.ts +54 -0
  41. package/out/keywords/string/date.js +98 -0
  42. package/out/keywords/string/digits.d.ts +7 -0
  43. package/out/keywords/string/digits.js +2 -0
  44. package/out/keywords/string/email.d.ts +7 -0
  45. package/out/keywords/string/email.js +4 -0
  46. package/out/keywords/string/integer.d.ts +15 -0
  47. package/out/keywords/string/integer.js +16 -0
  48. package/out/keywords/string/ip.d.ts +20 -0
  49. package/out/keywords/string/ip.js +23 -0
  50. package/out/keywords/string/json.d.ts +14 -0
  51. package/out/keywords/string/json.js +45 -0
  52. package/out/keywords/string/lower.d.ts +14 -0
  53. package/out/keywords/string/lower.js +12 -0
  54. package/out/keywords/string/normalize.d.ts +72 -0
  55. package/out/keywords/string/normalize.js +43 -0
  56. package/out/keywords/string/numeric.d.ts +14 -0
  57. package/out/keywords/string/numeric.js +13 -0
  58. package/out/keywords/string/semver.d.ts +7 -0
  59. package/out/keywords/string/semver.js +4 -0
  60. package/out/keywords/string/string.d.ts +57 -0
  61. package/out/keywords/string/string.js +41 -0
  62. package/out/keywords/string/trim.d.ts +14 -0
  63. package/out/keywords/string/trim.js +14 -0
  64. package/out/keywords/string/upper.d.ts +14 -0
  65. package/out/keywords/string/upper.js +12 -0
  66. package/out/keywords/string/url.d.ts +14 -0
  67. package/out/keywords/string/url.js +37 -0
  68. package/out/keywords/string/utils.d.ts +2 -0
  69. package/out/keywords/string/utils.js +10 -0
  70. package/out/keywords/string/uuid.d.ts +38 -0
  71. package/out/keywords/string/uuid.js +19 -0
  72. package/out/keywords/ts.d.ts +53 -0
  73. package/out/keywords/ts.js +51 -0
  74. package/out/keywords/utils.d.ts +1 -0
  75. package/out/keywords/utils.js +2 -0
  76. package/out/module.d.ts +21 -10
  77. package/out/module.js +3 -4
  78. package/out/parser/definition.d.ts +21 -17
  79. package/out/parser/definition.js +5 -6
  80. package/out/parser/objectLiteral.d.ts +54 -37
  81. package/out/parser/objectLiteral.js +75 -43
  82. package/out/parser/semantic/bounds.d.ts +11 -11
  83. package/out/parser/semantic/bounds.js +0 -1
  84. package/out/parser/semantic/default.d.ts +8 -0
  85. package/out/parser/semantic/default.js +1 -0
  86. package/out/parser/semantic/divisor.d.ts +5 -6
  87. package/out/parser/semantic/divisor.js +0 -1
  88. package/out/parser/semantic/infer.d.ts +21 -13
  89. package/out/parser/semantic/infer.js +0 -1
  90. package/out/parser/semantic/keyof.d.ts +7 -0
  91. package/out/parser/semantic/keyof.js +1 -0
  92. package/out/parser/semantic/utils.d.ts +3 -4
  93. package/out/parser/semantic/utils.js +0 -1
  94. package/out/parser/semantic/validate.d.ts +21 -18
  95. package/out/parser/semantic/validate.js +0 -2
  96. package/out/parser/string/reduce/dynamic.d.ts +16 -15
  97. package/out/parser/string/reduce/dynamic.js +8 -8
  98. package/out/parser/string/reduce/shared.d.ts +17 -30
  99. package/out/parser/string/reduce/shared.js +4 -3
  100. package/out/parser/string/reduce/static.d.ts +22 -24
  101. package/out/parser/string/reduce/static.js +0 -1
  102. package/out/parser/string/shift/operand/date.d.ts +3 -6
  103. package/out/parser/string/shift/operand/date.js +1 -2
  104. package/out/parser/string/shift/operand/enclosed.d.ts +5 -16
  105. package/out/parser/string/shift/operand/enclosed.js +5 -5
  106. package/out/parser/string/shift/operand/genericArgs.d.ts +13 -14
  107. package/out/parser/string/shift/operand/genericArgs.js +7 -13
  108. package/out/parser/string/shift/operand/operand.d.ts +8 -8
  109. package/out/parser/string/shift/operand/operand.js +5 -7
  110. package/out/parser/string/shift/operand/unenclosed.d.ts +31 -19
  111. package/out/parser/string/shift/operand/unenclosed.js +10 -15
  112. package/out/parser/string/shift/operator/bounds.d.ts +15 -27
  113. package/out/parser/string/shift/operator/bounds.js +11 -17
  114. package/out/parser/string/shift/operator/default.d.ts +19 -0
  115. package/out/parser/string/shift/operator/default.js +17 -0
  116. package/out/parser/string/shift/operator/divisor.d.ts +4 -5
  117. package/out/parser/string/shift/operator/divisor.js +1 -2
  118. package/out/parser/string/shift/operator/operator.d.ts +8 -8
  119. package/out/parser/string/shift/operator/operator.js +1 -2
  120. package/out/parser/string/shift/scanner.d.ts +26 -31
  121. package/out/parser/string/shift/scanner.js +23 -21
  122. package/out/parser/string/string.d.ts +14 -12
  123. package/out/parser/string/string.js +5 -3
  124. package/out/parser/tuple.d.ts +22 -21
  125. package/out/parser/tuple.js +12 -24
  126. package/out/scope.d.ts +102 -55
  127. package/out/scope.js +61 -60
  128. package/out/subtypes/array.d.ts +13 -0
  129. package/out/subtypes/array.js +1 -0
  130. package/out/subtypes/base.d.ts +84 -0
  131. package/out/subtypes/base.js +1 -0
  132. package/out/subtypes/date.d.ts +11 -0
  133. package/out/subtypes/date.js +1 -0
  134. package/out/subtypes/instantiate.d.ts +16 -0
  135. package/out/subtypes/instantiate.js +1 -0
  136. package/out/subtypes/morph.d.ts +13 -0
  137. package/out/subtypes/morph.js +1 -0
  138. package/out/subtypes/number.d.ts +12 -0
  139. package/out/subtypes/number.js +1 -0
  140. package/out/subtypes/object.d.ts +33 -0
  141. package/out/subtypes/object.js +1 -0
  142. package/out/subtypes/string.d.ts +13 -0
  143. package/out/subtypes/string.js +1 -0
  144. package/out/subtypes/validator.d.ts +11 -0
  145. package/out/subtypes/validator.js +1 -0
  146. package/out/type.d.ts +30 -50
  147. package/out/type.js +19 -15
  148. package/package.json +46 -43
  149. package/__tests__/array.test.ts +0 -391
  150. package/__tests__/badDefinitionType.test.ts +0 -58
  151. package/__tests__/basis.test.ts +0 -50
  152. package/__tests__/bounds.test.ts +0 -318
  153. package/__tests__/cast.test.ts +0 -37
  154. package/__tests__/completions.test.ts +0 -51
  155. package/__tests__/config.test.ts +0 -85
  156. package/__tests__/cyclic.test.ts +0 -148
  157. package/__tests__/dateLiteral.test.ts +0 -36
  158. package/__tests__/declared.test.ts +0 -124
  159. package/__tests__/discrimination.test.ts +0 -74
  160. package/__tests__/divisor.test.ts +0 -114
  161. package/__tests__/enclosed.test.ts +0 -107
  162. package/__tests__/examples.test.ts +0 -56
  163. package/__tests__/expressions.test.ts +0 -210
  164. package/__tests__/generateBenchData.ts +0 -89
  165. package/__tests__/generated/cyclic.ts +0 -3058
  166. package/__tests__/generic.test.ts +0 -313
  167. package/__tests__/group.test.ts +0 -85
  168. package/__tests__/hkt.test.ts +0 -22
  169. package/__tests__/imports.test.ts +0 -120
  170. package/__tests__/instanceof.test.ts +0 -104
  171. package/__tests__/intersection.test.ts +0 -108
  172. package/__tests__/keyTraversal.test.ts +0 -77
  173. package/__tests__/keyof.test.ts +0 -150
  174. package/__tests__/keywords.test.ts +0 -214
  175. package/__tests__/literal.test.ts +0 -74
  176. package/__tests__/match.bench.ts +0 -31
  177. package/__tests__/match.test.ts +0 -234
  178. package/__tests__/methods.bench.ts +0 -22
  179. package/__tests__/narrow.test.ts +0 -100
  180. package/__tests__/object.bench.ts +0 -28
  181. package/__tests__/objectLiteral.test.ts +0 -319
  182. package/__tests__/operand.bench.ts +0 -45
  183. package/__tests__/operator.bench.ts +0 -130
  184. package/__tests__/pipe.test.ts +0 -501
  185. package/__tests__/realWorld.test.ts +0 -63
  186. package/__tests__/regex.test.ts +0 -68
  187. package/__tests__/scope.bench.ts +0 -39
  188. package/__tests__/scope.test.ts +0 -177
  189. package/__tests__/serialization.test.ts +0 -19
  190. package/__tests__/string.test.ts +0 -52
  191. package/__tests__/submodule.test.ts +0 -86
  192. package/__tests__/this.test.ts +0 -83
  193. package/__tests__/thunk.test.ts +0 -86
  194. package/__tests__/traverse.test.ts +0 -133
  195. package/__tests__/tsGenerics.test.ts +0 -12
  196. package/__tests__/type.test.ts +0 -36
  197. package/__tests__/typeReference.test.ts +0 -39
  198. package/__tests__/unenclosed.test.ts +0 -136
  199. package/__tests__/union.test.ts +0 -214
  200. package/ark.ts +0 -47
  201. package/generic.ts +0 -69
  202. package/main.ts +0 -6
  203. package/match.ts +0 -218
  204. package/module.ts +0 -15
  205. package/out/ark.d.ts +0 -29
  206. package/out/ark.d.ts.map +0 -1
  207. package/out/ark.js +0 -11
  208. package/out/ark.js.map +0 -1
  209. package/out/base.d.ts +0 -205
  210. package/out/base.d.ts.map +0 -1
  211. package/out/base.js +0 -320
  212. package/out/base.js.map +0 -1
  213. package/out/builtins/builtins.d.ts +0 -23
  214. package/out/builtins/builtins.d.ts.map +0 -1
  215. package/out/builtins/builtins.js +0 -15
  216. package/out/builtins/builtins.js.map +0 -1
  217. package/out/builtins/jsObjects.d.ts +0 -19
  218. package/out/builtins/jsObjects.d.ts.map +0 -1
  219. package/out/builtins/jsObjects.js +0 -18
  220. package/out/builtins/jsObjects.js.map +0 -1
  221. package/out/builtins/parsing.d.ts +0 -16
  222. package/out/builtins/parsing.d.ts.map +0 -1
  223. package/out/builtins/parsing.js +0 -62
  224. package/out/builtins/parsing.js.map +0 -1
  225. package/out/builtins/tsGenerics.d.ts +0 -2
  226. package/out/builtins/tsGenerics.d.ts.map +0 -1
  227. package/out/builtins/tsGenerics.js +0 -26
  228. package/out/builtins/tsGenerics.js.map +0 -1
  229. package/out/builtins/tsKeywords.d.ts +0 -23
  230. package/out/builtins/tsKeywords.d.ts.map +0 -1
  231. package/out/builtins/tsKeywords.js +0 -23
  232. package/out/builtins/tsKeywords.js.map +0 -1
  233. package/out/builtins/utils/creditCard.d.ts +0 -3
  234. package/out/builtins/utils/creditCard.d.ts.map +0 -1
  235. package/out/builtins/utils/creditCard.js +0 -35
  236. package/out/builtins/utils/creditCard.js.map +0 -1
  237. package/out/builtins/utils/date.d.ts +0 -41
  238. package/out/builtins/utils/date.d.ts.map +0 -1
  239. package/out/builtins/utils/date.js +0 -56
  240. package/out/builtins/utils/date.js.map +0 -1
  241. package/out/builtins/validation.d.ts +0 -19
  242. package/out/builtins/validation.d.ts.map +0 -1
  243. package/out/builtins/validation.js +0 -74
  244. package/out/builtins/validation.js.map +0 -1
  245. package/out/config.d.ts.map +0 -1
  246. package/out/config.js.map +0 -1
  247. package/out/constraints/ast.d.ts +0 -287
  248. package/out/constraints/ast.d.ts.map +0 -1
  249. package/out/constraints/ast.js +0 -2
  250. package/out/constraints/ast.js.map +0 -1
  251. package/out/constraints/constraint.d.ts +0 -200
  252. package/out/constraints/constraint.d.ts.map +0 -1
  253. package/out/constraints/constraint.js +0 -25
  254. package/out/constraints/constraint.js.map +0 -1
  255. package/out/constraints/predicate.d.ts +0 -64
  256. package/out/constraints/predicate.d.ts.map +0 -1
  257. package/out/constraints/predicate.js +0 -52
  258. package/out/constraints/predicate.js.map +0 -1
  259. package/out/constraints/props/index.d.ts +0 -42
  260. package/out/constraints/props/index.d.ts.map +0 -1
  261. package/out/constraints/props/index.js +0 -56
  262. package/out/constraints/props/index.js.map +0 -1
  263. package/out/constraints/props/optional.d.ts +0 -37
  264. package/out/constraints/props/optional.d.ts.map +0 -1
  265. package/out/constraints/props/optional.js +0 -56
  266. package/out/constraints/props/optional.js.map +0 -1
  267. package/out/constraints/props/prop.d.ts +0 -49
  268. package/out/constraints/props/prop.d.ts.map +0 -1
  269. package/out/constraints/props/prop.js +0 -106
  270. package/out/constraints/props/prop.js.map +0 -1
  271. package/out/constraints/props/props.d.ts +0 -37
  272. package/out/constraints/props/props.d.ts.map +0 -1
  273. package/out/constraints/props/props.js +0 -121
  274. package/out/constraints/props/props.js.map +0 -1
  275. package/out/constraints/props/required.d.ts +0 -46
  276. package/out/constraints/props/required.d.ts.map +0 -1
  277. package/out/constraints/props/required.js +0 -81
  278. package/out/constraints/props/required.js.map +0 -1
  279. package/out/constraints/props/sequence.d.ts +0 -82
  280. package/out/constraints/props/sequence.d.ts.map +0 -1
  281. package/out/constraints/props/sequence.js +0 -376
  282. package/out/constraints/props/sequence.js.map +0 -1
  283. package/out/constraints/props/shared.d.ts +0 -3
  284. package/out/constraints/props/shared.d.ts.map +0 -1
  285. package/out/constraints/props/shared.js +0 -4
  286. package/out/constraints/props/shared.js.map +0 -1
  287. package/out/constraints/refinements/after.d.ts +0 -33
  288. package/out/constraints/refinements/after.d.ts.map +0 -1
  289. package/out/constraints/refinements/after.js +0 -36
  290. package/out/constraints/refinements/after.js.map +0 -1
  291. package/out/constraints/refinements/before.d.ts +0 -33
  292. package/out/constraints/refinements/before.d.ts.map +0 -1
  293. package/out/constraints/refinements/before.js +0 -43
  294. package/out/constraints/refinements/before.js.map +0 -1
  295. package/out/constraints/refinements/divisor.d.ts +0 -52
  296. package/out/constraints/refinements/divisor.d.ts.map +0 -1
  297. package/out/constraints/refinements/divisor.js +0 -52
  298. package/out/constraints/refinements/divisor.js.map +0 -1
  299. package/out/constraints/refinements/exactLength.d.ts +0 -45
  300. package/out/constraints/refinements/exactLength.d.ts.map +0 -1
  301. package/out/constraints/refinements/exactLength.js +0 -52
  302. package/out/constraints/refinements/exactLength.js.map +0 -1
  303. package/out/constraints/refinements/kinds.d.ts +0 -29
  304. package/out/constraints/refinements/kinds.d.ts.map +0 -1
  305. package/out/constraints/refinements/kinds.js +0 -17
  306. package/out/constraints/refinements/kinds.js.map +0 -1
  307. package/out/constraints/refinements/length.d.ts +0 -48
  308. package/out/constraints/refinements/length.d.ts.map +0 -1
  309. package/out/constraints/refinements/length.js +0 -53
  310. package/out/constraints/refinements/length.js.map +0 -1
  311. package/out/constraints/refinements/max.d.ts +0 -31
  312. package/out/constraints/refinements/max.d.ts.map +0 -1
  313. package/out/constraints/refinements/max.js +0 -35
  314. package/out/constraints/refinements/max.js.map +0 -1
  315. package/out/constraints/refinements/maxLength.d.ts +0 -32
  316. package/out/constraints/refinements/maxLength.d.ts.map +0 -1
  317. package/out/constraints/refinements/maxLength.js +0 -36
  318. package/out/constraints/refinements/maxLength.js.map +0 -1
  319. package/out/constraints/refinements/min.d.ts +0 -31
  320. package/out/constraints/refinements/min.d.ts.map +0 -1
  321. package/out/constraints/refinements/min.js +0 -28
  322. package/out/constraints/refinements/min.js.map +0 -1
  323. package/out/constraints/refinements/minLength.d.ts +0 -32
  324. package/out/constraints/refinements/minLength.d.ts.map +0 -1
  325. package/out/constraints/refinements/minLength.js +0 -33
  326. package/out/constraints/refinements/minLength.js.map +0 -1
  327. package/out/constraints/refinements/range.d.ts +0 -119
  328. package/out/constraints/refinements/range.d.ts.map +0 -1
  329. package/out/constraints/refinements/range.js +0 -89
  330. package/out/constraints/refinements/range.js.map +0 -1
  331. package/out/constraints/refinements/regex.d.ts +0 -47
  332. package/out/constraints/refinements/regex.d.ts.map +0 -1
  333. package/out/constraints/refinements/regex.js +0 -37
  334. package/out/constraints/refinements/regex.js.map +0 -1
  335. package/out/constraints/refinements/shared.d.ts +0 -20
  336. package/out/constraints/refinements/shared.d.ts.map +0 -1
  337. package/out/constraints/refinements/shared.js +0 -10
  338. package/out/constraints/refinements/shared.js.map +0 -1
  339. package/out/generic.d.ts.map +0 -1
  340. package/out/generic.js.map +0 -1
  341. package/out/inference.d.ts +0 -137
  342. package/out/inference.d.ts.map +0 -1
  343. package/out/inference.js +0 -73
  344. package/out/inference.js.map +0 -1
  345. package/out/keywords/ark.d.ts.map +0 -1
  346. package/out/keywords/ark.js.map +0 -1
  347. package/out/keywords/internal.d.ts +0 -13
  348. package/out/keywords/internal.d.ts.map +0 -1
  349. package/out/keywords/internal.js +0 -13
  350. package/out/keywords/internal.js.map +0 -1
  351. package/out/keywords/jsObject.d.ts +0 -20
  352. package/out/keywords/jsObject.d.ts.map +0 -1
  353. package/out/keywords/jsObject.js +0 -18
  354. package/out/keywords/jsObject.js.map +0 -1
  355. package/out/keywords/parsing.d.ts +0 -17
  356. package/out/keywords/parsing.d.ts.map +0 -1
  357. package/out/keywords/parsing.js +0 -64
  358. package/out/keywords/parsing.js.map +0 -1
  359. package/out/keywords/root.d.ts +0 -7
  360. package/out/keywords/root.d.ts.map +0 -1
  361. package/out/keywords/root.js +0 -4
  362. package/out/keywords/root.js.map +0 -1
  363. package/out/keywords/tsGenerics.d.ts +0 -2
  364. package/out/keywords/tsGenerics.d.ts.map +0 -1
  365. package/out/keywords/tsGenerics.js +0 -26
  366. package/out/keywords/tsGenerics.js.map +0 -1
  367. package/out/keywords/tsPrimitive.d.ts +0 -24
  368. package/out/keywords/tsPrimitive.d.ts.map +0 -1
  369. package/out/keywords/tsPrimitive.js +0 -25
  370. package/out/keywords/tsPrimitive.js.map +0 -1
  371. package/out/keywords/utils/creditCard.d.ts +0 -11
  372. package/out/keywords/utils/creditCard.d.ts.map +0 -1
  373. package/out/keywords/utils/creditCard.js +0 -35
  374. package/out/keywords/utils/creditCard.js.map +0 -1
  375. package/out/keywords/utils/date.d.ts +0 -45
  376. package/out/keywords/utils/date.d.ts.map +0 -1
  377. package/out/keywords/utils/date.js +0 -56
  378. package/out/keywords/utils/date.js.map +0 -1
  379. package/out/keywords/validation.d.ts +0 -20
  380. package/out/keywords/validation.d.ts.map +0 -1
  381. package/out/keywords/validation.js +0 -80
  382. package/out/keywords/validation.js.map +0 -1
  383. package/out/kinds.d.ts +0 -102
  384. package/out/kinds.d.ts.map +0 -1
  385. package/out/kinds.js +0 -29
  386. package/out/kinds.js.map +0 -1
  387. package/out/main.d.ts +0 -7
  388. package/out/main.d.ts.map +0 -1
  389. package/out/main.js +0 -6
  390. package/out/main.js.map +0 -1
  391. package/out/match.d.ts +0 -72
  392. package/out/match.d.ts.map +0 -1
  393. package/out/match.js +0 -53
  394. package/out/match.js.map +0 -1
  395. package/out/module.d.ts.map +0 -1
  396. package/out/module.js.map +0 -1
  397. package/out/parse.d.ts +0 -29
  398. package/out/parse.d.ts.map +0 -1
  399. package/out/parse.js +0 -161
  400. package/out/parse.js.map +0 -1
  401. package/out/parser/definition.d.ts.map +0 -1
  402. package/out/parser/definition.js.map +0 -1
  403. package/out/parser/generic.d.ts +0 -17
  404. package/out/parser/generic.d.ts.map +0 -1
  405. package/out/parser/generic.js +0 -16
  406. package/out/parser/generic.js.map +0 -1
  407. package/out/parser/objectLiteral.d.ts.map +0 -1
  408. package/out/parser/objectLiteral.js.map +0 -1
  409. package/out/parser/semantic/bounds.d.ts.map +0 -1
  410. package/out/parser/semantic/bounds.js.map +0 -1
  411. package/out/parser/semantic/divisor.d.ts.map +0 -1
  412. package/out/parser/semantic/divisor.js.map +0 -1
  413. package/out/parser/semantic/infer.d.ts.map +0 -1
  414. package/out/parser/semantic/infer.js.map +0 -1
  415. package/out/parser/semantic/utils.d.ts.map +0 -1
  416. package/out/parser/semantic/utils.js.map +0 -1
  417. package/out/parser/semantic/validate.d.ts.map +0 -1
  418. package/out/parser/semantic/validate.js.map +0 -1
  419. package/out/parser/string/reduce/dynamic.d.ts.map +0 -1
  420. package/out/parser/string/reduce/dynamic.js.map +0 -1
  421. package/out/parser/string/reduce/shared.d.ts.map +0 -1
  422. package/out/parser/string/reduce/shared.js.map +0 -1
  423. package/out/parser/string/reduce/static.d.ts.map +0 -1
  424. package/out/parser/string/reduce/static.js.map +0 -1
  425. package/out/parser/string/shift/operand/date.d.ts.map +0 -1
  426. package/out/parser/string/shift/operand/date.js.map +0 -1
  427. package/out/parser/string/shift/operand/enclosed.d.ts.map +0 -1
  428. package/out/parser/string/shift/operand/enclosed.js.map +0 -1
  429. package/out/parser/string/shift/operand/genericArgs.d.ts.map +0 -1
  430. package/out/parser/string/shift/operand/genericArgs.js.map +0 -1
  431. package/out/parser/string/shift/operand/operand.d.ts.map +0 -1
  432. package/out/parser/string/shift/operand/operand.js.map +0 -1
  433. package/out/parser/string/shift/operand/unenclosed.d.ts.map +0 -1
  434. package/out/parser/string/shift/operand/unenclosed.js.map +0 -1
  435. package/out/parser/string/shift/operator/bounds.d.ts.map +0 -1
  436. package/out/parser/string/shift/operator/bounds.js.map +0 -1
  437. package/out/parser/string/shift/operator/divisor.d.ts.map +0 -1
  438. package/out/parser/string/shift/operator/divisor.js.map +0 -1
  439. package/out/parser/string/shift/operator/operator.d.ts.map +0 -1
  440. package/out/parser/string/shift/operator/operator.js.map +0 -1
  441. package/out/parser/string/shift/scanner.d.ts.map +0 -1
  442. package/out/parser/string/shift/scanner.js.map +0 -1
  443. package/out/parser/string/string.d.ts.map +0 -1
  444. package/out/parser/string/string.js.map +0 -1
  445. package/out/parser/tuple.d.ts.map +0 -1
  446. package/out/parser/tuple.js.map +0 -1
  447. package/out/schema.d.ts +0 -175
  448. package/out/schema.d.ts.map +0 -1
  449. package/out/schema.js +0 -73
  450. package/out/schema.js.map +0 -1
  451. package/out/schemaScope.d.ts +0 -180
  452. package/out/schemaScope.d.ts.map +0 -1
  453. package/out/schemaScope.js +0 -235
  454. package/out/schemaScope.js.map +0 -1
  455. package/out/scope.d.ts.map +0 -1
  456. package/out/scope.js.map +0 -1
  457. package/out/shared/compile.d.ts +0 -22
  458. package/out/shared/compile.d.ts.map +0 -1
  459. package/out/shared/compile.js +0 -79
  460. package/out/shared/compile.js.map +0 -1
  461. package/out/shared/context.d.ts +0 -54
  462. package/out/shared/context.d.ts.map +0 -1
  463. package/out/shared/context.js +0 -53
  464. package/out/shared/context.js.map +0 -1
  465. package/out/shared/declare.d.ts +0 -69
  466. package/out/shared/declare.d.ts.map +0 -1
  467. package/out/shared/declare.js +0 -2
  468. package/out/shared/declare.js.map +0 -1
  469. package/out/shared/disjoint.d.ts +0 -91
  470. package/out/shared/disjoint.d.ts.map +0 -1
  471. package/out/shared/disjoint.js +0 -110
  472. package/out/shared/disjoint.js.map +0 -1
  473. package/out/shared/errors.d.ts +0 -99
  474. package/out/shared/errors.d.ts.map +0 -1
  475. package/out/shared/errors.js +0 -108
  476. package/out/shared/errors.js.map +0 -1
  477. package/out/shared/implement.d.ts +0 -363
  478. package/out/shared/implement.d.ts.map +0 -1
  479. package/out/shared/implement.js +0 -68
  480. package/out/shared/implement.js.map +0 -1
  481. package/out/shared/inference.d.ts +0 -6
  482. package/out/shared/inference.d.ts.map +0 -1
  483. package/out/shared/inference.js +0 -5
  484. package/out/shared/inference.js.map +0 -1
  485. package/out/shared/intersections.d.ts +0 -60
  486. package/out/shared/intersections.d.ts.map +0 -1
  487. package/out/shared/intersections.js +0 -2
  488. package/out/shared/intersections.js.map +0 -1
  489. package/out/shared/traversal.d.ts +0 -62
  490. package/out/shared/traversal.d.ts.map +0 -1
  491. package/out/shared/traversal.js +0 -97
  492. package/out/shared/traversal.js.map +0 -1
  493. package/out/shared/utils.d.ts +0 -24
  494. package/out/shared/utils.d.ts.map +0 -1
  495. package/out/shared/utils.js +0 -15
  496. package/out/shared/utils.js.map +0 -1
  497. package/out/type.d.ts.map +0 -1
  498. package/out/type.js.map +0 -1
  499. package/out/types/basis.d.ts +0 -47
  500. package/out/types/basis.d.ts.map +0 -1
  501. package/out/types/basis.js +0 -15
  502. package/out/types/basis.js.map +0 -1
  503. package/out/types/discriminate.d.ts +0 -34
  504. package/out/types/discriminate.d.ts.map +0 -1
  505. package/out/types/discriminate.js +0 -120
  506. package/out/types/discriminate.js.map +0 -1
  507. package/out/types/domain.d.ts +0 -57
  508. package/out/types/domain.d.ts.map +0 -1
  509. package/out/types/domain.js +0 -41
  510. package/out/types/domain.js.map +0 -1
  511. package/out/types/intersection.d.ts +0 -127
  512. package/out/types/intersection.d.ts.map +0 -1
  513. package/out/types/intersection.js +0 -379
  514. package/out/types/intersection.js.map +0 -1
  515. package/out/types/morph.d.ts +0 -157
  516. package/out/types/morph.d.ts.map +0 -1
  517. package/out/types/morph.js +0 -99
  518. package/out/types/morph.js.map +0 -1
  519. package/out/types/proto.d.ts +0 -51
  520. package/out/types/proto.d.ts.map +0 -1
  521. package/out/types/proto.js +0 -60
  522. package/out/types/proto.js.map +0 -1
  523. package/out/types/type.d.ts +0 -143
  524. package/out/types/type.d.ts.map +0 -1
  525. package/out/types/type.js +0 -123
  526. package/out/types/type.js.map +0 -1
  527. package/out/types/union.d.ts +0 -71
  528. package/out/types/union.d.ts.map +0 -1
  529. package/out/types/union.js +0 -379
  530. package/out/types/union.js.map +0 -1
  531. package/out/types/unit.d.ts +0 -45
  532. package/out/types/unit.d.ts.map +0 -1
  533. package/out/types/unit.js +0 -56
  534. package/out/types/unit.js.map +0 -1
  535. package/out/util.d.ts +0 -31
  536. package/out/util.d.ts.map +0 -1
  537. package/out/util.js +0 -8
  538. package/out/util.js.map +0 -1
  539. package/parser/definition.ts +0 -143
  540. package/parser/generic.ts +0 -66
  541. package/parser/objectLiteral.ts +0 -217
  542. package/parser/semantic/bounds.ts +0 -62
  543. package/parser/semantic/divisor.ts +0 -11
  544. package/parser/semantic/infer.ts +0 -141
  545. package/parser/semantic/utils.ts +0 -15
  546. package/parser/semantic/validate.ts +0 -117
  547. package/parser/string/reduce/dynamic.ts +0 -208
  548. package/parser/string/reduce/shared.ts +0 -99
  549. package/parser/string/reduce/static.ts +0 -296
  550. package/parser/string/shift/operand/date.ts +0 -55
  551. package/parser/string/shift/operand/enclosed.ts +0 -123
  552. package/parser/string/shift/operand/genericArgs.ts +0 -128
  553. package/parser/string/shift/operand/operand.ts +0 -42
  554. package/parser/string/shift/operand/unenclosed.ts +0 -218
  555. package/parser/string/shift/operator/bounds.ts +0 -270
  556. package/parser/string/shift/operator/divisor.ts +0 -33
  557. package/parser/string/shift/operator/operator.ts +0 -71
  558. package/parser/string/shift/scanner.ts +0 -210
  559. package/parser/string/string.ts +0 -85
  560. package/parser/tuple.ts +0 -542
  561. package/scope.ts +0 -285
  562. package/type.ts +0 -265
@@ -1,180 +0,0 @@
1
- import {
2
- type Dict,
3
- type List,
4
- type evaluate,
5
- type require,
6
- type requireKeys
7
- } from "@arktype/util"
8
- import type { Node, TypeNode } from "./base.js"
9
- import type { schema } from "./builtins/builtins.js"
10
- import type { JsObjects } from "./builtins/jsObjects.js"
11
- import type { TsKeywords } from "./builtins/tsKeywords.js"
12
- import type { LengthBoundableData } from "./constraints/refinements/range.js"
13
- import type {
14
- instantiateAliases,
15
- instantiateSchemaBranches,
16
- validateAliases,
17
- validateSchemaBranch
18
- } from "./inference.js"
19
- import { type Schema, type reducibleKindOf } from "./kinds.js"
20
- import { type SchemaParseOptions } from "./parse.js"
21
- import type { TraverseAllows, TraverseApply } from "./shared/context.js"
22
- import type {
23
- ActualWriter,
24
- ArkErrorCode,
25
- ExpectedWriter,
26
- MessageWriter,
27
- ProblemWriter
28
- } from "./shared/errors.js"
29
- import type {
30
- DescriptionWriter,
31
- NodeKind,
32
- TypeKind
33
- } from "./shared/implement.js"
34
- import type {
35
- NormalizedUnionSchema,
36
- UnionChildKind,
37
- UnionNode
38
- } from "./types/union.js"
39
- import type { UnitNode } from "./types/unit.js"
40
- export type nodeResolutions<keywords> = {
41
- [k in keyof keywords]: TypeNode
42
- }
43
- export type BaseResolutions = Record<string, TypeNode>
44
- declare global {
45
- export interface StaticArkConfig {
46
- preserve(): never
47
- }
48
- }
49
- type nodeConfigForKind<kind extends NodeKind> = evaluate<
50
- {
51
- description?: DescriptionWriter<kind>
52
- } & (kind extends ArkErrorCode
53
- ? {
54
- expected?: ExpectedWriter<kind>
55
- actual?: ActualWriter<kind>
56
- problem?: ProblemWriter<kind>
57
- message?: MessageWriter<kind>
58
- }
59
- : {})
60
- >
61
- type NodeConfigsByKind = {
62
- [kind in NodeKind]: nodeConfigForKind<kind>
63
- }
64
- export type NodeConfig<kind extends NodeKind = NodeKind> =
65
- NodeConfigsByKind[kind]
66
- type UnknownNodeConfig = {
67
- description?: DescriptionWriter
68
- expected?: ExpectedWriter
69
- actual?: ActualWriter
70
- problem?: ProblemWriter
71
- message?: MessageWriter
72
- }
73
- export type ParsedUnknownNodeConfig = requireKeys<
74
- UnknownNodeConfig,
75
- "description"
76
- >
77
- export type StaticArkOption<k extends keyof StaticArkConfig> = ReturnType<
78
- StaticArkConfig[k]
79
- >
80
- export interface ArkConfig extends Partial<NodeConfigsByKind> {}
81
- export type ParsedArkConfig = require<ArkConfig, 2>
82
- export declare class ScopeNode<r extends object = any> {
83
- def: Dict
84
- infer: {
85
- [k in keyof r]: r[k] extends schema.cast<infer t> ? t : never
86
- }
87
- static jsObjects: JsObjects.resolutions
88
- static tsKeywords: TsKeywords.resolutions
89
- readonly nodeCache: {
90
- [innerId: string]: Node
91
- }
92
- readonly config: ParsedArkConfig
93
- readonly resolutions: r
94
- readonly referencesByName: {
95
- [name: string]: Node
96
- }
97
- readonly references: readonly Node[]
98
- protected resolved: boolean
99
- protected prereducedAliases: boolean
100
- readonly lengthBoundable: UnionNode<LengthBoundableData>
101
- constructor(def: Dict, config?: ArkConfig)
102
- get tsKeywords(): TsKeywords.resolutions
103
- get jsObjects(): JsObjects.resolutions
104
- static from<const aliases>(
105
- aliases: validateAliases<aliases>,
106
- config?: ArkConfig
107
- ): ScopeNode<instantiateAliases<aliases>>
108
- static root: ScopeNode<{}>
109
- parseUnion<const branches extends readonly Schema<UnionChildKind>[]>(
110
- input: {
111
- branches: {
112
- [i in keyof branches]: validateSchemaBranch<branches[i], r>
113
- }
114
- } & NormalizedUnionSchema
115
- ): instantiateSchemaBranches<branches>
116
- parseBranches<const branches extends readonly Schema<UnionChildKind>[]>(
117
- ...branches: {
118
- [i in keyof branches]: validateSchemaBranch<branches[i], r>
119
- }
120
- ): instantiateSchemaBranches<branches>
121
- parseUnits<const branches extends List>(
122
- ...values: branches
123
- ): branches["length"] extends 1
124
- ? UnionNode<branches[0]>
125
- : UnionNode<branches[number]> | UnitNode<branches[number]>
126
- parseTypeNode<defKind extends TypeKind>(
127
- schema: Schema<defKind>,
128
- opts?: TypeSchemaParseOptions<defKind>
129
- ): Node<reducibleKindOf<defKind>>
130
- parseRoot<kind extends NodeKind>(
131
- kind: kind,
132
- def: Schema<kind>,
133
- opts?: SchemaParseOptions
134
- ): Node<reducibleKindOf<kind>>
135
- parsePrereduced<kind extends NodeKind>(
136
- kind: kind,
137
- def: Schema<kind>
138
- ): Node<kind>
139
- parse<kind extends NodeKind>(
140
- kind: kind,
141
- def: Schema<kind>,
142
- opts?: SchemaParseOptions
143
- ): Node<reducibleKindOf<kind>>
144
- protected bindCompiledScope(references: readonly Node[]): void
145
- protected compileScope(references: readonly Node[]): {
146
- [k: `${string}Allows`]: TraverseAllows
147
- [k: `${string}Apply`]: TraverseApply
148
- }
149
- readonly schema: SchemaParser<r>
150
- }
151
- export type SchemaBranchesParser<$> = <
152
- const branches extends readonly Schema<UnionChildKind>[]
153
- >(
154
- ...branches: {
155
- [i in keyof branches]: validateSchemaBranch<branches[i], $>
156
- }
157
- ) => instantiateSchemaBranches<branches>
158
- export type SchemaParser<$> = SchemaBranchesParser<$> & {
159
- union<const branches extends readonly Schema<UnionChildKind>[]>(
160
- input: {
161
- branches: {
162
- [i in keyof branches]: validateSchemaBranch<branches[i], $>
163
- }
164
- } & NormalizedUnionSchema
165
- ): instantiateSchemaBranches<branches>
166
- units<const branches extends List>(
167
- ...values: branches
168
- ): branches["length"] extends 1
169
- ? UnionNode<branches[0]>
170
- : UnionNode<branches[number]> | UnitNode<branches[number]>
171
- }
172
- export interface TypeSchemaParseOptions<allowedKind extends TypeKind = TypeKind>
173
- extends SchemaParseOptions {
174
- root?: boolean
175
- allowedKinds?: readonly allowedKind[]
176
- }
177
- export declare const scopeNode: typeof ScopeNode.from
178
- export declare const rootSchema: SchemaBranchesParser<{}>
179
- export {}
180
- //# sourceMappingURL=schemaScope.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schemaScope.d.ts","sourceRoot":"","sources":["../schemaScope.ts"],"names":[],"mappings":"AAAA,OAAO,EAMN,KAAK,IAAI,EACT,KAAK,IAAI,EACT,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAE1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAA;AAC7E,OAAO,KAAK,EACX,kBAAkB,EAClB,yBAAyB,EACzB,eAAe,EACf,oBAAoB,EACpB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAe,KAAK,MAAM,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAA;AAC3E,O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import { globalConfig } from "./config.js"
9
- import { nodesByKind } from "./kinds.js"
10
- import { parseAttachments } from "./parse.js"
11
- import { NodeCompiler } from "./shared/compile.js"
12
- import { discriminatingIntersectionKeys } from "./types/intersection.js"
13
- import { BaseType } from "./types/type.js"
14
- const parseConfig = (scopeConfig) => {
15
- if (!scopeConfig) {
16
- return globalConfig
17
- }
18
- const parsedConfig = { ...globalConfig }
19
- let k
20
- for (k in scopeConfig) {
21
- if (k === "prereducedAliases") {
22
- parsedConfig[k] = scopeConfig[k]
23
- } else {
24
- parsedConfig[k] = {
25
- ...nodesByKind[k].implementation.defaults,
26
- ...scopeConfig[k]
27
- }
28
- }
29
- }
30
- return parsedConfig
31
- }
32
- const assertTypeKind = (schema) => {
33
- switch (typeof schema) {
34
- case "string":
35
- return "domain"
36
- case "function":
37
- return "proto"
38
- case "object":
39
- // throw at end of function
40
- if (schema === null) break
41
- if (schema instanceof BaseType) return schema.kind
42
- if ("morph" in schema) return "morph"
43
- if ("branches" in schema || isArray(schema)) return "union"
44
- if ("unit" in schema) return "unit"
45
- const schemaKeys = Object.keys(schema)
46
- if (
47
- schemaKeys.length === 0 ||
48
- schemaKeys.some((k) => k in discriminatingIntersectionKeys)
49
- )
50
- return "intersection"
51
- if ("proto" in schema) return "proto"
52
- if ("domain" in schema) return "domain"
53
- }
54
- return throwParseError(`${printable(schema)} is not a valid type schema`)
55
- }
56
- export class ScopeNode {
57
- def
58
- nodeCache = {}
59
- config
60
- resolutions = {}
61
- referencesByName = {}
62
- references
63
- resolved = false
64
- prereducedAliases
65
- lengthBoundable
66
- constructor(def, config = {}) {
67
- this.def = def
68
- this.config = parseConfig(config)
69
- this.prereducedAliases = config.prereducedAliases ?? false
70
- for (const k in this.def) {
71
- this.resolutions[k] = this.parseRoot(
72
- assertTypeKind(this.def[k]),
73
- this.def[k],
74
- {
75
- alias: k,
76
- prereduced: this.prereducedAliases
77
- }
78
- )
79
- }
80
- this.references = Object.values(this.referencesByName)
81
- this.bindCompiledScope(this.references)
82
- this.resolved = true
83
- this.parse(
84
- "union",
85
- {
86
- branches: [
87
- "string",
88
- "number",
89
- "object",
90
- "bigint",
91
- "symbol",
92
- { unit: true },
93
- { unit: false },
94
- { unit: null },
95
- { unit: undefined }
96
- ]
97
- },
98
- { reduceTo: this.parsePrereduced("intersection", {}) }
99
- )
100
- this.lengthBoundable = this.parsePrereduced("union", ["string", Array])
101
- }
102
- get tsKeywords() {
103
- return ScopeNode.tsKeywords
104
- }
105
- get jsObjects() {
106
- return ScopeNode.jsObjects
107
- }
108
- static from(aliases, config = {}) {
109
- return new ScopeNode(aliases, config)
110
- }
111
- static root = this.from({})
112
- parseUnion(input) {
113
- return this.parseRoot("union", input)
114
- }
115
- parseBranches(...branches) {
116
- return branches.length === 1
117
- ? this.parseTypeNode(branches[0], { root: true })
118
- : this.parseRoot("union", branches)
119
- }
120
- parseUnits(...values) {
121
- const uniqueValues = []
122
- for (const value of values) {
123
- if (!uniqueValues.includes(value)) {
124
- uniqueValues.push(value)
125
- }
126
- }
127
- const branches = uniqueValues.map((unit) =>
128
- this.parsePrereduced("unit", { unit })
129
- )
130
- if (branches.length === 1) {
131
- return branches[0]
132
- }
133
- return this.parseRoot("union", {
134
- branches
135
- })
136
- }
137
- parseTypeNode(schema, opts = {}) {
138
- const kind = assertTypeKind(schema)
139
- if (opts.allowedKinds && !opts.allowedKinds.includes(kind)) {
140
- return throwParseError(
141
- `Schema of kind ${kind} should be one of ${opts.allowedKinds}`
142
- )
143
- }
144
- return opts.root
145
- ? this.parseRoot(kind, schema, opts)
146
- : this.parse(kind, schema, opts)
147
- }
148
- parseRoot(kind, def, opts = {}) {
149
- const node = this.parse(kind, def, opts)
150
- if (this.resolved) {
151
- // this node was not part of the original scope, so compile an anonymous scope
152
- // including only its references
153
- this.bindCompiledScope(node.contributesReferences)
154
- } else {
155
- // we're still parsing the scope itself, so defer compilation but
156
- // add the node as a reference
157
- Object.assign(
158
- this.referencesByName,
159
- node.contributesReferencesByName
160
- )
161
- }
162
- return node
163
- }
164
- parsePrereduced(kind, def) {
165
- return this.parse(kind, def, { prereduced: true })
166
- }
167
- parse(kind, def, opts = {}) {
168
- if (opts.alias && opts.alias in this.resolutions) {
169
- return throwInternalError(
170
- `Unexpected attempt to recreate existing alias ${opts.alias}`
171
- )
172
- }
173
- const node = parseAttachments(kind, def, {
174
- ...opts,
175
- $: this,
176
- definition: def,
177
- prereduced: opts.prereduced ?? false
178
- })
179
- return node
180
- }
181
- bindCompiledScope(references) {
182
- const compiledTraversals = this.compileScope(references)
183
- for (const node of references) {
184
- if (node.jit) {
185
- // if node has already been bound to another scope or anonymous type, don't rebind it
186
- continue
187
- }
188
- node.jit = true
189
- node.traverseAllows =
190
- compiledTraversals[`${node.name}Allows`].bind(
191
- compiledTraversals
192
- )
193
- if (node.isType() && !node.includesContextDependentPredicate) {
194
- // if the reference doesn't require context, we can assign over
195
- // it directly to avoid having to initialize it
196
- node.allows = node.traverseAllows
197
- }
198
- node.traverseApply =
199
- compiledTraversals[`${node.name}Apply`].bind(compiledTraversals)
200
- }
201
- }
202
- compileScope(references) {
203
- return new CompiledFunction()
204
- .block(`return`, (js) => {
205
- references.forEach((node) => {
206
- const allowsCompiler = new NodeCompiler("Allows").indent()
207
- node.compile(allowsCompiler)
208
- const applyCompiler = new NodeCompiler("Apply").indent()
209
- node.compile(applyCompiler)
210
- js.line(
211
- allowsCompiler.writeMethod(`${node.name}Allows`) +
212
- ",\n" +
213
- applyCompiler.writeMethod(`${node.name}Apply`) +
214
- ","
215
- )
216
- })
217
- return js
218
- })
219
- .compile()()
220
- }
221
- schema = Object.assign(this.parseBranches.bind(this), {
222
- units: this.parseUnits.bind(this),
223
- union: this.parseUnion.bind(this)
224
- })
225
- }
226
- export const scopeNode = ScopeNode.from
227
- export const rootSchema = (...branches) =>
228
- ScopeNode.root.parseTypeNode(
229
- branches.length === 1 ? branches[0] : branches,
230
- {
231
- root: true,
232
- prereduced: true
233
- }
234
- )
235
- //# sourceMappingURL=schem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B,eAAe,CACd,oEAAoE,CACpE,CAAA;IACF,CAAC;IACD,OAAO;QACN,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,eAAe,CAAC;QACjC,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAAK,CAAC,eAAe,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KAC5D,CAAA;AACF,CAAC,CAAA"}
@@ -1,22 +0,0 @@
1
- import { CompiledFunction } from "@arktype/util"
2
- import type { Node, UnknownNode } from "../base.js"
3
- import type { Discriminant } from "../types/discriminate.js"
4
- import type { PrimitiveKind } from "./implement.js"
5
- import type { TraversalKind } from "./traversal.js"
6
- export type InvokeOptions = {
7
- arg?: string
8
- kind?: TraversalKind
9
- }
10
- export declare class NodeCompiler extends CompiledFunction<["data", "ctx"]> {
11
- traversalKind: TraversalKind
12
- path: string[]
13
- discriminants: Discriminant[]
14
- constructor(traversalKind: TraversalKind)
15
- invoke(node: UnknownNode, opts?: InvokeOptions): string
16
- requiresContextFor(node: UnknownNode): boolean
17
- checkReferenceKey(keyExpression: string, node: UnknownNode): this
18
- check(node: UnknownNode, opts?: InvokeOptions): this
19
- compilePrimitive(node: Node<PrimitiveKind>): this
20
- writeMethod(name: string): string
21
- }
22
- //# sourceMappingURL=compile.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../shared/compile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAA0B,MAAM,eAAe,CAAA;AACxE,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAEnD,MAAM,MAAM,aAAa,GAAG;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,aAAa,CAAA;CACpB,CAAA;AAED,qBAAa,YAAa,SAAQ,gBAAgB,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAI/C,aAAa,EAAE,aAAa;IAH/C,IAAI,EAAE,MAAM,EAAE,CAAK;IACnB,aAAa,EAAE,YAAY,EAAE,CAAK;gBAEf,aAAa,EAAE,aAAa;IAI/C,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,MAAM;IAUvD,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO;IAM9C,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI;IAcjE,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,IAAI;IAMpD,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI;IAiCjD,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAGjC"}
@@ -1,79 +0,0 @@
1
- import { CompiledFunction, compileSerializedValue } from "@arktype/util"
2
- export class NodeCompiler extends CompiledFunction {
3
- traversalKind
4
- path = []
5
- discriminants = []
6
- constructor(traversalKind) {
7
- super("data", "ctx")
8
- this.traversalKind = traversalKind
9
- }
10
- invoke(node, opts) {
11
- const invokedKind = opts?.kind ?? this.traversalKind
12
- const method = `${node.reference}${invokedKind}`
13
- const arg = opts?.arg ?? this.data
14
- if (this.requiresContextFor(node)) {
15
- return `this.${method}(${arg}, ${this.ctx})`
16
- }
17
- return `this.${method}(${arg})`
18
- }
19
- requiresContextFor(node) {
20
- return (
21
- this.traversalKind === "Apply" ||
22
- node.includesContextDependentPredicate
23
- )
24
- }
25
- checkReferenceKey(keyExpression, node) {
26
- const requiresContext = this.requiresContextFor(node)
27
- if (requiresContext) {
28
- this.line(`${this.ctx}.path.push(${keyExpression})`)
29
- }
30
- this.check(node, {
31
- arg: `${this.data}${this.index(keyExpression)}`
32
- })
33
- if (requiresContext) {
34
- this.line(`${this.ctx}.path.pop()`)
35
- }
36
- return this
37
- }
38
- check(node, opts) {
39
- return this.traversalKind === "Allows"
40
- ? this.if(`!${this.invoke(node, opts)}`, () => this.return(false))
41
- : this.line(this.invoke(node, opts))
42
- }
43
- compilePrimitive(node) {
44
- const pathString = this.path.join()
45
- if (
46
- node.kind === "domain" &&
47
- node.domain === "object" &&
48
- this.discriminants.some((d) => d.path.join().startsWith(pathString))
49
- ) {
50
- // if we've already checked a path at least as long as the current one,
51
- // we don't need to revalidate that we're in an object
52
- return this
53
- }
54
- if (
55
- (node.kind === "domain" || node.kind === "unit") &&
56
- this.discriminants.some(
57
- (d) =>
58
- d.path.join() === pathString &&
59
- (node.kind === "domain"
60
- ? d.kind === "domain" || d.kind === "value"
61
- : d.kind === "value")
62
- )
63
- ) {
64
- // if the discriminant has already checked the domain at the current path
65
- // (or an exact value, implying a domain), we don't need to recheck it
66
- return this
67
- }
68
- if (this.traversalKind === "Allows") {
69
- return this.return(node.compiledCondition)
70
- }
71
- return this.if(node.compiledNegation, () =>
72
- this.line(`${this.ctx}.error(${node.compiledErrorContext})`)
73
- )
74
- }
75
- writeMethod(name) {
76
- return `${name}(${this.argNames.join(", ")}){\n${this.body} }\n`
77
- }
78
- }
79
- //# sourceMappingURL=compile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compile.js","sourceRoot":"","sources":["../../shared/compile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAWxE,MAAM,OAAO,YAAa,SAAQ,gBAAiC;IAI/C;IAHnB,IAAI,GAAa,EAAE,CAAA;IACnB,aAAa,GAAmB,EAAE,CAAA;IAElC,YAAmB,aAA4B;QAC9C,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;QADF,kBAAa,GAAb,aAAa,CA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AI,CAAC,iBAAiB,CAAC,CAAA;QAC3C,CAAC;QACD,OAAO,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,GAAG,EAAE,CAC1C,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,UAAU,IAAI,CAAC,oBAAoB,GAAG,CAAC,CAC5D,CAAA;IACF,CAAC;IAED,WAAW,CAAC,IAAY;QACvB,OAAO,GAAG,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,SAAS,CAAA;IACpE,CAAC;CACD"}
@@ -1,54 +0,0 @@
1
- import { ArkErrors, type ArkErrorInput } from "./errors.js"
2
- import type { ParsedArkConfig } from "../schemaScope.js"
3
- export type TraversalPath = (string | symbol)[]
4
- export declare const pathToPropString: (path: TraversalPath) => string
5
- export declare class TraversalContext {
6
- root: unknown
7
- config: ParsedArkConfig
8
- path: TraversalPath
9
- errorsStack: ArkErrors[]
10
- entriesToPrune: [data: Record<string, unknown>, key: string][]
11
- seen: {
12
- [name in string]?: object[]
13
- }
14
- constructor(root: unknown, config: ParsedArkConfig)
15
- get currentErrors(): ArkErrors
16
- get error(): (
17
- input: ArkErrorInput
18
- ) => import("./errors.js").ArkTypeError<
19
- | "max"
20
- | "min"
21
- | "maxLength"
22
- | "minLength"
23
- | "before"
24
- | "after"
25
- | "length"
26
- | "union"
27
- | "unit"
28
- | "intersection"
29
- | "proto"
30
- | "domain"
31
- | "regex"
32
- | "divisor"
33
- | "required"
34
- | "predicate"
35
- >
36
- get data(): unknown
37
- invalid(input: ArkErrorInput): false
38
- pushUnion(): void
39
- popUnion(branchCount: number, data: unknown, path: string[]): void
40
- }
41
- export type TraversalMethodsByKind<input = unknown> = {
42
- Allows: TraverseAllows<input>
43
- Apply: TraverseApply<input>
44
- }
45
- export type TraversalKind = keyof TraversalMethodsByKind
46
- export type TraverseAllows<data = unknown> = (
47
- data: data,
48
- ctx: TraversalContext
49
- ) => boolean
50
- export type TraverseApply<data = unknown> = (
51
- data: data,
52
- ctx: TraversalContext
53
- ) => void
54
- //# sourceMappingURL=context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../shared/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAExD,MAAM,MAAM,aAAa,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;AAE/C,eAAO,MAAM,gBAAgB,iCAM5B,CAAA;AAED,qBAAa,gBAAgB;IAUpB,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,eAAe;IAV/B,IAAI,EAAE,aAAa,CAAK;IACxB,WAAW,EAAE,SAAS,EAAE,CAAA;IAExB,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,CAAK;IAGnE,IAAI,EAAE;SAAG,IAAI,IAAI,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE;KAAE,CAAK;gBAGlC,IAAI,EAAE,OAAO,EACb,MAAM,EAAE,eAAe;IAK/B,IAAI,aAAa,cAEhB;IAED,IAAI,KAAK,sPAER;IAED,IAAI,IAAI,IAAI,OAAO,CAMlB;IAED,OAAO,CAAC,KAAK,EAAE,aAAa,GAAG,KAAK;IAKpC,SAAS;IAIT,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE;CAM3D;AAED,MAAM,MAAM,sBAAsB,CAAC,KAAK,GAAG,OAAO,IAAI;IACrD,MAAM,EAAE,cAAc,CAAC,KAAK,CAAC,CAAA;IAC7B,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,CAAA;CAC3B,CAAA;AAED,MAAM,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