reliant-type 1.0.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 (345) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1305 -0
  3. package/dist/cjs/constants/SECURITY_CONSTANTS.js +49 -0
  4. package/dist/cjs/constants/SECURITY_CONSTANTS.js.map +1 -0
  5. package/dist/cjs/constants/VALIDATION_CONSTANTS.js +103 -0
  6. package/dist/cjs/constants/VALIDATION_CONSTANTS.js.map +1 -0
  7. package/dist/cjs/core/schema/extensions/SmartInference.js +200 -0
  8. package/dist/cjs/core/schema/extensions/SmartInference.js.map +1 -0
  9. package/dist/cjs/core/schema/extensions/components/AutoDocumentation/Docs.js +100 -0
  10. package/dist/cjs/core/schema/extensions/components/AutoDocumentation/Docs.js.map +1 -0
  11. package/dist/cjs/core/schema/extensions/components/AutoDocumentation/DocumentationGenerator.js +192 -0
  12. package/dist/cjs/core/schema/extensions/components/AutoDocumentation/DocumentationGenerator.js.map +1 -0
  13. package/dist/cjs/core/schema/extensions/components/AutoDocumentation/InteractiveDocumentationGenerator.js +174 -0
  14. package/dist/cjs/core/schema/extensions/components/AutoDocumentation/InteractiveDocumentationGenerator.js.map +1 -0
  15. package/dist/cjs/core/schema/extensions/components/AutoDocumentation/SchemaAnalyzer.js +54 -0
  16. package/dist/cjs/core/schema/extensions/components/AutoDocumentation/SchemaAnalyzer.js.map +1 -0
  17. package/dist/cjs/core/schema/extensions/components/AutoDocumentation/TypeScriptGenerator.js +50 -0
  18. package/dist/cjs/core/schema/extensions/components/AutoDocumentation/TypeScriptGenerator.js.map +1 -0
  19. package/dist/cjs/core/schema/extensions/components/AutoDocumentation/index.js +15 -0
  20. package/dist/cjs/core/schema/extensions/components/AutoDocumentation/index.js.map +1 -0
  21. package/dist/cjs/core/schema/extensions/components/ConditionalValidation/ConditionalBuilder.js +70 -0
  22. package/dist/cjs/core/schema/extensions/components/ConditionalValidation/ConditionalBuilder.js.map +1 -0
  23. package/dist/cjs/core/schema/extensions/components/ConditionalValidation/ConditionalElse.js +40 -0
  24. package/dist/cjs/core/schema/extensions/components/ConditionalValidation/ConditionalElse.js.map +1 -0
  25. package/dist/cjs/core/schema/extensions/components/ConditionalValidation/ConditionalThen.js +19 -0
  26. package/dist/cjs/core/schema/extensions/components/ConditionalValidation/ConditionalThen.js.map +1 -0
  27. package/dist/cjs/core/schema/extensions/components/ConditionalValidation/MultiConditionalBuilder.js +20 -0
  28. package/dist/cjs/core/schema/extensions/components/ConditionalValidation/MultiConditionalBuilder.js.map +1 -0
  29. package/dist/cjs/core/schema/extensions/components/ConditionalValidation/MultiConditionalThen.js +49 -0
  30. package/dist/cjs/core/schema/extensions/components/ConditionalValidation/MultiConditionalThen.js.map +1 -0
  31. package/dist/cjs/core/schema/extensions/components/ConditionalValidation/index.js +98 -0
  32. package/dist/cjs/core/schema/extensions/components/ConditionalValidation/index.js.map +1 -0
  33. package/dist/cjs/core/schema/extensions/components/RealtimeValidation/FormValidator.js +85 -0
  34. package/dist/cjs/core/schema/extensions/components/RealtimeValidation/FormValidator.js.map +1 -0
  35. package/dist/cjs/core/schema/extensions/components/RealtimeValidation/LiveValidator.js +133 -0
  36. package/dist/cjs/core/schema/extensions/components/RealtimeValidation/LiveValidator.js.map +1 -0
  37. package/dist/cjs/core/schema/extensions/components/RealtimeValidation/StreamValidator.js +351 -0
  38. package/dist/cjs/core/schema/extensions/components/RealtimeValidation/StreamValidator.js.map +1 -0
  39. package/dist/cjs/core/schema/extensions/components/RealtimeValidation/index.js +109 -0
  40. package/dist/cjs/core/schema/extensions/components/RealtimeValidation/index.js.map +1 -0
  41. package/dist/cjs/core/schema/extensions/index.js +61 -0
  42. package/dist/cjs/core/schema/extensions/index.js.map +1 -0
  43. package/dist/cjs/core/schema/extensions/mods/index.js +51 -0
  44. package/dist/cjs/core/schema/extensions/mods/index.js.map +1 -0
  45. package/dist/cjs/core/schema/extensions/mods/openapi-converter.js +227 -0
  46. package/dist/cjs/core/schema/extensions/mods/openapi-converter.js.map +1 -0
  47. package/dist/cjs/core/schema/extensions/mods/typescript-generator.js +287 -0
  48. package/dist/cjs/core/schema/extensions/mods/typescript-generator.js.map +1 -0
  49. package/dist/cjs/core/schema/extensions/mods/validation-engine.js +224 -0
  50. package/dist/cjs/core/schema/extensions/mods/validation-engine.js.map +1 -0
  51. package/dist/cjs/core/schema/mode/interfaces/Interface.js +277 -0
  52. package/dist/cjs/core/schema/mode/interfaces/Interface.js.map +1 -0
  53. package/dist/cjs/core/schema/mode/interfaces/InterfaceSchema.js +1431 -0
  54. package/dist/cjs/core/schema/mode/interfaces/InterfaceSchema.js.map +1 -0
  55. package/dist/cjs/core/schema/mode/interfaces/conditional/evaluator/ConditionalEvaluator.js +520 -0
  56. package/dist/cjs/core/schema/mode/interfaces/conditional/evaluator/ConditionalEvaluator.js.map +1 -0
  57. package/dist/cjs/core/schema/mode/interfaces/conditional/parser/ConditionalAST.js +624 -0
  58. package/dist/cjs/core/schema/mode/interfaces/conditional/parser/ConditionalAST.js.map +1 -0
  59. package/dist/cjs/core/schema/mode/interfaces/conditional/parser/ConditionalLexer.js +811 -0
  60. package/dist/cjs/core/schema/mode/interfaces/conditional/parser/ConditionalLexer.js.map +1 -0
  61. package/dist/cjs/core/schema/mode/interfaces/conditional/parser/ConditionalParser.js +599 -0
  62. package/dist/cjs/core/schema/mode/interfaces/conditional/parser/ConditionalParser.js.map +1 -0
  63. package/dist/cjs/core/schema/mode/interfaces/conditional/types/ConditionalTypes.js +89 -0
  64. package/dist/cjs/core/schema/mode/interfaces/conditional/types/ConditionalTypes.js.map +1 -0
  65. package/dist/cjs/core/schema/mode/interfaces/errors/ErrorHandler.js +356 -0
  66. package/dist/cjs/core/schema/mode/interfaces/errors/ErrorHandler.js.map +1 -0
  67. package/dist/cjs/core/schema/mode/interfaces/errors/types/errors.type.js +80 -0
  68. package/dist/cjs/core/schema/mode/interfaces/errors/types/errors.type.js.map +1 -0
  69. package/dist/cjs/core/schema/mode/interfaces/precompilation/FieldPrecompilers.js +778 -0
  70. package/dist/cjs/core/schema/mode/interfaces/precompilation/FieldPrecompilers.js.map +1 -0
  71. package/dist/cjs/core/schema/mode/interfaces/precompilation/SchemaPrecompiler.js +523 -0
  72. package/dist/cjs/core/schema/mode/interfaces/precompilation/SchemaPrecompiler.js.map +1 -0
  73. package/dist/cjs/core/schema/mode/interfaces/typescript/ConditionalTypes.js +681 -0
  74. package/dist/cjs/core/schema/mode/interfaces/typescript/ConditionalTypes.js.map +1 -0
  75. package/dist/cjs/core/schema/mode/interfaces/typescript/IDESupport.js +430 -0
  76. package/dist/cjs/core/schema/mode/interfaces/typescript/IDESupport.js.map +1 -0
  77. package/dist/cjs/core/schema/mode/interfaces/typescript/TypeInference.js +225 -0
  78. package/dist/cjs/core/schema/mode/interfaces/typescript/TypeInference.js.map +1 -0
  79. package/dist/cjs/core/schema/mode/interfaces/typescript/index.js +44 -0
  80. package/dist/cjs/core/schema/mode/interfaces/typescript/index.js.map +1 -0
  81. package/dist/cjs/core/schema/mode/interfaces/validators/ConstraintParser.js +1134 -0
  82. package/dist/cjs/core/schema/mode/interfaces/validators/ConstraintParser.js.map +1 -0
  83. package/dist/cjs/core/schema/mode/interfaces/validators/TypeGuards.js +256 -0
  84. package/dist/cjs/core/schema/mode/interfaces/validators/TypeGuards.js.map +1 -0
  85. package/dist/cjs/core/schema/mode/interfaces/validators/TypeValidators.js +429 -0
  86. package/dist/cjs/core/schema/mode/interfaces/validators/TypeValidators.js.map +1 -0
  87. package/dist/cjs/core/schema/mode/interfaces/validators/UnionCache.js +404 -0
  88. package/dist/cjs/core/schema/mode/interfaces/validators/UnionCache.js.map +1 -0
  89. package/dist/cjs/core/schema/mode/interfaces/validators/ValidationHelpers.js +851 -0
  90. package/dist/cjs/core/schema/mode/interfaces/validators/ValidationHelpers.js.map +1 -0
  91. package/dist/cjs/core/schema/mode/interfaces/validators/mods/passValidator.js +262 -0
  92. package/dist/cjs/core/schema/mode/interfaces/validators/mods/passValidator.js.map +1 -0
  93. package/dist/cjs/core/schema/mode/interfaces/validators/mods/securityValidator.js +887 -0
  94. package/dist/cjs/core/schema/mode/interfaces/validators/mods/securityValidator.js.map +1 -0
  95. package/dist/cjs/core/schema/mode/interfaces/validators/mods/urlValidation.js +191 -0
  96. package/dist/cjs/core/schema/mode/interfaces/validators/mods/urlValidation.js.map +1 -0
  97. package/dist/cjs/core/schema/optimization/ObjectValidationCache.js +462 -0
  98. package/dist/cjs/core/schema/optimization/ObjectValidationCache.js.map +1 -0
  99. package/dist/cjs/core/schema/optimization/PerformanceMonitor.js +773 -0
  100. package/dist/cjs/core/schema/optimization/PerformanceMonitor.js.map +1 -0
  101. package/dist/cjs/core/schema/optimization/SchemaCompiler.js +600 -0
  102. package/dist/cjs/core/schema/optimization/SchemaCompiler.js.map +1 -0
  103. package/dist/cjs/core/types/ValidatorTypes.js +70 -0
  104. package/dist/cjs/core/types/ValidatorTypes.js.map +1 -0
  105. package/dist/cjs/core/types/parser.type.js +12 -0
  106. package/dist/cjs/core/types/parser.type.js.map +1 -0
  107. package/dist/cjs/core/utils/Make.js +61 -0
  108. package/dist/cjs/core/utils/Make.js.map +1 -0
  109. package/dist/cjs/core/utils/Mod.js +1033 -0
  110. package/dist/cjs/core/utils/Mod.js.map +1 -0
  111. package/dist/cjs/core/utils/UrlArgs.js +102 -0
  112. package/dist/cjs/core/utils/UrlArgs.js.map +1 -0
  113. package/dist/cjs/core/utils/arrayToEnum.js +18 -0
  114. package/dist/cjs/core/utils/arrayToEnum.js.map +1 -0
  115. package/dist/cjs/core/utils/createUrlArgsEnumFArray.js +13 -0
  116. package/dist/cjs/core/utils/createUrlArgsEnumFArray.js.map +1 -0
  117. package/dist/cjs/core/utils/securityHelpers.js +215 -0
  118. package/dist/cjs/core/utils/securityHelpers.js.map +1 -0
  119. package/dist/cjs/core/utils/securityValidatorHelpers.js +65 -0
  120. package/dist/cjs/core/utils/securityValidatorHelpers.js.map +1 -0
  121. package/dist/cjs/index.js +31 -0
  122. package/dist/cjs/index.js.map +1 -0
  123. package/dist/cjs/package.json +3 -0
  124. package/dist/esm/constants/SECURITY_CONSTANTS.js +47 -0
  125. package/dist/esm/constants/SECURITY_CONSTANTS.js.map +1 -0
  126. package/dist/esm/constants/VALIDATION_CONSTANTS.js +98 -0
  127. package/dist/esm/constants/VALIDATION_CONSTANTS.js.map +1 -0
  128. package/dist/esm/core/schema/extensions/SmartInference.js +197 -0
  129. package/dist/esm/core/schema/extensions/SmartInference.js.map +1 -0
  130. package/dist/esm/core/schema/extensions/components/AutoDocumentation/Docs.js +98 -0
  131. package/dist/esm/core/schema/extensions/components/AutoDocumentation/Docs.js.map +1 -0
  132. package/dist/esm/core/schema/extensions/components/AutoDocumentation/DocumentationGenerator.js +190 -0
  133. package/dist/esm/core/schema/extensions/components/AutoDocumentation/DocumentationGenerator.js.map +1 -0
  134. package/dist/esm/core/schema/extensions/components/AutoDocumentation/InteractiveDocumentationGenerator.js +172 -0
  135. package/dist/esm/core/schema/extensions/components/AutoDocumentation/InteractiveDocumentationGenerator.js.map +1 -0
  136. package/dist/esm/core/schema/extensions/components/AutoDocumentation/SchemaAnalyzer.js +52 -0
  137. package/dist/esm/core/schema/extensions/components/AutoDocumentation/SchemaAnalyzer.js.map +1 -0
  138. package/dist/esm/core/schema/extensions/components/AutoDocumentation/TypeScriptGenerator.js +48 -0
  139. package/dist/esm/core/schema/extensions/components/AutoDocumentation/TypeScriptGenerator.js.map +1 -0
  140. package/dist/esm/core/schema/extensions/components/AutoDocumentation/index.js +12 -0
  141. package/dist/esm/core/schema/extensions/components/AutoDocumentation/index.js.map +1 -0
  142. package/dist/esm/core/schema/extensions/components/ConditionalValidation/ConditionalBuilder.js +68 -0
  143. package/dist/esm/core/schema/extensions/components/ConditionalValidation/ConditionalBuilder.js.map +1 -0
  144. package/dist/esm/core/schema/extensions/components/ConditionalValidation/ConditionalElse.js +38 -0
  145. package/dist/esm/core/schema/extensions/components/ConditionalValidation/ConditionalElse.js.map +1 -0
  146. package/dist/esm/core/schema/extensions/components/ConditionalValidation/ConditionalThen.js +17 -0
  147. package/dist/esm/core/schema/extensions/components/ConditionalValidation/ConditionalThen.js.map +1 -0
  148. package/dist/esm/core/schema/extensions/components/ConditionalValidation/MultiConditionalBuilder.js +18 -0
  149. package/dist/esm/core/schema/extensions/components/ConditionalValidation/MultiConditionalBuilder.js.map +1 -0
  150. package/dist/esm/core/schema/extensions/components/ConditionalValidation/MultiConditionalThen.js +45 -0
  151. package/dist/esm/core/schema/extensions/components/ConditionalValidation/MultiConditionalThen.js.map +1 -0
  152. package/dist/esm/core/schema/extensions/components/ConditionalValidation/index.js +92 -0
  153. package/dist/esm/core/schema/extensions/components/ConditionalValidation/index.js.map +1 -0
  154. package/dist/esm/core/schema/extensions/components/RealtimeValidation/FormValidator.js +83 -0
  155. package/dist/esm/core/schema/extensions/components/RealtimeValidation/FormValidator.js.map +1 -0
  156. package/dist/esm/core/schema/extensions/components/RealtimeValidation/LiveValidator.js +131 -0
  157. package/dist/esm/core/schema/extensions/components/RealtimeValidation/LiveValidator.js.map +1 -0
  158. package/dist/esm/core/schema/extensions/components/RealtimeValidation/StreamValidator.js +349 -0
  159. package/dist/esm/core/schema/extensions/components/RealtimeValidation/StreamValidator.js.map +1 -0
  160. package/dist/esm/core/schema/extensions/components/RealtimeValidation/index.js +103 -0
  161. package/dist/esm/core/schema/extensions/components/RealtimeValidation/index.js.map +1 -0
  162. package/dist/esm/core/schema/extensions/index.js +53 -0
  163. package/dist/esm/core/schema/extensions/index.js.map +1 -0
  164. package/dist/esm/core/schema/extensions/mods/index.js +47 -0
  165. package/dist/esm/core/schema/extensions/mods/index.js.map +1 -0
  166. package/dist/esm/core/schema/extensions/mods/openapi-converter.js +225 -0
  167. package/dist/esm/core/schema/extensions/mods/openapi-converter.js.map +1 -0
  168. package/dist/esm/core/schema/extensions/mods/typescript-generator.js +284 -0
  169. package/dist/esm/core/schema/extensions/mods/typescript-generator.js.map +1 -0
  170. package/dist/esm/core/schema/extensions/mods/validation-engine.js +222 -0
  171. package/dist/esm/core/schema/extensions/mods/validation-engine.js.map +1 -0
  172. package/dist/esm/core/schema/mode/interfaces/Interface.js +269 -0
  173. package/dist/esm/core/schema/mode/interfaces/Interface.js.map +1 -0
  174. package/dist/esm/core/schema/mode/interfaces/InterfaceSchema.js +1429 -0
  175. package/dist/esm/core/schema/mode/interfaces/InterfaceSchema.js.map +1 -0
  176. package/dist/esm/core/schema/mode/interfaces/conditional/evaluator/ConditionalEvaluator.js +518 -0
  177. package/dist/esm/core/schema/mode/interfaces/conditional/evaluator/ConditionalEvaluator.js.map +1 -0
  178. package/dist/esm/core/schema/mode/interfaces/conditional/parser/ConditionalAST.js +620 -0
  179. package/dist/esm/core/schema/mode/interfaces/conditional/parser/ConditionalAST.js.map +1 -0
  180. package/dist/esm/core/schema/mode/interfaces/conditional/parser/ConditionalLexer.js +809 -0
  181. package/dist/esm/core/schema/mode/interfaces/conditional/parser/ConditionalLexer.js.map +1 -0
  182. package/dist/esm/core/schema/mode/interfaces/conditional/parser/ConditionalParser.js +597 -0
  183. package/dist/esm/core/schema/mode/interfaces/conditional/parser/ConditionalParser.js.map +1 -0
  184. package/dist/esm/core/schema/mode/interfaces/conditional/types/ConditionalTypes.js +89 -0
  185. package/dist/esm/core/schema/mode/interfaces/conditional/types/ConditionalTypes.js.map +1 -0
  186. package/dist/esm/core/schema/mode/interfaces/errors/ErrorHandler.js +354 -0
  187. package/dist/esm/core/schema/mode/interfaces/errors/ErrorHandler.js.map +1 -0
  188. package/dist/esm/core/schema/mode/interfaces/errors/types/errors.type.js +80 -0
  189. package/dist/esm/core/schema/mode/interfaces/errors/types/errors.type.js.map +1 -0
  190. package/dist/esm/core/schema/mode/interfaces/precompilation/FieldPrecompilers.js +776 -0
  191. package/dist/esm/core/schema/mode/interfaces/precompilation/FieldPrecompilers.js.map +1 -0
  192. package/dist/esm/core/schema/mode/interfaces/precompilation/SchemaPrecompiler.js +521 -0
  193. package/dist/esm/core/schema/mode/interfaces/precompilation/SchemaPrecompiler.js.map +1 -0
  194. package/dist/esm/core/schema/mode/interfaces/typescript/ConditionalTypes.js +681 -0
  195. package/dist/esm/core/schema/mode/interfaces/typescript/ConditionalTypes.js.map +1 -0
  196. package/dist/esm/core/schema/mode/interfaces/typescript/IDESupport.js +428 -0
  197. package/dist/esm/core/schema/mode/interfaces/typescript/IDESupport.js.map +1 -0
  198. package/dist/esm/core/schema/mode/interfaces/typescript/TypeInference.js +223 -0
  199. package/dist/esm/core/schema/mode/interfaces/typescript/TypeInference.js.map +1 -0
  200. package/dist/esm/core/schema/mode/interfaces/typescript/index.js +35 -0
  201. package/dist/esm/core/schema/mode/interfaces/typescript/index.js.map +1 -0
  202. package/dist/esm/core/schema/mode/interfaces/validators/ConstraintParser.js +1132 -0
  203. package/dist/esm/core/schema/mode/interfaces/validators/ConstraintParser.js.map +1 -0
  204. package/dist/esm/core/schema/mode/interfaces/validators/TypeGuards.js +254 -0
  205. package/dist/esm/core/schema/mode/interfaces/validators/TypeGuards.js.map +1 -0
  206. package/dist/esm/core/schema/mode/interfaces/validators/TypeValidators.js +427 -0
  207. package/dist/esm/core/schema/mode/interfaces/validators/TypeValidators.js.map +1 -0
  208. package/dist/esm/core/schema/mode/interfaces/validators/UnionCache.js +400 -0
  209. package/dist/esm/core/schema/mode/interfaces/validators/UnionCache.js.map +1 -0
  210. package/dist/esm/core/schema/mode/interfaces/validators/ValidationHelpers.js +849 -0
  211. package/dist/esm/core/schema/mode/interfaces/validators/ValidationHelpers.js.map +1 -0
  212. package/dist/esm/core/schema/mode/interfaces/validators/mods/passValidator.js +260 -0
  213. package/dist/esm/core/schema/mode/interfaces/validators/mods/passValidator.js.map +1 -0
  214. package/dist/esm/core/schema/mode/interfaces/validators/mods/securityValidator.js +881 -0
  215. package/dist/esm/core/schema/mode/interfaces/validators/mods/securityValidator.js.map +1 -0
  216. package/dist/esm/core/schema/mode/interfaces/validators/mods/urlValidation.js +189 -0
  217. package/dist/esm/core/schema/mode/interfaces/validators/mods/urlValidation.js.map +1 -0
  218. package/dist/esm/core/schema/optimization/ObjectValidationCache.js +460 -0
  219. package/dist/esm/core/schema/optimization/ObjectValidationCache.js.map +1 -0
  220. package/dist/esm/core/schema/optimization/PerformanceMonitor.js +771 -0
  221. package/dist/esm/core/schema/optimization/PerformanceMonitor.js.map +1 -0
  222. package/dist/esm/core/schema/optimization/SchemaCompiler.js +598 -0
  223. package/dist/esm/core/schema/optimization/SchemaCompiler.js.map +1 -0
  224. package/dist/esm/core/types/ValidatorTypes.js +65 -0
  225. package/dist/esm/core/types/ValidatorTypes.js.map +1 -0
  226. package/dist/esm/core/types/parser.type.js +12 -0
  227. package/dist/esm/core/types/parser.type.js.map +1 -0
  228. package/dist/esm/core/utils/Make.js +59 -0
  229. package/dist/esm/core/utils/Make.js.map +1 -0
  230. package/dist/esm/core/utils/Mod.js +1031 -0
  231. package/dist/esm/core/utils/Mod.js.map +1 -0
  232. package/dist/esm/core/utils/UrlArgs.js +98 -0
  233. package/dist/esm/core/utils/UrlArgs.js.map +1 -0
  234. package/dist/esm/core/utils/arrayToEnum.js +16 -0
  235. package/dist/esm/core/utils/arrayToEnum.js.map +1 -0
  236. package/dist/esm/core/utils/createUrlArgsEnumFArray.js +11 -0
  237. package/dist/esm/core/utils/createUrlArgsEnumFArray.js.map +1 -0
  238. package/dist/esm/core/utils/securityHelpers.js +207 -0
  239. package/dist/esm/core/utils/securityHelpers.js.map +1 -0
  240. package/dist/esm/core/utils/securityValidatorHelpers.js +62 -0
  241. package/dist/esm/core/utils/securityValidatorHelpers.js.map +1 -0
  242. package/dist/esm/index.js +12 -0
  243. package/dist/esm/index.js.map +1 -0
  244. package/dist/esm/package.json +3 -0
  245. package/dist/schema.d.ts +2595 -0
  246. package/docs/ALL_TYPES.md +120 -0
  247. package/docs/API-STABILITY.md +336 -0
  248. package/docs/CONDITIONAL-VALIDATION.md +637 -0
  249. package/docs/EXAMPLES.md +876 -0
  250. package/docs/FIELD-TYPES.md +829 -0
  251. package/docs/GETTING-STARTED.md +394 -0
  252. package/docs/LIVE-UTILITY.md +1137 -0
  253. package/docs/QUICK-REFERENCE.md +346 -0
  254. package/docs/README.md +205 -0
  255. package/docs/VSCODE-EXTENSION.md +458 -0
  256. package/package.json +219 -0
  257. package/src/bench/BENCHMARK-RESULTS.md +211 -0
  258. package/src/bench/benchmark-results.json +148 -0
  259. package/src/bench/performance-comparison.ts +218 -0
  260. package/src/bench/precompilation-benchmark.ts +218 -0
  261. package/src/constants/SECURITY_CONSTANTS.ts +44 -0
  262. package/src/constants/VALIDATION_CONSTANTS.ts +176 -0
  263. package/src/core/README.md +395 -0
  264. package/src/core/compiler/SchemaTransformer.ts +279 -0
  265. package/src/core/compiler/TypeAnalyzer.ts +378 -0
  266. package/src/core/compiler/TypeScriptCompilerIntegration.ts +220 -0
  267. package/src/core/compiler/TypeToSchemaConverter.ts +288 -0
  268. package/src/core/index.ts +70 -0
  269. package/src/core/schema/extensions/AutoDocumentation.ts +572 -0
  270. package/src/core/schema/extensions/ConditionalValidation.ts +330 -0
  271. package/src/core/schema/extensions/README.md +171 -0
  272. package/src/core/schema/extensions/RealtimeValidation.ts +656 -0
  273. package/src/core/schema/extensions/SmartInference.ts +224 -0
  274. package/src/core/schema/extensions/components/AutoDocumentation/Docs.ts +98 -0
  275. package/src/core/schema/extensions/components/AutoDocumentation/DocumentationGenerator.ts +201 -0
  276. package/src/core/schema/extensions/components/AutoDocumentation/InteractiveDocumentationGenerator.ts +176 -0
  277. package/src/core/schema/extensions/components/AutoDocumentation/OpenAPIGenerator.ts +175 -0
  278. package/src/core/schema/extensions/components/AutoDocumentation/SchemaAnalyzer.ts +49 -0
  279. package/src/core/schema/extensions/components/AutoDocumentation/TypeScriptGenerator.ts +54 -0
  280. package/src/core/schema/extensions/components/AutoDocumentation/index.ts +17 -0
  281. package/src/core/schema/extensions/components/ConditionalValidation/ConditionalBuilder.ts +101 -0
  282. package/src/core/schema/extensions/components/ConditionalValidation/ConditionalElse.ts +65 -0
  283. package/src/core/schema/extensions/components/ConditionalValidation/ConditionalThen.ts +33 -0
  284. package/src/core/schema/extensions/components/ConditionalValidation/Extend.ts +75 -0
  285. package/src/core/schema/extensions/components/ConditionalValidation/MultiConditionalBuilder.ts +16 -0
  286. package/src/core/schema/extensions/components/ConditionalValidation/MultiConditionalThen.ts +50 -0
  287. package/src/core/schema/extensions/components/ConditionalValidation/index.ts +104 -0
  288. package/src/core/schema/extensions/components/RealtimeValidation/FormValidator.ts +88 -0
  289. package/src/core/schema/extensions/components/RealtimeValidation/LiveValidator.ts +171 -0
  290. package/src/core/schema/extensions/components/RealtimeValidation/StreamValidator.ts +397 -0
  291. package/src/core/schema/extensions/components/RealtimeValidation/index.ts +114 -0
  292. package/src/core/schema/extensions/index.ts +76 -0
  293. package/src/core/schema/extensions/mods/index.ts +131 -0
  294. package/src/core/schema/extensions/mods/openapi-converter.ts +338 -0
  295. package/src/core/schema/extensions/mods/typescript-generator.ts +379 -0
  296. package/src/core/schema/extensions/mods/validation-engine.ts +295 -0
  297. package/src/core/schema/mode/interfaces/Interface.ts +364 -0
  298. package/src/core/schema/mode/interfaces/InterfaceSchema.ts +1838 -0
  299. package/src/core/schema/mode/interfaces/README.md +278 -0
  300. package/src/core/schema/mode/interfaces/conditional/evaluator/ConditionalEvaluator.ts +657 -0
  301. package/src/core/schema/mode/interfaces/conditional/parser/ConditionalAST.ts +826 -0
  302. package/src/core/schema/mode/interfaces/conditional/parser/ConditionalLexer.ts +992 -0
  303. package/src/core/schema/mode/interfaces/conditional/parser/ConditionalParser.ts +803 -0
  304. package/src/core/schema/mode/interfaces/conditional/parser/readme.md +406 -0
  305. package/src/core/schema/mode/interfaces/conditional/types/ConditionalTypes.ts +273 -0
  306. package/src/core/schema/mode/interfaces/errors/ErrorHandler.ts +624 -0
  307. package/src/core/schema/mode/interfaces/errors/types/errors.type.ts +102 -0
  308. package/src/core/schema/mode/interfaces/precompilation/FieldPrecompilers.ts +962 -0
  309. package/src/core/schema/mode/interfaces/precompilation/SchemaPrecompiler.ts +667 -0
  310. package/src/core/schema/mode/interfaces/typescript/ConditionalTypes.ts +1534 -0
  311. package/src/core/schema/mode/interfaces/typescript/IDESupport.ts +534 -0
  312. package/src/core/schema/mode/interfaces/typescript/TypeInference.ts +737 -0
  313. package/src/core/schema/mode/interfaces/typescript/index.ts +92 -0
  314. package/src/core/schema/mode/interfaces/validators/ConstraintParser.ts +1438 -0
  315. package/src/core/schema/mode/interfaces/validators/EnhancedErrorReporting.ts +227 -0
  316. package/src/core/schema/mode/interfaces/validators/TypeGuards.ts +288 -0
  317. package/src/core/schema/mode/interfaces/validators/TypeValidators.ts +660 -0
  318. package/src/core/schema/mode/interfaces/validators/UnionCache.ts +508 -0
  319. package/src/core/schema/mode/interfaces/validators/ValidationHelpers.ts +1257 -0
  320. package/src/core/schema/mode/interfaces/validators/index.ts +21 -0
  321. package/src/core/schema/mode/interfaces/validators/mods/passValidator.ts +424 -0
  322. package/src/core/schema/mode/interfaces/validators/mods/securityValidator.ts +1634 -0
  323. package/src/core/schema/mode/interfaces/validators/mods/urlValidation.ts +333 -0
  324. package/src/core/schema/optimization/ObjectValidationCache.ts +560 -0
  325. package/src/core/schema/optimization/PerformanceInitializer.ts +188 -0
  326. package/src/core/schema/optimization/PerformanceMonitor.ts +898 -0
  327. package/src/core/schema/optimization/SchemaCompiler.ts +730 -0
  328. package/src/core/testing/TestDataGenerator.ts +590 -0
  329. package/src/core/types/SchemaValidator.type.ts +210 -0
  330. package/src/core/types/ValidatorTypes.ts +93 -0
  331. package/src/core/types/extension.type.ts +109 -0
  332. package/src/core/types/objValidationCache.ts +17 -0
  333. package/src/core/types/parser.type.ts +15 -0
  334. package/src/core/types/perfoMonitor.ts +37 -0
  335. package/src/core/types/scompiler.ts +22 -0
  336. package/src/core/types/securityValidator.type.ts +10 -0
  337. package/src/core/types/types.ts +154 -0
  338. package/src/core/utils/Make.ts +97 -0
  339. package/src/core/utils/Mod.ts +1168 -0
  340. package/src/core/utils/UrlArgs.ts +124 -0
  341. package/src/core/utils/arrayToEnum.ts +89 -0
  342. package/src/core/utils/createUrlArgsEnumFArray.ts +11 -0
  343. package/src/core/utils/securityHelpers.ts +341 -0
  344. package/src/core/utils/securityValidatorHelpers.ts +76 -0
  345. package/src/index.ts +124 -0
