@typia/utils 12.1.0-dev.20260325 → 13.0.0-dev.20260426

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 (619) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +85 -85
  3. package/lib/_virtual/ArrayUtil.mjs +4 -0
  4. package/lib/_virtual/ArrayUtil.mjs.map +1 -0
  5. package/lib/_virtual/EndpointUtil.mjs +4 -0
  6. package/lib/_virtual/EndpointUtil.mjs.map +1 -0
  7. package/lib/_virtual/HttpError.mjs +4 -0
  8. package/lib/_virtual/HttpError.mjs.map +1 -0
  9. package/lib/_virtual/HttpLlm.mjs +4 -0
  10. package/lib/_virtual/HttpLlm.mjs.map +1 -0
  11. package/lib/_virtual/HttpLlmApplicationComposer.mjs +4 -0
  12. package/lib/_virtual/HttpLlmApplicationComposer.mjs.map +1 -0
  13. package/lib/_virtual/HttpLlmFunctionFetcher.mjs +4 -0
  14. package/lib/_virtual/HttpLlmFunctionFetcher.mjs.map +1 -0
  15. package/lib/_virtual/HttpMigrateApplicationComposer.mjs +4 -0
  16. package/lib/_virtual/HttpMigrateApplicationComposer.mjs.map +1 -0
  17. package/lib/_virtual/HttpMigrateRouteAccessor.mjs +4 -0
  18. package/lib/_virtual/HttpMigrateRouteAccessor.mjs.map +1 -0
  19. package/lib/_virtual/HttpMigrateRouteComposer.mjs +4 -0
  20. package/lib/_virtual/HttpMigrateRouteComposer.mjs.map +1 -0
  21. package/lib/_virtual/HttpMigrateRouteFetcher.mjs +4 -0
  22. package/lib/_virtual/HttpMigrateRouteFetcher.mjs.map +1 -0
  23. package/lib/_virtual/HttpMigration.mjs +4 -0
  24. package/lib/_virtual/HttpMigration.mjs.map +1 -0
  25. package/lib/_virtual/IOpenApiValidatorContext.mjs +4 -0
  26. package/lib/_virtual/IOpenApiValidatorContext.mjs.map +1 -0
  27. package/lib/_virtual/JsonDescriptor.mjs +4 -0
  28. package/lib/_virtual/JsonDescriptor.mjs.map +1 -0
  29. package/lib/_virtual/LlmDescriptionInverter.mjs +4 -0
  30. package/lib/_virtual/LlmDescriptionInverter.mjs.map +1 -0
  31. package/lib/_virtual/LlmJson.mjs +4 -0
  32. package/lib/_virtual/LlmJson.mjs.map +1 -0
  33. package/lib/_virtual/LlmParametersComposer.mjs +4 -0
  34. package/lib/_virtual/LlmParametersComposer.mjs.map +1 -0
  35. package/lib/_virtual/LlmSchemaConverter.mjs +4 -0
  36. package/lib/_virtual/LlmSchemaConverter.mjs.map +1 -0
  37. package/lib/_virtual/LlmTypeChecker.mjs +4 -0
  38. package/lib/_virtual/LlmTypeChecker.mjs.map +1 -0
  39. package/lib/_virtual/MapUtil.mjs +4 -0
  40. package/lib/_virtual/MapUtil.mjs.map +1 -0
  41. package/lib/_virtual/NamingConvention.mjs +4 -0
  42. package/lib/_virtual/NamingConvention.mjs.map +1 -0
  43. package/lib/_virtual/OpenApiArrayValidator.mjs +4 -0
  44. package/lib/_virtual/OpenApiArrayValidator.mjs.map +1 -0
  45. package/lib/_virtual/OpenApiBooleanValidator.mjs +4 -0
  46. package/lib/_virtual/OpenApiBooleanValidator.mjs.map +1 -0
  47. package/lib/_virtual/OpenApiConstantValidator.mjs +4 -0
  48. package/lib/_virtual/OpenApiConstantValidator.mjs.map +1 -0
  49. package/lib/_virtual/OpenApiConstraintShifter.mjs +4 -0
  50. package/lib/_virtual/OpenApiConstraintShifter.mjs.map +1 -0
  51. package/lib/_virtual/OpenApiConverter.mjs +4 -0
  52. package/lib/_virtual/OpenApiConverter.mjs.map +1 -0
  53. package/lib/_virtual/OpenApiExclusiveEmender.mjs +4 -0
  54. package/lib/_virtual/OpenApiExclusiveEmender.mjs.map +1 -0
  55. package/lib/_virtual/OpenApiIntegerValidator.mjs +4 -0
  56. package/lib/_virtual/OpenApiIntegerValidator.mjs.map +1 -0
  57. package/lib/_virtual/OpenApiNumberValidator.mjs +4 -0
  58. package/lib/_virtual/OpenApiNumberValidator.mjs.map +1 -0
  59. package/lib/_virtual/OpenApiObjectValidator.mjs +4 -0
  60. package/lib/_virtual/OpenApiObjectValidator.mjs.map +1 -0
  61. package/lib/_virtual/OpenApiOneOfValidator.mjs +4 -0
  62. package/lib/_virtual/OpenApiOneOfValidator.mjs.map +1 -0
  63. package/lib/_virtual/OpenApiSchemaNamingRule.mjs +4 -0
  64. package/lib/_virtual/OpenApiSchemaNamingRule.mjs.map +1 -0
  65. package/lib/_virtual/OpenApiStationValidator.mjs +4 -0
  66. package/lib/_virtual/OpenApiStationValidator.mjs.map +1 -0
  67. package/lib/_virtual/OpenApiStringValidator.mjs +4 -0
  68. package/lib/_virtual/OpenApiStringValidator.mjs.map +1 -0
  69. package/lib/_virtual/OpenApiTupleValidator.mjs +4 -0
  70. package/lib/_virtual/OpenApiTupleValidator.mjs.map +1 -0
  71. package/lib/_virtual/OpenApiTypeChecker.mjs +4 -0
  72. package/lib/_virtual/OpenApiTypeChecker.mjs.map +1 -0
  73. package/lib/_virtual/OpenApiTypeCheckerBase.mjs +4 -0
  74. package/lib/_virtual/OpenApiTypeCheckerBase.mjs.map +1 -0
  75. package/lib/_virtual/OpenApiV3Downgrader.mjs +4 -0
  76. package/lib/_virtual/OpenApiV3Downgrader.mjs.map +1 -0
  77. package/lib/_virtual/OpenApiV3TypeChecker.mjs +4 -0
  78. package/lib/_virtual/OpenApiV3TypeChecker.mjs.map +1 -0
  79. package/lib/_virtual/OpenApiV3Upgrader.mjs +4 -0
  80. package/lib/_virtual/OpenApiV3Upgrader.mjs.map +1 -0
  81. package/lib/_virtual/OpenApiV3_1Downgrader.mjs +4 -0
  82. package/lib/_virtual/OpenApiV3_1Downgrader.mjs.map +1 -0
  83. package/lib/_virtual/OpenApiV3_1TypeChecker.mjs +4 -0
  84. package/lib/_virtual/OpenApiV3_1TypeChecker.mjs.map +1 -0
  85. package/lib/_virtual/OpenApiV3_1Upgrader.mjs +4 -0
  86. package/lib/_virtual/OpenApiV3_1Upgrader.mjs.map +1 -0
  87. package/lib/_virtual/OpenApiV3_2Upgrader.mjs +4 -0
  88. package/lib/_virtual/OpenApiV3_2Upgrader.mjs.map +1 -0
  89. package/lib/_virtual/OpenApiValidator.mjs +4 -0
  90. package/lib/_virtual/OpenApiValidator.mjs.map +1 -0
  91. package/lib/_virtual/Singleton.mjs +4 -0
  92. package/lib/_virtual/Singleton.mjs.map +1 -0
  93. package/lib/_virtual/StringUtil.mjs +4 -0
  94. package/lib/_virtual/StringUtil.mjs.map +1 -0
  95. package/lib/_virtual/SwaggerV2Downgrader.mjs +4 -0
  96. package/lib/_virtual/SwaggerV2Downgrader.mjs.map +1 -0
  97. package/lib/_virtual/SwaggerV2TypeChecker.mjs +4 -0
  98. package/lib/_virtual/SwaggerV2TypeChecker.mjs.map +1 -0
  99. package/lib/_virtual/SwaggerV2Upgrader.mjs +4 -0
  100. package/lib/_virtual/SwaggerV2Upgrader.mjs.map +1 -0
  101. package/lib/_virtual/_commonjsHelpers.mjs +6 -0
  102. package/lib/_virtual/_commonjsHelpers.mjs.map +1 -0
  103. package/lib/_virtual/_isBigintString.mjs +4 -0
  104. package/lib/_virtual/_isBigintString.mjs.map +1 -0
  105. package/lib/_virtual/_isFormatByte.mjs +4 -0
  106. package/lib/_virtual/_isFormatByte.mjs.map +1 -0
  107. package/lib/_virtual/_isFormatDate.mjs +4 -0
  108. package/lib/_virtual/_isFormatDate.mjs.map +1 -0
  109. package/lib/_virtual/_isFormatDateTime.mjs +4 -0
  110. package/lib/_virtual/_isFormatDateTime.mjs.map +1 -0
  111. package/lib/_virtual/_isFormatDuration.mjs +4 -0
  112. package/lib/_virtual/_isFormatDuration.mjs.map +1 -0
  113. package/lib/_virtual/_isFormatEmail.mjs +4 -0
  114. package/lib/_virtual/_isFormatEmail.mjs.map +1 -0
  115. package/lib/_virtual/_isFormatHostname.mjs +4 -0
  116. package/lib/_virtual/_isFormatHostname.mjs.map +1 -0
  117. package/lib/_virtual/_isFormatIdnEmail.mjs +4 -0
  118. package/lib/_virtual/_isFormatIdnEmail.mjs.map +1 -0
  119. package/lib/_virtual/_isFormatIdnHostname.mjs +4 -0
  120. package/lib/_virtual/_isFormatIdnHostname.mjs.map +1 -0
  121. package/lib/_virtual/_isFormatIpv4.mjs +4 -0
  122. package/lib/_virtual/_isFormatIpv4.mjs.map +1 -0
  123. package/lib/_virtual/_isFormatIpv6.mjs +4 -0
  124. package/lib/_virtual/_isFormatIpv6.mjs.map +1 -0
  125. package/lib/_virtual/_isFormatIri.mjs +4 -0
  126. package/lib/_virtual/_isFormatIri.mjs.map +1 -0
  127. package/lib/_virtual/_isFormatIriReference.mjs +4 -0
  128. package/lib/_virtual/_isFormatIriReference.mjs.map +1 -0
  129. package/lib/_virtual/_isFormatJsonPointer.mjs +4 -0
  130. package/lib/_virtual/_isFormatJsonPointer.mjs.map +1 -0
  131. package/lib/_virtual/_isFormatPassword.mjs +4 -0
  132. package/lib/_virtual/_isFormatPassword.mjs.map +1 -0
  133. package/lib/_virtual/_isFormatRegex.mjs +4 -0
  134. package/lib/_virtual/_isFormatRegex.mjs.map +1 -0
  135. package/lib/_virtual/_isFormatRelativeJsonPointer.mjs +4 -0
  136. package/lib/_virtual/_isFormatRelativeJsonPointer.mjs.map +1 -0
  137. package/lib/_virtual/_isFormatTime.mjs +4 -0
  138. package/lib/_virtual/_isFormatTime.mjs.map +1 -0
  139. package/lib/_virtual/_isFormatUri.mjs +4 -0
  140. package/lib/_virtual/_isFormatUri.mjs.map +1 -0
  141. package/lib/_virtual/_isFormatUriReference.mjs +4 -0
  142. package/lib/_virtual/_isFormatUriReference.mjs.map +1 -0
  143. package/lib/_virtual/_isFormatUriTemplate.mjs +4 -0
  144. package/lib/_virtual/_isFormatUriTemplate.mjs.map +1 -0
  145. package/lib/_virtual/_isFormatUrl.mjs +4 -0
  146. package/lib/_virtual/_isFormatUrl.mjs.map +1 -0
  147. package/lib/_virtual/_isFormatUuid.mjs +4 -0
  148. package/lib/_virtual/_isFormatUuid.mjs.map +1 -0
  149. package/lib/_virtual/_isUniqueItems.mjs +4 -0
  150. package/lib/_virtual/_isUniqueItems.mjs.map +1 -0
  151. package/lib/_virtual/coerceLlmArguments.mjs +4 -0
  152. package/lib/_virtual/coerceLlmArguments.mjs.map +1 -0
  153. package/lib/_virtual/dedent.mjs +4 -0
  154. package/lib/_virtual/dedent.mjs.map +1 -0
  155. package/lib/_virtual/index.mjs +4 -0
  156. package/lib/_virtual/index.mjs.map +1 -0
  157. package/lib/_virtual/index2.mjs +4 -0
  158. package/lib/_virtual/index2.mjs.map +1 -0
  159. package/lib/_virtual/index3.mjs +4 -0
  160. package/lib/_virtual/index3.mjs.map +1 -0
  161. package/lib/_virtual/index4.mjs +4 -0
  162. package/lib/_virtual/index4.mjs.map +1 -0
  163. package/lib/_virtual/index5.mjs +4 -0
  164. package/lib/_virtual/index5.mjs.map +1 -0
  165. package/lib/_virtual/parseLenientJson.mjs +4 -0
  166. package/lib/_virtual/parseLenientJson.mjs.map +1 -0
  167. package/lib/_virtual/stringifyValidationFailure.mjs +4 -0
  168. package/lib/_virtual/stringifyValidationFailure.mjs.map +1 -0
  169. package/lib/converters/LlmSchemaConverter.js +149 -51
  170. package/lib/converters/LlmSchemaConverter.js.map +1 -1
  171. package/lib/converters/LlmSchemaConverter.mjs +5 -511
  172. package/lib/converters/LlmSchemaConverter.mjs.map +1 -1
  173. package/lib/converters/LlmSchemaConverter2.mjs +551 -0
  174. package/lib/converters/LlmSchemaConverter2.mjs.map +1 -0
  175. package/lib/converters/OpenApiConverter.js.map +1 -1
  176. package/lib/converters/OpenApiConverter.mjs +5 -146
  177. package/lib/converters/OpenApiConverter.mjs.map +1 -1
  178. package/lib/converters/OpenApiConverter2.mjs +167 -0
  179. package/lib/converters/OpenApiConverter2.mjs.map +1 -0
  180. package/lib/converters/index.mjs +7 -3
  181. package/lib/converters/index.mjs.map +1 -1
  182. package/lib/converters/index2.mjs +37 -0
  183. package/lib/converters/index2.mjs.map +1 -0
  184. package/lib/converters/internal/LlmDescriptionInverter.js.map +1 -1
  185. package/lib/converters/internal/LlmDescriptionInverter.mjs +5 -138
  186. package/lib/converters/internal/LlmDescriptionInverter.mjs.map +1 -1
  187. package/lib/converters/internal/LlmDescriptionInverter2.mjs +153 -0
  188. package/lib/converters/internal/LlmDescriptionInverter2.mjs.map +1 -0
  189. package/lib/converters/internal/LlmParametersComposer.js +14 -17
  190. package/lib/converters/internal/LlmParametersComposer.js.map +1 -1
  191. package/lib/converters/internal/LlmParametersComposer.mjs +5 -39
  192. package/lib/converters/internal/LlmParametersComposer.mjs.map +1 -1
  193. package/lib/converters/internal/LlmParametersComposer2.mjs +48 -0
  194. package/lib/converters/internal/LlmParametersComposer2.mjs.map +1 -0
  195. package/lib/converters/internal/OpenApiConstraintShifter.js.map +1 -1
  196. package/lib/converters/internal/OpenApiConstraintShifter.mjs +5 -99
  197. package/lib/converters/internal/OpenApiConstraintShifter.mjs.map +1 -1
  198. package/lib/converters/internal/OpenApiConstraintShifter2.mjs +115 -0
  199. package/lib/converters/internal/OpenApiConstraintShifter2.mjs.map +1 -0
  200. package/lib/converters/internal/OpenApiExclusiveEmender.js.map +1 -1
  201. package/lib/converters/internal/OpenApiExclusiveEmender.mjs +6 -33
  202. package/lib/converters/internal/OpenApiExclusiveEmender.mjs.map +1 -1
  203. package/lib/converters/internal/OpenApiExclusiveEmender2.mjs +43 -0
  204. package/lib/converters/internal/OpenApiExclusiveEmender2.mjs.map +1 -0
  205. package/lib/converters/internal/OpenApiV3Downgrader.js +2 -1
  206. package/lib/converters/internal/OpenApiV3Downgrader.js.map +1 -1
  207. package/lib/converters/internal/OpenApiV3Downgrader.mjs +5 -299
  208. package/lib/converters/internal/OpenApiV3Downgrader.mjs.map +1 -1
  209. package/lib/converters/internal/OpenApiV3Downgrader2.mjs +247 -0
  210. package/lib/converters/internal/OpenApiV3Downgrader2.mjs.map +1 -0
  211. package/lib/converters/internal/OpenApiV3Upgrader.js +58 -67
  212. package/lib/converters/internal/OpenApiV3Upgrader.js.map +1 -1
  213. package/lib/converters/internal/OpenApiV3Upgrader.mjs +5 -367
  214. package/lib/converters/internal/OpenApiV3Upgrader.mjs.map +1 -1
  215. package/lib/converters/internal/OpenApiV3Upgrader2.mjs +308 -0
  216. package/lib/converters/internal/OpenApiV3Upgrader2.mjs.map +1 -0
  217. package/lib/converters/internal/OpenApiV3_1Downgrader.js.map +1 -1
  218. package/lib/converters/internal/OpenApiV3_1Downgrader.mjs +5 -236
  219. package/lib/converters/internal/OpenApiV3_1Downgrader.mjs.map +1 -1
  220. package/lib/converters/internal/OpenApiV3_1Downgrader2.mjs +203 -0
  221. package/lib/converters/internal/OpenApiV3_1Downgrader2.mjs.map +1 -0
  222. package/lib/converters/internal/OpenApiV3_1Upgrader.js +68 -70
  223. package/lib/converters/internal/OpenApiV3_1Upgrader.js.map +1 -1
  224. package/lib/converters/internal/OpenApiV3_1Upgrader.mjs +5 -564
  225. package/lib/converters/internal/OpenApiV3_1Upgrader.mjs.map +1 -1
  226. package/lib/converters/internal/OpenApiV3_1Upgrader2.mjs +435 -0
  227. package/lib/converters/internal/OpenApiV3_1Upgrader2.mjs.map +1 -0
  228. package/lib/converters/internal/OpenApiV3_2Upgrader.js +57 -63
  229. package/lib/converters/internal/OpenApiV3_2Upgrader.js.map +1 -1
  230. package/lib/converters/internal/OpenApiV3_2Upgrader.mjs +5 -240
  231. package/lib/converters/internal/OpenApiV3_2Upgrader.mjs.map +1 -1
  232. package/lib/converters/internal/OpenApiV3_2Upgrader2.mjs +211 -0
  233. package/lib/converters/internal/OpenApiV3_2Upgrader2.mjs.map +1 -0
  234. package/lib/converters/internal/SwaggerV2Downgrader.js +44 -56
  235. package/lib/converters/internal/SwaggerV2Downgrader.js.map +1 -1
  236. package/lib/converters/internal/SwaggerV2Downgrader.mjs +5 -352
  237. package/lib/converters/internal/SwaggerV2Downgrader.mjs.map +1 -1
  238. package/lib/converters/internal/SwaggerV2Downgrader2.mjs +297 -0
  239. package/lib/converters/internal/SwaggerV2Downgrader2.mjs.map +1 -0
  240. package/lib/converters/internal/SwaggerV2Upgrader.js +52 -63
  241. package/lib/converters/internal/SwaggerV2Upgrader.js.map +1 -1
  242. package/lib/converters/internal/SwaggerV2Upgrader.mjs +5 -421
  243. package/lib/converters/internal/SwaggerV2Upgrader.mjs.map +1 -1
  244. package/lib/converters/internal/SwaggerV2Upgrader2.mjs +378 -0
  245. package/lib/converters/internal/SwaggerV2Upgrader2.mjs.map +1 -0
  246. package/lib/http/HttpError.js.map +1 -1
  247. package/lib/http/HttpError.mjs +6 -74
  248. package/lib/http/HttpError.mjs.map +1 -1
  249. package/lib/http/HttpError2.mjs +81 -0
  250. package/lib/http/HttpError2.mjs.map +1 -0
  251. package/lib/http/HttpLlm.js +5 -4
  252. package/lib/http/HttpLlm.js.map +1 -1
  253. package/lib/http/HttpLlm.mjs +5 -96
  254. package/lib/http/HttpLlm.mjs.map +1 -1
  255. package/lib/http/HttpLlm2.mjs +115 -0
  256. package/lib/http/HttpLlm2.mjs.map +1 -0
  257. package/lib/http/HttpMigration.js.map +1 -1
  258. package/lib/http/HttpMigration.mjs +5 -49
  259. package/lib/http/HttpMigration.mjs.map +1 -1
  260. package/lib/http/HttpMigration2.mjs +66 -0
  261. package/lib/http/HttpMigration2.mjs.map +1 -0
  262. package/lib/http/index.mjs +7 -3
  263. package/lib/http/index.mjs.map +1 -1
  264. package/lib/http/index2.mjs +36 -0
  265. package/lib/http/index2.mjs.map +1 -0
  266. package/lib/http/internal/HttpLlmApplicationComposer.js +12 -13
  267. package/lib/http/internal/HttpLlmApplicationComposer.js.map +1 -1
  268. package/lib/http/internal/HttpLlmApplicationComposer.mjs +5 -297
  269. package/lib/http/internal/HttpLlmApplicationComposer.mjs.map +1 -1
  270. package/lib/http/internal/HttpLlmApplicationComposer2.mjs +309 -0
  271. package/lib/http/internal/HttpLlmApplicationComposer2.mjs.map +1 -0
  272. package/lib/http/internal/HttpLlmFunctionFetcher.js.map +1 -1
  273. package/lib/http/internal/HttpLlmFunctionFetcher.mjs +5 -21
  274. package/lib/http/internal/HttpLlmFunctionFetcher.mjs.map +1 -1
  275. package/lib/http/internal/HttpLlmFunctionFetcher2.mjs +36 -0
  276. package/lib/http/internal/HttpLlmFunctionFetcher2.mjs.map +1 -0
  277. package/lib/http/internal/HttpMigrateApplicationComposer.js.map +1 -1
  278. package/lib/http/internal/HttpMigrateApplicationComposer.mjs +5 -44
  279. package/lib/http/internal/HttpMigrateApplicationComposer.mjs.map +1 -1
  280. package/lib/http/internal/HttpMigrateApplicationComposer2.mjs +59 -0
  281. package/lib/http/internal/HttpMigrateApplicationComposer2.mjs.map +1 -0
  282. package/lib/http/internal/HttpMigrateRouteAccessor.js.map +1 -1
  283. package/lib/http/internal/HttpMigrateRouteAccessor.mjs +5 -103
  284. package/lib/http/internal/HttpMigrateRouteAccessor.mjs.map +1 -1
  285. package/lib/http/internal/HttpMigrateRouteAccessor2.mjs +121 -0
  286. package/lib/http/internal/HttpMigrateRouteAccessor2.mjs.map +1 -0
  287. package/lib/http/internal/HttpMigrateRouteComposer.js +35 -54
  288. package/lib/http/internal/HttpMigrateRouteComposer.js.map +1 -1
  289. package/lib/http/internal/HttpMigrateRouteComposer.mjs +5 -381
  290. package/lib/http/internal/HttpMigrateRouteComposer.mjs.map +1 -1
  291. package/lib/http/internal/HttpMigrateRouteComposer2.mjs +384 -0
  292. package/lib/http/internal/HttpMigrateRouteComposer2.mjs.map +1 -0
  293. package/lib/http/internal/HttpMigrateRouteFetcher.js +7 -6
  294. package/lib/http/internal/HttpMigrateRouteFetcher.js.map +1 -1
  295. package/lib/http/internal/HttpMigrateRouteFetcher.mjs +5 -171
  296. package/lib/http/internal/HttpMigrateRouteFetcher.mjs.map +1 -1
  297. package/lib/http/internal/HttpMigrateRouteFetcher2.mjs +192 -0
  298. package/lib/http/internal/HttpMigrateRouteFetcher2.mjs.map +1 -0
  299. package/lib/index.mjs +7 -19
  300. package/lib/index.mjs.map +1 -1
  301. package/lib/index2.mjs +38 -0
  302. package/lib/index2.mjs.map +1 -0
  303. package/lib/utils/ArrayUtil.js.map +1 -1
  304. package/lib/utils/ArrayUtil.mjs +6 -26
  305. package/lib/utils/ArrayUtil.mjs.map +1 -1
  306. package/lib/utils/ArrayUtil2.mjs +40 -0
  307. package/lib/utils/ArrayUtil2.mjs.map +1 -0
  308. package/lib/utils/LlmJson.d.ts +1 -1
  309. package/lib/utils/LlmJson.js.map +1 -1
  310. package/lib/utils/LlmJson.mjs +5 -153
  311. package/lib/utils/LlmJson.mjs.map +1 -1
  312. package/lib/utils/LlmJson2.mjs +172 -0
  313. package/lib/utils/LlmJson2.mjs.map +1 -0
  314. package/lib/utils/MapUtil.js.map +1 -1
  315. package/lib/utils/MapUtil.mjs +6 -13
  316. package/lib/utils/MapUtil.mjs.map +1 -1
  317. package/lib/utils/MapUtil2.mjs +27 -0
  318. package/lib/utils/MapUtil2.mjs.map +1 -0
  319. package/lib/utils/NamingConvention.js.map +1 -1
  320. package/lib/utils/NamingConvention.mjs +6 -196
  321. package/lib/utils/NamingConvention.mjs.map +1 -1
  322. package/lib/utils/NamingConvention2.mjs +210 -0
  323. package/lib/utils/NamingConvention2.mjs.map +1 -0
  324. package/lib/utils/Singleton.d.ts +6 -1
  325. package/lib/utils/Singleton.js +0 -1
  326. package/lib/utils/Singleton.js.map +1 -1
  327. package/lib/utils/Singleton.mjs +6 -16
  328. package/lib/utils/Singleton.mjs.map +1 -1
  329. package/lib/utils/Singleton2.mjs +28 -0
  330. package/lib/utils/Singleton2.mjs.map +1 -0
  331. package/lib/utils/StringUtil.js +6 -9
  332. package/lib/utils/StringUtil.js.map +1 -1
  333. package/lib/utils/StringUtil.mjs +6 -11
  334. package/lib/utils/StringUtil.mjs.map +1 -1
  335. package/lib/utils/StringUtil2.mjs +25 -0
  336. package/lib/utils/StringUtil2.mjs.map +1 -0
  337. package/lib/utils/dedent.js.map +1 -1
  338. package/lib/utils/dedent.mjs +6 -48
  339. package/lib/utils/dedent.mjs.map +1 -1
  340. package/lib/utils/dedent2.mjs +62 -0
  341. package/lib/utils/dedent2.mjs.map +1 -0
  342. package/lib/utils/index.mjs +7 -7
  343. package/lib/utils/index.mjs.map +1 -1
  344. package/lib/utils/index2.mjs +44 -0
  345. package/lib/utils/index2.mjs.map +1 -0
  346. package/lib/utils/internal/EndpointUtil.js.map +1 -1
  347. package/lib/utils/internal/EndpointUtil.mjs +5 -34
  348. package/lib/utils/internal/EndpointUtil.mjs.map +1 -1
  349. package/lib/utils/internal/EndpointUtil2.mjs +49 -0
  350. package/lib/utils/internal/EndpointUtil2.mjs.map +1 -0
  351. package/lib/utils/internal/JsonDescriptor.js +18 -25
  352. package/lib/utils/internal/JsonDescriptor.js.map +1 -1
  353. package/lib/utils/internal/JsonDescriptor.mjs +5 -45
  354. package/lib/utils/internal/JsonDescriptor.mjs.map +1 -1
  355. package/lib/utils/internal/JsonDescriptor2.mjs +64 -0
  356. package/lib/utils/internal/JsonDescriptor2.mjs.map +1 -0
  357. package/lib/utils/internal/OpenApiTypeCheckerBase.js +15 -9
  358. package/lib/utils/internal/OpenApiTypeCheckerBase.js.map +1 -1
  359. package/lib/utils/internal/OpenApiTypeCheckerBase.mjs +5 -581
  360. package/lib/utils/internal/OpenApiTypeCheckerBase.mjs.map +1 -1
  361. package/lib/utils/internal/OpenApiTypeCheckerBase2.mjs +539 -0
  362. package/lib/utils/internal/OpenApiTypeCheckerBase2.mjs.map +1 -0
  363. package/lib/utils/internal/coerceLlmArguments.js +18 -4
  364. package/lib/utils/internal/coerceLlmArguments.js.map +1 -1
  365. package/lib/utils/internal/coerceLlmArguments.mjs +5 -245
  366. package/lib/utils/internal/coerceLlmArguments.mjs.map +1 -1
  367. package/lib/utils/internal/coerceLlmArguments2.mjs +276 -0
  368. package/lib/utils/internal/coerceLlmArguments2.mjs.map +1 -0
  369. package/lib/utils/internal/parseLenientJson.js.map +1 -1
  370. package/lib/utils/internal/parseLenientJson.mjs +6 -803
  371. package/lib/utils/internal/parseLenientJson.mjs.map +1 -1
  372. package/lib/utils/internal/parseLenientJson2.mjs +815 -0
  373. package/lib/utils/internal/parseLenientJson2.mjs.map +1 -0
  374. package/lib/utils/internal/stringifyValidationFailure.js.map +1 -1
  375. package/lib/utils/internal/stringifyValidationFailure.mjs +5 -315
  376. package/lib/utils/internal/stringifyValidationFailure.mjs.map +1 -1
  377. package/lib/utils/internal/stringifyValidationFailure2.mjs +333 -0
  378. package/lib/utils/internal/stringifyValidationFailure2.mjs.map +1 -0
  379. package/lib/validators/LlmTypeChecker.js +4 -3
  380. package/lib/validators/LlmTypeChecker.js.map +1 -1
  381. package/lib/validators/LlmTypeChecker.mjs +5 -297
  382. package/lib/validators/LlmTypeChecker.mjs.map +1 -1
  383. package/lib/validators/LlmTypeChecker2.mjs +323 -0
  384. package/lib/validators/LlmTypeChecker2.mjs.map +1 -0
  385. package/lib/validators/OpenApiTypeChecker.js.map +1 -1
  386. package/lib/validators/OpenApiTypeChecker.mjs +5 -215
  387. package/lib/validators/OpenApiTypeChecker.mjs.map +1 -1
  388. package/lib/validators/OpenApiTypeChecker2.mjs +219 -0
  389. package/lib/validators/OpenApiTypeChecker2.mjs.map +1 -0
  390. package/lib/validators/OpenApiV3TypeChecker.js.map +1 -1
  391. package/lib/validators/OpenApiV3TypeChecker.mjs +6 -27
  392. package/lib/validators/OpenApiV3TypeChecker.mjs.map +1 -1
  393. package/lib/validators/OpenApiV3TypeChecker2.mjs +41 -0
  394. package/lib/validators/OpenApiV3TypeChecker2.mjs.map +1 -0
  395. package/lib/validators/OpenApiV3_1TypeChecker.js.map +1 -1
  396. package/lib/validators/OpenApiV3_1TypeChecker.mjs +6 -31
  397. package/lib/validators/OpenApiV3_1TypeChecker.mjs.map +1 -1
  398. package/lib/validators/OpenApiV3_1TypeChecker2.mjs +45 -0
  399. package/lib/validators/OpenApiV3_1TypeChecker2.mjs.map +1 -0
  400. package/lib/validators/OpenApiValidator.js.map +1 -1
  401. package/lib/validators/OpenApiValidator.mjs +5 -72
  402. package/lib/validators/OpenApiValidator.mjs.map +1 -1
  403. package/lib/validators/OpenApiValidator2.mjs +83 -0
  404. package/lib/validators/OpenApiValidator2.mjs.map +1 -0
  405. package/lib/validators/SwaggerV2TypeChecker.js.map +1 -1
  406. package/lib/validators/SwaggerV2TypeChecker.mjs +6 -28
  407. package/lib/validators/SwaggerV2TypeChecker.mjs.map +1 -1
  408. package/lib/validators/SwaggerV2TypeChecker2.mjs +42 -0
  409. package/lib/validators/SwaggerV2TypeChecker2.mjs.map +1 -0
  410. package/lib/validators/functional/_isBigintString.js.map +1 -1
  411. package/lib/validators/functional/_isBigintString.mjs +6 -10
  412. package/lib/validators/functional/_isBigintString.mjs.map +1 -1
  413. package/lib/validators/functional/_isBigintString2.mjs +25 -0
  414. package/lib/validators/functional/_isBigintString2.mjs.map +1 -0
  415. package/lib/validators/functional/_isFormatByte.js.map +1 -1
  416. package/lib/validators/functional/_isFormatByte.mjs +6 -6
  417. package/lib/validators/functional/_isFormatByte.mjs.map +1 -1
  418. package/lib/validators/functional/_isFormatByte2.mjs +21 -0
  419. package/lib/validators/functional/_isFormatByte2.mjs.map +1 -0
  420. package/lib/validators/functional/_isFormatDate.js.map +1 -1
  421. package/lib/validators/functional/_isFormatDate.mjs +6 -3
  422. package/lib/validators/functional/_isFormatDate.mjs.map +1 -1
  423. package/lib/validators/functional/_isFormatDate2.mjs +18 -0
  424. package/lib/validators/functional/_isFormatDate2.mjs.map +1 -0
  425. package/lib/validators/functional/_isFormatDateTime.js.map +1 -1
  426. package/lib/validators/functional/_isFormatDateTime.mjs +6 -3
  427. package/lib/validators/functional/_isFormatDateTime.mjs.map +1 -1
  428. package/lib/validators/functional/_isFormatDateTime2.mjs +18 -0
  429. package/lib/validators/functional/_isFormatDateTime2.mjs.map +1 -0
  430. package/lib/validators/functional/_isFormatDuration.js.map +1 -1
  431. package/lib/validators/functional/_isFormatDuration.mjs +6 -3
  432. package/lib/validators/functional/_isFormatDuration.mjs.map +1 -1
  433. package/lib/validators/functional/_isFormatDuration2.mjs +18 -0
  434. package/lib/validators/functional/_isFormatDuration2.mjs.map +1 -0
  435. package/lib/validators/functional/_isFormatEmail.js.map +1 -1
  436. package/lib/validators/functional/_isFormatEmail.mjs +6 -3
  437. package/lib/validators/functional/_isFormatEmail.mjs.map +1 -1
  438. package/lib/validators/functional/_isFormatEmail2.mjs +18 -0
  439. package/lib/validators/functional/_isFormatEmail2.mjs.map +1 -0
  440. package/lib/validators/functional/_isFormatHostname.js.map +1 -1
  441. package/lib/validators/functional/_isFormatHostname.mjs +6 -3
  442. package/lib/validators/functional/_isFormatHostname.mjs.map +1 -1
  443. package/lib/validators/functional/_isFormatHostname2.mjs +18 -0
  444. package/lib/validators/functional/_isFormatHostname2.mjs.map +1 -0
  445. package/lib/validators/functional/_isFormatIdnEmail.js.map +1 -1
  446. package/lib/validators/functional/_isFormatIdnEmail.mjs +6 -3
  447. package/lib/validators/functional/_isFormatIdnEmail.mjs.map +1 -1
  448. package/lib/validators/functional/_isFormatIdnEmail2.mjs +18 -0
  449. package/lib/validators/functional/_isFormatIdnEmail2.mjs.map +1 -0
  450. package/lib/validators/functional/_isFormatIdnHostname.js.map +1 -1
  451. package/lib/validators/functional/_isFormatIdnHostname.mjs +6 -3
  452. package/lib/validators/functional/_isFormatIdnHostname.mjs.map +1 -1
  453. package/lib/validators/functional/_isFormatIdnHostname2.mjs +18 -0
  454. package/lib/validators/functional/_isFormatIdnHostname2.mjs.map +1 -0
  455. package/lib/validators/functional/_isFormatIpv4.js.map +1 -1
  456. package/lib/validators/functional/_isFormatIpv4.mjs +6 -3
  457. package/lib/validators/functional/_isFormatIpv4.mjs.map +1 -1
  458. package/lib/validators/functional/_isFormatIpv42.mjs +18 -0
  459. package/lib/validators/functional/_isFormatIpv42.mjs.map +1 -0
  460. package/lib/validators/functional/_isFormatIpv6.js.map +1 -1
  461. package/lib/validators/functional/_isFormatIpv6.mjs +6 -3
  462. package/lib/validators/functional/_isFormatIpv6.mjs.map +1 -1
  463. package/lib/validators/functional/_isFormatIpv62.mjs +18 -0
  464. package/lib/validators/functional/_isFormatIpv62.mjs.map +1 -0
  465. package/lib/validators/functional/_isFormatIri.js.map +1 -1
  466. package/lib/validators/functional/_isFormatIri.mjs +6 -3
  467. package/lib/validators/functional/_isFormatIri.mjs.map +1 -1
  468. package/lib/validators/functional/_isFormatIri2.mjs +18 -0
  469. package/lib/validators/functional/_isFormatIri2.mjs.map +1 -0
  470. package/lib/validators/functional/_isFormatIriReference.js.map +1 -1
  471. package/lib/validators/functional/_isFormatIriReference.mjs +6 -3
  472. package/lib/validators/functional/_isFormatIriReference.mjs.map +1 -1
  473. package/lib/validators/functional/_isFormatIriReference2.mjs +18 -0
  474. package/lib/validators/functional/_isFormatIriReference2.mjs.map +1 -0
  475. package/lib/validators/functional/_isFormatJsonPointer.js.map +1 -1
  476. package/lib/validators/functional/_isFormatJsonPointer.mjs +6 -3
  477. package/lib/validators/functional/_isFormatJsonPointer.mjs.map +1 -1
  478. package/lib/validators/functional/_isFormatJsonPointer2.mjs +18 -0
  479. package/lib/validators/functional/_isFormatJsonPointer2.mjs.map +1 -0
  480. package/lib/validators/functional/_isFormatPassword.js.map +1 -1
  481. package/lib/validators/functional/_isFormatPassword.mjs +6 -2
  482. package/lib/validators/functional/_isFormatPassword.mjs.map +1 -1
  483. package/lib/validators/functional/_isFormatPassword2.mjs +17 -0
  484. package/lib/validators/functional/_isFormatPassword2.mjs.map +1 -0
  485. package/lib/validators/functional/_isFormatRegex.js.map +1 -1
  486. package/lib/validators/functional/_isFormatRegex.mjs +6 -10
  487. package/lib/validators/functional/_isFormatRegex.mjs.map +1 -1
  488. package/lib/validators/functional/_isFormatRegex2.mjs +25 -0
  489. package/lib/validators/functional/_isFormatRegex2.mjs.map +1 -0
  490. package/lib/validators/functional/_isFormatRelativeJsonPointer.js.map +1 -1
  491. package/lib/validators/functional/_isFormatRelativeJsonPointer.mjs +6 -3
  492. package/lib/validators/functional/_isFormatRelativeJsonPointer.mjs.map +1 -1
  493. package/lib/validators/functional/_isFormatRelativeJsonPointer2.mjs +18 -0
  494. package/lib/validators/functional/_isFormatRelativeJsonPointer2.mjs.map +1 -0
  495. package/lib/validators/functional/_isFormatTime.js.map +1 -1
  496. package/lib/validators/functional/_isFormatTime.mjs +6 -3
  497. package/lib/validators/functional/_isFormatTime.mjs.map +1 -1
  498. package/lib/validators/functional/_isFormatTime2.mjs +18 -0
  499. package/lib/validators/functional/_isFormatTime2.mjs.map +1 -0
  500. package/lib/validators/functional/_isFormatUri.js.map +1 -1
  501. package/lib/validators/functional/_isFormatUri.mjs +6 -4
  502. package/lib/validators/functional/_isFormatUri.mjs.map +1 -1
  503. package/lib/validators/functional/_isFormatUri2.mjs +19 -0
  504. package/lib/validators/functional/_isFormatUri2.mjs.map +1 -0
  505. package/lib/validators/functional/_isFormatUriReference.js.map +1 -1
  506. package/lib/validators/functional/_isFormatUriReference.mjs +6 -3
  507. package/lib/validators/functional/_isFormatUriReference.mjs.map +1 -1
  508. package/lib/validators/functional/_isFormatUriReference2.mjs +18 -0
  509. package/lib/validators/functional/_isFormatUriReference2.mjs.map +1 -0
  510. package/lib/validators/functional/_isFormatUriTemplate.js.map +1 -1
  511. package/lib/validators/functional/_isFormatUriTemplate.mjs +6 -3
  512. package/lib/validators/functional/_isFormatUriTemplate.mjs.map +1 -1
  513. package/lib/validators/functional/_isFormatUriTemplate2.mjs +18 -0
  514. package/lib/validators/functional/_isFormatUriTemplate2.mjs.map +1 -0
  515. package/lib/validators/functional/_isFormatUrl.js.map +1 -1
  516. package/lib/validators/functional/_isFormatUrl.mjs +6 -3
  517. package/lib/validators/functional/_isFormatUrl.mjs.map +1 -1
  518. package/lib/validators/functional/_isFormatUrl2.mjs +18 -0
  519. package/lib/validators/functional/_isFormatUrl2.mjs.map +1 -0
  520. package/lib/validators/functional/_isFormatUuid.js.map +1 -1
  521. package/lib/validators/functional/_isFormatUuid.mjs +6 -3
  522. package/lib/validators/functional/_isFormatUuid.mjs.map +1 -1
  523. package/lib/validators/functional/_isFormatUuid2.mjs +18 -0
  524. package/lib/validators/functional/_isFormatUuid2.mjs.map +1 -0
  525. package/lib/validators/functional/_isUniqueItems.js.map +1 -1
  526. package/lib/validators/functional/_isUniqueItems.mjs +6 -136
  527. package/lib/validators/functional/_isUniqueItems.mjs.map +1 -1
  528. package/lib/validators/functional/_isUniqueItems2.mjs +151 -0
  529. package/lib/validators/functional/_isUniqueItems2.mjs.map +1 -0
  530. package/lib/validators/index.d.ts +1 -0
  531. package/lib/validators/index.js +0 -1
  532. package/lib/validators/index.js.map +1 -1
  533. package/lib/validators/index.mjs +7 -6
  534. package/lib/validators/index.mjs.map +1 -1
  535. package/lib/validators/index2.mjs +45 -0
  536. package/lib/validators/index2.mjs.map +1 -0
  537. package/lib/validators/internal/IOpenApiValidatorContext.mjs +6 -0
  538. package/lib/validators/internal/IOpenApiValidatorContext.mjs.map +1 -1
  539. package/lib/validators/internal/IOpenApiValidatorContext2.mjs +14 -0
  540. package/lib/validators/internal/IOpenApiValidatorContext2.mjs.map +1 -0
  541. package/lib/validators/internal/OpenApiArrayValidator.js.map +1 -1
  542. package/lib/validators/internal/OpenApiArrayValidator.mjs +5 -44
  543. package/lib/validators/internal/OpenApiArrayValidator.mjs.map +1 -1
  544. package/lib/validators/internal/OpenApiArrayValidator2.mjs +45 -0
  545. package/lib/validators/internal/OpenApiArrayValidator2.mjs.map +1 -0
  546. package/lib/validators/internal/OpenApiBooleanValidator.js.map +1 -1
  547. package/lib/validators/internal/OpenApiBooleanValidator.mjs +6 -7
  548. package/lib/validators/internal/OpenApiBooleanValidator.mjs.map +1 -1
  549. package/lib/validators/internal/OpenApiBooleanValidator2.mjs +21 -0
  550. package/lib/validators/internal/OpenApiBooleanValidator2.mjs.map +1 -0
  551. package/lib/validators/internal/OpenApiConstantValidator.js.map +1 -1
  552. package/lib/validators/internal/OpenApiConstantValidator.mjs +6 -7
  553. package/lib/validators/internal/OpenApiConstantValidator.mjs.map +1 -1
  554. package/lib/validators/internal/OpenApiConstantValidator2.mjs +21 -0
  555. package/lib/validators/internal/OpenApiConstantValidator2.mjs.map +1 -0
  556. package/lib/validators/internal/OpenApiIntegerValidator.js.map +1 -1
  557. package/lib/validators/internal/OpenApiIntegerValidator.mjs +6 -45
  558. package/lib/validators/internal/OpenApiIntegerValidator.mjs.map +1 -1
  559. package/lib/validators/internal/OpenApiIntegerValidator2.mjs +44 -0
  560. package/lib/validators/internal/OpenApiIntegerValidator2.mjs.map +1 -0
  561. package/lib/validators/internal/OpenApiNumberValidator.js.map +1 -1
  562. package/lib/validators/internal/OpenApiNumberValidator.mjs +6 -45
  563. package/lib/validators/internal/OpenApiNumberValidator.mjs.map +1 -1
  564. package/lib/validators/internal/OpenApiNumberValidator2.mjs +44 -0
  565. package/lib/validators/internal/OpenApiNumberValidator2.mjs.map +1 -0
  566. package/lib/validators/internal/OpenApiObjectValidator.js +6 -12
  567. package/lib/validators/internal/OpenApiObjectValidator.js.map +1 -1
  568. package/lib/validators/internal/OpenApiObjectValidator.mjs +5 -65
  569. package/lib/validators/internal/OpenApiObjectValidator.mjs.map +1 -1
  570. package/lib/validators/internal/OpenApiObjectValidator2.mjs +65 -0
  571. package/lib/validators/internal/OpenApiObjectValidator2.mjs.map +1 -0
  572. package/lib/validators/internal/OpenApiOneOfValidator.js +20 -20
  573. package/lib/validators/internal/OpenApiOneOfValidator.js.map +1 -1
  574. package/lib/validators/internal/OpenApiOneOfValidator.mjs +5 -203
  575. package/lib/validators/internal/OpenApiOneOfValidator.mjs.map +1 -1
  576. package/lib/validators/internal/OpenApiOneOfValidator2.mjs +196 -0
  577. package/lib/validators/internal/OpenApiOneOfValidator2.mjs.map +1 -0
  578. package/lib/validators/internal/OpenApiSchemaNamingRule.js.map +1 -1
  579. package/lib/validators/internal/OpenApiSchemaNamingRule.mjs +5 -118
  580. package/lib/validators/internal/OpenApiSchemaNamingRule.mjs.map +1 -1
  581. package/lib/validators/internal/OpenApiSchemaNamingRule2.mjs +134 -0
  582. package/lib/validators/internal/OpenApiSchemaNamingRule2.mjs.map +1 -0
  583. package/lib/validators/internal/OpenApiStationValidator.js +2 -1
  584. package/lib/validators/internal/OpenApiStationValidator.js.map +1 -1
  585. package/lib/validators/internal/OpenApiStationValidator.mjs +5 -104
  586. package/lib/validators/internal/OpenApiStationValidator.mjs.map +1 -1
  587. package/lib/validators/internal/OpenApiStationValidator2.mjs +86 -0
  588. package/lib/validators/internal/OpenApiStationValidator2.mjs.map +1 -0
  589. package/lib/validators/internal/OpenApiStringValidator.js.map +1 -1
  590. package/lib/validators/internal/OpenApiStringValidator.mjs +5 -82
  591. package/lib/validators/internal/OpenApiStringValidator.mjs.map +1 -1
  592. package/lib/validators/internal/OpenApiStringValidator2.mjs +105 -0
  593. package/lib/validators/internal/OpenApiStringValidator2.mjs.map +1 -0
  594. package/lib/validators/internal/OpenApiTupleValidator.js.map +1 -1
  595. package/lib/validators/internal/OpenApiTupleValidator.mjs +5 -43
  596. package/lib/validators/internal/OpenApiTupleValidator.mjs.map +1 -1
  597. package/lib/validators/internal/OpenApiTupleValidator2.mjs +43 -0
  598. package/lib/validators/internal/OpenApiTupleValidator2.mjs.map +1 -0
  599. package/package.json +8 -9
  600. package/src/converters/LlmSchemaConverter.ts +152 -33
  601. package/src/converters/OpenApiConverter.ts +375 -375
  602. package/src/converters/internal/OpenApiV3Downgrader.ts +381 -381
  603. package/src/converters/internal/OpenApiV3Upgrader.ts +494 -494
  604. package/src/converters/internal/OpenApiV3_1Downgrader.ts +318 -318
  605. package/src/converters/internal/OpenApiV3_1Upgrader.ts +713 -710
  606. package/src/converters/internal/OpenApiV3_2Upgrader.ts +342 -342
  607. package/src/converters/internal/SwaggerV2Downgrader.ts +450 -450
  608. package/src/converters/internal/SwaggerV2Upgrader.ts +547 -547
  609. package/src/http/HttpError.ts +114 -114
  610. package/src/http/HttpLlm.ts +169 -169
  611. package/src/http/HttpMigration.ts +94 -94
  612. package/src/http/internal/HttpMigrateApplicationComposer.ts +56 -56
  613. package/src/http/internal/HttpMigrateRouteComposer.ts +505 -505
  614. package/src/utils/LlmJson.ts +173 -173
  615. package/src/utils/Singleton.ts +0 -1
  616. package/src/utils/internal/OpenApiTypeCheckerBase.ts +2 -0
  617. package/src/utils/internal/coerceLlmArguments.ts +21 -3
  618. package/src/utils/internal/parseLenientJson.ts +919 -919
  619. package/src/validators/index.ts +0 -1
