arktype 2.0.0-dev.7 → 2.0.0-dev.9

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 (414) hide show
  1. package/__tests__/array.test.ts +23 -25
  2. package/__tests__/config.test.ts +19 -8
  3. package/__tests__/examples.test.ts +3 -3
  4. package/__tests__/imports.test.ts +18 -12
  5. package/__tests__/instanceof.test.ts +7 -7
  6. package/__tests__/intersection.test.ts +2 -2
  7. package/__tests__/keyTraversal.test.ts +15 -15
  8. package/__tests__/keywords.test.ts +50 -37
  9. package/__tests__/literal.test.ts +30 -14
  10. package/__tests__/match.bench.ts +6 -6
  11. package/__tests__/narrow.test.ts +18 -24
  12. package/__tests__/objectLiteral.test.ts +134 -11
  13. package/__tests__/operator.bench.ts +4 -4
  14. package/__tests__/{morph.test.ts → pipe.test.ts} +136 -75
  15. package/__tests__/scope.test.ts +202 -15
  16. package/__tests__/traverse.test.ts +45 -36
  17. package/__tests__/type.test.ts +8 -10
  18. package/ark.ts +14 -11
  19. package/generic.ts +8 -6
  20. package/match.ts +59 -70
  21. package/out/ark.d.ts +5 -5
  22. package/out/ark.js +4 -5
  23. package/out/ark.js.map +1 -1
  24. package/out/generic.d.ts +0 -1
  25. package/out/generic.js +8 -7
  26. package/out/generic.js.map +1 -1
  27. package/out/main.d.ts +0 -1
  28. package/out/main.js +0 -1
  29. package/out/match.d.ts +0 -1
  30. package/out/match.js +50 -57
  31. package/out/match.js.map +1 -1
  32. package/out/module.d.ts +0 -1
  33. package/out/module.js +0 -1
  34. package/out/parser/definition.d.ts +1 -2
  35. package/out/parser/definition.js +0 -1
  36. package/out/parser/generic.d.ts +5 -6
  37. package/out/parser/generic.js +4 -6
  38. package/out/parser/generic.js.map +1 -1
  39. package/out/parser/objectLiteral.d.ts +1 -2
  40. package/out/parser/objectLiteral.js +17 -11
  41. package/out/parser/objectLiteral.js.map +1 -1
  42. package/out/parser/semantic/bounds.d.ts +1 -2
  43. package/out/parser/semantic/bounds.js +0 -1
  44. package/out/parser/semantic/divisor.d.ts +0 -1
  45. package/out/parser/semantic/divisor.js +0 -2
  46. package/out/parser/semantic/infer.d.ts +0 -1
  47. package/out/parser/semantic/infer.js +0 -2
  48. package/out/parser/semantic/utils.d.ts +0 -1
  49. package/out/parser/semantic/utils.js +0 -2
  50. package/out/parser/semantic/validate.d.ts +4 -5
  51. package/out/parser/semantic/validate.js +0 -1
  52. package/out/parser/semantic/validate.js.map +1 -1
  53. package/out/parser/string/reduce/dynamic.d.ts +0 -1
  54. package/out/parser/string/reduce/dynamic.js +4 -9
  55. package/out/parser/string/reduce/dynamic.js.map +1 -1
  56. package/out/parser/string/reduce/shared.d.ts +5 -18
  57. package/out/parser/string/reduce/shared.js +0 -1
  58. package/out/parser/string/reduce/static.d.ts +0 -1
  59. package/out/parser/string/reduce/static.js +0 -2
  60. package/out/parser/string/shift/operand/date.d.ts +2 -3
  61. package/out/parser/string/shift/operand/date.js +2 -5
  62. package/out/parser/string/shift/operand/date.js.map +1 -1
  63. package/out/parser/string/shift/operand/enclosed.d.ts +2 -17
  64. package/out/parser/string/shift/operand/enclosed.js +6 -9
  65. package/out/parser/string/shift/operand/enclosed.js.map +1 -1
  66. package/out/parser/string/shift/operand/genericArgs.d.ts +5 -6
  67. package/out/parser/string/shift/operand/genericArgs.js +4 -6
  68. package/out/parser/string/shift/operand/genericArgs.js.map +1 -1
  69. package/out/parser/string/shift/operand/operand.d.ts +0 -1
  70. package/out/parser/string/shift/operand/operand.js +0 -1
  71. package/out/parser/string/shift/operand/unenclosed.d.ts +6 -7
  72. package/out/parser/string/shift/operand/unenclosed.js +6 -13
  73. package/out/parser/string/shift/operand/unenclosed.js.map +1 -1
  74. package/out/parser/string/shift/operator/bounds.d.ts +1 -8
  75. package/out/parser/string/shift/operator/bounds.js +4 -9
  76. package/out/parser/string/shift/operator/bounds.js.map +1 -1
  77. package/out/parser/string/shift/operator/divisor.d.ts +1 -2
  78. package/out/parser/string/shift/operator/divisor.js +1 -3
  79. package/out/parser/string/shift/operator/divisor.js.map +1 -1
  80. package/out/parser/string/shift/operator/operator.d.ts +1 -2
  81. package/out/parser/string/shift/operator/operator.js +0 -1
  82. package/out/parser/string/shift/scanner.d.ts +0 -1
  83. package/out/parser/string/shift/scanner.js +2 -5
  84. package/out/parser/string/shift/scanner.js.map +1 -1
  85. package/out/parser/string/string.d.ts +0 -1
  86. package/out/parser/string/string.js +1 -3
  87. package/out/parser/string/string.js.map +1 -1
  88. package/out/parser/tuple.d.ts +1 -2
  89. package/out/parser/tuple.js +12 -16
  90. package/out/parser/tuple.js.map +1 -1
  91. package/out/scope.d.ts +12 -12
  92. package/out/scope.js +16 -38
  93. package/out/scope.js.map +1 -1
  94. package/out/type.d.ts +38 -19
  95. package/out/type.js +32 -2
  96. package/out/type.js.map +1 -1
  97. package/package.json +6 -4
  98. package/parser/generic.ts +13 -14
  99. package/parser/objectLiteral.ts +25 -11
  100. package/parser/semantic/validate.ts +2 -3
  101. package/parser/string/reduce/dynamic.ts +7 -10
  102. package/parser/string/shift/operand/date.ts +3 -6
  103. package/parser/string/shift/operand/enclosed.ts +8 -8
  104. package/parser/string/shift/operand/genericArgs.ts +8 -8
  105. package/parser/string/shift/operand/unenclosed.ts +15 -25
  106. package/parser/string/shift/operator/bounds.ts +7 -9
  107. package/parser/string/shift/operator/divisor.ts +2 -3
  108. package/parser/string/shift/scanner.ts +2 -4
  109. package/parser/string/string.ts +2 -3
  110. package/parser/tuple.ts +15 -16
  111. package/scope.ts +39 -57
  112. package/type.ts +151 -35
  113. package/__tests__/cyclic.test.ts +0 -148
  114. package/out/ark.d.ts.map +0 -1
  115. package/out/base.d.ts +0 -205
  116. package/out/base.d.ts.map +0 -1
  117. package/out/base.js +0 -320
  118. package/out/base.js.map +0 -1
  119. package/out/builtins/builtins.d.ts +0 -23
  120. package/out/builtins/builtins.d.ts.map +0 -1
  121. package/out/builtins/builtins.js +0 -15
  122. package/out/builtins/builtins.js.map +0 -1
  123. package/out/builtins/jsObjects.d.ts +0 -19
  124. package/out/builtins/jsObjects.d.ts.map +0 -1
  125. package/out/builtins/jsObjects.js +0 -18
  126. package/out/builtins/jsObjects.js.map +0 -1
  127. package/out/builtins/parsing.d.ts +0 -16
  128. package/out/builtins/parsing.d.ts.map +0 -1
  129. package/out/builtins/parsing.js +0 -62
  130. package/out/builtins/parsing.js.map +0 -1
  131. package/out/builtins/tsGenerics.d.ts +0 -2
  132. package/out/builtins/tsGenerics.d.ts.map +0 -1
  133. package/out/builtins/tsGenerics.js +0 -26
  134. package/out/builtins/tsGenerics.js.map +0 -1
  135. package/out/builtins/tsKeywords.d.ts +0 -23
  136. package/out/builtins/tsKeywords.d.ts.map +0 -1
  137. package/out/builtins/tsKeywords.js +0 -23
  138. package/out/builtins/tsKeywords.js.map +0 -1
  139. package/out/builtins/utils/creditCard.d.ts +0 -3
  140. package/out/builtins/utils/creditCard.d.ts.map +0 -1
  141. package/out/builtins/utils/creditCard.js +0 -35
  142. package/out/builtins/utils/creditCard.js.map +0 -1
  143. package/out/builtins/utils/date.d.ts +0 -41
  144. package/out/builtins/utils/date.d.ts.map +0 -1
  145. package/out/builtins/utils/date.js +0 -56
  146. package/out/builtins/utils/date.js.map +0 -1
  147. package/out/builtins/validation.d.ts +0 -19
  148. package/out/builtins/validation.d.ts.map +0 -1
  149. package/out/builtins/validation.js +0 -74
  150. package/out/builtins/validation.js.map +0 -1
  151. package/out/config.d.ts +0 -9
  152. package/out/config.d.ts.map +0 -1
  153. package/out/config.js +0 -18
  154. package/out/config.js.map +0 -1
  155. package/out/constraints/ast.d.ts +0 -287
  156. package/out/constraints/ast.d.ts.map +0 -1
  157. package/out/constraints/ast.js +0 -2
  158. package/out/constraints/ast.js.map +0 -1
  159. package/out/constraints/constraint.d.ts +0 -200
  160. package/out/constraints/constraint.d.ts.map +0 -1
  161. package/out/constraints/constraint.js +0 -25
  162. package/out/constraints/constraint.js.map +0 -1
  163. package/out/constraints/predicate.d.ts +0 -64
  164. package/out/constraints/predicate.d.ts.map +0 -1
  165. package/out/constraints/predicate.js +0 -52
  166. package/out/constraints/predicate.js.map +0 -1
  167. package/out/constraints/props/index.d.ts +0 -42
  168. package/out/constraints/props/index.d.ts.map +0 -1
  169. package/out/constraints/props/index.js +0 -56
  170. package/out/constraints/props/index.js.map +0 -1
  171. package/out/constraints/props/optional.d.ts +0 -37
  172. package/out/constraints/props/optional.d.ts.map +0 -1
  173. package/out/constraints/props/optional.js +0 -56
  174. package/out/constraints/props/optional.js.map +0 -1
  175. package/out/constraints/props/prop.d.ts +0 -49
  176. package/out/constraints/props/prop.d.ts.map +0 -1
  177. package/out/constraints/props/prop.js +0 -106
  178. package/out/constraints/props/prop.js.map +0 -1
  179. package/out/constraints/props/props.d.ts +0 -37
  180. package/out/constraints/props/props.d.ts.map +0 -1
  181. package/out/constraints/props/props.js +0 -121
  182. package/out/constraints/props/props.js.map +0 -1
  183. package/out/constraints/props/required.d.ts +0 -46
  184. package/out/constraints/props/required.d.ts.map +0 -1
  185. package/out/constraints/props/required.js +0 -81
  186. package/out/constraints/props/required.js.map +0 -1
  187. package/out/constraints/props/sequence.d.ts +0 -82
  188. package/out/constraints/props/sequence.d.ts.map +0 -1
  189. package/out/constraints/props/sequence.js +0 -376
  190. package/out/constraints/props/sequence.js.map +0 -1
  191. package/out/constraints/props/shared.d.ts +0 -3
  192. package/out/constraints/props/shared.d.ts.map +0 -1
  193. package/out/constraints/props/shared.js +0 -4
  194. package/out/constraints/props/shared.js.map +0 -1
  195. package/out/constraints/refinements/after.d.ts +0 -33
  196. package/out/constraints/refinements/after.d.ts.map +0 -1
  197. package/out/constraints/refinements/after.js +0 -36
  198. package/out/constraints/refinements/after.js.map +0 -1
  199. package/out/constraints/refinements/before.d.ts +0 -33
  200. package/out/constraints/refinements/before.d.ts.map +0 -1
  201. package/out/constraints/refinements/before.js +0 -43
  202. package/out/constraints/refinements/before.js.map +0 -1
  203. package/out/constraints/refinements/divisor.d.ts +0 -52
  204. package/out/constraints/refinements/divisor.d.ts.map +0 -1
  205. package/out/constraints/refinements/divisor.js +0 -52
  206. package/out/constraints/refinements/divisor.js.map +0 -1
  207. package/out/constraints/refinements/exactLength.d.ts +0 -45
  208. package/out/constraints/refinements/exactLength.d.ts.map +0 -1
  209. package/out/constraints/refinements/exactLength.js +0 -52
  210. package/out/constraints/refinements/exactLength.js.map +0 -1
  211. package/out/constraints/refinements/kinds.d.ts +0 -29
  212. package/out/constraints/refinements/kinds.d.ts.map +0 -1
  213. package/out/constraints/refinements/kinds.js +0 -17
  214. package/out/constraints/refinements/kinds.js.map +0 -1
  215. package/out/constraints/refinements/length.d.ts +0 -48
  216. package/out/constraints/refinements/length.d.ts.map +0 -1
  217. package/out/constraints/refinements/length.js +0 -53
  218. package/out/constraints/refinements/length.js.map +0 -1
  219. package/out/constraints/refinements/max.d.ts +0 -31
  220. package/out/constraints/refinements/max.d.ts.map +0 -1
  221. package/out/constraints/refinements/max.js +0 -35
  222. package/out/constraints/refinements/max.js.map +0 -1
  223. package/out/constraints/refinements/maxLength.d.ts +0 -32
  224. package/out/constraints/refinements/maxLength.d.ts.map +0 -1
  225. package/out/constraints/refinements/maxLength.js +0 -36
  226. package/out/constraints/refinements/maxLength.js.map +0 -1
  227. package/out/constraints/refinements/min.d.ts +0 -31
  228. package/out/constraints/refinements/min.d.ts.map +0 -1
  229. package/out/constraints/refinements/min.js +0 -28
  230. package/out/constraints/refinements/min.js.map +0 -1
  231. package/out/constraints/refinements/minLength.d.ts +0 -32
  232. package/out/constraints/refinements/minLength.d.ts.map +0 -1
  233. package/out/constraints/refinements/minLength.js +0 -33
  234. package/out/constraints/refinements/minLength.js.map +0 -1
  235. package/out/constraints/refinements/range.d.ts +0 -119
  236. package/out/constraints/refinements/range.d.ts.map +0 -1
  237. package/out/constraints/refinements/range.js +0 -89
  238. package/out/constraints/refinements/range.js.map +0 -1
  239. package/out/constraints/refinements/regex.d.ts +0 -47
  240. package/out/constraints/refinements/regex.d.ts.map +0 -1
  241. package/out/constraints/refinements/regex.js +0 -37
  242. package/out/constraints/refinements/regex.js.map +0 -1
  243. package/out/constraints/refinements/shared.d.ts +0 -20
  244. package/out/constraints/refinements/shared.d.ts.map +0 -1
  245. package/out/constraints/refinements/shared.js +0 -10
  246. package/out/constraints/refinements/shared.js.map +0 -1
  247. package/out/generic.d.ts.map +0 -1
  248. package/out/inference.d.ts +0 -137
  249. package/out/inference.d.ts.map +0 -1
  250. package/out/inference.js +0 -73
  251. package/out/inference.js.map +0 -1
  252. package/out/keywords/ark.d.ts +0 -70
  253. package/out/keywords/ark.d.ts.map +0 -1
  254. package/out/keywords/ark.js +0 -29
  255. package/out/keywords/ark.js.map +0 -1
  256. package/out/keywords/internal.d.ts +0 -13
  257. package/out/keywords/internal.d.ts.map +0 -1
  258. package/out/keywords/internal.js +0 -13
  259. package/out/keywords/internal.js.map +0 -1
  260. package/out/keywords/jsObject.d.ts +0 -20
  261. package/out/keywords/jsObject.d.ts.map +0 -1
  262. package/out/keywords/jsObject.js +0 -18
  263. package/out/keywords/jsObject.js.map +0 -1
  264. package/out/keywords/parsing.d.ts +0 -17
  265. package/out/keywords/parsing.d.ts.map +0 -1
  266. package/out/keywords/parsing.js +0 -64
  267. package/out/keywords/parsing.js.map +0 -1
  268. package/out/keywords/root.d.ts +0 -7
  269. package/out/keywords/root.d.ts.map +0 -1
  270. package/out/keywords/root.js +0 -4
  271. package/out/keywords/root.js.map +0 -1
  272. package/out/keywords/tsGenerics.d.ts +0 -2
  273. package/out/keywords/tsGenerics.d.ts.map +0 -1
  274. package/out/keywords/tsGenerics.js +0 -26
  275. package/out/keywords/tsGenerics.js.map +0 -1
  276. package/out/keywords/tsPrimitive.d.ts +0 -24
  277. package/out/keywords/tsPrimitive.d.ts.map +0 -1
  278. package/out/keywords/tsPrimitive.js +0 -25
  279. package/out/keywords/tsPrimitive.js.map +0 -1
  280. package/out/keywords/utils/creditCard.d.ts +0 -11
  281. package/out/keywords/utils/creditCard.d.ts.map +0 -1
  282. package/out/keywords/utils/creditCard.js +0 -35
  283. package/out/keywords/utils/creditCard.js.map +0 -1
  284. package/out/keywords/utils/date.d.ts +0 -45
  285. package/out/keywords/utils/date.d.ts.map +0 -1
  286. package/out/keywords/utils/date.js +0 -56
  287. package/out/keywords/utils/date.js.map +0 -1
  288. package/out/keywords/validation.d.ts +0 -20
  289. package/out/keywords/validation.d.ts.map +0 -1
  290. package/out/keywords/validation.js +0 -80
  291. package/out/keywords/validation.js.map +0 -1
  292. package/out/kinds.d.ts +0 -102
  293. package/out/kinds.d.ts.map +0 -1
  294. package/out/kinds.js +0 -29
  295. package/out/kinds.js.map +0 -1
  296. package/out/main.d.ts.map +0 -1
  297. package/out/match.d.ts.map +0 -1
  298. package/out/module.d.ts.map +0 -1
  299. package/out/parse.d.ts +0 -29
  300. package/out/parse.d.ts.map +0 -1
  301. package/out/parse.js +0 -161
  302. package/out/parse.js.map +0 -1
  303. package/out/parser/definition.d.ts.map +0 -1
  304. package/out/parser/generic.d.ts.map +0 -1
  305. package/out/parser/objectLiteral.d.ts.map +0 -1
  306. package/out/parser/semantic/bounds.d.ts.map +0 -1
  307. package/out/parser/semantic/divisor.d.ts.map +0 -1
  308. package/out/parser/semantic/infer.d.ts.map +0 -1
  309. package/out/parser/semantic/utils.d.ts.map +0 -1
  310. package/out/parser/semantic/validate.d.ts.map +0 -1
  311. package/out/parser/string/reduce/dynamic.d.ts.map +0 -1
  312. package/out/parser/string/reduce/shared.d.ts.map +0 -1
  313. package/out/parser/string/reduce/static.d.ts.map +0 -1
  314. package/out/parser/string/shift/operand/date.d.ts.map +0 -1
  315. package/out/parser/string/shift/operand/enclosed.d.ts.map +0 -1
  316. package/out/parser/string/shift/operand/genericArgs.d.ts.map +0 -1
  317. package/out/parser/string/shift/operand/operand.d.ts.map +0 -1
  318. package/out/parser/string/shift/operand/unenclosed.d.ts.map +0 -1
  319. package/out/parser/string/shift/operator/bounds.d.ts.map +0 -1
  320. package/out/parser/string/shift/operator/divisor.d.ts.map +0 -1
  321. package/out/parser/string/shift/operator/operator.d.ts.map +0 -1
  322. package/out/parser/string/shift/scanner.d.ts.map +0 -1
  323. package/out/parser/string/string.d.ts.map +0 -1
  324. package/out/parser/tuple.d.ts.map +0 -1
  325. package/out/schema.d.ts +0 -175
  326. package/out/schema.d.ts.map +0 -1
  327. package/out/schema.js +0 -73
  328. package/out/schema.js.map +0 -1
  329. package/out/schemaScope.d.ts +0 -180
  330. package/out/schemaScope.d.ts.map +0 -1
  331. package/out/schemaScope.js +0 -235
  332. package/out/schemaScope.js.map +0 -1
  333. package/out/scope.d.ts.map +0 -1
  334. package/out/shared/compile.d.ts +0 -22
  335. package/out/shared/compile.d.ts.map +0 -1
  336. package/out/shared/compile.js +0 -79
  337. package/out/shared/compile.js.map +0 -1
  338. package/out/shared/context.d.ts +0 -54
  339. package/out/shared/context.d.ts.map +0 -1
  340. package/out/shared/context.js +0 -53
  341. package/out/shared/context.js.map +0 -1
  342. package/out/shared/declare.d.ts +0 -69
  343. package/out/shared/declare.d.ts.map +0 -1
  344. package/out/shared/declare.js +0 -2
  345. package/out/shared/declare.js.map +0 -1
  346. package/out/shared/disjoint.d.ts +0 -91
  347. package/out/shared/disjoint.d.ts.map +0 -1
  348. package/out/shared/disjoint.js +0 -110
  349. package/out/shared/disjoint.js.map +0 -1
  350. package/out/shared/errors.d.ts +0 -99
  351. package/out/shared/errors.d.ts.map +0 -1
  352. package/out/shared/errors.js +0 -108
  353. package/out/shared/errors.js.map +0 -1
  354. package/out/shared/implement.d.ts +0 -363
  355. package/out/shared/implement.d.ts.map +0 -1
  356. package/out/shared/implement.js +0 -68
  357. package/out/shared/implement.js.map +0 -1
  358. package/out/shared/inference.d.ts +0 -6
  359. package/out/shared/inference.d.ts.map +0 -1
  360. package/out/shared/inference.js +0 -5
  361. package/out/shared/inference.js.map +0 -1
  362. package/out/shared/intersections.d.ts +0 -60
  363. package/out/shared/intersections.d.ts.map +0 -1
  364. package/out/shared/intersections.js +0 -2
  365. package/out/shared/intersections.js.map +0 -1
  366. package/out/shared/traversal.d.ts +0 -62
  367. package/out/shared/traversal.d.ts.map +0 -1
  368. package/out/shared/traversal.js +0 -97
  369. package/out/shared/traversal.js.map +0 -1
  370. package/out/shared/utils.d.ts +0 -24
  371. package/out/shared/utils.d.ts.map +0 -1
  372. package/out/shared/utils.js +0 -15
  373. package/out/shared/utils.js.map +0 -1
  374. package/out/type.d.ts.map +0 -1
  375. package/out/types/basis.d.ts +0 -47
  376. package/out/types/basis.d.ts.map +0 -1
  377. package/out/types/basis.js +0 -15
  378. package/out/types/basis.js.map +0 -1
  379. package/out/types/discriminate.d.ts +0 -34
  380. package/out/types/discriminate.d.ts.map +0 -1
  381. package/out/types/discriminate.js +0 -120
  382. package/out/types/discriminate.js.map +0 -1
  383. package/out/types/domain.d.ts +0 -57
  384. package/out/types/domain.d.ts.map +0 -1
  385. package/out/types/domain.js +0 -41
  386. package/out/types/domain.js.map +0 -1
  387. package/out/types/intersection.d.ts +0 -127
  388. package/out/types/intersection.d.ts.map +0 -1
  389. package/out/types/intersection.js +0 -379
  390. package/out/types/intersection.js.map +0 -1
  391. package/out/types/morph.d.ts +0 -157
  392. package/out/types/morph.d.ts.map +0 -1
  393. package/out/types/morph.js +0 -99
  394. package/out/types/morph.js.map +0 -1
  395. package/out/types/proto.d.ts +0 -51
  396. package/out/types/proto.d.ts.map +0 -1
  397. package/out/types/proto.js +0 -60
  398. package/out/types/proto.js.map +0 -1
  399. package/out/types/type.d.ts +0 -143
  400. package/out/types/type.d.ts.map +0 -1
  401. package/out/types/type.js +0 -123
  402. package/out/types/type.js.map +0 -1
  403. package/out/types/union.d.ts +0 -71
  404. package/out/types/union.d.ts.map +0 -1
  405. package/out/types/union.js +0 -379
  406. package/out/types/union.js.map +0 -1
  407. package/out/types/unit.d.ts +0 -45
  408. package/out/types/unit.d.ts.map +0 -1
  409. package/out/types/unit.js +0 -56
  410. package/out/types/unit.js.map +0 -1
  411. package/out/util.d.ts +0 -31
  412. package/out/util.d.ts.map +0 -1
  413. package/out/util.js +0 -8
  414. package/out/util.js.map +0 -1