@@ -0,0 +1,1132 @@
1
+ import { ConstraintType } from '../../../../types/parser.type.js';
2
+ import { VALID_CONDITIONNAL_TYPES, SUPPORTED_VALIDATOR_TYPES } from '../../../../types/ValidatorTypes.js';
3
+
4
+ /**
5
+ * Constraint Parser Module - Enhanced Robust Version
6
+ *
7
+ * Optimized parsing of constraint syntax like "string(3,20)", "number(0,100)?", etc.
8
+ * Uses caching, pre-compiled patterns, and robust regex validation for maximum reliability.
9
+ */
10
+ /**
11
+ * Enhanced constraint parser with robust regex patterns and bulletproof validation
12
+ */
13
+ class ConstraintParser {
14
+ /**
15
+ * Parse constraint syntax with aggressive caching and robust validation
16
+ */
17
+ static parseConstraints(fieldType) {
18
+ if (!this._isValidInput(fieldType)) {
19
+ throw new Error("Invalid field type: must be a non-empty string");
20
+ }
21
+ // Check cache first
22
+ const cached = this._parseCache.get(fieldType);
23
+ if (cached) {
24
+ this._cacheHits++;
25
+ return this._deepClone(cached);
26
+ }
27
+ this._cacheMisses++;
28
+ const result = this._parseConstraintsInternal(fieldType);
29
+ // Cache the result with size limit
30
+ this._addToCache(fieldType, result);
31
+ return result;
32
+ }
33
+ /**
34
+ * Enhanced input validation
35
+ */
36
+ static _isValidInput(input) {
37
+ return (typeof input === "string" &&
38
+ input.length > 0 &&
39
+ !this._patterns.whitespaceOnly.test(input));
40
+ }
41
+ /**
42
+ * Deep clone utility for cache results
43
+ */
44
+ static _deepClone(obj) {
45
+ const cloned = {
46
+ type: obj.type,
47
+ constraints: {},
48
+ optional: obj.optional,
49
+ required: obj.required,
50
+ };
51
+ // Deep clone constraints object
52
+ if (obj.constraints && typeof obj.constraints === "object") {
53
+ for (const [key, value] of Object.entries(obj.constraints)) {
54
+ if (value instanceof RegExp) {
55
+ cloned.constraints[key] = new RegExp(value.source, value.flags);
56
+ }
57
+ else if (typeof value === "object" && value !== null) {
58
+ cloned.constraints[key] = { ...value };
59
+ }
60
+ else {
61
+ cloned.constraints[key] = value;
62
+ }
63
+ }
64
+ }
65
+ return cloned;
66
+ }
67
+ /**
68
+ * Enhanced internal parsing logic with robust error handling
69
+ */
70
+ static _parseConstraintsInternal(fieldType) {
71
+ let optional = false;
72
+ let required = false;
73
+ let type = this._sanitizeInput(fieldType);
74
+ let constraints = {};
75
+ if (!type) {
76
+ throw new Error("Field type cannot be empty after sanitization");
77
+ }
78
+ // Enhanced optional marker detection
79
+ if (this._hasOptionalMarker(type)) {
80
+ optional = true;
81
+ type = this._removeOptionalMarker(type);
82
+ if (!type) {
83
+ throw new Error('Invalid field type: cannot be only "?"');
84
+ }
85
+ }
86
+ // Enhanced required marker detection
87
+ if (this._hasRequiredMarker(type)) {
88
+ required = true;
89
+ type = this._removeRequiredMarker(type);
90
+ if (!type) {
91
+ throw new Error('Invalid field type: cannot be only "!"');
92
+ }
93
+ }
94
+ // Enhanced union type detection
95
+ if (this._isUnionTypeInParentheses(type)) {
96
+ return { type, constraints: {}, optional, required };
97
+ }
98
+ // Enhanced constraint parsing with robust validation
99
+ const constraintMatch = this._parseBalancedConstraints(type);
100
+ if (constraintMatch) {
101
+ const { baseType, constraintStr } = constraintMatch;
102
+ type = baseType;
103
+ if (constraintStr) {
104
+ try {
105
+ constraints = this._parseConstraintString(constraintStr, baseType);
106
+ }
107
+ catch (error) {
108
+ throw new Error(`Invalid constraint syntax in "${fieldType}": ${this._getErrorMessage(error)}`);
109
+ }
110
+ }
111
+ }
112
+ // Check for conditional expressions (when ... *? ... : ...)
113
+ if (this._isConditionalExpression(type)) {
114
+ return { type, constraints: {}, optional, required };
115
+ }
116
+ // Enhanced base type validation
117
+ if (!this._isValidBaseType(type)) {
118
+ throw new Error(`Invalid base type: "${type}"`);
119
+ }
120
+ return { type, constraints, optional, required };
121
+ }
122
+ /**
123
+ * Check if type is a conditional expression using secure regex pattern
124
+ */
125
+ static _isConditionalExpression(type) {
126
+ // Secure regex pattern to match: when <condition> *? <thenValue> [: <elseValue>]
127
+ const conditionalPattern = /^\s*when\s+.+?\s*\*\?\s*.+/;
128
+ return conditionalPattern.test(type);
129
+ }
130
+ /**
131
+ * Enhanced input sanitization
132
+ */
133
+ static _sanitizeInput(input) {
134
+ if (typeof input !== "string") {
135
+ throw new Error("Input must be a string");
136
+ }
137
+ // Trim whitespace but preserve internal structure
138
+ return input.trim().replace(/\s+/g, " ");
139
+ }
140
+ /**
141
+ * Robust optional marker detection
142
+ */
143
+ static _hasOptionalMarker(type) {
144
+ return (type.length > 0 &&
145
+ type.charCodeAt(type.length - 1) === this._charCodes.questionMark &&
146
+ this._patterns.optionalMarker.test(type));
147
+ }
148
+ /**
149
+ * Safe optional marker removal
150
+ */
151
+ static _removeOptionalMarker(type) {
152
+ if (!this._hasOptionalMarker(type)) {
153
+ return type;
154
+ }
155
+ return type.slice(0, -1).trim();
156
+ }
157
+ /**
158
+ * Robust required marker detection
159
+ */
160
+ static _hasRequiredMarker(type) {
161
+ return (type.length > 0 &&
162
+ type.charCodeAt(type.length - 1) === this._charCodes.exclamation &&
163
+ this._patterns.requiredMarker.test(type));
164
+ }
165
+ /**
166
+ * Safe required marker removal
167
+ */
168
+ static _removeRequiredMarker(type) {
169
+ if (!this._hasRequiredMarker(type)) {
170
+ return type;
171
+ }
172
+ return type.slice(0, -1).trim();
173
+ }
174
+ /**
175
+ * Enhanced union type detection with regex validation
176
+ */
177
+ static _isUnionTypeInParentheses(type) {
178
+ return (this._patterns.unionType.test(type) &&
179
+ this._containsPipeOperator(type) &&
180
+ this._hasBalancedParentheses(type));
181
+ }
182
+ /**
183
+ * Check for pipe operator in union types
184
+ */
185
+ static _containsPipeOperator(type) {
186
+ for (let i = 0; i < type.length; i++) {
187
+ if (type.charCodeAt(i) === this._charCodes.pipe) {
188
+ return true;
189
+ }
190
+ }
191
+ return false;
192
+ }
193
+ /**
194
+ * Validate balanced parentheses
195
+ */
196
+ static _hasBalancedParentheses(input) {
197
+ let depth = 0;
198
+ for (let i = 0; i < input.length; i++) {
199
+ const charCode = input.charCodeAt(i);
200
+ if (charCode === this._charCodes.openParen) {
201
+ depth++;
202
+ }
203
+ else if (charCode === this._charCodes.closeParen) {
204
+ depth--;
205
+ if (depth < 0) {
206
+ return false;
207
+ }
208
+ }
209
+ }
210
+ return depth === 0;
211
+ }
212
+ /**
213
+ * Enhanced constraint parsing with robust parentheses handling
214
+ */
215
+ static _parseBalancedConstraints(type) {
216
+ const match = type.match(this._patterns.constraint);
217
+ if (!match) {
218
+ return null;
219
+ }
220
+ const [, baseType, constraintStr] = match;
221
+ // Enhanced base type validation
222
+ if (!this._patterns.baseType.test(baseType)) {
223
+ throw new Error(`Invalid base type format: "${baseType}"`);
224
+ }
225
+ // Validate constraint string is not empty
226
+ if (!constraintStr || this._patterns.whitespaceOnly.test(constraintStr)) {
227
+ throw new Error(`Empty constraint string in: "${type}"`);
228
+ }
229
+ // Validate balanced parentheses in constraint string
230
+ if (!this._validateConstraintParentheses(constraintStr)) {
231
+ throw new Error(`Unbalanced parentheses in constraint: "${type}"`);
232
+ }
233
+ return { baseType, constraintStr };
234
+ }
235
+ /**
236
+ * Validate parentheses balance in constraint strings
237
+ */
238
+ static _validateConstraintParentheses(constraintStr) {
239
+ let depth = 0;
240
+ let inRegex = false;
241
+ let escaped = false;
242
+ for (let i = 0; i < constraintStr.length; i++) {
243
+ const charCode = constraintStr.charCodeAt(i);
244
+ constraintStr[i];
245
+ // Handle regex pattern detection
246
+ if (charCode === this._charCodes.slash && !escaped) {
247
+ inRegex = !inRegex;
248
+ escaped = false;
249
+ continue;
250
+ }
251
+ // Handle escaping
252
+ if (charCode === this._charCodes.backslash && !escaped) {
253
+ escaped = true;
254
+ continue;
255
+ }
256
+ // Skip parentheses inside regex patterns
257
+ if (!inRegex) {
258
+ if (charCode === this._charCodes.openParen && !escaped) {
259
+ depth++;
260
+ }
261
+ else if (charCode === this._charCodes.closeParen && !escaped) {
262
+ depth--;
263
+ if (depth < 0) {
264
+ return false;
265
+ }
266
+ }
267
+ }
268
+ escaped = false;
269
+ }
270
+ return depth === 0;
271
+ }
272
+ /**
273
+ * Enhanced constraint string parsing with robust error handling
274
+ */
275
+ static _parseConstraintString(constraintStr, baseType) {
276
+ const trimmed = constraintStr.trim();
277
+ if (!trimmed) {
278
+ return {};
279
+ }
280
+ const constraints = {};
281
+ // Enhanced regex pattern detection
282
+ const regexMatch = this._parseRegexPattern(trimmed);
283
+ if (regexMatch) {
284
+ constraints.pattern = regexMatch;
285
+ return constraints;
286
+ }
287
+ // Enhanced semicolon-separated complex constraints
288
+ if (this._containsCharCode(trimmed, this._charCodes.semicolon)) {
289
+ return this._parseComplexConstraints(trimmed);
290
+ }
291
+ // Enhanced min,max constraints
292
+ if (this._containsCharCode(trimmed, this._charCodes.comma)) {
293
+ return this._parseMinMaxConstraints(trimmed, baseType);
294
+ }
295
+ // Enhanced single value constraint
296
+ if (this._isValidNumericValue(trimmed)) {
297
+ const val = this._parseNumericValue(trimmed);
298
+ this._setConstraintValue(constraints, baseType, ConstraintType.Max, val);
299
+ return constraints;
300
+ }
301
+ throw new Error(`Unrecognized constraint format: "${trimmed}"`);
302
+ }
303
+ /**
304
+ * Enhanced regex pattern parsing
305
+ */
306
+ static _parseRegexPattern(input) {
307
+ const match = input.match(this._patterns.regex);
308
+ if (!match) {
309
+ return null;
310
+ }
311
+ try {
312
+ const [, pattern, flags] = match;
313
+ // Validate flags
314
+ if (flags && !this._isValidRegexFlags(flags)) {
315
+ throw new Error(`Invalid regex flags: "${flags}"`);
316
+ }
317
+ return new RegExp(pattern, flags || "");
318
+ }
319
+ catch (error) {
320
+ throw new Error(`Invalid regex pattern: ${this._getErrorMessage(error)}`);
321
+ }
322
+ }
323
+ /**
324
+ * Validate regex flags
325
+ */
326
+ static _isValidRegexFlags(flags) {
327
+ const validFlags = new Set(["g", "i", "m", "s", "u", "v", "y"]);
328
+ const flagSet = new Set();
329
+ for (const flag of flags) {
330
+ if (!validFlags.has(flag)) {
331
+ return false;
332
+ }
333
+ if (flagSet.has(flag)) {
334
+ return false; // Duplicate flag
335
+ }
336
+ flagSet.add(flag);
337
+ }
338
+ return true;
339
+ }
340
+ /**
341
+ * Check if string contains specific character code
342
+ */
343
+ static _containsCharCode(str, charCode) {
344
+ for (let i = 0; i < str.length; i++) {
345
+ if (str.charCodeAt(i) === charCode) {
346
+ return true;
347
+ }
348
+ }
349
+ return false;
350
+ }
351
+ /**
352
+ * Enhanced numeric value validation
353
+ */
354
+ static _isValidNumericValue(value) {
355
+ if (!value || typeof value !== "string") {
356
+ return false;
357
+ }
358
+ return this._patterns.numeric.test(value.trim());
359
+ }
360
+ /**
361
+ * Safe numeric value parsing
362
+ */
363
+ static _parseNumericValue(value) {
364
+ const trimmed = value.trim();
365
+ if (!this._isValidNumericValue(trimmed)) {
366
+ throw new Error(`Invalid numeric value: "${value}"`);
367
+ }
368
+ const parsed = Number(trimmed);
369
+ if (!Number.isFinite(parsed)) {
370
+ throw new Error(`Non-finite numeric value: "${value}"`);
371
+ }
372
+ return parsed;
373
+ }
374
+ /**
375
+ * Enhanced min,max constraint parsing
376
+ */
377
+ static _parseMinMaxConstraints(constraintStr, baseType) {
378
+ const constraints = {};
379
+ const parts = constraintStr.split(this._patterns.commaSplit);
380
+ if (parts.length > 2) {
381
+ throw new Error(`Too many constraint values. Expected format: "min,max" but got: "${constraintStr}"`);
382
+ }
383
+ const [minStr, maxStr] = parts;
384
+ // Enhanced minimum value parsing
385
+ if (minStr && !this._patterns.whitespaceOnly.test(minStr)) {
386
+ const minVal = this._parseNumericValue(minStr);
387
+ this._setConstraintValue(constraints, baseType, ConstraintType.Min, minVal);
388
+ }
389
+ // Enhanced maximum value parsing
390
+ if (maxStr && !this._patterns.whitespaceOnly.test(maxStr)) {
391
+ const maxVal = this._parseNumericValue(maxStr);
392
+ this._setConstraintValue(constraints, baseType, ConstraintType.Max, maxVal);
393
+ }
394
+ // Enhanced min/max relationship validation
395
+ this._validateMinMaxRelationship(constraints);
396
+ return constraints;
397
+ }
398
+ /**
399
+ * Validate min/max constraint relationships
400
+ */
401
+ static _validateMinMaxRelationship(constraints) {
402
+ const pairs = [
403
+ ["min", "max"],
404
+ ["minLength", "maxLength"],
405
+ ["minItems", "maxItems"],
406
+ ];
407
+ for (const [minKey, maxKey] of pairs) {
408
+ if (constraints[minKey] !== undefined &&
409
+ constraints[maxKey] !== undefined) {
410
+ if (constraints[minKey] > constraints[maxKey]) {
411
+ throw new Error(`${minKey} value (${constraints[minKey]}) cannot be greater than ${maxKey} value (${constraints[maxKey]})`);
412
+ }
413
+ }
414
+ }
415
+ }
416
+ /**
417
+ * Enhanced constraint value setting with robust validation
418
+ */
419
+ static _setConstraintValue(constraints, baseType, constraintType, value) {
420
+ // Enhanced negative value validation
421
+ if (!Number.isFinite(value)) {
422
+ throw new Error(`Constraint value must be finite: ${value}`);
423
+ }
424
+ // Type-specific negative value validation
425
+ if (this._isStringType(baseType) && value < 0) {
426
+ throw new Error("String length constraints cannot be negative");
427
+ }
428
+ if (this._isArrayType(baseType) && value < 0) {
429
+ throw new Error("Array length constraints cannot be negative");
430
+ }
431
+ // Set appropriate constraint based on type
432
+ if (this._isArrayType(baseType)) {
433
+ constraints[constraintType === ConstraintType.Min
434
+ ? ConstraintType.MinItems
435
+ : ConstraintType.MaxItems] = value;
436
+ }
437
+ else if (this._isStringType(baseType)) {
438
+ constraints[constraintType === ConstraintType.Min
439
+ ? ConstraintType.MinLength
440
+ : ConstraintType.MaxLength] = value;
441
+ }
442
+ else {
443
+ constraints[constraintType] = value;
444
+ }
445
+ }
446
+ /**
447
+ * Enhanced string type detection
448
+ */
449
+ static _isStringType(type) {
450
+ return (type === "string" ||
451
+ (this._patterns.baseType.test(type) && type.includes("string")));
452
+ }
453
+ /**
454
+ * Enhanced array type detection
455
+ */
456
+ static _isArrayType(type) {
457
+ return this._patterns.arrayType.test(type) || type.endsWith("[]");
458
+ }
459
+ /**
460
+ * Enhanced base type validation with comprehensive checks
461
+ */
462
+ static _isValidBaseType(type) {
463
+ if (!type || typeof type !== "string") {
464
+ return false;
465
+ }
466
+ // Enhanced whitespace validation
467
+ if (this._patterns.whitespaceOnly.test(type)) {
468
+ return false;
469
+ }
470
+ // Check valid conditional types
471
+ if (VALID_CONDITIONNAL_TYPES.includes(type)) {
472
+ return true;
473
+ }
474
+ // Enhanced union type validation
475
+ if (this._containsPipeOperator(type)) {
476
+ return this._validateUnionType(type);
477
+ }
478
+ // Enhanced literal value validation
479
+ if (this._patterns.literalValue.test(type)) {
480
+ return true;
481
+ }
482
+ // Enhanced Record type validation
483
+ if (this._isRecordType(type)) {
484
+ return true;
485
+ }
486
+ // Enhanced supported validator types check
487
+ if (SUPPORTED_VALIDATOR_TYPES.includes(type)) {
488
+ return true;
489
+ }
490
+ // Enhanced base type pattern validation
491
+ return this._patterns.baseType.test(type);
492
+ }
493
+ /**
494
+ * Validate union types
495
+ */
496
+ static _validateUnionType(type) {
497
+ const parts = type.split("|");
498
+ if (parts.length < 2) {
499
+ return false;
500
+ }
501
+ return parts.every((part) => {
502
+ const trimmed = part.trim();
503
+ return trimmed.length > 0 && !this._patterns.whitespaceOnly.test(trimmed);
504
+ });
505
+ }
506
+ /**
507
+ * Enhanced Record type detection
508
+ */
509
+ static _isRecordType(type) {
510
+ return (this._patterns.recordTypeLower.test(type) ||
511
+ this._patterns.recordTypeUpper.test(type));
512
+ }
513
+ /**
514
+ * Enhanced cache management with deep cloning
515
+ */
516
+ static _addToCache(key, value) {
517
+ if (this._parseCache.size >= this._maxCacheSize) {
518
+ const firstKey = this._parseCache.keys().next().value;
519
+ if (firstKey) {
520
+ this._parseCache.delete(firstKey);
521
+ }
522
+ }
523
+ this._parseCache.set(key, this._deepClone(value));
524
+ }
525
+ /**
526
+ * Enhanced complex constraint parsing
527
+ */
528
+ static _parseComplexConstraints(constraintStr) {
529
+ const constraints = {};
530
+ const parts = constraintStr
531
+ .split(this._patterns.semicolonSplit)
532
+ .map((part) => part.trim())
533
+ .filter((part) => !this._patterns.whitespaceOnly.test(part));
534
+ if (parts.length === 0) {
535
+ throw new Error("Empty complex constraint string");
536
+ }
537
+ for (const part of parts) {
538
+ try {
539
+ this._parseComplexConstraintPart(constraints, part);
540
+ }
541
+ catch (error) {
542
+ throw new Error(`Error parsing constraint "${part}": ${this._getErrorMessage(error)}`);
543
+ }
544
+ }
545
+ return constraints;
546
+ }
547
+ /**
548
+ * Parse individual complex constraint part
549
+ */
550
+ static _parseComplexConstraintPart(constraints, part) {
551
+ const colonParts = part.split(this._patterns.colonSplit);
552
+ if (colonParts.length !== 2) {
553
+ throw new Error(`Invalid constraint format. Expected "key:value" but got: "${part}"`);
554
+ }
555
+ const [key, value] = colonParts;
556
+ if (this._patterns.whitespaceOnly.test(key) ||
557
+ this._patterns.whitespaceOnly.test(value)) {
558
+ throw new Error(`Invalid constraint format. Both key and value must be non-empty: "${part}"`);
559
+ }
560
+ if (!this._patterns.constraintKey.test(key)) {
561
+ throw new Error(`Invalid constraint key format: "${key}"`);
562
+ }
563
+ this._parseComplexConstraintPair(constraints, key, value);
564
+ }
565
+ /**
566
+ * Enhanced individual constraint key-value pair parsing
567
+ */
568
+ static _parseComplexConstraintPair(constraints, key, value) {
569
+ switch (key) {
570
+ case ConstraintType.Min:
571
+ case ConstraintType.Max:
572
+ case ConstraintType.MinLength:
573
+ case ConstraintType.MaxLength:
574
+ case ConstraintType.MinItems:
575
+ case ConstraintType.MaxItems:
576
+ const numValue = this._parseNumericValue(value);
577
+ if (numValue < 0 && (key.includes("Length") || key.includes("Items"))) {
578
+ throw new Error(`"${key}" cannot be negative`);
579
+ }
580
+ constraints[key] = numValue;
581
+ break;
582
+ case "pattern":
583
+ const regexPattern = this._parseRegexPattern(value);
584
+ if (!regexPattern) {
585
+ throw new Error(`Pattern must be in regex format (/pattern/flags): "${value}"`);
586
+ }
587
+ constraints.pattern = regexPattern;
588
+ break;
589
+ case "unique":
590
+ if (!this._patterns.booleanValue.test(value)) {
591
+ throw new Error(`"unique" must be "true" or "false", got: "${value}"`);
592
+ }
593
+ constraints.unique = value.toLowerCase() === "true";
594
+ break;
595
+ default:
596
+ throw new Error(`Unknown constraint key: "${key}"`);
597
+ }
598
+ }
599
+ /**
600
+ * Enhanced error message extraction
601
+ */
602
+ static _getErrorMessage(error) {
603
+ if (error instanceof Error) {
604
+ return error.message;
605
+ }
606
+ if (typeof error === "string") {
607
+ return error;
608
+ }
609
+ return "Unknown error";
610
+ }
611
+ // Enhanced public utility methods with stronger validation
612
+ /**
613
+ * Check if a field type has constraints - enhanced validation
614
+ */
615
+ static hasConstraints(fieldType) {
616
+ if (!this._isValidInput(fieldType)) {
617
+ return false;
618
+ }
619
+ const sanitized = this._sanitizeInput(fieldType);
620
+ const withoutModifiers = sanitized
621
+ .replace(this._patterns.optionalMarker, "")
622
+ .replace(this._patterns.requiredMarker, "");
623
+ return this._patterns.complexConstraint.test(withoutModifiers);
624
+ }
625
+ /**
626
+ * Extract base type without constraints - enhanced
627
+ */
628
+ static getBaseType(fieldType) {
629
+ if (!this._isValidInput(fieldType)) {
630
+ return "";
631
+ }
632
+ try {
633
+ const parsed = this.parseConstraints(fieldType);
634
+ return parsed.type;
635
+ }
636
+ catch {
637
+ // Enhanced fallback with regex
638
+ const sanitized = this._sanitizeInput(fieldType);
639
+ return sanitized
640
+ .replace(/\([^)]*\)/, "")
641
+ .replace(this._patterns.optionalMarker, "")
642
+ .replace(this._patterns.requiredMarker, "")
643
+ .trim();
644
+ }
645
+ }
646
+ /**
647
+ * Check if field type is optional - enhanced
648
+ */
649
+ static isOptional(fieldType) {
650
+ return this._isValidInput(fieldType) && this._hasOptionalMarker(fieldType);
651
+ }
652
+ /**
653
+ * Check if field type is required - enhanced
654
+ */
655
+ static isRequired(fieldType) {
656
+ return this._isValidInput(fieldType) && this._hasRequiredMarker(fieldType);
657
+ }
658
+ /**
659
+ * Check if field type is an array - enhanced
660
+ */
661
+ static isArrayType(fieldType) {
662
+ if (!this._isValidInput(fieldType)) {
663
+ return false;
664
+ }
665
+ try {
666
+ const parsed = this.parseConstraints(fieldType);
667
+ return this._isArrayType(parsed.type);
668
+ }
669
+ catch {
670
+ return false;
671
+ }
672
+ }
673
+ /**
674
+ * Get element type for array types - enhanced
675
+ */
676
+ static getElementType(fieldType) {
677
+ if (!this._isValidInput(fieldType)) {
678
+ return fieldType;
679
+ }
680
+ try {
681
+ const parsed = this.parseConstraints(fieldType);
682
+ if (this._isArrayType(parsed.type)) {
683
+ return parsed.type.replace(/\[\]$/, "");
684
+ }
685
+ return parsed.type;
686
+ }
687
+ catch {
688
+ return fieldType;
689
+ }
690
+ }
691
+ /**
692
+ * Enhanced constraint validation
693
+ */
694
+ static validateConstraints(constraints, type) {
695
+ if (!constraints || typeof constraints !== "object") {
696
+ return [];
697
+ }
698
+ const errors = [];
699
+ try {
700
+ // Enhanced min/max validation
701
+ this._validateMinMaxRelationship(constraints);
702
+ // Enhanced type-specific validation
703
+ this._validateTypeSpecificConstraints(constraints, type, errors);
704
+ // Enhanced regex pattern validation
705
+ if (constraints.pattern && !(constraints.pattern instanceof RegExp)) {
706
+ errors.push("Pattern constraint must be a RegExp object");
707
+ }
708
+ // Enhanced negative value validation
709
+ this._validateNegativeConstraints(constraints, errors);
710
+ }
711
+ catch (error) {
712
+ errors.push(`Constraint validation error: ${this._getErrorMessage(error)}`);
713
+ }
714
+ return errors;
715
+ }
716
+ /**
717
+ * Validate type-specific constraints
718
+ */
719
+ static _validateTypeSpecificConstraints(constraints, type, errors) {
720
+ if (type === "positive" &&
721
+ constraints.min !== undefined &&
722
+ constraints.min < 0) {
723
+ errors.push("Positive type cannot have negative minimum value");
724
+ }
725
+ if (type === "negative" &&
726
+ constraints.max !== undefined &&
727
+ constraints.max > 0) {
728
+ errors.push("Negative type cannot have positive maximum value");
729
+ }
730
+ }
731
+ /**
732
+ * Validate negative constraints
733
+ */
734
+ static _validateNegativeConstraints(constraints, errors) {
735
+ const lengthKeys = [
736
+ ConstraintType.MinLength,
737
+ ConstraintType.MaxLength,
738
+ ConstraintType.MinItems,
739
+ ConstraintType.MaxItems,
740
+ ];
741
+ lengthKeys.forEach((key) => {
742
+ if (constraints[key] !== undefined && constraints[key] < 0) {
743
+ errors.push(`${key} cannot be negative`);
744
+ }
745
+ });
746
+ }
747
+ /**
748
+ * Enhanced constraint merging
749
+ */
750
+ static mergeConstraints(baseOptions, constraints) {
751
+ if (!baseOptions && !constraints) {
752
+ return {};
753
+ }
754
+ if (!baseOptions) {
755
+ return this._deepCloneObject(constraints);
756
+ }
757
+ if (!constraints) {
758
+ return this._deepCloneObject(baseOptions);
759
+ }
760
+ const merged = { ...baseOptions };
761
+ // Enhanced merging with conflict resolution
762
+ for (const [key, value] of Object.entries(constraints)) {
763
+ if (value instanceof RegExp) {
764
+ merged[key] = new RegExp(value.source, value.flags);
765
+ }
766
+ else if (typeof value === "object" && value !== null) {
767
+ merged[key] = { ...value };
768
+ }
769
+ else {
770
+ merged[key] = value;
771
+ }
772
+ }
773
+ return merged;
774
+ }
775
+ /**
776
+ * Deep clone utility for objects
777
+ */
778
+ static _deepCloneObject(obj) {
779
+ if (!obj || typeof obj !== "object") {
780
+ return obj;
781
+ }
782
+ const cloned = {};
783
+ for (const [key, value] of Object.entries(obj)) {
784
+ if (value instanceof RegExp) {
785
+ cloned[key] = new RegExp(value.source, value.flags);
786
+ }
787
+ else if (typeof value === "object" && value !== null) {
788
+ cloned[key] = { ...value };
789
+ }
790
+ else {
791
+ cloned[key] = value;
792
+ }
793
+ }
794
+ return cloned;
795
+ }
796
+ /**
797
+ * Enhanced cache clearing with statistics reset
798
+ */
799
+ static clearCache() {
800
+ this._parseCache.clear();
801
+ this._cacheHits = 0;
802
+ this._cacheMisses = 0;
803
+ }
804
+ /**
805
+ * Enhanced cache statistics with additional metrics
806
+ */
807
+ static getCacheStats() {
808
+ const total = this._cacheHits + this._cacheMisses;
809
+ const hitRate = total > 0 ? this._cacheHits / total : 0;
810
+ const efficiency = this._parseCache.size > 0 ? hitRate : 0;
811
+ return {
812
+ size: this._parseCache.size,
813
+ hitRate: Number(hitRate.toFixed(4)),
814
+ hits: this._cacheHits,
815
+ misses: this._cacheMisses,
816
+ maxSize: this._maxCacheSize,
817
+ efficiency: Number(efficiency.toFixed(4)),
818
+ };
819
+ }
820
+ /**
821
+ * Enhanced constraint description with better formatting
822
+ */
823
+ static getConstraintDescription(constraints, _type) {
824
+ if (!constraints || typeof constraints !== "object") {
825
+ return "";
826
+ }
827
+ const descriptions = [];
828
+ try {
829
+ const constraintKeys = [
830
+ ConstraintType.Min,
831
+ ConstraintType.Max,
832
+ ConstraintType.MinLength,
833
+ ConstraintType.MaxLength,
834
+ ConstraintType.MinItems,
835
+ ConstraintType.MaxItems,
836
+ ];
837
+ constraintKeys.forEach((key) => {
838
+ if (constraints[key] !== undefined &&
839
+ Number.isFinite(constraints[key])) {
840
+ descriptions.push(`${key}: ${constraints[key]}`);
841
+ }
842
+ });
843
+ if (constraints.pattern instanceof RegExp) {
844
+ const flags = constraints.pattern.flags
845
+ ? `/${constraints.pattern.flags}`
846
+ : "";
847
+ descriptions.push(`pattern: /${constraints.pattern.source}${flags}`);
848
+ }
849
+ if (constraints.unique === true) {
850
+ descriptions.push("unique: true");
851
+ }
852
+ // Enhanced description formatting
853
+ return descriptions.length > 0 ? `(${descriptions.join(", ")})` : "";
854
+ }
855
+ catch (error) {
856
+ return `(invalid constraints: ${this._getErrorMessage(error)})`;
857
+ }
858
+ }
859
+ /**
860
+ * Enhanced complex constraint parsing (public interface)
861
+ */
862
+ static parseComplexConstraints(constraintStr) {
863
+ if (!this._isValidInput(constraintStr)) {
864
+ throw new Error("Invalid constraint string: must be a non-empty string");
865
+ }
866
+ try {
867
+ return this._parseComplexConstraints(constraintStr);
868
+ }
869
+ catch (error) {
870
+ throw new Error(`Failed to parse complex constraints "${constraintStr}": ${this._getErrorMessage(error)}`);
871
+ }
872
+ }
873
+ // Additional enhanced utility methods
874
+ /**
875
+ * Validate field type format comprehensively
876
+ */
877
+ static isValidFieldType(fieldType) {
878
+ if (!this._isValidInput(fieldType)) {
879
+ return false;
880
+ }
881
+ try {
882
+ this.parseConstraints(fieldType);
883
+ return true;
884
+ }
885
+ catch {
886
+ return false;
887
+ }
888
+ }
889
+ /**
890
+ * Extract all modifiers from field type
891
+ */
892
+ static getFieldTypeModifiers(fieldType) {
893
+ if (!this._isValidInput(fieldType)) {
894
+ return { optional: false, required: false, hasConstraints: false };
895
+ }
896
+ try {
897
+ const parsed = this.parseConstraints(fieldType);
898
+ return {
899
+ optional: parsed.optional,
900
+ required: parsed.required,
901
+ hasConstraints: Object.keys(parsed.constraints).length > 0,
902
+ };
903
+ }
904
+ catch {
905
+ return {
906
+ optional: this.isOptional(fieldType),
907
+ required: this.isRequired(fieldType),
908
+ hasConstraints: this.hasConstraints(fieldType),
909
+ };
910
+ }
911
+ }
912
+ /**
913
+ * Normalize field type string
914
+ */
915
+ static normalizeFieldType(fieldType) {
916
+ if (!this._isValidInput(fieldType)) {
917
+ return "";
918
+ }
919
+ try {
920
+ const parsed = this.parseConstraints(fieldType);
921
+ let normalized = parsed.type;
922
+ // Add constraints back if they exist
923
+ if (Object.keys(parsed.constraints).length > 0) {
924
+ const constraintDesc = this._formatConstraintsForType(parsed.constraints);
925
+ if (constraintDesc) {
926
+ normalized += `(${constraintDesc})`;
927
+ }
928
+ }
929
+ // Add modifiers back
930
+ if (parsed.required) {
931
+ normalized += "!";
932
+ }
933
+ if (parsed.optional) {
934
+ normalized += "?";
935
+ }
936
+ return normalized;
937
+ }
938
+ catch {
939
+ return this._sanitizeInput(fieldType);
940
+ }
941
+ }
942
+ /**
943
+ * Format constraints for type reconstruction
944
+ */
945
+ static _formatConstraintsForType(constraints) {
946
+ if (!constraints || typeof constraints !== "object") {
947
+ return "";
948
+ }
949
+ const parts = [];
950
+ // Handle regex pattern
951
+ if (constraints.pattern instanceof RegExp) {
952
+ const flags = constraints.pattern.flags || "";
953
+ parts.push(`/${constraints.pattern.source}/${flags}`);
954
+ return parts.join(";");
955
+ }
956
+ // Handle min/max pairs
957
+ if (constraints.min !== undefined && constraints.max !== undefined) {
958
+ parts.push(`${constraints.min},${constraints.max}`);
959
+ }
960
+ else if (constraints.min !== undefined) {
961
+ parts.push(`${constraints.min},`);
962
+ }
963
+ else if (constraints.max !== undefined) {
964
+ parts.push(`${constraints.max}`);
965
+ }
966
+ // Handle length constraints
967
+ if (constraints.minLength !== undefined &&
968
+ constraints.maxLength !== undefined) {
969
+ if (parts.length === 0) {
970
+ parts.push(`${constraints.minLength},${constraints.maxLength}`);
971
+ }
972
+ else {
973
+ parts.push(`minLength:${constraints.minLength};maxLength:${constraints.maxLength}`);
974
+ }
975
+ }
976
+ // Handle items constraints
977
+ if (constraints.minItems !== undefined &&
978
+ constraints.maxItems !== undefined) {
979
+ if (parts.length === 0) {
980
+ parts.push(`${constraints.minItems},${constraints.maxItems}`);
981
+ }
982
+ else {
983
+ parts.push(`minItems:${constraints.minItems};maxItems:${constraints.maxItems}`);
984
+ }
985
+ }
986
+ // Handle unique
987
+ if (constraints.unique === true) {
988
+ parts.push("unique:true");
989
+ }
990
+ return parts.join(";");
991
+ }
992
+ /**
993
+ * Performance monitoring utilities
994
+ */
995
+ static getParsingPerformance() {
996
+ const total = this._cacheHits + this._cacheMisses;
997
+ const hitRatio = total > 0 ? this._cacheHits / total : 0;
998
+ return {
999
+ totalParses: total,
1000
+ cacheHitRatio: Number(hitRatio.toFixed(4)),
1001
+ averageParseTime: 0, // Would need instrumentation
1002
+ memoryUsage: this._parseCache.size * 100, // Rough estimate
1003
+ };
1004
+ }
1005
+ /**
1006
+ * Optimize cache by removing least recently used entries
1007
+ */
1008
+ static optimizeCache() {
1009
+ if (this._parseCache.size <= this._maxCacheSize * 0.8) {
1010
+ return; // No optimization needed
1011
+ }
1012
+ const entries = Array.from(this._parseCache.entries());
1013
+ const keepSize = Math.floor(this._maxCacheSize * 0.6);
1014
+ // Keep most recent entries (simple LRU approximation)
1015
+ this._parseCache.clear();
1016
+ entries.slice(-keepSize).forEach(([key, value]) => {
1017
+ this._parseCache.set(key, value);
1018
+ });
1019
+ }
1020
+ /**
1021
+ * Validate constraint compatibility with field type
1022
+ */
1023
+ static validateConstraintCompatibility(fieldType, constraints) {
1024
+ const errors = [];
1025
+ if (!this._isValidInput(fieldType)) {
1026
+ errors.push("Invalid field type");
1027
+ return { valid: false, errors };
1028
+ }
1029
+ if (!constraints || typeof constraints !== "object") {
1030
+ return { valid: true, errors: [] };
1031
+ }
1032
+ try {
1033
+ const parsed = this.parseConstraints(fieldType);
1034
+ const baseType = parsed.type;
1035
+ // Check string-specific constraints
1036
+ if (!this._isStringType(baseType)) {
1037
+ if (constraints.minLength !== undefined ||
1038
+ constraints.maxLength !== undefined) {
1039
+ errors.push("Length constraints are only valid for string types");
1040
+ }
1041
+ if (constraints.pattern !== undefined) {
1042
+ errors.push("Pattern constraints are only valid for string types");
1043
+ }
1044
+ }
1045
+ // Check array-specific constraints
1046
+ if (!this._isArrayType(baseType)) {
1047
+ if (constraints.minItems !== undefined ||
1048
+ constraints.maxItems !== undefined) {
1049
+ errors.push("Item constraints are only valid for array types");
1050
+ }
1051
+ if (constraints.unique !== undefined) {
1052
+ errors.push("Unique constraints are only valid for array types");
1053
+ }
1054
+ }
1055
+ // Check numeric-specific constraints
1056
+ const numericTypes = ["number", "integer", "positive", "negative"];
1057
+ if (!numericTypes.some((t) => baseType.includes(t))) {
1058
+ if (constraints.min !== undefined || constraints.max !== undefined) {
1059
+ errors.push("Min/Max constraints are only valid for numeric types");
1060
+ }
1061
+ }
1062
+ }
1063
+ catch (error) {
1064
+ errors.push(`Type parsing error: ${this._getErrorMessage(error)}`);
1065
+ }
1066
+ return { valid: errors.length === 0, errors };
1067
+ }
1068
+ }
1069
+ // Private static properties for better encapsulation
1070
+ ConstraintParser._parseCache = new Map();
1071
+ ConstraintParser._maxCacheSize = 1000;
1072
+ ConstraintParser._cacheHits = 0;
1073
+ ConstraintParser._cacheMisses = 0;
1074
+ // pre-compiled regex patterns with stronger validation
1075
+ ConstraintParser._patterns = {
1076
+ // Robust constraint pattern - handles complex nested patterns
1077
+ constraint: /^([a-zA-Z_][a-zA-Z0-9_]*(?:\[\])*)\((.+)\)$/,
1078
+ // Enhanced regex pattern detection with proper escaping
1079
+ regex: /^\/(.+?)\/([gimsuvy]*)$/,
1080
+ // Precise comma splitting that handles whitespace
1081
+ commaSplit: /\s*,\s*/,
1082
+ // Robust numeric validation including scientific notation and edge cases
1083
+ numeric: /^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/,
1084
+ // Strict base type validation
1085
+ baseType: /^[a-zA-Z_][a-zA-Z0-9_]*(?:\[\])*$/,
1086
+ // Enhanced complex constraint detection
1087
+ complexConstraint: /^[a-zA-Z_][a-zA-Z0-9_]*(?:\[\])*\([^)]*\)$/,
1088
+ // Union type detection with balanced parentheses
1089
+ unionType: /^\([^()]*(?:\|[^()]*)+\)$/,
1090
+ // Record type detection (both cases)
1091
+ recordTypeLower: /^record<[^<>]+>$/i,
1092
+ recordTypeUpper: /^Record<[^<>]+>$/,
1093
+ // Optional marker validation
1094
+ optionalMarker: /\?$/,
1095
+ // Required marker validation
1096
+ requiredMarker: /!$/,
1097
+ // Whitespace validation
1098
+ whitespaceOnly: /^\s*$/,
1099
+ // Constraint key validation
1100
+ constraintKey: /^[a-zA-Z][a-zA-Z0-9_]*$/,
1101
+ // Balanced parentheses validation
1102
+ balancedParens: /^[^()]*(?:\([^()]*\)[^()]*)*$/,
1103
+ // Array type detection
1104
+ arrayType: /^[a-zA-Z_][a-zA-Z0-9_]*\[\]$/,
1105
+ // Equal sign prefix for literal values
1106
+ literalValue: /^=/,
1107
+ // Boolean value validation
1108
+ booleanValue: /^(?:true|false)$/i,
1109
+ // Enhanced semicolon split for complex constraints
1110
+ semicolonSplit: /\s*;\s*/,
1111
+ // Colon split for key-value pairs
1112
+ colonSplit: /\s*:\s*/,
1113
+ };
1114
+ // Character codes for optimized checks
1115
+ ConstraintParser._charCodes = {
1116
+ questionMark: 63, // '?'
1117
+ exclamation: 33, // '!'
1118
+ openParen: 40, // '('
1119
+ closeParen: 41, // ')'
1120
+ comma: 44, // ','
1121
+ semicolon: 59, // ';'
1122
+ colon: 58, // ':'
1123
+ pipe: 124, // '|'
1124
+ openBracket: 91, // '['
1125
+ closeBracket: 93, // ']'
1126
+ slash: 47, // '/'
1127
+ backslash: 92, // '\'
1128
+ equal: 61, // '='
1129
+ };
1130
+
1131
+ export { ConstraintParser };
1132
+ //# sourceMappingURL=ConstraintParser.js.map