@@ -0,0 +1,815 @@
1
+ import { __exports as parseLenientJson } from '../../_virtual/parseLenientJson.mjs';
2
+
3
+ var hasRequiredParseLenientJson;
4
+
5
+ function requireParseLenientJson () {
6
+ if (hasRequiredParseLenientJson) return parseLenientJson;
7
+ hasRequiredParseLenientJson = 1;
8
+ Object.defineProperty(parseLenientJson, "__esModule", { value: true });
9
+ parseLenientJson.parseLenientJson = parseLenientJson$1;
10
+ /**
11
+ * Parse lenient JSON that may be incomplete or malformed.
12
+ *
13
+ * Handles:
14
+ *
15
+ * - Unclosed brackets `{`, `[` - parses as much as possible
16
+ * - Trailing commas `[1, 2, ]` - ignores them
17
+ * - Unclosed strings `"hello` - returns partial string
18
+ * - Junk text before JSON (LLM often adds explanatory text)
19
+ * - Markdown code blocks (extracts content from `json ... `)
20
+ * - Incomplete keywords like `tru`, `fal`, `nul`
21
+ * - Unicode escape sequences including surrogate pairs (emoji)
22
+ * - JavaScript-style comments (single-line and multi-line)
23
+ * - Unquoted object keys (JavaScript identifier style)
24
+ *
25
+ * @param input Raw JSON string (potentially incomplete)
26
+ * @returns Parse result with data, original input, and any errors
27
+ * @internal
28
+ */
29
+ function parseLenientJson$1(input) {
30
+ // For safe guard
31
+ if (typeof input !== "string")
32
+ input = String(input);
33
+ // Try native JSON.parse first (faster for valid JSON)
34
+ let error = null;
35
+ try {
36
+ return {
37
+ success: true,
38
+ data: JSON.parse(input),
39
+ };
40
+ }
41
+ catch (e) {
42
+ // Fall back to lenient parser
43
+ error = e instanceof Error ? e : new Error(String(e));
44
+ }
45
+ try {
46
+ return iterate(input);
47
+ }
48
+ catch (_a) {
49
+ // actually unreachable, maybe?
50
+ return {
51
+ success: false,
52
+ data: undefined,
53
+ input,
54
+ errors: [
55
+ {
56
+ path: "$input",
57
+ expected: "valid JSON",
58
+ description: error.message,
59
+ },
60
+ ],
61
+ };
62
+ }
63
+ }
64
+ function iterate(input) {
65
+ // Extract markdown code block if present
66
+ const codeBlockContent = extractMarkdownCodeBlock(input);
67
+ const jsonSource = codeBlockContent !== null ? codeBlockContent : input;
68
+ // Check if input is empty or whitespace-only
69
+ const trimmed = jsonSource.trim();
70
+ if (trimmed.length === 0) {
71
+ return {
72
+ success: false,
73
+ data: undefined,
74
+ input,
75
+ errors: [
76
+ {
77
+ path: "$input",
78
+ expected: "JSON value",
79
+ description: "empty input",
80
+ },
81
+ ],
82
+ };
83
+ }
84
+ // Check if input starts with a primitive value (no junk prefix skipping needed)
85
+ if (startsWithPrimitive(trimmed)) {
86
+ const errors = [];
87
+ const parser = new LenientJsonParser(jsonSource, errors);
88
+ const data = parser.parse();
89
+ if (errors.length > 0) {
90
+ return { success: false, data: data, input, errors };
91
+ }
92
+ return { success: true, data: data };
93
+ }
94
+ // Find JSON start position (skip junk prefix from LLM)
95
+ const jsonStart = findJsonStart(jsonSource);
96
+ if (jsonStart === -1) {
97
+ // No object/array found - check if there's a primitive after skipping comments
98
+ const skipped = skipCommentsAndWhitespace(jsonSource);
99
+ if (skipped.length > 0 && startsWithPrimitive(skipped)) {
100
+ const errors = [];
101
+ const parser = new LenientJsonParser(jsonSource, errors);
102
+ const data = parser.parse();
103
+ if (errors.length > 0) {
104
+ return { success: false, data: data, input, errors };
105
+ }
106
+ return { success: true, data: data };
107
+ }
108
+ // No valid JSON found - return failure
109
+ return {
110
+ success: false,
111
+ data: undefined,
112
+ input,
113
+ errors: [
114
+ {
115
+ path: "$input",
116
+ expected: "JSON value",
117
+ description: jsonSource,
118
+ },
119
+ ],
120
+ };
121
+ }
122
+ // Extract JSON portion (skip junk prefix)
123
+ const jsonInput = jsonStart > 0 ? jsonSource.slice(jsonStart) : jsonSource;
124
+ const errors = [];
125
+ const parser = new LenientJsonParser(jsonInput, errors);
126
+ const data = parser.parse();
127
+ if (errors.length > 0) {
128
+ return {
129
+ success: false,
130
+ data: data,
131
+ input,
132
+ errors,
133
+ };
134
+ }
135
+ return {
136
+ success: true,
137
+ data: data,
138
+ };
139
+ }
140
+ /**
141
+ * Check if a string is a valid 4-character hexadecimal string.
142
+ *
143
+ * @internal
144
+ */
145
+ function isHexString(s) {
146
+ if (s.length !== 4)
147
+ return false;
148
+ for (let i = 0; i < 4; i++) {
149
+ const c = s.charCodeAt(i);
150
+ if (!((c >= 48 && c <= 57) || (c >= 65 && c <= 70) || (c >= 97 && c <= 102))) {
151
+ return false;
152
+ }
153
+ }
154
+ return true;
155
+ }
156
+ /**
157
+ * Extract JSON content from markdown code block if present.
158
+ *
159
+ * LLM outputs often wrap JSON in markdown code blocks like:
160
+ *
161
+ * Here is your result:
162
+ *
163
+ * ```json
164
+ * { "name": "test" }
165
+ * ```
166
+ *
167
+ * This function extracts the content between the backticks.
168
+ *
169
+ * IMPORTANT: Only extracts if the input doesn't already start with JSON. If
170
+ * input (after trim) starts with `{`, `[`, or `"`, it's already JSON and any
171
+ * markdown inside is part of a string value.
172
+ *
173
+ * @param input Text that may contain markdown code block
174
+ * @returns Extracted content or null if no code block found
175
+ * @internal
176
+ */
177
+ function extractMarkdownCodeBlock(input) {
178
+ // Must be ```json specifically, not just ```
179
+ const codeBlockStart = input.indexOf("```json");
180
+ if (codeBlockStart === -1)
181
+ return null;
182
+ // Check if input already starts with JSON (after trimming whitespace)
183
+ // If so, don't extract - the markdown is inside a JSON string value
184
+ const trimmed = input.trimStart();
185
+ if (trimmed.length > 0) {
186
+ const firstChar = trimmed[0];
187
+ if (firstChar === "{" || firstChar === "[" || firstChar === '"') {
188
+ return null;
189
+ }
190
+ }
191
+ // Find the end of the opening line (after ```json)
192
+ let contentStart = codeBlockStart + 7; // length of "```json"
193
+ while (contentStart < input.length && input[contentStart] !== "\n") {
194
+ contentStart++;
195
+ }
196
+ if (contentStart >= input.length)
197
+ return null;
198
+ contentStart++; // skip the newline
199
+ // Find the closing ```
200
+ const codeBlockEnd = input.indexOf("```", contentStart);
201
+ if (codeBlockEnd === -1) {
202
+ // No closing ``` - return everything after opening
203
+ return input.slice(contentStart);
204
+ }
205
+ return input.slice(contentStart, codeBlockEnd);
206
+ }
207
+ /**
208
+ * Find the start position of JSON object/array content in text that may have
209
+ * junk prefix.
210
+ *
211
+ * LLM outputs often contain text before JSON like:
212
+ *
213
+ * - "Here is your JSON: {"name": "test"}"
214
+ * - "Sure! [1, 2, 3]"
215
+ *
216
+ * This function skips over comments and strings to find the real JSON start.
217
+ * Primitive values (strings, numbers, booleans) are handled directly by the
218
+ * parser.
219
+ *
220
+ * @param input Text that may contain JSON with junk prefix
221
+ * @returns Index of first `{` or `[` outside comments/strings, or -1 if not
222
+ * found
223
+ * @internal
224
+ */
225
+ function findJsonStart(input) {
226
+ let pos = 0;
227
+ const len = input.length;
228
+ while (pos < len) {
229
+ const ch = input[pos];
230
+ // Found JSON start
231
+ if (ch === "{" || ch === "[") {
232
+ return pos;
233
+ }
234
+ // Skip single-line comment
235
+ if (ch === "/" && pos + 1 < len && input[pos + 1] === "/") {
236
+ pos += 2;
237
+ while (pos < len && input[pos] !== "\n" && input[pos] !== "\r") {
238
+ pos++;
239
+ }
240
+ continue;
241
+ }
242
+ // Skip multi-line comment
243
+ if (ch === "/" && pos + 1 < len && input[pos + 1] === "*") {
244
+ pos += 2;
245
+ while (pos + 1 < len) {
246
+ if (input[pos] === "*" && input[pos + 1] === "/") {
247
+ pos += 2;
248
+ break;
249
+ }
250
+ pos++;
251
+ }
252
+ // If unclosed comment, move to end
253
+ if (pos + 1 >= len) {
254
+ pos = len;
255
+ }
256
+ continue;
257
+ }
258
+ // Skip string literal (to avoid matching { or [ inside strings)
259
+ if (ch === '"') {
260
+ pos++;
261
+ while (pos < len) {
262
+ if (input[pos] === "\\") {
263
+ pos += 2; // skip escape sequence
264
+ continue;
265
+ }
266
+ if (input[pos] === '"') {
267
+ pos++;
268
+ break;
269
+ }
270
+ pos++;
271
+ }
272
+ continue;
273
+ }
274
+ pos++;
275
+ }
276
+ return -1;
277
+ }
278
+ /**
279
+ * Skip leading comments and whitespace from input.
280
+ *
281
+ * @param input Text that may start with comments or whitespace
282
+ * @returns Input with leading comments and whitespace removed
283
+ * @internal
284
+ */
285
+ function skipCommentsAndWhitespace(input) {
286
+ let pos = 0;
287
+ const len = input.length;
288
+ while (pos < len) {
289
+ const ch = input[pos];
290
+ // Skip whitespace
291
+ if (ch === " " || ch === "\t" || ch === "\n" || ch === "\r") {
292
+ pos++;
293
+ continue;
294
+ }
295
+ // Skip single-line comment
296
+ if (ch === "/" && pos + 1 < len && input[pos + 1] === "/") {
297
+ pos += 2;
298
+ while (pos < len && input[pos] !== "\n" && input[pos] !== "\r") {
299
+ pos++;
300
+ }
301
+ continue;
302
+ }
303
+ // Skip multi-line comment
304
+ if (ch === "/" && pos + 1 < len && input[pos + 1] === "*") {
305
+ pos += 2;
306
+ while (pos + 1 < len) {
307
+ if (input[pos] === "*" && input[pos + 1] === "/") {
308
+ pos += 2;
309
+ break;
310
+ }
311
+ pos++;
312
+ }
313
+ if (pos + 1 >= len) {
314
+ pos = len;
315
+ }
316
+ continue;
317
+ }
318
+ // Not whitespace or comment
319
+ break;
320
+ }
321
+ return input.slice(pos);
322
+ }
323
+ /**
324
+ * Check if input starts with a valid JSON primitive token.
325
+ *
326
+ * @param input Trimmed input string
327
+ * @returns True if input starts with a primitive value
328
+ * @internal
329
+ */
330
+ function startsWithPrimitive(input) {
331
+ if (input.length === 0)
332
+ return false;
333
+ const ch = input[0];
334
+ // String
335
+ if (ch === '"')
336
+ return true;
337
+ // Number (digit or minus)
338
+ if ((ch >= "0" && ch <= "9") || ch === "-")
339
+ return true;
340
+ // Keywords
341
+ if (input.startsWith("true") ||
342
+ input.startsWith("false") ||
343
+ input.startsWith("null"))
344
+ return true;
345
+ // Partial keywords (note: "null" requires at least 2 chars to match parseKeywordOrIdentifier logic)
346
+ if ("true".startsWith(input) ||
347
+ "false".startsWith(input) ||
348
+ ("null".startsWith(input) && input.length >= 2))
349
+ return true;
350
+ // Boolean string variants (note: "n" is intentionally excluded)
351
+ const lower = input.toLowerCase();
352
+ if (lower === "yes" ||
353
+ lower === "y" ||
354
+ lower === "on" ||
355
+ lower === "no" ||
356
+ lower === "off")
357
+ return true;
358
+ return false;
359
+ }
360
+ /**
361
+ * Lenient JSON parser that handles incomplete JSON.
362
+ *
363
+ * @internal
364
+ */
365
+ class LenientJsonParser {
366
+ constructor(input, errors) {
367
+ this.pos = 0;
368
+ this.depth = 0;
369
+ this.input = input;
370
+ this.errors = errors;
371
+ }
372
+ parse() {
373
+ this.skipWhitespace();
374
+ if (this.pos >= this.input.length) {
375
+ return undefined;
376
+ }
377
+ return this.parseValue("$input");
378
+ }
379
+ parseValue(path) {
380
+ this.skipWhitespace();
381
+ if (this.pos >= this.input.length) {
382
+ return undefined;
383
+ }
384
+ // Check for maximum depth to prevent stack overflow
385
+ if (this.depth >= MAX_DEPTH) {
386
+ this.errors.push({
387
+ path,
388
+ expected: "value (max depth exceeded)",
389
+ description: undefined,
390
+ });
391
+ return undefined;
392
+ }
393
+ const char = this.input[this.pos];
394
+ if (char === "{")
395
+ return this.parseObject(path);
396
+ if (char === "[")
397
+ return this.parseArray(path);
398
+ if (char === '"')
399
+ return this.parseString();
400
+ if (char === "-" || (char >= "0" && char <= "9"))
401
+ return this.parseNumber();
402
+ // Handle keywords (true, false, null) or invalid identifiers
403
+ if (this.isIdentifierStart(char)) {
404
+ return this.parseKeywordOrIdentifier(path);
405
+ }
406
+ // Don't skip structural characters - let the caller handle them
407
+ const ch = this.input[this.pos];
408
+ if (ch === "}" || ch === "]" || ch === ",") {
409
+ // Not an error - just no value here (e.g., {"a":} or [,])
410
+ return undefined;
411
+ }
412
+ this.errors.push({
413
+ path,
414
+ expected: "JSON value",
415
+ description: this.getErrorContext(),
416
+ });
417
+ // Skip the problematic character and try to continue
418
+ this.pos++;
419
+ return undefined;
420
+ }
421
+ getErrorContext() {
422
+ // Get surrounding context for better error messages
423
+ const start = Math.max(0, this.pos - 10);
424
+ const end = Math.min(this.input.length, this.pos + 20);
425
+ const before = this.input.slice(start, this.pos);
426
+ const after = this.input.slice(this.pos, end);
427
+ return ((start > 0 ? "..." : "") +
428
+ before +
429
+ "→" +
430
+ after +
431
+ (end < this.input.length ? "..." : ""));
432
+ }
433
+ parseKeywordOrIdentifier(path) {
434
+ // Extract the token (sequence of identifier characters)
435
+ const start = this.pos;
436
+ while (this.pos < this.input.length &&
437
+ this.isIdentifierChar(this.input[this.pos])) {
438
+ this.pos++;
439
+ }
440
+ const token = this.input.slice(start, this.pos);
441
+ // Check for complete or partial keyword matches
442
+ if (token === "true")
443
+ return true;
444
+ if (token === "false")
445
+ return false;
446
+ if (token === "null")
447
+ return null;
448
+ // Boolean string coercion: "yes", "y", "on" -> true, "no", "off" -> false
449
+ // Note: "n" is intentionally NOT handled (neither null nor false)
450
+ const lower = token.toLowerCase();
451
+ if (lower === "yes" || lower === "y" || lower === "on")
452
+ return true;
453
+ if (lower === "no" || lower === "off")
454
+ return false;
455
+ // Partial match for lenient parsing (e.g., "tru" -> true, "fal" -> false)
456
+ if ("true".startsWith(token) && token.length > 0)
457
+ return true;
458
+ if ("false".startsWith(token) && token.length > 0)
459
+ return false;
460
+ if ("null".startsWith(token) && token.length >= 2)
461
+ return null;
462
+ // Check if this looks like a string with missing opening quote (e.g., abcdefg")
463
+ if (this.pos < this.input.length && this.input[this.pos] === '"') {
464
+ // Treat as unquoted string value - skip the errant closing quote and return as string
465
+ this.pos++; // skip the closing quote
466
+ this.errors.push({
467
+ path,
468
+ expected: "quoted string",
469
+ description: "missing opening quote for '" + token + "'",
470
+ });
471
+ return token;
472
+ }
473
+ // Invalid identifier as value - provide helpful error message
474
+ this.errors.push({
475
+ path,
476
+ expected: "JSON value (string, number, boolean, null, object, or array)",
477
+ description: "unquoted string '" + token + "' - did you forget quotes?",
478
+ });
479
+ // Skip to next comma, closing brace/bracket for recovery
480
+ this.skipToRecoveryPoint();
481
+ return undefined;
482
+ }
483
+ skipToRecoveryPoint() {
484
+ while (this.pos < this.input.length) {
485
+ const ch = this.input[this.pos];
486
+ if (ch === "," || ch === "}" || ch === "]") {
487
+ return;
488
+ }
489
+ this.pos++;
490
+ }
491
+ }
492
+ parseObject(path) {
493
+ const result = {};
494
+ this.pos++; // skip '{'
495
+ this.depth++;
496
+ this.skipWhitespace();
497
+ while (this.pos < this.input.length) {
498
+ this.skipWhitespace();
499
+ // Handle end of object or end of input
500
+ if (this.pos >= this.input.length || this.input[this.pos] === "}") {
501
+ if (this.pos < this.input.length)
502
+ this.pos++; // skip '}'
503
+ this.depth--;
504
+ return result;
505
+ }
506
+ // Skip trailing comma
507
+ if (this.input[this.pos] === ",") {
508
+ this.pos++;
509
+ this.skipWhitespace();
510
+ continue;
511
+ }
512
+ // Parse key (quoted string or unquoted identifier)
513
+ let key;
514
+ if (this.input[this.pos] === '"') {
515
+ key = this.parseString();
516
+ }
517
+ else if (this.isIdentifierStart(this.input[this.pos])) {
518
+ key = this.parseIdentifier();
519
+ }
520
+ else {
521
+ this.errors.push({
522
+ path,
523
+ expected: "string key",
524
+ description: this.input[this.pos],
525
+ });
526
+ // Try to recover by skipping to next meaningful character
527
+ this.depth--;
528
+ return result;
529
+ }
530
+ if (typeof key !== "string") {
531
+ this.depth--;
532
+ return result;
533
+ }
534
+ this.skipWhitespace();
535
+ // Expect colon - but if we're at end of input, it's just incomplete (not an error)
536
+ if (this.pos >= this.input.length) {
537
+ this.depth--;
538
+ return result;
539
+ }
540
+ if (this.input[this.pos] !== ":") {
541
+ this.errors.push({
542
+ path: path + "." + key,
543
+ expected: "':'",
544
+ description: this.input[this.pos],
545
+ });
546
+ this.depth--;
547
+ return result;
548
+ }
549
+ this.pos++; // skip ':'
550
+ this.skipWhitespace();
551
+ // Parse value
552
+ if (this.pos >= this.input.length) {
553
+ // No value - incomplete but not an error for lenient parsing
554
+ this.depth--;
555
+ return result;
556
+ }
557
+ const value = this.parseValue(path + "." + key);
558
+ result[key] = value;
559
+ this.skipWhitespace();
560
+ // Handle comma or end
561
+ if (this.pos < this.input.length && this.input[this.pos] === ",") {
562
+ this.pos++;
563
+ }
564
+ }
565
+ this.depth--;
566
+ return result;
567
+ }
568
+ parseArray(path) {
569
+ const result = [];
570
+ this.pos++; // skip '['
571
+ this.depth++;
572
+ this.skipWhitespace();
573
+ let index = 0;
574
+ while (this.pos < this.input.length) {
575
+ this.skipWhitespace();
576
+ // Handle end of array or end of input
577
+ if (this.pos >= this.input.length || this.input[this.pos] === "]") {
578
+ if (this.pos < this.input.length)
579
+ this.pos++; // skip ']'
580
+ this.depth--;
581
+ return result;
582
+ }
583
+ // Skip trailing comma
584
+ if (this.input[this.pos] === ",") {
585
+ this.pos++;
586
+ this.skipWhitespace();
587
+ continue;
588
+ }
589
+ // Parse value
590
+ const prevPos = this.pos;
591
+ const value = this.parseValue(path + "[" + index + "]");
592
+ // Guard: if parseValue didn't advance, skip unexpected char to prevent infinite loop
593
+ if (this.pos === prevPos && this.pos < this.input.length) {
594
+ this.pos++;
595
+ continue;
596
+ }
597
+ result.push(value);
598
+ index++;
599
+ this.skipWhitespace();
600
+ // Handle comma or end
601
+ if (this.pos < this.input.length && this.input[this.pos] === ",") {
602
+ this.pos++;
603
+ }
604
+ }
605
+ this.depth--;
606
+ return result;
607
+ }
608
+ parseString() {
609
+ this.pos++; // skip opening '"'
610
+ let result = "";
611
+ let escaped = false;
612
+ while (this.pos < this.input.length) {
613
+ const char = this.input[this.pos];
614
+ if (escaped) {
615
+ switch (char) {
616
+ case '"':
617
+ result += '"';
618
+ break;
619
+ case "\\":
620
+ result += "\\";
621
+ break;
622
+ case "/":
623
+ result += "/";
624
+ break;
625
+ case "b":
626
+ result += "\b";
627
+ break;
628
+ case "f":
629
+ result += "\f";
630
+ break;
631
+ case "n":
632
+ result += "\n";
633
+ break;
634
+ case "r":
635
+ result += "\r";
636
+ break;
637
+ case "t":
638
+ result += "\t";
639
+ break;
640
+ case "u":
641
+ // Parse unicode escape
642
+ if (this.pos + 4 <= this.input.length) {
643
+ const hex = this.input.slice(this.pos + 1, this.pos + 5);
644
+ if (isHexString(hex)) {
645
+ const highCode = parseInt(hex, 16);
646
+ this.pos += 4;
647
+ // Check for surrogate pair (emoji and characters > U+FFFF)
648
+ if (highCode >= 0xd800 &&
649
+ highCode <= 0xdbff &&
650
+ this.pos + 6 <= this.input.length &&
651
+ this.input[this.pos + 1] === "\\" &&
652
+ this.input[this.pos + 2] === "u") {
653
+ const lowHex = this.input.slice(this.pos + 3, this.pos + 7);
654
+ if (isHexString(lowHex)) {
655
+ const lowCode = parseInt(lowHex, 16);
656
+ if (lowCode >= 0xdc00 && lowCode <= 0xdfff) {
657
+ result += String.fromCharCode(highCode, lowCode);
658
+ this.pos += 6;
659
+ break;
660
+ }
661
+ }
662
+ }
663
+ result += String.fromCharCode(highCode);
664
+ }
665
+ else {
666
+ // Invalid hex - preserve escape sequence literally
667
+ result += "\\u" + hex;
668
+ this.pos += 4;
669
+ }
670
+ }
671
+ else {
672
+ // Incomplete unicode escape - add partial sequence
673
+ const partial = this.input.slice(this.pos + 1);
674
+ result += "\\u" + partial;
675
+ this.pos = this.input.length - 1;
676
+ }
677
+ break;
678
+ default:
679
+ result += char;
680
+ }
681
+ escaped = false;
682
+ this.pos++;
683
+ continue;
684
+ }
685
+ if (char === "\\") {
686
+ escaped = true;
687
+ this.pos++;
688
+ continue;
689
+ }
690
+ if (char === '"') {
691
+ this.pos++; // skip closing '"'
692
+ return result;
693
+ }
694
+ result += char;
695
+ this.pos++;
696
+ }
697
+ // Unclosed string - return what we have (lenient)
698
+ return result;
699
+ }
700
+ parseNumber() {
701
+ const start = this.pos;
702
+ // Handle negative sign
703
+ if (this.input[this.pos] === "-") {
704
+ this.pos++;
705
+ }
706
+ // Parse integer part
707
+ while (this.pos < this.input.length &&
708
+ this.input[this.pos] >= "0" &&
709
+ this.input[this.pos] <= "9") {
710
+ this.pos++;
711
+ }
712
+ // Parse decimal part
713
+ if (this.pos < this.input.length && this.input[this.pos] === ".") {
714
+ this.pos++;
715
+ while (this.pos < this.input.length &&
716
+ this.input[this.pos] >= "0" &&
717
+ this.input[this.pos] <= "9") {
718
+ this.pos++;
719
+ }
720
+ }
721
+ // Parse exponent
722
+ if (this.pos < this.input.length &&
723
+ (this.input[this.pos] === "e" || this.input[this.pos] === "E")) {
724
+ this.pos++;
725
+ if (this.pos < this.input.length &&
726
+ (this.input[this.pos] === "+" || this.input[this.pos] === "-")) {
727
+ this.pos++;
728
+ }
729
+ while (this.pos < this.input.length &&
730
+ this.input[this.pos] >= "0" &&
731
+ this.input[this.pos] <= "9") {
732
+ this.pos++;
733
+ }
734
+ }
735
+ const numStr = this.input.slice(start, this.pos);
736
+ const num = Number(numStr);
737
+ return Number.isNaN(num) ? 0 : num;
738
+ }
739
+ isIdentifierStart(ch) {
740
+ return ((ch >= "a" && ch <= "z") ||
741
+ (ch >= "A" && ch <= "Z") ||
742
+ ch === "_" ||
743
+ ch === "$");
744
+ }
745
+ isIdentifierChar(ch) {
746
+ return ((ch >= "a" && ch <= "z") ||
747
+ (ch >= "A" && ch <= "Z") ||
748
+ (ch >= "0" && ch <= "9") ||
749
+ ch === "_" ||
750
+ ch === "$");
751
+ }
752
+ parseIdentifier() {
753
+ const start = this.pos;
754
+ while (this.pos < this.input.length &&
755
+ this.isIdentifierChar(this.input[this.pos])) {
756
+ this.pos++;
757
+ }
758
+ return this.input.slice(start, this.pos);
759
+ }
760
+ skipWhitespace() {
761
+ while (this.pos < this.input.length) {
762
+ const ch = this.input[this.pos];
763
+ // Skip standard whitespace
764
+ if (ch === " " || ch === "\t" || ch === "\n" || ch === "\r") {
765
+ this.pos++;
766
+ continue;
767
+ }
768
+ // Skip single-line comment: // ...
769
+ if (ch === "/" &&
770
+ this.pos + 1 < this.input.length &&
771
+ this.input[this.pos + 1] === "/") {
772
+ this.pos += 2;
773
+ while (this.pos < this.input.length &&
774
+ this.input[this.pos] !== "\n" &&
775
+ this.input[this.pos] !== "\r") {
776
+ this.pos++;
777
+ }
778
+ continue;
779
+ }
780
+ // Skip multi-line comment: /* ... */
781
+ if (ch === "/" &&
782
+ this.pos + 1 < this.input.length &&
783
+ this.input[this.pos + 1] === "*") {
784
+ this.pos += 2;
785
+ while (this.pos + 1 < this.input.length) {
786
+ if (this.input[this.pos] === "*" &&
787
+ this.input[this.pos + 1] === "/") {
788
+ this.pos += 2;
789
+ break;
790
+ }
791
+ this.pos++;
792
+ }
793
+ // Handle unclosed comment - move to end
794
+ if (this.pos + 1 >= this.input.length) {
795
+ this.pos = this.input.length;
796
+ }
797
+ continue;
798
+ }
799
+ // Not whitespace or comment
800
+ break;
801
+ }
802
+ }
803
+ }
804
+ /**
805
+ * Maximum nesting depth to prevent stack overflow attacks.
806
+ *
807
+ * @internal
808
+ */
809
+ const MAX_DEPTH = 512;
810
+
811
+ return parseLenientJson;
812
+ }
813
+
814
+ export { requireParseLenientJson as __require };
815
+ //# sourceMappingURL=parseLenientJson2.mjs.map