@@ -1,52 +0,0 @@
1
- import {
2
- BasePrimitiveConstraint,
3
- writeInvalidOperandMessage
4
- } from "../constraint.js"
5
- export class DivisorNode extends BasePrimitiveConstraint {
6
- static implementation = this.implement({
7
- collapsibleKey: "rule",
8
- keys: {
9
- rule: {}
10
- },
11
- normalize: (schema) =>
12
- typeof schema === "number" ? { rule: schema } : schema,
13
- intersections: {
14
- divisor: (l, r, $) =>
15
- $.node("divisor", {
16
- rule: Math.abs(
17
- (l.rule * r.rule) /
18
- greatestCommonDivisor(l.rule, r.rule)
19
- )
20
- })
21
- },
22
- hasAssociatedError: true,
23
- defaults: {
24
- description(node) {
25
- return node.rule === 1
26
- ? "an integer"
27
- : `a multiple of ${node.rule}`
28
- }
29
- }
30
- })
31
- traverseAllows = (data) => data % this.rule === 0
32
- compiledCondition = `data % ${this.rule} === 0`
33
- compiledNegation = `data % ${this.rule} !== 0`
34
- impliedBasis = this.$.keywords.number
35
- errorContext = this.createErrorContext(this.inner)
36
- expression = `% ${this.rule}`
37
- }
38
- export const writeIndivisibleMessage = (t) =>
39
- writeInvalidOperandMessage("divisor", t.$.keywords.number, t)
40
- // https://en.wikipedia.org/wiki/Euclidean_algorithm
41
- const greatestCommonDivisor = (l, r) => {
42
- let previous
43
- let greatestCommonDivisor = l
44
- let current = r
45
- while (current !== 0) {
46
- previous = current
47
- current = greatestCommonDivisor % current
48
- greatestCommonDivisor = previous
49
- }
50
- return greatestCommonDivisor
51
- }
52
- //# sourceMappingURL=divisor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"divisor.js","sourceRoot":"","sources":["../../../constraints/refinements/divisor.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,uBAAuB,EACvB,0BAA0B,EAC1B,MAAM,kBAAkB,CAAA;AAiBzB,MAAM,OAAO,WAAY,SAAQ,uBAA2C;IAC3E,MAAM,CAAC,cAAc,GAAG,IAAI,C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EACyB,EAAE,CAClC,0BAA0B,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;AAK9D,oDAAoD;AACpD,MAAM,qBAAqB,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE;IACtD,IAAI,QAAgB,CAAA;IACpB,IAAI,qBAAqB,GAAG,CAAC,CAAA;IAC7B,IAAI,OAAO,GAAG,CAAC,CAAA;IACf,OAAO,OAAO,KAAK,CAAC,EAAE,CAAC;QACtB,QAAQ,GAAG,OAAO,CAAA;QAClB,OAAO,GAAG,qBAAqB,GAAG,OAAO,CAAA;QACzC,qBAAqB,GAAG,QAAQ,CAAA;IACjC,CAAC;IACD,OAAO,qBAAqB,CAAA;AAC7B,CAAC,CAAA"}
@@ -1,45 +0,0 @@
1
- import type { BaseMeta, declareNode } from "../../shared/declare.js"
2
- import type { TraverseAllows } from "../../shared/traversal.js"
3
- import { BasePrimitiveConstraint } from "../constraint.js"
4
- import type { LengthBoundableData } from "./range.js"
5
- export interface ExactLengthInner extends BaseMeta {
6
- readonly rule: number
7
- }
8
- export type NormalizedExactLengthSchema = ExactLengthInner
9
- export type ExactLengthSchema = NormalizedExactLengthSchema | number
10
- export type ExactLengthDeclaration = declareNode<{
11
- kind: "exactLength"
12
- schema: ExactLengthSchema
13
- normalizedSchema: NormalizedExactLengthSchema
14
- inner: ExactLengthInner
15
- prerequisite: LengthBoundableData
16
- errorContext: ExactLengthInner
17
- }>
18
- export declare class ExactLengthNode extends BasePrimitiveConstraint<ExactLengthDeclaration> {
19
- static implementation: import("../../shared/implement.js").nodeImplementationOf<{
20
- reducibleTo: "exactLength"
21
- intersectionIsOpen: false
22
- childKind: never
23
- kind: "exactLength"
24
- schema: ExactLengthSchema
25
- normalizedSchema: ExactLengthInner
26
- inner: ExactLengthInner
27
- prerequisite: LengthBoundableData
28
- errorContext: ExactLengthInner &
29
- import("../../shared/declare.js").BaseErrorContext<"exactLength">
30
- }>
31
- traverseAllows: TraverseAllows<LengthBoundableData>
32
- readonly compiledCondition: string
33
- readonly compiledNegation: string
34
- readonly impliedBasis: import("../../main.js").Type<
35
- string | unknown[],
36
- import("../../keywords/internal.js").internalPrimitive.exports
37
- >
38
- readonly errorContext: {
39
- code: "exactLength"
40
- readonly rule: number
41
- readonly description?: string
42
- }
43
- readonly expression: string
44
- }
45
- //# sourceMappingURL=exactLength.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"exactLength.d.ts","sourceRoot":"","sources":["../../../constraints/refinements/exactLength.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAErD,MAAM,WAAW,gBAAiB,SAAQ,QAAQ;IACjD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,MAAM,2BAA2B,GAAG,gBAAgB,CAAA;AAE1D,MAAM,MAAM,iBAAiB,GAAG,2BAA2B,GAAG,MAAM,CAAA;AAEpE,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC;IAChD,IAAI,EAAE,aAAa,CAAA;IACnB,MAAM,EAAE,iBAAiB,CAAA;IACzB,gBAAgB,EAAE,2BAA2B,CAAA;IAC7C,KAAK,EAAE,gBAAgB,CAAA;IACvB,YAAY,EAAE,mBAAmB,CAAA;IACjC,YAAY,EAAE,gBAAgB,CAAA;CAC9B,CAAC,CAAA;AAEF,qBAAa,eAAgB,SAAQ,uBAAuB,CAAC,sBAAsB,CAAC;IACnF,MAAM,CAAC,cAAc;;;;;;;;;;OAwCnB;IAEF,cAAc,EAAE,cAAc,CAAC,mBAAmB,CAAC,CACzB;IAE1B,QAAQ,CAAC,iBAAiB,SAAiC;IAC3D,QAAQ,CAAC,gBAAgB,SAAiC;IAC1D,QAAQ,CAAC,YAAY,mHAAkC;IACvD,QAAQ,CAAC,YAAY;;;;MAAsC;IAC3D,QAAQ,CAAC,UAAU,SAA6B;CAChD"}
@@ -1,52 +0,0 @@
1
- import { Disjoint } from "../../shared/disjoint.js"
2
- import { BasePrimitiveConstraint } from "../constraint.js"
3
- export class ExactLengthNode extends BasePrimitiveConstraint {
4
- static implementation = this.implement({
5
- collapsibleKey: "rule",
6
- keys: {
7
- rule: {}
8
- },
9
- normalize: (schema) =>
10
- typeof schema === "number" ? { rule: schema } : schema,
11
- intersections: {
12
- exactLength: (l, r) =>
13
- new Disjoint({
14
- "[length]": {
15
- unit: {
16
- l: l.$.node("unit", { unit: l.rule }),
17
- r: r.$.node("unit", { unit: r.rule })
18
- }
19
- }
20
- }),
21
- minLength: (exactLength, minLength) =>
22
- (
23
- minLength.exclusive
24
- ? exactLength.rule > minLength.rule
25
- : exactLength.rule >= minLength.rule
26
- )
27
- ? exactLength
28
- : Disjoint.from("range", exactLength, minLength),
29
- maxLength: (exactLength, maxLength) =>
30
- (
31
- maxLength.exclusive
32
- ? exactLength.rule < maxLength.rule
33
- : exactLength.rule <= maxLength.rule
34
- )
35
- ? exactLength
36
- : Disjoint.from("range", exactLength, maxLength)
37
- },
38
- hasAssociatedError: true,
39
- defaults: {
40
- description(node) {
41
- return `exactly length ${node.rule}`
42
- }
43
- }
44
- })
45
- traverseAllows = (data) => data.length === this.rule
46
- compiledCondition = `data.length === ${this.rule}`
47
- compiledNegation = `data.length !== ${this.rule}`
48
- impliedBasis = this.$.keywords.lengthBoundable
49
- errorContext = this.createErrorContext(this.inner)
50
- expression = `{ length: ${this.rule} }`
51
- }
52
- //# sourceMappingURL=exactLength.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"exactLength.js","sourceRoot":"","sources":["../../../constraints/refinements/exactLength.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAA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AC,IAAI;gBACnC,CAAC,CAAC,WAAW,CAAC,IAAI,IAAI,SAAS,CAAC,IAAI,CACrC;gBACA,CAAC,CAAC,WAAW;gBACb,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,CAAC;SAClD;QACD,kBAAkB,EAAE,IAAI;QACxB,QAAQ,EAAE;YACT,WAAW,CAAC,IAAI;gBACf,OAAO,kBAAkB,IAAI,CAAC,IAAI,EAAE,CAAA;YACrC,CAAC;SACD;KACD,CAAC,CAAA;IAEF,cAAc,GAAwC,CAAC,IAAI,EAAE,EAAE,CAC9D,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,CAAA;IAEjB,iBAAiB,GAAG,mBAAmB,IAAI,CAAC,IAAI,EAAE,CAAA;IAClD,gBAAgB,GAAG,mBAAmB,IAAI,CAAC,IAAI,EAAE,CAAA;IACjD,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAA;IAC9C,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAClD,UAAU,GAAG,aAAa,IAAI,CAAC,IAAI,IAAI,CAAA"}
@@ -1,29 +0,0 @@
1
- import { AfterNode, type AfterDeclaration } from "./after.js"
2
- import { BeforeNode, type BeforeDeclaration } from "./before.js"
3
- import { ExactLengthNode, type ExactLengthDeclaration } from "./exactLength.js"
4
- import { MaxNode, type MaxDeclaration } from "./max.js"
5
- import { MaxLengthNode, type MaxLengthDeclaration } from "./maxLength.js"
6
- import { MinNode, type MinDeclaration } from "./min.js"
7
- import { MinLengthNode, type MinLengthDeclaration } from "./minLength.js"
8
- export interface BoundDeclarations {
9
- min: MinDeclaration
10
- max: MaxDeclaration
11
- minLength: MinLengthDeclaration
12
- maxLength: MaxLengthDeclaration
13
- exactLength: ExactLengthDeclaration
14
- after: AfterDeclaration
15
- before: BeforeDeclaration
16
- }
17
- export declare const BoundNodes: {
18
- min: typeof MinNode
19
- max: typeof MaxNode
20
- minLength: typeof MinLengthNode
21
- maxLength: typeof MaxLengthNode
22
- exactLength: typeof ExactLengthNode
23
- after: typeof AfterNode
24
- before: typeof BeforeNode
25
- }
26
- export type BoundNodesByKind = {
27
- [k in keyof typeof BoundNodes]: InstanceType<(typeof BoundNodes)[k]>
28
- }
29
- //# sourceMappingURL=kinds.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"kinds.d.ts","sourceRoot":"","sources":["../../../constraints/refinements/kinds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAChE,OAAO,EAAE,eAAe,EAAE,KAAK,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAC/E,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAA;AACvD,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAA;AACvD,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAEzE,MAAM,WAAW,iBAAiB;IACjC,GAAG,EAAE,cAAc,CAAA;IACnB,GAAG,EAAE,cAAc,CAAA;IACnB,SAAS,EAAE,oBAAoB,CAAA;IAC/B,SAAS,EAAE,oBAAoB,CAAA;IAC/B,WAAW,EAAE,sBAAsB,CAAA;IACnC,KAAK,EAAE,gBAAgB,CAAA;IACvB,MAAM,EAAE,iBAAiB,CAAA;CACzB;AAED,eAAO,MAAM,UAAU;;;;;;;;CAQtB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;KAC7B,CAAC,IAAI,MAAM,OAAO,UAAU,GAAG,YAAY,CAAC,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;CACpE,CAAA"}
@@ -1,17 +0,0 @@
1
- import { AfterNode } from "./after.js"
2
- import { BeforeNode } from "./before.js"
3
- import { ExactLengthNode } from "./exactLength.js"
4
- import { MaxNode } from "./max.js"
5
- import { MaxLengthNode } from "./maxLength.js"
6
- import { MinNode } from "./min.js"
7
- import { MinLengthNode } from "./minLength.js"
8
- export const BoundNodes = {
9
- min: MinNode,
10
- max: MaxNode,
11
- minLength: MinLengthNode,
12
- maxLength: MaxLengthNode,
13
- exactLength: ExactLengthNode,
14
- after: AfterNode,
15
- before: BeforeNode
16
- }
17
- //# sourceMappingURL=kinds.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"kinds.js","sourceRoot":"","sources":["../../../constraints/refinements/kinds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAyB,MAAM,YAAY,CAAA;AAC7D,OAAO,EAAE,UAAU,EAA0B,MAAM,aAAa,CAAA;AAChE,OAAO,EAAE,eAAe,EAA+B,MAAM,kBAAkB,CAAA;AAC/E,OAAO,EAAE,OAAO,EAAuB,MAAM,UAAU,CAAA;AACvD,OAAO,EAAE,aAAa,EAA6B,MAAM,gBAAgB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAuB,MAAM,UAAU,CAAA;AACvD,OAAO,EAAE,aAAa,EAA6B,MAAM,gBAAgB,CAAA;AAYzE,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,OAAO;IACZ,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,aAAa;IACxB,WAAW,EAAE,eAAe;IAC5B,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,UAAU;CAClB,CAAA"}
@@ -1,48 +0,0 @@
1
- import type { declareNode } from "../../shared/declare.js"
2
- import {
3
- BasePrimitiveConstraint,
4
- type PrimitiveConstraintInner
5
- } from "../constraint.js"
6
- import type { LengthBoundableData } from "./range.js"
7
- export interface LengthInner extends PrimitiveConstraintInner<number> {}
8
- export type length<n extends number> = {
9
- "==": n
10
- }
11
- export type NormalizedLengthSchema = LengthInner
12
- export type LengthSchema = NormalizedLengthSchema | number
13
- export type LengthDeclaration = declareNode<{
14
- kind: "length"
15
- schema: LengthSchema
16
- normalizedSchema: NormalizedLengthSchema
17
- inner: LengthInner
18
- prerequisite: LengthBoundableData
19
- errorContext: LengthInner
20
- }>
21
- export declare class LengthNode extends BasePrimitiveConstraint<
22
- LengthDeclaration,
23
- typeof LengthNode
24
- > {
25
- static implementation: import("../../shared/implement.js").nodeImplementationOf<{
26
- intersectionIsOpen: false
27
- childKind: never
28
- reducibleTo: "length"
29
- kind: "length"
30
- schema: LengthSchema
31
- normalizedSchema: LengthInner
32
- inner: LengthInner
33
- prerequisite: LengthBoundableData
34
- errorContext: LengthInner &
35
- import("../../shared/declare.js").BaseErrorContext<"length">
36
- }>
37
- traverseAllows: (data: LengthBoundableData) => boolean
38
- readonly compiledCondition: string
39
- readonly compiledNegation: string
40
- readonly impliedBasis: import("../../types/union.js").UnionNode<LengthBoundableData>
41
- readonly errorContext: {
42
- code: "length"
43
- description: string
44
- readonly rule: number
45
- }
46
- readonly expression: string
47
- }
48
- //# sourceMappingURL=length.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"length.d.ts","sourceRoot":"","sources":["../../../constraints/refinements/length.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAE1D,OAAO,EACN,uBAAuB,EACvB,KAAK,wBAAwB,EAC7B,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAErD,MAAM,WAAW,WAAY,SAAQ,wBAAwB,CAAC,MAAM,CAAC;CAAG;AAExE,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,MAAM,IAAI;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAA;AAElD,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAA;AAEhD,MAAM,MAAM,YAAY,GAAG,sBAAsB,GAAG,MAAM,CAAA;AAE1D,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,mBAAmB,CAAA;IACjC,YAAY,EAAE,WAAW,CAAA;CACzB,CAAC,CAAA;AAEF,qBAAa,UAAW,SAAQ,uBAAuB,CACtD,iBAAiB,EACjB,OAAO,UAAU,CACjB;IACA,MAAM,CAAC,cAAc;;;;;;;;;;OAwCnB;IAEF,cAAc,SAAU,mBAAmB,aAA8B;IAEzE,QAAQ,CAAC,iBAAiB,SAAsC;IAChE,QAAQ,CAAC,gBAAgB,SAAsC;IAC/D,QAAQ,CAAC,YAAY,gEAAyB;IAC9C,QAAQ,CAAC,YAAY;;;;MAAsC;IAC3D,QAAQ,CAAC,UAAU,SAA4B;CAC/C"}
@@ -1,53 +0,0 @@
1
- import { jsData } from "../../shared/compile.js"
2
- import { Disjoint } from "../../shared/disjoint.js"
3
- import { BasePrimitiveConstraint } from "../constraint.js"
4
- export class LengthNode extends BasePrimitiveConstraint {
5
- static implementation = this.implement({
6
- collapseKey: "rule",
7
- keys: {
8
- rule: {}
9
- },
10
- normalize: (schema) =>
11
- typeof schema === "number" ? { rule: schema } : schema,
12
- intersections: {
13
- length: (l, r) =>
14
- new Disjoint({
15
- "[length]": {
16
- unit: {
17
- l: l.$.parse("unit", { unit: l.rule }),
18
- r: r.$.parse("unit", { unit: r.rule })
19
- }
20
- }
21
- }),
22
- minLength: (length, minLength) =>
23
- (
24
- minLength.exclusive
25
- ? length.rule > minLength.rule
26
- : length.rule >= minLength.rule
27
- )
28
- ? length
29
- : Disjoint.from("range", length, minLength),
30
- maxLength: (length, maxLength) =>
31
- (
32
- maxLength.exclusive
33
- ? length.rule < maxLength.rule
34
- : length.rule <= maxLength.rule
35
- )
36
- ? length
37
- : Disjoint.from("range", length, maxLength)
38
- },
39
- hasAssociatedError: true,
40
- defaults: {
41
- description(node) {
42
- return `exactly length ${node.rule}`
43
- }
44
- }
45
- })
46
- traverseAllows = (data) => data.length === this.rule
47
- compiledCondition = `${jsData}.length === ${this.rule}`
48
- compiledNegation = `${jsData}.length !== ${this.rule}`
49
- impliedBasis = this.$.lengthBoundable
50
- errorContext = this.createErrorContext(this.inner)
51
- expression = `{ length: ${this.rule}}`
52
- }
53
- //# sourceMappingURL=length.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"length.js","sourceRoot":"","sources":["../../../constraints/refinements/length.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,EACN,uBAAuB,EAEvB,MAAM,kBAAkB,CAAA;AAoBzB,MAAM,OAAO,UAAW,SAAQ,uBAG/B;IACA,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC;QACtC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE;YACL,IAAI,EAAE,EAAE;SACR;QACD,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE,CACrB,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM;QACvD,aAAa,EAAE;YACd,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAChB,IAAI,QAAQ,CAAC;gBACZ,UAAU,EAAE;oBACX,IAAI,EAAE;wBACL,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;wBACtC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MA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CAAA;IAClD,UAAU,GAAG,aAAa,IAAI,CAAC,IAAI,GAAG,CAAA"}
@@ -1,31 +0,0 @@
1
- import type { declareNode } from "../../shared/declare.js"
2
- import type { nodeImplementationOf } from "../../shared/implement.js"
3
- import {
4
- BaseRange,
5
- type BaseNormalizedRangeSchema,
6
- type BaseRangeInner
7
- } from "./range.js"
8
- export interface MaxInner extends BaseRangeInner {
9
- rule: number
10
- }
11
- export interface NormalizedMaxSchema extends BaseNormalizedRangeSchema {
12
- rule: number
13
- }
14
- export type MaxSchema = NormalizedMaxSchema | number
15
- export type MaxDeclaration = declareNode<{
16
- kind: "max"
17
- schema: MaxSchema
18
- normalizedSchema: NormalizedMaxSchema
19
- inner: MaxInner
20
- prerequisite: number
21
- errorContext: MaxInner
22
- }>
23
- export declare class MaxNode extends BaseRange<MaxDeclaration> {
24
- static implementation: nodeImplementationOf<MaxDeclaration>
25
- readonly impliedBasis: import("../../main.js").Type<
26
- number,
27
- import("../../keywords/tsPrimitive.js").tsPrimitive.exports
28
- >
29
- traverseAllows: (data: number) => boolean
30
- }
31
- //# sourceMappingURL=max.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"max.d.ts","sourceRoot":"","sources":["../../../constraints/refinements/max.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAE1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,EACN,SAAS,EAET,KAAK,yBAAyB,EAC9B,KAAK,cAAc,EACnB,MAAM,YAAY,CAAA;AAEnB,MAAM,WAAW,QAAS,SAAQ,cAAc;IAC/C,IAAI,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,mBAAoB,SAAQ,yBAAyB;IACrE,IAAI,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,MAAM,SAAS,GAAG,mBAAmB,GAAG,MAAM,CAAA;AAEpD,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC;IACxC,IAAI,EAAE,KAAK,CAAA;IACX,MAAM,EAAE,SAAS,CAAA;IACjB,gBAAgB,EAAE,mBAAmB,CAAA;IACrC,KAAK,EAAE,QAAQ,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,QAAQ,CAAA;CACtB,CAAC,CAAA;AAEF,qBAAa,OAAQ,SAAQ,SAAS,CAAC,cAAc,CAAC;IACrD,MAAM,CAAC,cAAc,EAAE,oBAAoB,CAAC,cAAc,CAAC,CAuBzD;IAEF,QAAQ,CAAC,YAAY,oGAAyB;IAE9C,cAAc,SACJ,MAAM,aACsB;CACtC"}
@@ -1,35 +0,0 @@
1
- import { Disjoint } from "../../shared/disjoint.js"
2
- import { BaseRange, parseExclusiveKey } from "./range.js"
3
- export class MaxNode extends BaseRange {
4
- static implementation = this.implement({
5
- collapsibleKey: "rule",
6
- hasAssociatedError: true,
7
- keys: {
8
- rule: {},
9
- exclusive: parseExclusiveKey
10
- },
11
- normalize: (schema) =>
12
- typeof schema === "number" ? { rule: schema } : schema,
13
- defaults: {
14
- description(node) {
15
- return `${node.exclusive ? "less than" : "at most"} ${
16
- node.rule
17
- }`
18
- }
19
- },
20
- intersections: {
21
- max: (l, r) => (l.isStricterThan(r) ? l : r),
22
- min: (max, min, $) =>
23
- max.overlapsRange(min)
24
- ? max.overlapIsUnit(min)
25
- ? $.node("unit", { unit: max.rule })
26
- : null
27
- : Disjoint.from("range", max, min)
28
- }
29
- })
30
- impliedBasis = this.$.keywords.number
31
- traverseAllows = this.exclusive
32
- ? (data) => data < this.rule
33
- : (data) => data <= this.rule
34
- }
35
- //# sourceMappingURL=max.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"max.js","sourceRoot":"","sources":["../../../constraints/refinements/max.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAEnD,OAAO,EACN,SAAS,EACT,iBAAiB,EAGjB,MAAM,YAAY,CAAA;AAq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C,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI;QACpC,CAAC,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAA"}
@@ -1,32 +0,0 @@
1
- import type { declareNode } from "../../shared/declare.js"
2
- import type { nodeImplementationOf } from "../../shared/implement.js"
3
- import {
4
- BaseRange,
5
- type BaseNormalizedRangeSchema,
6
- type BaseRangeInner,
7
- type LengthBoundableData
8
- } from "./range.js"
9
- export interface MaxLengthInner extends BaseRangeInner {
10
- rule: number
11
- }
12
- export interface NormalizedMaxLengthSchema extends BaseNormalizedRangeSchema {
13
- rule: number
14
- }
15
- export type MaxLengthSchema = NormalizedMaxLengthSchema | number
16
- export type MaxLengthDeclaration = declareNode<{
17
- kind: "maxLength"
18
- schema: MaxLengthSchema
19
- normalizedSchema: NormalizedMaxLengthSchema
20
- inner: MaxLengthInner
21
- prerequisite: LengthBoundableData
22
- errorContext: MaxLengthInner
23
- }>
24
- export declare class MaxLengthNode extends BaseRange<MaxLengthDeclaration> {
25
- static implementation: nodeImplementationOf<MaxLengthDeclaration>
26
- readonly impliedBasis: import("../../main.js").Type<
27
- string | unknown[],
28
- import("../../keywords/internal.js").internalPrimitive.exports
29
- >
30
- traverseAllows: (data: LengthBoundableData) => boolean
31
- }
32
- //# sourceMappingURL=maxLength.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"maxLength.d.ts","sourceRoot":"","sources":["../../../constraints/refinements/maxLength.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAE1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,EACN,SAAS,EAET,KAAK,yBAAyB,EAC9B,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,MAAM,YAAY,CAAA;AAEnB,MAAM,WAAW,cAAe,SAAQ,cAAc;IACrD,IAAI,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,yBAA0B,SAAQ,yBAAyB;IAC3E,IAAI,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,MAAM,eAAe,GAAG,yBAAyB,GAAG,MAAM,CAAA;AAEhE,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC;IAC9C,IAAI,EAAE,WAAW,CAAA;IACjB,MAAM,EAAE,eAAe,CAAA;IACvB,gBAAgB,EAAE,yBAAyB,CAAA;IAC3C,KAAK,EAAE,cAAc,CAAA;IACrB,YAAY,EAAE,mBAAmB,CAAA;IACjC,YAAY,EAAE,cAAc,CAAA;CAC5B,CAAC,CAAA;AAEF,qBAAa,aAAc,SAAQ,SAAS,CAAC,oBAAoB,CAAC;IACjE,MAAM,CAAC,cAAc,EAAE,oBAAoB,CAAC,oBAAoB,CAAC,CA2B9D;IAEH,QAAQ,CAAC,YAAY,mHAAkC;IAEvD,cAAc,SACJ,mBAAmB,aAC6B;CAC1D"}
@@ -1,36 +0,0 @@
1
- import { Disjoint } from "../../shared/disjoint.js"
2
- import { BaseRange, parseExclusiveKey } from "./range.js"
3
- export class MaxLengthNode extends BaseRange {
4
- static implementation = this.implement({
5
- collapsibleKey: "rule",
6
- hasAssociatedError: true,
7
- keys: {
8
- rule: {},
9
- exclusive: parseExclusiveKey
10
- },
11
- normalize: (schema) =>
12
- typeof schema === "number" ? { rule: schema } : schema,
13
- defaults: {
14
- description(node) {
15
- return node.exclusive
16
- ? `less than length ${node.rule}`
17
- : `at most length ${node.rule}`
18
- },
19
- actual: (data) => `${data.length}`
20
- },
21
- intersections: {
22
- maxLength: (l, r) => (l.isStricterThan(r) ? l : r),
23
- minLength: (max, min, $) =>
24
- max.overlapsRange(min)
25
- ? max.overlapIsUnit(min)
26
- ? $.node("exactLength", { rule: max.rule })
27
- : null
28
- : Disjoint.from("range", max, min)
29
- }
30
- })
31
- impliedBasis = this.$.keywords.lengthBoundable
32
- traverseAllows = this.exclusive
33
- ? (data) => data.length < this.rule
34
- : (data) => data.length <= this.rule
35
- }
36
- //# sourceMappingURL=maxLength.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"maxLength.js","sourceRoot":"","sources":["../../../constraints/refinements/maxLength.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAEnD,OAAO,EACN,SAAS,EACT,iBAAiB,EAIjB,MAAM,YAAY,CAAA;AAqBnB,MAAM,OAAO,aAAc,SAAQ,SAA+B;IACjE,MAAM,CAAC,cAAc,GACpB,IAAI,CAAC,SAAS,CAAC;QACd,cAAc,EAAE,MAAM;QACtB,kBAAkB,EAAE,IAAI;QACxB,IAAI,EAAE;YACL,IAAI,EAAE,EAAE;YACR,SAAS,EAAE,iBAAiB;SAC5B;QACD,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE,CACrB,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM;QACvD,QAAQ,EAAE;YACT,WAAW,CAAC,IAAI;gBACf,OAAO,IAAI,CAAC,SAAS;oBACpB,CAAC,CAAC,oBAAoB,IAAI,CAAC,IAAI,EAAE;oBACjC,CAAC,CAAC,kBAAkB,IAAI,CAAC,IAAI,EAAE,CAAA;YACjC,CAAC;YACD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE;SAClC;QACD,aAAa,EAAE;YACd,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAClD,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,CAC1B,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC;gBACrB,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC;oBACvB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC;oBAC3C,CAAC,CAAC,IAAI;gBACP,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC;SACpC;KACD,CAAC,CAAA;IAEM,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAA;IAEvD,cAAc,GAAG,IAAI,CAAC,SAAS;QAC9B,CAAC,CAAC,CAAC,IAAyB,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI;QACxD,CAAC,CAAC,CAAC,IAAyB,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,IAAI,CAAA"}
@@ -1,31 +0,0 @@
1
- import type { declareNode } from "../../shared/declare.js"
2
- import type { nodeImplementationOf } from "../../shared/implement.js"
3
- import {
4
- BaseRange,
5
- type BaseNormalizedRangeSchema,
6
- type BaseRangeInner
7
- } from "./range.js"
8
- export interface MinInner extends BaseRangeInner {
9
- rule: number
10
- }
11
- export interface NormalizedMinSchema extends BaseNormalizedRangeSchema {
12
- rule: number
13
- }
14
- export type MinSchema = NormalizedMinSchema | number
15
- export type MinDeclaration = declareNode<{
16
- kind: "min"
17
- schema: MinSchema
18
- normalizedSchema: NormalizedMinSchema
19
- inner: MinInner
20
- prerequisite: number
21
- errorContext: MinInner
22
- }>
23
- export declare class MinNode extends BaseRange<MinDeclaration> {
24
- static implementation: nodeImplementationOf<MinDeclaration>
25
- readonly impliedBasis: import("../../main.js").Type<
26
- number,
27
- import("../../keywords/tsPrimitive.js").tsPrimitive.exports
28
- >
29
- traverseAllows: (data: number) => boolean
30
- }
31
- //# sourceMappingURL=min.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"min.d.ts","sourceRoot":"","sources":["../../../constraints/refinements/min.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,EACN,SAAS,EAET,KAAK,yBAAyB,EAC9B,KAAK,cAAc,EACnB,MAAM,YAAY,CAAA;AAEnB,MAAM,WAAW,QAAS,SAAQ,cAAc;IAC/C,IAAI,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,mBAAoB,SAAQ,yBAAyB;IACrE,IAAI,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,MAAM,SAAS,GAAG,mBAAmB,GAAG,MAAM,CAAA;AAEpD,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC;IACxC,IAAI,EAAE,KAAK,CAAA;IACX,MAAM,EAAE,SAAS,CAAA;IACjB,gBAAgB,EAAE,mBAAmB,CAAA;IACrC,KAAK,EAAE,QAAQ,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,QAAQ,CAAA;CACtB,CAAC,CAAA;AAEF,qBAAa,OAAQ,SAAQ,SAAS,CAAC,cAAc,CAAC;IACrD,MAAM,CAAC,cAAc,EAAE,oBAAoB,CAAC,cAAc,CAAC,CAiBzD;IAEF,QAAQ,CAAC,YAAY,oGAAyB;IAE9C,cAAc,SACJ,MAAM,aACsB;CACtC"}
@@ -1,28 +0,0 @@
1
- import { BaseRange, parseExclusiveKey } from "./range.js"
2
- export class MinNode extends BaseRange {
3
- static implementation = this.implement({
4
- collapsibleKey: "rule",
5
- hasAssociatedError: true,
6
- keys: {
7
- rule: {},
8
- exclusive: parseExclusiveKey
9
- },
10
- normalize: (schema) =>
11
- typeof schema === "number" ? { rule: schema } : schema,
12
- intersections: {
13
- min: (l, r) => (l.isStricterThan(r) ? l : r)
14
- },
15
- defaults: {
16
- description(node) {
17
- return `${node.exclusive ? "more than" : "at least"} ${
18
- node.rule
19
- }`
20
- }
21
- }
22
- })
23
- impliedBasis = this.$.keywords.number
24
- traverseAllows = this.exclusive
25
- ? (data) => data > this.rule
26
- : (data) => data >= this.rule
27
- }
28
- //# sourceMappingURL=min.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"min.js","sourceRoot":"","sources":["../../../constraints/refinements/min.ts"],"names":[],"mappings":"AAEA,OAAO,EACN,SAAS,EACT,iBAAiB,EAGjB,MAAM,YAAY,CAAA;AAqBnB,MAAM,OAAO,OAAQ,SAAQ,SAAyB;IACrD,MAAM,CAAC,cAAc,GAAyC,IAAI,CAAC,SAAS,CAAC;QAC5E,cAAc,EAAE,MAAM;QACtB,kBAAkB,EAAE,IAAI;QACxB,IAAI,EAAE;YACL,IAAI,EAAE,EAAE;YACR,SAAS,EAAE,iBAAiB;SAC5B;QACD,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE,CACrB,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM;QACvD,aAAa,EAAE;YACd,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC5C;QACD,QAAQ,EAAE;YACT,WAAW,CAAC,IAAI;gBACf,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,IAAI,IAAI,CAAC,IAAI,EAAE,CAAA;YACnE,CAAC;SACD;KACD,CAAC,CAAA;IAEO,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAA;IAE9C,cAAc,GAAG,IAAI,CAAC,SAAS;QAC9B,CAAC,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI;QACpC,CAAC,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAA"}
@@ -1,32 +0,0 @@
1
- import type { declareNode } from "../../shared/declare.js"
2
- import type { nodeImplementationOf } from "../../shared/implement.js"
3
- import {
4
- BaseRange,
5
- type BaseNormalizedRangeSchema,
6
- type BaseRangeInner,
7
- type LengthBoundableData
8
- } from "./range.js"
9
- export interface MinLengthInner extends BaseRangeInner {
10
- rule: number
11
- }
12
- export interface NormalizedMinLengthSchema extends BaseNormalizedRangeSchema {
13
- rule: number
14
- }
15
- export type MinLengthSchema = NormalizedMinLengthSchema | number
16
- export type MinLengthDeclaration = declareNode<{
17
- kind: "minLength"
18
- schema: MinLengthSchema
19
- normalizedSchema: NormalizedMinLengthSchema
20
- inner: MinLengthInner
21
- prerequisite: LengthBoundableData
22
- errorContext: MinLengthInner
23
- }>
24
- export declare class MinLengthNode extends BaseRange<MinLengthDeclaration> {
25
- static implementation: nodeImplementationOf<MinLengthDeclaration>
26
- traverseAllows: (data: LengthBoundableData) => boolean
27
- readonly impliedBasis: import("../../main.js").Type<
28
- string | unknown[],
29
- import("../../keywords/internal.js").internalPrimitive.exports
30
- >
31
- }
32
- //# sourceMappingURL=minLength.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"minLength.d.ts","sourceRoot":"","sources":["../../../constraints/refinements/minLength.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,EACN,SAAS,EAET,KAAK,yBAAyB,EAC9B,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,MAAM,YAAY,CAAA;AAEnB,MAAM,WAAW,cAAe,SAAQ,cAAc;IACrD,IAAI,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,yBAA0B,SAAQ,yBAAyB;IAC3E,IAAI,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,MAAM,eAAe,GAAG,yBAAyB,GAAG,MAAM,CAAA;AAEhE,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC;IAC9C,IAAI,EAAE,WAAW,CAAA;IACjB,MAAM,EAAE,eAAe,CAAA;IACvB,gBAAgB,EAAE,yBAAyB,CAAA;IAC3C,KAAK,EAAE,cAAc,CAAA;IACrB,YAAY,EAAE,mBAAmB,CAAA;IACjC,YAAY,EAAE,cAAc,CAAA;CAC5B,CAAC,CAAA;AAEF,qBAAa,aAAc,SAAQ,SAAS,CAAC,oBAAoB,CAAC;IACjE,MAAM,CAAC,cAAc,EAAE,oBAAoB,CAAC,oBAAoB,CAAC,CAyB9D;IAEH,cAAc,SACJ,mBAAmB,aAC6B;IAE1D,QAAQ,CAAC,YAAY,mHAAkC;CACvD"}
@@ -1,33 +0,0 @@
1
- import { BaseRange, parseExclusiveKey } from "./range.js"
2
- export class MinLengthNode extends BaseRange {
3
- static implementation = this.implement({
4
- collapsibleKey: "rule",
5
- hasAssociatedError: true,
6
- keys: {
7
- rule: {},
8
- exclusive: parseExclusiveKey
9
- },
10
- normalize: (schema) =>
11
- typeof schema === "number" ? { rule: schema } : schema,
12
- defaults: {
13
- description(node) {
14
- return node.exclusive
15
- ? node.rule === 0
16
- ? "non-empty"
17
- : `more than length ${node.rule}`
18
- : node.rule === 1
19
- ? "non-empty"
20
- : `at least length ${node.rule}`
21
- },
22
- actual: (data) => `${data.length}`
23
- },
24
- intersections: {
25
- minLength: (l, r) => (l.isStricterThan(r) ? l : r)
26
- }
27
- })
28
- traverseAllows = this.exclusive
29
- ? (data) => data.length > this.rule
30
- : (data) => data.length >= this.rule
31
- impliedBasis = this.$.keywords.lengthBoundable
32
- }
33
- //# sourceMappingURL=minLength.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"minLength.js","sourceRoot":"","sources":["../../../constraints/refinements/minLength.ts"],"names":[],"mappings":"AAEA,OAAO,EACN,SAAS,EACT,iBAAiB,EAIjB,MAAM,YAAY,CAAA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