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,97 +0,0 @@
1
- import { deepClone } from "@arktype/util"
2
- import { ArkErrors, createError } from "./errors.js"
3
- export class TraversalContext {
4
- root
5
- config
6
- path = []
7
- morphs = []
8
- errors = new ArkErrors(this)
9
- branches = []
10
- // Qualified
11
- seen = {}
12
- constructor(root, config) {
13
- this.root = root
14
- this.config = config
15
- }
16
- get currentBranch() {
17
- return this.branches.at(-1)
18
- }
19
- queueMorph(morph) {
20
- const input = { path: [...this.path], morph }
21
- this.currentBranch?.morphs.push(input) ?? this.morphs.push(input)
22
- }
23
- finalize() {
24
- if (this.hasError()) {
25
- return { errors: this.errors }
26
- }
27
- const data = this.root
28
- let out = data
29
- if (this.morphs.length) {
30
- out = deepClone(this.root)
31
- for (let i = 0; i < this.morphs.length; i++) {
32
- const { path, morph } = this.morphs[i]
33
- if (path.length === 0) {
34
- this.path = []
35
- // if the morph applies to the root, just assign to it directly
36
- const result = morph(out, this)
37
- if (this.hasError()) return { errors: this.errors }
38
- out = result
39
- continue
40
- }
41
- // find the object on which the key to be morphed exists
42
- let parent = out
43
- for (
44
- let pathIndex = 0;
45
- pathIndex < path.length - 1;
46
- pathIndex++
47
- )
48
- parent = parent[path[pathIndex]]
49
- // apply the morph function and assign the result to the corresponding property
50
- const key = path.at(-1)
51
- this.path = path
52
- const result = morph(parent[key], this)
53
- if (this.hasError()) return { errors: this.errors }
54
- else parent[key] = result
55
- }
56
- }
57
- return { data, out }
58
- }
59
- hasError() {
60
- return this.currentBranch
61
- ? this.currentBranch.error !== undefined
62
- : this.errors.count !== 0
63
- }
64
- get failFast() {
65
- return this.branches.length !== 0
66
- }
67
- error(input) {
68
- const error = createError(this, input)
69
- if (this.currentBranch) {
70
- this.currentBranch.error = error
71
- } else {
72
- this.errors.add(error)
73
- }
74
- return error
75
- }
76
- get data() {
77
- let result = this.root
78
- for (const segment of this.path) {
79
- result = result?.[segment]
80
- }
81
- return result
82
- }
83
- invalid(input) {
84
- this.error(input)
85
- return false
86
- }
87
- pushBranch() {
88
- this.branches.push({
89
- error: undefined,
90
- morphs: []
91
- })
92
- }
93
- popBranch() {
94
- return this.branches.pop()
95
- }
96
- }
97
- //# sourceMappingURL=traversal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"traversal.js","sourceRoot":"","sources":["../../shared/traversal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAGzC,OAAO,EACN,SAAS,EACT,WAAW,EAKX,MAAM,aAAa,CAAA;AAapB,MAAM,OAAO,gBAAgB;IAUpB;IACA;IAVR,IAAI,GAAkB,EAAE,CAAA;IACxB,MAAM,GAAkB,EAAE,CAAA;IAC1B,MAAM,GAAc,IAAI,SAAS,CAAC,IAAI,CAAC,CAAA;IACvC,QAAQ,GAA6B,EAAE,CAAA;IAEvC,YAAY;IACZ,IAAI,GAAoC,EAAE,CAAA;IAE1C,YACQ,IAAa,EACb,MAAyB;QADzB,SAAI,G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AM,CAAC;YACP,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QACvB,CAAC;QACD,OAAO,KAAK,CAAA;IACb,CAAC;IAED,IAAI,IAAI;QACP,IAAI,MAAM,GAAQ,IAAI,CAAC,IAAI,CAAA;QAC3B,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACjC,MAAM,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,CAAA;QAC3B,CAAC;QACD,OAAO,MAAM,CAAA;IACd,CAAC;IAED,OAAO,CAAC,KAAoB;QAC3B,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACjB,OAAO,KAAK,CAAA;IACb,CAAC;IAED,UAAU;QACT,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;YAClB,KAAK,EAAE,SAAS;YAChB,MAAM,EAAE,EAAE;SACV,CAAC,CAAA;IACH,CAAC;IAED,SAAS;QACR,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAG,CAAA;IAC5B,CAAC;CACD"}
@@ -1,24 +0,0 @@
1
- import { type array, type mutable } from "@arktype/util"
2
- export declare const makeRootAndArrayPropertiesMutable: <o extends object>(
3
- o: o
4
- ) => {
5
- -readonly [k in keyof o]: o[k] extends array | undefined
6
- ? o[k] extends infer T
7
- ? T extends o[k]
8
- ? T extends object
9
- ? T extends (...args: never[]) => unknown
10
- ? T
11
- : { -readonly [k_1 in keyof T]: T[k_1] }
12
- : T
13
- : never
14
- : never
15
- : o[k]
16
- }
17
- export type makeRootAndArrayPropertiesMutable<inner> = {
18
- -readonly [k in keyof inner]: inner[k] extends array | undefined
19
- ? mutable<inner[k]>
20
- : inner[k]
21
- } & unknown
22
- export type TraversalPath = PropertyKey[]
23
- export declare const pathToPropString: (path: TraversalPath) => string
24
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../shared/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,MAAM,eAAe,CAAA;AAEtB,eAAO,MAAM,iCAAiC,yQAKyB,CAAA;AAEvE,MAAM,MAAM,iCAAiC,CAAC,KAAK,IAAI;IACtD,CAAC,UAAU,CAAC,IAAI,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,SAAS,KAAK,GAAG,SAAS,GAC7D,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GACjB,KAAK,CAAC,CAAC,CAAC;CACX,GAAG,OAAO,CAAA;AAEX,MAAM,MAAM,aAAa,GAAG,WAAW,EAAE,CAAA;AAEzC,eAAO,MAAM,gBAAgB,2BAA0B,MAMtD,CAAA"}
@@ -1,15 +0,0 @@
1
- import { flatMorph, isArray, literalPropAccess } from "@arktype/util"
2
- export const makeRootAndArrayPropertiesMutable = (o) =>
3
- // TODO: this cast should not be required, but it seems TS is referencing
4
- // the wrong parameters here?
5
- flatMorph(o, (k, v) => [k, isArray(v) ? [...v] : v])
6
- export const pathToPropString = (path) => {
7
- const propAccessChain = path.reduce(
8
- (s, segment) => s + literalPropAccess(segment),
9
- ""
10
- )
11
- return propAccessChain[0] === "."
12
- ? propAccessChain.slice(1)
13
- : propAccessChain
14
- }
15
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../shared/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,SAAS,EACT,OAAO,EACP,iBAAiB,EAGjB,MAAM,eAAe,CAAA;AAEtB,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAChD,CAAI,EACmC,EAAE;AACzC,yEAAyE;AACzE,6BAA6B;AAC7B,SAAS,CAAC,CAAU,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAA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AAwD;gBACxD,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,CAAU,CAAU,CAAA;YACrD,CAAC;YACD,wEAAwE;YACxE,0EAA0E;YAC1E,uDAAuD;YACvD,OAAO,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;QACzB,CAAC,EACD,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,qBAAqB,EAAE,CAC1C,CAAA;IACF,CAAC;CACD;AAoID,MAAM,CAAC,MAAM,IAAI,GAAoB,SAAkB,CAAA"}
@@ -1,47 +0,0 @@
1
- import type {
2
- Constructor,
3
- Key,
4
- NonEnumerableDomain,
5
- inferDomain,
6
- instanceOf,
7
- isAny
8
- } from "@arktype/util"
9
- import type { Schema } from "../kinds.js"
10
- import type { NodeCompiler } from "../shared/compile.js"
11
- import type { BasisKind } from "../shared/implement.js"
12
- import type { TraverseApply } from "../shared/traversal.js"
13
- import type { DomainSchema } from "./domain.js"
14
- import type { ProtoSchema } from "./proto.js"
15
- import { BaseType, type BaseTypeDeclaration, type Type } from "./type.js"
16
- import type { UnitSchema } from "./unit.js"
17
- export interface BaseBasisDeclaration extends BaseTypeDeclaration {
18
- kind: BasisKind
19
- }
20
- export declare abstract class BaseBasis<
21
- t,
22
- d extends BaseBasisDeclaration,
23
- $
24
- > extends BaseType<t, d, $> {
25
- abstract readonly expression: string
26
- abstract readonly compiledCondition: string
27
- abstract readonly compiledNegation: string
28
- abstract readonly errorContext: d["errorContext"]
29
- abstract literalKeys: Key[]
30
- rawKeyOf(): Type
31
- traverseApply: TraverseApply<d["prerequisite"]>
32
- compile(js: NodeCompiler): void
33
- }
34
- export type inferBasis<def extends Schema<BasisKind>> = isAny<def> extends true
35
- ? any
36
- : def extends NonEnumerableDomain
37
- ? inferDomain<def>
38
- : def extends Constructor<infer instance>
39
- ? instance
40
- : def extends DomainSchema<infer domain>
41
- ? inferDomain<domain>
42
- : def extends ProtoSchema<infer proto>
43
- ? instanceOf<proto>
44
- : def extends UnitSchema<infer is>
45
- ? is
46
- : never
47
- //# sourceMappingURL=basis.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"basis.d.ts","sourceRoot":"","sources":["../../types/basis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,WAAW,EACX,GAAG,EACH,mBAAmB,EACnB,WAAW,EACX,UAAU,EACV,KAAK,EACL,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,KAAK,mBAAmB,EAAE,KAAK,IAAI,EAAE,MAAM,WAAW,CAAA;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAE3C,MAAM,WAAW,oBAAqB,SAAQ,mBAAmB;IAChE,IAAI,EAAE,SAAS,CAAA;CACf;AAED,8BAAsB,SAAS,CAC9B,CAAC,EACD,CAAC,SAAS,oBAAoB,EAC9B,CAAC,CACA,SAAQ,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IACpC,QAAQ,CAAC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAA;IAC3C,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IAC1C,QAAQ,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC,cAAc,CAAC,CAAA;IACjD,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE,CAAA;IAE3B,QAAQ,IAAI,IAAI;IAIhB,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAI9C;IAED,OAAO,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI;CAG/B;AAED,MAAM,MAAM,UAAU,CAAC,GAAG,SAAS,MAAM,CAAC,SAAS,CAAC,IAEnD,KAAK,CAAC,GAAG,CAAC,SAAS,IAAI,GACpB,GAAG,GACH,GAAG,SAAS,mBAAmB,GAC/B,WAAW,CAAC,GAAG,CAAC,GAChB,GAAG,SAAS,WAAW,CAAC,MAAM,QAAQ,CAAC,GACvC,QAAQ,GACR,GAAG,SAAS,YAAY,CAAC,MAAM,MAAM,CAAC,GACtC,WAAW,CAAC,MAAM,CAAC,GACnB,GAAG,SAAS,WAAW,CAAC,MAAM,KAAK,CAAC,GACpC,UAAU,CAAC,KAAK,CAAC,GACjB,GAAG,SAAS,UAAU,CAAC,MAAM,EAAE,CAAC,GAChC,EAAE,GACF,KAAK,CAAA"}
@@ -1,15 +0,0 @@
1
- import { BaseType } from "./type.js"
2
- export class BaseBasis extends BaseType {
3
- rawKeyOf() {
4
- return this.$.parseUnits(...this.literalKeys)
5
- }
6
- traverseApply = (data, ctx) => {
7
- if (!this.traverseAllows(data, ctx)) {
8
- ctx.error(this.errorContext)
9
- }
10
- }
11
- compile(js) {
12
- js.compilePrimitive(this)
13
- }
14
- }
15
- //# sourceMappingURL=basis.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"basis.js","sourceRoot":"","sources":["../../types/basis.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,QAAQ,EAAuC,MAAM,WAAW,CAAA;AAOzE,MAAM,OAAgB,SAIpB,SAAQ,QAAiB;IAO1B,QAAQ;QACP,OAAO,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,CAAA;IAC9C,CAAC;IAED,aAAa,GAAqC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;QAC/D,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;YACrC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,YAAqB,CAAC,CAAA;QACtC,CAAC;IACF,CAAC,CAAA;IAED,OAAO,CAAC,EAAgB;QACvB,EAAE,CAAC,gBAAgB,CAAC,IAAa,CAAC,CAAA;IACnC,CAAC;CACD"}
@@ -1,34 +0,0 @@
1
- import {
2
- type Domain,
3
- type SerializedPrimitive,
4
- type evaluate
5
- } from "@arktype/util"
6
- import type { UnionChildNode } from "./union.js"
7
- export type CaseKey<kind extends DiscriminantKind = DiscriminantKind> =
8
- DiscriminantKind extends kind ? string : DiscriminantKinds[kind] | "default"
9
- export type Discriminant<kind extends DiscriminantKind = DiscriminantKind> =
10
- Readonly<{
11
- readonly path: string[]
12
- readonly kind: kind
13
- readonly cases: DiscriminatedCases<kind>
14
- readonly isPureRootLiteral: boolean
15
- }>
16
- export type DiscriminatedCases<
17
- kind extends DiscriminantKind = DiscriminantKind
18
- > = Readonly<{
19
- [caseKey in CaseKey<kind>]: Discriminant | UnionChildNode[]
20
- }>
21
- export type DiscriminantKinds = {
22
- domain: Domain
23
- value: SerializedPrimitive
24
- }
25
- export type DiscriminantKind = evaluate<keyof DiscriminantKinds>
26
- export declare const discriminate: (
27
- branches: readonly UnionChildNode[]
28
- ) => Discriminant | null
29
- export declare const writeUndiscriminableMorphUnionMessage: <
30
- path extends string
31
- >(
32
- path: path
33
- ) => `${string} union including one or more morphs must be discriminable`
34
- //# sourceMappingURL=discriminate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"discriminate.d.ts","sourceRoot":"","sources":["../../types/discriminate.ts"],"names":[],"mappings":"AAAA,OAAO,EAKN,KAAK,MAAM,EACX,KAAK,mBAAmB,EACxB,KAAK,QAAQ,EAGb,MAAM,eAAe,CAAA;AAEtB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,MAAM,MAAM,OAAO,CAAC,IAAI,SAAS,gBAAgB,GAAG,gBAAgB,IACnE,gBAAgB,SAAS,IAAI,GAAG,MAAM,GAAG,iBAAiB,CAAC,IAAI,CAAC,GAAG,SAAS,CAAA;AAE7E,MAAM,MAAM,YAAY,CAAC,IAAI,SAAS,gBAAgB,GAAG,gBAAgB,IACxE,QAAQ,CAAC;IACR,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAA;IACvB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;IACnB,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAA;IAExC,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAA;CACnC,CAAC,CAAA;AAEH,MAAM,MAAM,kBAAkB,CAC7B,IAAI,SAAS,gBAAgB,GAAG,gBAAgB,IAC7C,QAAQ,CAAC;KACX,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,YAAY,GAAG,cAAc,EAAE;CAC3D,CAAC,CAAA;AAQF,MAAM,MAAM,iBAAiB,GAAG;IAC/B,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,mBAAmB,CAAA;CAC1B,CAAA;AAOD,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC,MAAM,iBAAiB,CAAC,CAAA;AAehE,eAAO,MAAM,YAAY,aACd,SAAS,cAAc,EAAE,KACjC,YAAY,GAAG,IA8FjB,CAAA;AAGD,eAAO,MAAM,qCAAqC,2GAKmB,CAAA"}
@@ -1,120 +0,0 @@
1
- import {
2
- compileSerializedValue,
3
- entriesOf,
4
- isKeyOf,
5
- throwInternalError
6
- } from "@arktype/util"
7
- import { Disjoint } from "../shared/disjoint.js"
8
- const discriminantKinds = {
9
- domain: 1,
10
- value: 1
11
- }
12
- const parseDiscriminantKey = (key) => {
13
- const lastPathIndex = key.lastIndexOf("]")
14
- return [
15
- JSON.parse(key.slice(0, lastPathIndex + 1)),
16
- key.slice(lastPathIndex + 1)
17
- ]
18
- }
19
- const discriminantCache = new Map()
20
- export const discriminate = (branches) => {
21
- if (branches.length < 2) {
22
- return null
23
- }
24
- const cached = discriminantCache.get(branches)
25
- if (cached !== undefined) {
26
- return cached
27
- }
28
- // const pureValueBranches = branches.flatMap((branch) =>
29
- // branch.unit ? branch.unit : []
30
- // )
31
- // if (pureValueBranches.length === branches.length) {
32
- // const cases: DiscriminatedCases = transform(
33
- // pureValueBranches,
34
- // ([i, valueNode]) => [valueNode.serialized, [branches[i]]]
35
- // )
36
- // return {
37
- // path: [],
38
- // kind: "value",
39
- // cases,
40
- // isPureRootLiteral: true
41
- // }
42
- // }
43
- const casesBySpecifier = {}
44
- for (let lIndex = 0; lIndex < branches.length - 1; lIndex++) {
45
- const l = branches[lIndex]
46
- for (let rIndex = lIndex + 1; rIndex < branches.length; rIndex++) {
47
- const r = branches[rIndex]
48
- const result = l.intersect(r)
49
- if (!(result instanceof Disjoint)) {
50
- continue
51
- }
52
- for (const { path, kind, disjoint } of result.flat) {
53
- if (!isKeyOf(kind, discriminantKinds)) {
54
- continue
55
- }
56
- const qualifiedDiscriminant = `${path}${kind}`
57
- let lSerialized
58
- let rSerialized
59
- if (kind === "domain") {
60
- lSerialized = disjoint.l
61
- rSerialized = disjoint.r
62
- } else if (kind === "value") {
63
- lSerialized = compileSerializedValue(disjoint.l)
64
- rSerialized = compileSerializedValue(disjoint.r)
65
- } else {
66
- return throwInternalError(
67
- `Unexpected attempt to discriminate disjoint kind '${kind}'`
68
- )
69
- }
70
- if (!casesBySpecifier[qualifiedDiscriminant]) {
71
- casesBySpecifier[qualifiedDiscriminant] = {
72
- [lSerialized]: [l],
73
- [rSerialized]: [r]
74
- }
75
- continue
76
- }
77
- const cases = casesBySpecifier[qualifiedDiscriminant]
78
- if (!isKeyOf(lSerialized, cases)) {
79
- cases[lSerialized] = [l]
80
- } else if (!cases[lSerialized].includes(l)) {
81
- cases[lSerialized].push(l)
82
- }
83
- if (!isKeyOf(rSerialized, cases)) {
84
- cases[rSerialized] = [r]
85
- } else if (!cases[rSerialized].includes(r)) {
86
- cases[rSerialized].push(r)
87
- }
88
- }
89
- }
90
- }
91
- // TODO: determinstic? Update cache key?
92
- const bestDiscriminantEntry = entriesOf(casesBySpecifier)
93
- .sort((a, b) => Object.keys(a[1]).length - Object.keys(b[1]).length)
94
- .at(-1)
95
- if (!bestDiscriminantEntry) {
96
- discriminantCache.set(branches, null)
97
- return null
98
- }
99
- const [specifier, predicateCases] = bestDiscriminantEntry
100
- const [path, kind] = parseDiscriminantKey(specifier)
101
- const cases = {}
102
- for (const k in predicateCases) {
103
- const subdiscriminant = discriminate(predicateCases[k])
104
- cases[k] = subdiscriminant ?? predicateCases[k]
105
- }
106
- const discriminant = {
107
- kind,
108
- path,
109
- cases,
110
- isPureRootLiteral: false
111
- }
112
- discriminantCache.set(branches, discriminant)
113
- return discriminant
114
- }
115
- // TODO: if deeply includes morphs?
116
- export const writeUndiscriminableMorphUnionMessage = (path) =>
117
- `${
118
- path === "/" ? "A" : `At ${path}, a`
119
- } union including one or more morphs must be discriminable`
120
- //# sourceMappingURL=discriminate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"discriminate.js","sourceRoot":"","sources":["../../types/discriminate.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,sBAAsB,EACtB,SAAS,EACT,OAAO,EACP,kBAAkB,EAMlB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,QAAQ,EAAuB,MAAM,uBAAuB,CAAA;AAgCrE,MAAM,iBAAiB,GAA6B;IACnD,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,CAAC;CACR,CAAA;AAID,MAAM,oBAAoB,GAAG,CAAC,GAAoB,EAAE,EAAE;IACrD,MAAM,aAAa,GAAG,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;IAC1C,OAAO;QACN,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,GAAG,CAAC,C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A;IAChD,CAAC;IACD,MAAM,YAAY,GAAiB;QAClC,IAAI;QACJ,IAAI;QACJ,KAAK;QACL,iBAAiB,EAAE,KAAK;KACxB,CAAA;IACD,iBAAiB,CAAC,GAAG,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;IAC7C,OAAO,YAAY,CAAA;AACpB,CAAC,CAAA;AAED,mCAAmC;AACnC,MAAM,CAAC,MAAM,qCAAqC,GAAG,CACpD,IAAU,EACT,EAAE,CACH,GACC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,IAAI,KAChC,2DAAoE,CAAA"}
@@ -1,57 +0,0 @@
1
- import { type NonEnumerableDomain } from "@arktype/util"
2
- import type { BaseMeta, declareNode } from "../shared/declare.js"
3
- import type { TraverseAllows } from "../shared/traversal.js"
4
- import { BaseBasis } from "./basis.js"
5
- export interface DomainInner<
6
- domain extends NonEnumerableDomain = NonEnumerableDomain
7
- > extends BaseMeta {
8
- readonly domain: domain
9
- }
10
- export type DomainSchema<
11
- domain extends NonEnumerableDomain = NonEnumerableDomain
12
- > = domain | NormalizedDomainSchema<domain>
13
- export type NormalizedDomainSchema<
14
- domain extends NonEnumerableDomain = NonEnumerableDomain
15
- > = DomainInner<domain>
16
- export type DomainDeclaration = declareNode<{
17
- kind: "domain"
18
- schema: DomainSchema
19
- normalizedSchema: NormalizedDomainSchema
20
- inner: DomainInner
21
- errorContext: DomainInner
22
- }>
23
- export declare class DomainNode<t = any, $ = any> extends BaseBasis<
24
- t,
25
- DomainDeclaration,
26
- $
27
- > {
28
- static implementation: import("../shared/implement.js").nodeImplementationOf<{
29
- reducibleTo: "domain"
30
- intersectionIsOpen: false
31
- prerequisite: unknown
32
- childKind: never
33
- kind: "domain"
34
- schema: DomainSchema<
35
- "string" | "number" | "bigint" | "symbol" | "object"
36
- >
37
- normalizedSchema: NormalizedDomainSchema<
38
- "string" | "number" | "bigint" | "symbol" | "object"
39
- >
40
- inner: DomainInner<"string" | "number" | "bigint" | "symbol" | "object">
41
- errorContext: DomainInner<
42
- "string" | "number" | "bigint" | "symbol" | "object"
43
- > &
44
- import("../shared/declare.js").BaseErrorContext<"domain">
45
- }>
46
- traverseAllows: TraverseAllows
47
- readonly compiledCondition: string
48
- readonly compiledNegation: string
49
- readonly errorContext: {
50
- code: "domain"
51
- readonly domain: "string" | "number" | "bigint" | "symbol" | "object"
52
- readonly description?: string
53
- }
54
- readonly expression: "string" | "number" | "bigint" | "symbol" | "object"
55
- readonly literalKeys: import("@arktype/util").Key[]
56
- }
57
- //# sourceMappingURL=domain.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"domain.d.ts","sourceRoot":"","sources":["../../types/domain.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,KAAK,mBAAmB,EACxB,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAEjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAEtC,MAAM,WAAW,WAAW,CAC3B,MAAM,SAAS,mBAAmB,GAAG,mBAAmB,CACvD,SAAQ,QAAQ;IACjB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,MAAM,YAAY,CAEvB,MAAM,SAAS,mBAAmB,GAAG,mBAAmB,IACrD,MAAM,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAA;AAE3C,MAAM,MAAM,sBAAsB,CACjC,MAAM,SAAS,mBAAmB,GAAG,mBAAmB,IACrD,WAAW,CAAC,MAAM,CAAC,CAAA;AAEvB,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC;IAC3C,IAAI,EAAE,QAAQ,CAAA;IACd,MAAM,EAAE,YAAY,CAAA;IACpB,gBAAgB,EAAE,sBAAsB,CAAA;IACxC,KAAK,EAAE,WAAW,CAAA;IAClB,YAAY,EAAE,WAAW,CAAA;CACzB,CAAC,CAAA;AAEF,qBAAa,UAAU,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,CAAE,SAAQ,SAAS,CAC1D,CAAC,EACD,iBAAiB,EACjB,CAAC,CACD;IACA,MAAM,CAAC,cAAc;;;;;;;;;;OAsBnB;IAEF,cAAc,EAAE,cAAc,CAA2C;IAEzE,QAAQ,CAAC,iBAAiB,SAGY;IAEtC,QAAQ,CAAC,gBAAgB,SAGa;IAEtC,QAAQ,CAAC,YAAY;;;;MAAsC;IAC3D,QAAQ,CAAC,UAAU,uDAAc;IACjC,QAAQ,CAAC,WAAW,gCAAiC;CACrD"}
@@ -1,41 +0,0 @@
1
- import { domainDescriptions, domainOf, getBaseDomainKeys } from "@arktype/util"
2
- import { Disjoint } from "../shared/disjoint.js"
3
- import { BaseBasis } from "./basis.js"
4
- export class DomainNode extends BaseBasis {
5
- static implementation = this.implement({
6
- hasAssociatedError: true,
7
- collapsibleKey: "domain",
8
- keys: {
9
- domain: {}
10
- },
11
- normalize: (input) =>
12
- typeof input === "string" ? { domain: input } : input,
13
- defaults: {
14
- description(node) {
15
- return domainDescriptions[node.domain]
16
- },
17
- actual(data) {
18
- // don't treat boolean as a domain since it is union of units
19
- // and are error messages are more consistent if they're described
20
- // that way universally
21
- return typeof data === "boolean" ? `${data}` : domainOf(data)
22
- }
23
- },
24
- intersections: {
25
- domain: (l, r) => Disjoint.from("domain", l, r)
26
- }
27
- })
28
- traverseAllows = (data) => domainOf(data) === this.domain
29
- compiledCondition =
30
- this.domain === "object"
31
- ? `((typeof data === "object" && data !== null) || typeof data === "function")`
32
- : `typeof data === "${this.domain}"`
33
- compiledNegation =
34
- this.domain === "object"
35
- ? `((typeof data !== "object" || data === null) && typeof data !== "function")`
36
- : `typeof data !== "${this.domain}"`
37
- errorContext = this.createErrorContext(this.inner)
38
- expression = this.domain
39
- literalKeys = getBaseDomainKeys(this.domain)
40
- }
41
- //# sourceMappingURL=dom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KAAK,QAAQ;QACvB,CAAC,CAAC,6EAA6E;QAC/E,CAAC,CAAC,oBAAoB,IAAI,CAAC,MAAM,GAAG,CAAA;IAE7B,gBAAgB,GACxB,IAAI,CAAC,MAAM,KAAK,QAAQ;QACvB,CAAC,CAAC,6EAA6E;QAC/E,CAAC,CAAC,oBAAoB,IAAI,CAAC,MAAM,GAAG,CAAA;IAE7B,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAClD,UAAU,GAAG,IAAI,CAAC,MAAM,CAAA;IACxB,WAAW,GAAG,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA"}
@@ -1,127 +0,0 @@
1
- import { type evaluate, type listable } from "@arktype/util"
2
- import { type Node } from "../base.js"
3
- import {
4
- PropsGroup,
5
- type ExtraneousKeyBehavior,
6
- type ExtraneousKeyRestriction
7
- } from "../constraints/props/props.js"
8
- import type { Inner, Prerequisite, Schema } from "../kinds.js"
9
- import type { NodeCompiler } from "../shared/compile.js"
10
- import { type BaseMeta, type declareNode } from "../shared/declare.js"
11
- import type { ArkTypeError } from "../shared/errors.js"
12
- import {
13
- type ConstraintKind,
14
- type IntersectionChildKind,
15
- type OpenNodeKind,
16
- type nodeImplementationOf
17
- } from "../shared/implement.js"
18
- import type { TraverseAllows, TraverseApply } from "../shared/traversal.js"
19
- import type { DomainNode, DomainSchema } from "./domain.js"
20
- import type { ProtoNode, ProtoSchema } from "./proto.js"
21
- import { BaseType, type Type } from "./type.js"
22
- export type IntersectionBasisKind = "domain" | "proto"
23
- export type IntersectionInner = evaluate<
24
- BaseMeta & {
25
- domain?: DomainNode
26
- proto?: ProtoNode
27
- } & {
28
- [k in ConditionalIntersectionKey]?: conditionalInnerValueOfKey<k>
29
- }
30
- >
31
- export type IntersectionSchema<inferredBasis = any> = evaluate<
32
- BaseMeta & {
33
- domain?: DomainSchema
34
- proto?: ProtoSchema
35
- } & conditionalSchemaOf<inferredBasis>
36
- >
37
- export type IntersectionDeclaration = declareNode<{
38
- kind: "intersection"
39
- schema: IntersectionSchema
40
- normalizedSchema: IntersectionSchema
41
- inner: IntersectionInner
42
- reducibleTo: "intersection" | IntersectionBasisKind
43
- errorContext: {
44
- errors: readonly ArkTypeError[]
45
- }
46
- childKind: IntersectionChildKind
47
- }>
48
- export declare class IntersectionNode<t = unknown, $ = any> extends BaseType<
49
- t,
50
- IntersectionDeclaration,
51
- $
52
- > {
53
- static implementation: nodeImplementationOf<IntersectionDeclaration>
54
- readonly basis: ProtoNode<any, any> | DomainNode<any, any> | undefined
55
- readonly refinements: Node<
56
- | "regex"
57
- | "divisor"
58
- | "exactLength"
59
- | "max"
60
- | "min"
61
- | "maxLength"
62
- | "minLength"
63
- | "before"
64
- | "after"
65
- >[]
66
- readonly props: PropsGroup | undefined
67
- readonly traversables: readonly (
68
- | PropsGroup
69
- | Node<
70
- | "proto"
71
- | "domain"
72
- | "regex"
73
- | "divisor"
74
- | "exactLength"
75
- | "max"
76
- | "min"
77
- | "maxLength"
78
- | "minLength"
79
- | "before"
80
- | "after"
81
- | "predicate"
82
- >
83
- )[]
84
- readonly expression: string
85
- traverseAllows: TraverseAllows
86
- traverseApply: TraverseApply
87
- compile(js: NodeCompiler): void
88
- rawKeyOf(): Type
89
- }
90
- export type ConditionalTerminalIntersectionSchema = {
91
- onExtraneousKey?: ExtraneousKeyBehavior
92
- }
93
- export type ConditionalTerminalIntersectionInner = {
94
- onExtraneousKey?: ExtraneousKeyRestriction
95
- }
96
- type ConditionalTerminalIntersectionKey =
97
- keyof ConditionalTerminalIntersectionInner
98
- type ConditionalIntersectionKey =
99
- | ConstraintKind
100
- | keyof ConditionalTerminalIntersectionInner
101
- export type constraintKindOf<t> = {
102
- [k in ConstraintKind]: t extends Prerequisite<k> ? k : never
103
- }[ConstraintKind]
104
- type conditionalIntersectionKeyOf<t> =
105
- | constraintKindOf<t>
106
- | (t extends object ? "onExtraneousKey" : never)
107
- type intersectionChildSchemaValueOf<k extends IntersectionChildKind> =
108
- k extends OpenNodeKind
109
- ? listable<Schema<k> | Inner<k>>
110
- : Schema<k> | Inner<k>
111
- type conditionalSchemaValueOfKey<k extends ConditionalIntersectionKey> =
112
- k extends IntersectionChildKind
113
- ? intersectionChildSchemaValueOf<k>
114
- : ConditionalTerminalIntersectionSchema[k &
115
- ConditionalTerminalIntersectionKey]
116
- type intersectionChildInnerValueOf<k extends IntersectionChildKind> =
117
- k extends OpenNodeKind ? readonly Node<k>[] : Node<k>
118
- type conditionalInnerValueOfKey<k extends ConditionalIntersectionKey> =
119
- k extends IntersectionChildKind
120
- ? intersectionChildInnerValueOf<k>
121
- : ConditionalTerminalIntersectionInner[k &
122
- ConditionalTerminalIntersectionKey]
123
- export type conditionalSchemaOf<t> = {
124
- [k in conditionalIntersectionKeyOf<t>]?: conditionalSchemaValueOfKey<k>
125
- }
126
- export {}
127
- //# sourceMappingURL=intersection.d.ts.map