@typia/utils 12.1.0-dev.20260325 → 13.0.0-dev.20260425
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.
- package/LICENSE +21 -21
- package/README.md +85 -85
- package/lib/_virtual/ArrayUtil.mjs +4 -0
- package/lib/_virtual/ArrayUtil.mjs.map +1 -0
- package/lib/_virtual/EndpointUtil.mjs +4 -0
- package/lib/_virtual/EndpointUtil.mjs.map +1 -0
- package/lib/_virtual/HttpError.mjs +4 -0
- package/lib/_virtual/HttpError.mjs.map +1 -0
- package/lib/_virtual/HttpLlm.mjs +4 -0
- package/lib/_virtual/HttpLlm.mjs.map +1 -0
- package/lib/_virtual/HttpLlmApplicationComposer.mjs +4 -0
- package/lib/_virtual/HttpLlmApplicationComposer.mjs.map +1 -0
- package/lib/_virtual/HttpLlmFunctionFetcher.mjs +4 -0
- package/lib/_virtual/HttpLlmFunctionFetcher.mjs.map +1 -0
- package/lib/_virtual/HttpMigrateApplicationComposer.mjs +4 -0
- package/lib/_virtual/HttpMigrateApplicationComposer.mjs.map +1 -0
- package/lib/_virtual/HttpMigrateRouteAccessor.mjs +4 -0
- package/lib/_virtual/HttpMigrateRouteAccessor.mjs.map +1 -0
- package/lib/_virtual/HttpMigrateRouteComposer.mjs +4 -0
- package/lib/_virtual/HttpMigrateRouteComposer.mjs.map +1 -0
- package/lib/_virtual/HttpMigrateRouteFetcher.mjs +4 -0
- package/lib/_virtual/HttpMigrateRouteFetcher.mjs.map +1 -0
- package/lib/_virtual/HttpMigration.mjs +4 -0
- package/lib/_virtual/HttpMigration.mjs.map +1 -0
- package/lib/_virtual/IOpenApiValidatorContext.mjs +4 -0
- package/lib/_virtual/IOpenApiValidatorContext.mjs.map +1 -0
- package/lib/_virtual/JsonDescriptor.mjs +4 -0
- package/lib/_virtual/JsonDescriptor.mjs.map +1 -0
- package/lib/_virtual/LlmDescriptionInverter.mjs +4 -0
- package/lib/_virtual/LlmDescriptionInverter.mjs.map +1 -0
- package/lib/_virtual/LlmJson.mjs +4 -0
- package/lib/_virtual/LlmJson.mjs.map +1 -0
- package/lib/_virtual/LlmParametersComposer.mjs +4 -0
- package/lib/_virtual/LlmParametersComposer.mjs.map +1 -0
- package/lib/_virtual/LlmSchemaConverter.mjs +4 -0
- package/lib/_virtual/LlmSchemaConverter.mjs.map +1 -0
- package/lib/_virtual/LlmTypeChecker.mjs +4 -0
- package/lib/_virtual/LlmTypeChecker.mjs.map +1 -0
- package/lib/_virtual/MapUtil.mjs +4 -0
- package/lib/_virtual/MapUtil.mjs.map +1 -0
- package/lib/_virtual/NamingConvention.mjs +4 -0
- package/lib/_virtual/NamingConvention.mjs.map +1 -0
- package/lib/_virtual/OpenApiArrayValidator.mjs +4 -0
- package/lib/_virtual/OpenApiArrayValidator.mjs.map +1 -0
- package/lib/_virtual/OpenApiBooleanValidator.mjs +4 -0
- package/lib/_virtual/OpenApiBooleanValidator.mjs.map +1 -0
- package/lib/_virtual/OpenApiConstantValidator.mjs +4 -0
- package/lib/_virtual/OpenApiConstantValidator.mjs.map +1 -0
- package/lib/_virtual/OpenApiConstraintShifter.mjs +4 -0
- package/lib/_virtual/OpenApiConstraintShifter.mjs.map +1 -0
- package/lib/_virtual/OpenApiConverter.mjs +4 -0
- package/lib/_virtual/OpenApiConverter.mjs.map +1 -0
- package/lib/_virtual/OpenApiExclusiveEmender.mjs +4 -0
- package/lib/_virtual/OpenApiExclusiveEmender.mjs.map +1 -0
- package/lib/_virtual/OpenApiIntegerValidator.mjs +4 -0
- package/lib/_virtual/OpenApiIntegerValidator.mjs.map +1 -0
- package/lib/_virtual/OpenApiNumberValidator.mjs +4 -0
- package/lib/_virtual/OpenApiNumberValidator.mjs.map +1 -0
- package/lib/_virtual/OpenApiObjectValidator.mjs +4 -0
- package/lib/_virtual/OpenApiObjectValidator.mjs.map +1 -0
- package/lib/_virtual/OpenApiOneOfValidator.mjs +4 -0
- package/lib/_virtual/OpenApiOneOfValidator.mjs.map +1 -0
- package/lib/_virtual/OpenApiSchemaNamingRule.mjs +4 -0
- package/lib/_virtual/OpenApiSchemaNamingRule.mjs.map +1 -0
- package/lib/_virtual/OpenApiStationValidator.mjs +4 -0
- package/lib/_virtual/OpenApiStationValidator.mjs.map +1 -0
- package/lib/_virtual/OpenApiStringValidator.mjs +4 -0
- package/lib/_virtual/OpenApiStringValidator.mjs.map +1 -0
- package/lib/_virtual/OpenApiTupleValidator.mjs +4 -0
- package/lib/_virtual/OpenApiTupleValidator.mjs.map +1 -0
- package/lib/_virtual/OpenApiTypeChecker.mjs +4 -0
- package/lib/_virtual/OpenApiTypeChecker.mjs.map +1 -0
- package/lib/_virtual/OpenApiTypeCheckerBase.mjs +4 -0
- package/lib/_virtual/OpenApiTypeCheckerBase.mjs.map +1 -0
- package/lib/_virtual/OpenApiV3Downgrader.mjs +4 -0
- package/lib/_virtual/OpenApiV3Downgrader.mjs.map +1 -0
- package/lib/_virtual/OpenApiV3TypeChecker.mjs +4 -0
- package/lib/_virtual/OpenApiV3TypeChecker.mjs.map +1 -0
- package/lib/_virtual/OpenApiV3Upgrader.mjs +4 -0
- package/lib/_virtual/OpenApiV3Upgrader.mjs.map +1 -0
- package/lib/_virtual/OpenApiV3_1Downgrader.mjs +4 -0
- package/lib/_virtual/OpenApiV3_1Downgrader.mjs.map +1 -0
- package/lib/_virtual/OpenApiV3_1TypeChecker.mjs +4 -0
- package/lib/_virtual/OpenApiV3_1TypeChecker.mjs.map +1 -0
- package/lib/_virtual/OpenApiV3_1Upgrader.mjs +4 -0
- package/lib/_virtual/OpenApiV3_1Upgrader.mjs.map +1 -0
- package/lib/_virtual/OpenApiV3_2Upgrader.mjs +4 -0
- package/lib/_virtual/OpenApiV3_2Upgrader.mjs.map +1 -0
- package/lib/_virtual/OpenApiValidator.mjs +4 -0
- package/lib/_virtual/OpenApiValidator.mjs.map +1 -0
- package/lib/_virtual/Singleton.mjs +4 -0
- package/lib/_virtual/Singleton.mjs.map +1 -0
- package/lib/_virtual/StringUtil.mjs +4 -0
- package/lib/_virtual/StringUtil.mjs.map +1 -0
- package/lib/_virtual/SwaggerV2Downgrader.mjs +4 -0
- package/lib/_virtual/SwaggerV2Downgrader.mjs.map +1 -0
- package/lib/_virtual/SwaggerV2TypeChecker.mjs +4 -0
- package/lib/_virtual/SwaggerV2TypeChecker.mjs.map +1 -0
- package/lib/_virtual/SwaggerV2Upgrader.mjs +4 -0
- package/lib/_virtual/SwaggerV2Upgrader.mjs.map +1 -0
- package/lib/_virtual/_commonjsHelpers.mjs +6 -0
- package/lib/_virtual/_commonjsHelpers.mjs.map +1 -0
- package/lib/_virtual/_isBigintString.mjs +4 -0
- package/lib/_virtual/_isBigintString.mjs.map +1 -0
- package/lib/_virtual/_isFormatByte.mjs +4 -0
- package/lib/_virtual/_isFormatByte.mjs.map +1 -0
- package/lib/_virtual/_isFormatDate.mjs +4 -0
- package/lib/_virtual/_isFormatDate.mjs.map +1 -0
- package/lib/_virtual/_isFormatDateTime.mjs +4 -0
- package/lib/_virtual/_isFormatDateTime.mjs.map +1 -0
- package/lib/_virtual/_isFormatDuration.mjs +4 -0
- package/lib/_virtual/_isFormatDuration.mjs.map +1 -0
- package/lib/_virtual/_isFormatEmail.mjs +4 -0
- package/lib/_virtual/_isFormatEmail.mjs.map +1 -0
- package/lib/_virtual/_isFormatHostname.mjs +4 -0
- package/lib/_virtual/_isFormatHostname.mjs.map +1 -0
- package/lib/_virtual/_isFormatIdnEmail.mjs +4 -0
- package/lib/_virtual/_isFormatIdnEmail.mjs.map +1 -0
- package/lib/_virtual/_isFormatIdnHostname.mjs +4 -0
- package/lib/_virtual/_isFormatIdnHostname.mjs.map +1 -0
- package/lib/_virtual/_isFormatIpv4.mjs +4 -0
- package/lib/_virtual/_isFormatIpv4.mjs.map +1 -0
- package/lib/_virtual/_isFormatIpv6.mjs +4 -0
- package/lib/_virtual/_isFormatIpv6.mjs.map +1 -0
- package/lib/_virtual/_isFormatIri.mjs +4 -0
- package/lib/_virtual/_isFormatIri.mjs.map +1 -0
- package/lib/_virtual/_isFormatIriReference.mjs +4 -0
- package/lib/_virtual/_isFormatIriReference.mjs.map +1 -0
- package/lib/_virtual/_isFormatJsonPointer.mjs +4 -0
- package/lib/_virtual/_isFormatJsonPointer.mjs.map +1 -0
- package/lib/_virtual/_isFormatPassword.mjs +4 -0
- package/lib/_virtual/_isFormatPassword.mjs.map +1 -0
- package/lib/_virtual/_isFormatRegex.mjs +4 -0
- package/lib/_virtual/_isFormatRegex.mjs.map +1 -0
- package/lib/_virtual/_isFormatRelativeJsonPointer.mjs +4 -0
- package/lib/_virtual/_isFormatRelativeJsonPointer.mjs.map +1 -0
- package/lib/_virtual/_isFormatTime.mjs +4 -0
- package/lib/_virtual/_isFormatTime.mjs.map +1 -0
- package/lib/_virtual/_isFormatUri.mjs +4 -0
- package/lib/_virtual/_isFormatUri.mjs.map +1 -0
- package/lib/_virtual/_isFormatUriReference.mjs +4 -0
- package/lib/_virtual/_isFormatUriReference.mjs.map +1 -0
- package/lib/_virtual/_isFormatUriTemplate.mjs +4 -0
- package/lib/_virtual/_isFormatUriTemplate.mjs.map +1 -0
- package/lib/_virtual/_isFormatUrl.mjs +4 -0
- package/lib/_virtual/_isFormatUrl.mjs.map +1 -0
- package/lib/_virtual/_isFormatUuid.mjs +4 -0
- package/lib/_virtual/_isFormatUuid.mjs.map +1 -0
- package/lib/_virtual/_isUniqueItems.mjs +4 -0
- package/lib/_virtual/_isUniqueItems.mjs.map +1 -0
- package/lib/_virtual/coerceLlmArguments.mjs +4 -0
- package/lib/_virtual/coerceLlmArguments.mjs.map +1 -0
- package/lib/_virtual/dedent.mjs +4 -0
- package/lib/_virtual/dedent.mjs.map +1 -0
- package/lib/_virtual/index.mjs +4 -0
- package/lib/_virtual/index.mjs.map +1 -0
- package/lib/_virtual/index2.mjs +4 -0
- package/lib/_virtual/index2.mjs.map +1 -0
- package/lib/_virtual/index3.mjs +4 -0
- package/lib/_virtual/index3.mjs.map +1 -0
- package/lib/_virtual/index4.mjs +4 -0
- package/lib/_virtual/index4.mjs.map +1 -0
- package/lib/_virtual/index5.mjs +4 -0
- package/lib/_virtual/index5.mjs.map +1 -0
- package/lib/_virtual/parseLenientJson.mjs +4 -0
- package/lib/_virtual/parseLenientJson.mjs.map +1 -0
- package/lib/_virtual/stringifyValidationFailure.mjs +4 -0
- package/lib/_virtual/stringifyValidationFailure.mjs.map +1 -0
- package/lib/converters/LlmSchemaConverter.js +149 -51
- package/lib/converters/LlmSchemaConverter.js.map +1 -1
- package/lib/converters/LlmSchemaConverter.mjs +5 -511
- package/lib/converters/LlmSchemaConverter.mjs.map +1 -1
- package/lib/converters/LlmSchemaConverter2.mjs +551 -0
- package/lib/converters/LlmSchemaConverter2.mjs.map +1 -0
- package/lib/converters/OpenApiConverter.js.map +1 -1
- package/lib/converters/OpenApiConverter.mjs +5 -146
- package/lib/converters/OpenApiConverter.mjs.map +1 -1
- package/lib/converters/OpenApiConverter2.mjs +167 -0
- package/lib/converters/OpenApiConverter2.mjs.map +1 -0
- package/lib/converters/index.mjs +7 -3
- package/lib/converters/index.mjs.map +1 -1
- package/lib/converters/index2.mjs +37 -0
- package/lib/converters/index2.mjs.map +1 -0
- package/lib/converters/internal/LlmDescriptionInverter.js.map +1 -1
- package/lib/converters/internal/LlmDescriptionInverter.mjs +5 -138
- package/lib/converters/internal/LlmDescriptionInverter.mjs.map +1 -1
- package/lib/converters/internal/LlmDescriptionInverter2.mjs +153 -0
- package/lib/converters/internal/LlmDescriptionInverter2.mjs.map +1 -0
- package/lib/converters/internal/LlmParametersComposer.js +14 -17
- package/lib/converters/internal/LlmParametersComposer.js.map +1 -1
- package/lib/converters/internal/LlmParametersComposer.mjs +5 -39
- package/lib/converters/internal/LlmParametersComposer.mjs.map +1 -1
- package/lib/converters/internal/LlmParametersComposer2.mjs +48 -0
- package/lib/converters/internal/LlmParametersComposer2.mjs.map +1 -0
- package/lib/converters/internal/OpenApiConstraintShifter.js.map +1 -1
- package/lib/converters/internal/OpenApiConstraintShifter.mjs +5 -99
- package/lib/converters/internal/OpenApiConstraintShifter.mjs.map +1 -1
- package/lib/converters/internal/OpenApiConstraintShifter2.mjs +115 -0
- package/lib/converters/internal/OpenApiConstraintShifter2.mjs.map +1 -0
- package/lib/converters/internal/OpenApiExclusiveEmender.js.map +1 -1
- package/lib/converters/internal/OpenApiExclusiveEmender.mjs +6 -33
- package/lib/converters/internal/OpenApiExclusiveEmender.mjs.map +1 -1
- package/lib/converters/internal/OpenApiExclusiveEmender2.mjs +43 -0
- package/lib/converters/internal/OpenApiExclusiveEmender2.mjs.map +1 -0
- package/lib/converters/internal/OpenApiV3Downgrader.js +2 -1
- package/lib/converters/internal/OpenApiV3Downgrader.js.map +1 -1
- package/lib/converters/internal/OpenApiV3Downgrader.mjs +5 -299
- package/lib/converters/internal/OpenApiV3Downgrader.mjs.map +1 -1
- package/lib/converters/internal/OpenApiV3Downgrader2.mjs +247 -0
- package/lib/converters/internal/OpenApiV3Downgrader2.mjs.map +1 -0
- package/lib/converters/internal/OpenApiV3Upgrader.js +58 -67
- package/lib/converters/internal/OpenApiV3Upgrader.js.map +1 -1
- package/lib/converters/internal/OpenApiV3Upgrader.mjs +5 -367
- package/lib/converters/internal/OpenApiV3Upgrader.mjs.map +1 -1
- package/lib/converters/internal/OpenApiV3Upgrader2.mjs +308 -0
- package/lib/converters/internal/OpenApiV3Upgrader2.mjs.map +1 -0
- package/lib/converters/internal/OpenApiV3_1Downgrader.js.map +1 -1
- package/lib/converters/internal/OpenApiV3_1Downgrader.mjs +5 -236
- package/lib/converters/internal/OpenApiV3_1Downgrader.mjs.map +1 -1
- package/lib/converters/internal/OpenApiV3_1Downgrader2.mjs +203 -0
- package/lib/converters/internal/OpenApiV3_1Downgrader2.mjs.map +1 -0
- package/lib/converters/internal/OpenApiV3_1Upgrader.js +68 -70
- package/lib/converters/internal/OpenApiV3_1Upgrader.js.map +1 -1
- package/lib/converters/internal/OpenApiV3_1Upgrader.mjs +5 -564
- package/lib/converters/internal/OpenApiV3_1Upgrader.mjs.map +1 -1
- package/lib/converters/internal/OpenApiV3_1Upgrader2.mjs +435 -0
- package/lib/converters/internal/OpenApiV3_1Upgrader2.mjs.map +1 -0
- package/lib/converters/internal/OpenApiV3_2Upgrader.js +57 -63
- package/lib/converters/internal/OpenApiV3_2Upgrader.js.map +1 -1
- package/lib/converters/internal/OpenApiV3_2Upgrader.mjs +5 -240
- package/lib/converters/internal/OpenApiV3_2Upgrader.mjs.map +1 -1
- package/lib/converters/internal/OpenApiV3_2Upgrader2.mjs +211 -0
- package/lib/converters/internal/OpenApiV3_2Upgrader2.mjs.map +1 -0
- package/lib/converters/internal/SwaggerV2Downgrader.js +44 -56
- package/lib/converters/internal/SwaggerV2Downgrader.js.map +1 -1
- package/lib/converters/internal/SwaggerV2Downgrader.mjs +5 -352
- package/lib/converters/internal/SwaggerV2Downgrader.mjs.map +1 -1
- package/lib/converters/internal/SwaggerV2Downgrader2.mjs +297 -0
- package/lib/converters/internal/SwaggerV2Downgrader2.mjs.map +1 -0
- package/lib/converters/internal/SwaggerV2Upgrader.js +52 -63
- package/lib/converters/internal/SwaggerV2Upgrader.js.map +1 -1
- package/lib/converters/internal/SwaggerV2Upgrader.mjs +5 -421
- package/lib/converters/internal/SwaggerV2Upgrader.mjs.map +1 -1
- package/lib/converters/internal/SwaggerV2Upgrader2.mjs +378 -0
- package/lib/converters/internal/SwaggerV2Upgrader2.mjs.map +1 -0
- package/lib/http/HttpError.js.map +1 -1
- package/lib/http/HttpError.mjs +6 -74
- package/lib/http/HttpError.mjs.map +1 -1
- package/lib/http/HttpError2.mjs +81 -0
- package/lib/http/HttpError2.mjs.map +1 -0
- package/lib/http/HttpLlm.js +5 -4
- package/lib/http/HttpLlm.js.map +1 -1
- package/lib/http/HttpLlm.mjs +5 -96
- package/lib/http/HttpLlm.mjs.map +1 -1
- package/lib/http/HttpLlm2.mjs +115 -0
- package/lib/http/HttpLlm2.mjs.map +1 -0
- package/lib/http/HttpMigration.js.map +1 -1
- package/lib/http/HttpMigration.mjs +5 -49
- package/lib/http/HttpMigration.mjs.map +1 -1
- package/lib/http/HttpMigration2.mjs +66 -0
- package/lib/http/HttpMigration2.mjs.map +1 -0
- package/lib/http/index.mjs +7 -3
- package/lib/http/index.mjs.map +1 -1
- package/lib/http/index2.mjs +36 -0
- package/lib/http/index2.mjs.map +1 -0
- package/lib/http/internal/HttpLlmApplicationComposer.js +12 -13
- package/lib/http/internal/HttpLlmApplicationComposer.js.map +1 -1
- package/lib/http/internal/HttpLlmApplicationComposer.mjs +5 -297
- package/lib/http/internal/HttpLlmApplicationComposer.mjs.map +1 -1
- package/lib/http/internal/HttpLlmApplicationComposer2.mjs +309 -0
- package/lib/http/internal/HttpLlmApplicationComposer2.mjs.map +1 -0
- package/lib/http/internal/HttpLlmFunctionFetcher.js.map +1 -1
- package/lib/http/internal/HttpLlmFunctionFetcher.mjs +5 -21
- package/lib/http/internal/HttpLlmFunctionFetcher.mjs.map +1 -1
- package/lib/http/internal/HttpLlmFunctionFetcher2.mjs +36 -0
- package/lib/http/internal/HttpLlmFunctionFetcher2.mjs.map +1 -0
- package/lib/http/internal/HttpMigrateApplicationComposer.js.map +1 -1
- package/lib/http/internal/HttpMigrateApplicationComposer.mjs +5 -44
- package/lib/http/internal/HttpMigrateApplicationComposer.mjs.map +1 -1
- package/lib/http/internal/HttpMigrateApplicationComposer2.mjs +59 -0
- package/lib/http/internal/HttpMigrateApplicationComposer2.mjs.map +1 -0
- package/lib/http/internal/HttpMigrateRouteAccessor.js.map +1 -1
- package/lib/http/internal/HttpMigrateRouteAccessor.mjs +5 -103
- package/lib/http/internal/HttpMigrateRouteAccessor.mjs.map +1 -1
- package/lib/http/internal/HttpMigrateRouteAccessor2.mjs +121 -0
- package/lib/http/internal/HttpMigrateRouteAccessor2.mjs.map +1 -0
- package/lib/http/internal/HttpMigrateRouteComposer.js +35 -54
- package/lib/http/internal/HttpMigrateRouteComposer.js.map +1 -1
- package/lib/http/internal/HttpMigrateRouteComposer.mjs +5 -381
- package/lib/http/internal/HttpMigrateRouteComposer.mjs.map +1 -1
- package/lib/http/internal/HttpMigrateRouteComposer2.mjs +384 -0
- package/lib/http/internal/HttpMigrateRouteComposer2.mjs.map +1 -0
- package/lib/http/internal/HttpMigrateRouteFetcher.js +7 -6
- package/lib/http/internal/HttpMigrateRouteFetcher.js.map +1 -1
- package/lib/http/internal/HttpMigrateRouteFetcher.mjs +5 -171
- package/lib/http/internal/HttpMigrateRouteFetcher.mjs.map +1 -1
- package/lib/http/internal/HttpMigrateRouteFetcher2.mjs +192 -0
- package/lib/http/internal/HttpMigrateRouteFetcher2.mjs.map +1 -0
- package/lib/index.mjs +7 -19
- package/lib/index.mjs.map +1 -1
- package/lib/index2.mjs +38 -0
- package/lib/index2.mjs.map +1 -0
- package/lib/utils/ArrayUtil.js.map +1 -1
- package/lib/utils/ArrayUtil.mjs +6 -26
- package/lib/utils/ArrayUtil.mjs.map +1 -1
- package/lib/utils/ArrayUtil2.mjs +40 -0
- package/lib/utils/ArrayUtil2.mjs.map +1 -0
- package/lib/utils/LlmJson.d.ts +1 -1
- package/lib/utils/LlmJson.js.map +1 -1
- package/lib/utils/LlmJson.mjs +5 -153
- package/lib/utils/LlmJson.mjs.map +1 -1
- package/lib/utils/LlmJson2.mjs +172 -0
- package/lib/utils/LlmJson2.mjs.map +1 -0
- package/lib/utils/MapUtil.js.map +1 -1
- package/lib/utils/MapUtil.mjs +6 -13
- package/lib/utils/MapUtil.mjs.map +1 -1
- package/lib/utils/MapUtil2.mjs +27 -0
- package/lib/utils/MapUtil2.mjs.map +1 -0
- package/lib/utils/NamingConvention.js.map +1 -1
- package/lib/utils/NamingConvention.mjs +6 -196
- package/lib/utils/NamingConvention.mjs.map +1 -1
- package/lib/utils/NamingConvention2.mjs +210 -0
- package/lib/utils/NamingConvention2.mjs.map +1 -0
- package/lib/utils/Singleton.d.ts +6 -1
- package/lib/utils/Singleton.js +0 -1
- package/lib/utils/Singleton.js.map +1 -1
- package/lib/utils/Singleton.mjs +6 -16
- package/lib/utils/Singleton.mjs.map +1 -1
- package/lib/utils/Singleton2.mjs +28 -0
- package/lib/utils/Singleton2.mjs.map +1 -0
- package/lib/utils/StringUtil.js +6 -9
- package/lib/utils/StringUtil.js.map +1 -1
- package/lib/utils/StringUtil.mjs +6 -11
- package/lib/utils/StringUtil.mjs.map +1 -1
- package/lib/utils/StringUtil2.mjs +25 -0
- package/lib/utils/StringUtil2.mjs.map +1 -0
- package/lib/utils/dedent.js.map +1 -1
- package/lib/utils/dedent.mjs +6 -48
- package/lib/utils/dedent.mjs.map +1 -1
- package/lib/utils/dedent2.mjs +62 -0
- package/lib/utils/dedent2.mjs.map +1 -0
- package/lib/utils/index.mjs +7 -7
- package/lib/utils/index.mjs.map +1 -1
- package/lib/utils/index2.mjs +44 -0
- package/lib/utils/index2.mjs.map +1 -0
- package/lib/utils/internal/EndpointUtil.js.map +1 -1
- package/lib/utils/internal/EndpointUtil.mjs +5 -34
- package/lib/utils/internal/EndpointUtil.mjs.map +1 -1
- package/lib/utils/internal/EndpointUtil2.mjs +49 -0
- package/lib/utils/internal/EndpointUtil2.mjs.map +1 -0
- package/lib/utils/internal/JsonDescriptor.js +18 -25
- package/lib/utils/internal/JsonDescriptor.js.map +1 -1
- package/lib/utils/internal/JsonDescriptor.mjs +5 -45
- package/lib/utils/internal/JsonDescriptor.mjs.map +1 -1
- package/lib/utils/internal/JsonDescriptor2.mjs +64 -0
- package/lib/utils/internal/JsonDescriptor2.mjs.map +1 -0
- package/lib/utils/internal/OpenApiTypeCheckerBase.js +15 -9
- package/lib/utils/internal/OpenApiTypeCheckerBase.js.map +1 -1
- package/lib/utils/internal/OpenApiTypeCheckerBase.mjs +5 -581
- package/lib/utils/internal/OpenApiTypeCheckerBase.mjs.map +1 -1
- package/lib/utils/internal/OpenApiTypeCheckerBase2.mjs +539 -0
- package/lib/utils/internal/OpenApiTypeCheckerBase2.mjs.map +1 -0
- package/lib/utils/internal/coerceLlmArguments.js +18 -4
- package/lib/utils/internal/coerceLlmArguments.js.map +1 -1
- package/lib/utils/internal/coerceLlmArguments.mjs +5 -245
- package/lib/utils/internal/coerceLlmArguments.mjs.map +1 -1
- package/lib/utils/internal/coerceLlmArguments2.mjs +276 -0
- package/lib/utils/internal/coerceLlmArguments2.mjs.map +1 -0
- package/lib/utils/internal/parseLenientJson.js.map +1 -1
- package/lib/utils/internal/parseLenientJson.mjs +6 -803
- package/lib/utils/internal/parseLenientJson.mjs.map +1 -1
- package/lib/utils/internal/parseLenientJson2.mjs +815 -0
- package/lib/utils/internal/parseLenientJson2.mjs.map +1 -0
- package/lib/utils/internal/stringifyValidationFailure.js.map +1 -1
- package/lib/utils/internal/stringifyValidationFailure.mjs +5 -315
- package/lib/utils/internal/stringifyValidationFailure.mjs.map +1 -1
- package/lib/utils/internal/stringifyValidationFailure2.mjs +333 -0
- package/lib/utils/internal/stringifyValidationFailure2.mjs.map +1 -0
- package/lib/validators/LlmTypeChecker.js +4 -3
- package/lib/validators/LlmTypeChecker.js.map +1 -1
- package/lib/validators/LlmTypeChecker.mjs +5 -297
- package/lib/validators/LlmTypeChecker.mjs.map +1 -1
- package/lib/validators/LlmTypeChecker2.mjs +323 -0
- package/lib/validators/LlmTypeChecker2.mjs.map +1 -0
- package/lib/validators/OpenApiTypeChecker.js.map +1 -1
- package/lib/validators/OpenApiTypeChecker.mjs +5 -215
- package/lib/validators/OpenApiTypeChecker.mjs.map +1 -1
- package/lib/validators/OpenApiTypeChecker2.mjs +219 -0
- package/lib/validators/OpenApiTypeChecker2.mjs.map +1 -0
- package/lib/validators/OpenApiV3TypeChecker.js.map +1 -1
- package/lib/validators/OpenApiV3TypeChecker.mjs +6 -27
- package/lib/validators/OpenApiV3TypeChecker.mjs.map +1 -1
- package/lib/validators/OpenApiV3TypeChecker2.mjs +41 -0
- package/lib/validators/OpenApiV3TypeChecker2.mjs.map +1 -0
- package/lib/validators/OpenApiV3_1TypeChecker.js.map +1 -1
- package/lib/validators/OpenApiV3_1TypeChecker.mjs +6 -31
- package/lib/validators/OpenApiV3_1TypeChecker.mjs.map +1 -1
- package/lib/validators/OpenApiV3_1TypeChecker2.mjs +45 -0
- package/lib/validators/OpenApiV3_1TypeChecker2.mjs.map +1 -0
- package/lib/validators/OpenApiValidator.js.map +1 -1
- package/lib/validators/OpenApiValidator.mjs +5 -72
- package/lib/validators/OpenApiValidator.mjs.map +1 -1
- package/lib/validators/OpenApiValidator2.mjs +83 -0
- package/lib/validators/OpenApiValidator2.mjs.map +1 -0
- package/lib/validators/SwaggerV2TypeChecker.js.map +1 -1
- package/lib/validators/SwaggerV2TypeChecker.mjs +6 -28
- package/lib/validators/SwaggerV2TypeChecker.mjs.map +1 -1
- package/lib/validators/SwaggerV2TypeChecker2.mjs +42 -0
- package/lib/validators/SwaggerV2TypeChecker2.mjs.map +1 -0
- package/lib/validators/functional/_isBigintString.js.map +1 -1
- package/lib/validators/functional/_isBigintString.mjs +6 -10
- package/lib/validators/functional/_isBigintString.mjs.map +1 -1
- package/lib/validators/functional/_isBigintString2.mjs +25 -0
- package/lib/validators/functional/_isBigintString2.mjs.map +1 -0
- package/lib/validators/functional/_isFormatByte.js.map +1 -1
- package/lib/validators/functional/_isFormatByte.mjs +6 -6
- package/lib/validators/functional/_isFormatByte.mjs.map +1 -1
- package/lib/validators/functional/_isFormatByte2.mjs +21 -0
- package/lib/validators/functional/_isFormatByte2.mjs.map +1 -0
- package/lib/validators/functional/_isFormatDate.js.map +1 -1
- package/lib/validators/functional/_isFormatDate.mjs +6 -3
- package/lib/validators/functional/_isFormatDate.mjs.map +1 -1
- package/lib/validators/functional/_isFormatDate2.mjs +18 -0
- package/lib/validators/functional/_isFormatDate2.mjs.map +1 -0
- package/lib/validators/functional/_isFormatDateTime.js.map +1 -1
- package/lib/validators/functional/_isFormatDateTime.mjs +6 -3
- package/lib/validators/functional/_isFormatDateTime.mjs.map +1 -1
- package/lib/validators/functional/_isFormatDateTime2.mjs +18 -0
- package/lib/validators/functional/_isFormatDateTime2.mjs.map +1 -0
- package/lib/validators/functional/_isFormatDuration.js.map +1 -1
- package/lib/validators/functional/_isFormatDuration.mjs +6 -3
- package/lib/validators/functional/_isFormatDuration.mjs.map +1 -1
- package/lib/validators/functional/_isFormatDuration2.mjs +18 -0
- package/lib/validators/functional/_isFormatDuration2.mjs.map +1 -0
- package/lib/validators/functional/_isFormatEmail.js.map +1 -1
- package/lib/validators/functional/_isFormatEmail.mjs +6 -3
- package/lib/validators/functional/_isFormatEmail.mjs.map +1 -1
- package/lib/validators/functional/_isFormatEmail2.mjs +18 -0
- package/lib/validators/functional/_isFormatEmail2.mjs.map +1 -0
- package/lib/validators/functional/_isFormatHostname.js.map +1 -1
- package/lib/validators/functional/_isFormatHostname.mjs +6 -3
- package/lib/validators/functional/_isFormatHostname.mjs.map +1 -1
- package/lib/validators/functional/_isFormatHostname2.mjs +18 -0
- package/lib/validators/functional/_isFormatHostname2.mjs.map +1 -0
- package/lib/validators/functional/_isFormatIdnEmail.js.map +1 -1
- package/lib/validators/functional/_isFormatIdnEmail.mjs +6 -3
- package/lib/validators/functional/_isFormatIdnEmail.mjs.map +1 -1
- package/lib/validators/functional/_isFormatIdnEmail2.mjs +18 -0
- package/lib/validators/functional/_isFormatIdnEmail2.mjs.map +1 -0
- package/lib/validators/functional/_isFormatIdnHostname.js.map +1 -1
- package/lib/validators/functional/_isFormatIdnHostname.mjs +6 -3
- package/lib/validators/functional/_isFormatIdnHostname.mjs.map +1 -1
- package/lib/validators/functional/_isFormatIdnHostname2.mjs +18 -0
- package/lib/validators/functional/_isFormatIdnHostname2.mjs.map +1 -0
- package/lib/validators/functional/_isFormatIpv4.js.map +1 -1
- package/lib/validators/functional/_isFormatIpv4.mjs +6 -3
- package/lib/validators/functional/_isFormatIpv4.mjs.map +1 -1
- package/lib/validators/functional/_isFormatIpv42.mjs +18 -0
- package/lib/validators/functional/_isFormatIpv42.mjs.map +1 -0
- package/lib/validators/functional/_isFormatIpv6.js.map +1 -1
- package/lib/validators/functional/_isFormatIpv6.mjs +6 -3
- package/lib/validators/functional/_isFormatIpv6.mjs.map +1 -1
- package/lib/validators/functional/_isFormatIpv62.mjs +18 -0
- package/lib/validators/functional/_isFormatIpv62.mjs.map +1 -0
- package/lib/validators/functional/_isFormatIri.js.map +1 -1
- package/lib/validators/functional/_isFormatIri.mjs +6 -3
- package/lib/validators/functional/_isFormatIri.mjs.map +1 -1
- package/lib/validators/functional/_isFormatIri2.mjs +18 -0
- package/lib/validators/functional/_isFormatIri2.mjs.map +1 -0
- package/lib/validators/functional/_isFormatIriReference.js.map +1 -1
- package/lib/validators/functional/_isFormatIriReference.mjs +6 -3
- package/lib/validators/functional/_isFormatIriReference.mjs.map +1 -1
- package/lib/validators/functional/_isFormatIriReference2.mjs +18 -0
- package/lib/validators/functional/_isFormatIriReference2.mjs.map +1 -0
- package/lib/validators/functional/_isFormatJsonPointer.js.map +1 -1
- package/lib/validators/functional/_isFormatJsonPointer.mjs +6 -3
- package/lib/validators/functional/_isFormatJsonPointer.mjs.map +1 -1
- package/lib/validators/functional/_isFormatJsonPointer2.mjs +18 -0
- package/lib/validators/functional/_isFormatJsonPointer2.mjs.map +1 -0
- package/lib/validators/functional/_isFormatPassword.js.map +1 -1
- package/lib/validators/functional/_isFormatPassword.mjs +6 -2
- package/lib/validators/functional/_isFormatPassword.mjs.map +1 -1
- package/lib/validators/functional/_isFormatPassword2.mjs +17 -0
- package/lib/validators/functional/_isFormatPassword2.mjs.map +1 -0
- package/lib/validators/functional/_isFormatRegex.js.map +1 -1
- package/lib/validators/functional/_isFormatRegex.mjs +6 -10
- package/lib/validators/functional/_isFormatRegex.mjs.map +1 -1
- package/lib/validators/functional/_isFormatRegex2.mjs +25 -0
- package/lib/validators/functional/_isFormatRegex2.mjs.map +1 -0
- package/lib/validators/functional/_isFormatRelativeJsonPointer.js.map +1 -1
- package/lib/validators/functional/_isFormatRelativeJsonPointer.mjs +6 -3
- package/lib/validators/functional/_isFormatRelativeJsonPointer.mjs.map +1 -1
- package/lib/validators/functional/_isFormatRelativeJsonPointer2.mjs +18 -0
- package/lib/validators/functional/_isFormatRelativeJsonPointer2.mjs.map +1 -0
- package/lib/validators/functional/_isFormatTime.js.map +1 -1
- package/lib/validators/functional/_isFormatTime.mjs +6 -3
- package/lib/validators/functional/_isFormatTime.mjs.map +1 -1
- package/lib/validators/functional/_isFormatTime2.mjs +18 -0
- package/lib/validators/functional/_isFormatTime2.mjs.map +1 -0
- package/lib/validators/functional/_isFormatUri.js.map +1 -1
- package/lib/validators/functional/_isFormatUri.mjs +6 -4
- package/lib/validators/functional/_isFormatUri.mjs.map +1 -1
- package/lib/validators/functional/_isFormatUri2.mjs +19 -0
- package/lib/validators/functional/_isFormatUri2.mjs.map +1 -0
- package/lib/validators/functional/_isFormatUriReference.js.map +1 -1
- package/lib/validators/functional/_isFormatUriReference.mjs +6 -3
- package/lib/validators/functional/_isFormatUriReference.mjs.map +1 -1
- package/lib/validators/functional/_isFormatUriReference2.mjs +18 -0
- package/lib/validators/functional/_isFormatUriReference2.mjs.map +1 -0
- package/lib/validators/functional/_isFormatUriTemplate.js.map +1 -1
- package/lib/validators/functional/_isFormatUriTemplate.mjs +6 -3
- package/lib/validators/functional/_isFormatUriTemplate.mjs.map +1 -1
- package/lib/validators/functional/_isFormatUriTemplate2.mjs +18 -0
- package/lib/validators/functional/_isFormatUriTemplate2.mjs.map +1 -0
- package/lib/validators/functional/_isFormatUrl.js.map +1 -1
- package/lib/validators/functional/_isFormatUrl.mjs +6 -3
- package/lib/validators/functional/_isFormatUrl.mjs.map +1 -1
- package/lib/validators/functional/_isFormatUrl2.mjs +18 -0
- package/lib/validators/functional/_isFormatUrl2.mjs.map +1 -0
- package/lib/validators/functional/_isFormatUuid.js.map +1 -1
- package/lib/validators/functional/_isFormatUuid.mjs +6 -3
- package/lib/validators/functional/_isFormatUuid.mjs.map +1 -1
- package/lib/validators/functional/_isFormatUuid2.mjs +18 -0
- package/lib/validators/functional/_isFormatUuid2.mjs.map +1 -0
- package/lib/validators/functional/_isUniqueItems.js.map +1 -1
- package/lib/validators/functional/_isUniqueItems.mjs +6 -136
- package/lib/validators/functional/_isUniqueItems.mjs.map +1 -1
- package/lib/validators/functional/_isUniqueItems2.mjs +151 -0
- package/lib/validators/functional/_isUniqueItems2.mjs.map +1 -0
- package/lib/validators/index.d.ts +1 -0
- package/lib/validators/index.js +0 -1
- package/lib/validators/index.js.map +1 -1
- package/lib/validators/index.mjs +7 -6
- package/lib/validators/index.mjs.map +1 -1
- package/lib/validators/index2.mjs +45 -0
- package/lib/validators/index2.mjs.map +1 -0
- package/lib/validators/internal/IOpenApiValidatorContext.mjs +6 -0
- package/lib/validators/internal/IOpenApiValidatorContext.mjs.map +1 -1
- package/lib/validators/internal/IOpenApiValidatorContext2.mjs +14 -0
- package/lib/validators/internal/IOpenApiValidatorContext2.mjs.map +1 -0
- package/lib/validators/internal/OpenApiArrayValidator.js.map +1 -1
- package/lib/validators/internal/OpenApiArrayValidator.mjs +5 -44
- package/lib/validators/internal/OpenApiArrayValidator.mjs.map +1 -1
- package/lib/validators/internal/OpenApiArrayValidator2.mjs +45 -0
- package/lib/validators/internal/OpenApiArrayValidator2.mjs.map +1 -0
- package/lib/validators/internal/OpenApiBooleanValidator.js.map +1 -1
- package/lib/validators/internal/OpenApiBooleanValidator.mjs +6 -7
- package/lib/validators/internal/OpenApiBooleanValidator.mjs.map +1 -1
- package/lib/validators/internal/OpenApiBooleanValidator2.mjs +21 -0
- package/lib/validators/internal/OpenApiBooleanValidator2.mjs.map +1 -0
- package/lib/validators/internal/OpenApiConstantValidator.js.map +1 -1
- package/lib/validators/internal/OpenApiConstantValidator.mjs +6 -7
- package/lib/validators/internal/OpenApiConstantValidator.mjs.map +1 -1
- package/lib/validators/internal/OpenApiConstantValidator2.mjs +21 -0
- package/lib/validators/internal/OpenApiConstantValidator2.mjs.map +1 -0
- package/lib/validators/internal/OpenApiIntegerValidator.js.map +1 -1
- package/lib/validators/internal/OpenApiIntegerValidator.mjs +6 -45
- package/lib/validators/internal/OpenApiIntegerValidator.mjs.map +1 -1
- package/lib/validators/internal/OpenApiIntegerValidator2.mjs +44 -0
- package/lib/validators/internal/OpenApiIntegerValidator2.mjs.map +1 -0
- package/lib/validators/internal/OpenApiNumberValidator.js.map +1 -1
- package/lib/validators/internal/OpenApiNumberValidator.mjs +6 -45
- package/lib/validators/internal/OpenApiNumberValidator.mjs.map +1 -1
- package/lib/validators/internal/OpenApiNumberValidator2.mjs +44 -0
- package/lib/validators/internal/OpenApiNumberValidator2.mjs.map +1 -0
- package/lib/validators/internal/OpenApiObjectValidator.js +6 -12
- package/lib/validators/internal/OpenApiObjectValidator.js.map +1 -1
- package/lib/validators/internal/OpenApiObjectValidator.mjs +5 -65
- package/lib/validators/internal/OpenApiObjectValidator.mjs.map +1 -1
- package/lib/validators/internal/OpenApiObjectValidator2.mjs +65 -0
- package/lib/validators/internal/OpenApiObjectValidator2.mjs.map +1 -0
- package/lib/validators/internal/OpenApiOneOfValidator.js +20 -20
- package/lib/validators/internal/OpenApiOneOfValidator.js.map +1 -1
- package/lib/validators/internal/OpenApiOneOfValidator.mjs +5 -203
- package/lib/validators/internal/OpenApiOneOfValidator.mjs.map +1 -1
- package/lib/validators/internal/OpenApiOneOfValidator2.mjs +196 -0
- package/lib/validators/internal/OpenApiOneOfValidator2.mjs.map +1 -0
- package/lib/validators/internal/OpenApiSchemaNamingRule.js.map +1 -1
- package/lib/validators/internal/OpenApiSchemaNamingRule.mjs +5 -118
- package/lib/validators/internal/OpenApiSchemaNamingRule.mjs.map +1 -1
- package/lib/validators/internal/OpenApiSchemaNamingRule2.mjs +134 -0
- package/lib/validators/internal/OpenApiSchemaNamingRule2.mjs.map +1 -0
- package/lib/validators/internal/OpenApiStationValidator.js +2 -1
- package/lib/validators/internal/OpenApiStationValidator.js.map +1 -1
- package/lib/validators/internal/OpenApiStationValidator.mjs +5 -104
- package/lib/validators/internal/OpenApiStationValidator.mjs.map +1 -1
- package/lib/validators/internal/OpenApiStationValidator2.mjs +86 -0
- package/lib/validators/internal/OpenApiStationValidator2.mjs.map +1 -0
- package/lib/validators/internal/OpenApiStringValidator.js.map +1 -1
- package/lib/validators/internal/OpenApiStringValidator.mjs +5 -82
- package/lib/validators/internal/OpenApiStringValidator.mjs.map +1 -1
- package/lib/validators/internal/OpenApiStringValidator2.mjs +105 -0
- package/lib/validators/internal/OpenApiStringValidator2.mjs.map +1 -0
- package/lib/validators/internal/OpenApiTupleValidator.js.map +1 -1
- package/lib/validators/internal/OpenApiTupleValidator.mjs +5 -43
- package/lib/validators/internal/OpenApiTupleValidator.mjs.map +1 -1
- package/lib/validators/internal/OpenApiTupleValidator2.mjs +43 -0
- package/lib/validators/internal/OpenApiTupleValidator2.mjs.map +1 -0
- package/package.json +8 -9
- package/src/converters/LlmSchemaConverter.ts +152 -33
- package/src/converters/OpenApiConverter.ts +375 -375
- package/src/converters/internal/OpenApiV3Downgrader.ts +381 -381
- package/src/converters/internal/OpenApiV3Upgrader.ts +494 -494
- package/src/converters/internal/OpenApiV3_1Downgrader.ts +318 -318
- package/src/converters/internal/OpenApiV3_1Upgrader.ts +713 -710
- package/src/converters/internal/OpenApiV3_2Upgrader.ts +342 -342
- package/src/converters/internal/SwaggerV2Downgrader.ts +450 -450
- package/src/converters/internal/SwaggerV2Upgrader.ts +547 -547
- package/src/http/HttpError.ts +114 -114
- package/src/http/HttpLlm.ts +169 -169
- package/src/http/HttpMigration.ts +94 -94
- package/src/http/internal/HttpMigrateApplicationComposer.ts +56 -56
- package/src/http/internal/HttpMigrateRouteComposer.ts +505 -505
- package/src/utils/LlmJson.ts +173 -173
- package/src/utils/Singleton.ts +0 -1
- package/src/utils/internal/OpenApiTypeCheckerBase.ts +2 -0
- package/src/utils/internal/coerceLlmArguments.ts +21 -3
- package/src/utils/internal/parseLenientJson.ts +919 -919
- package/src/validators/index.ts +0 -1
package/lib/utils/LlmJson.mjs
CHANGED
|
@@ -1,156 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { parseLenientJson } from './internal/parseLenientJson.mjs';
|
|
4
|
-
import { stringifyValidationFailure } from './internal/stringifyValidationFailure.mjs';
|
|
5
|
-
import { LlmSchemaConverter } from '../converters/LlmSchemaConverter.mjs';
|
|
1
|
+
import { getDefaultExportFromCjs } from '../_virtual/_commonjsHelpers.mjs';
|
|
2
|
+
import { __require as requireLlmJson } from './LlmJson2.mjs';
|
|
6
3
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*
|
|
10
|
-
* - {@link LlmJson.parse}: Lenient JSON parser for incomplete/malformed JSON
|
|
11
|
-
* - {@link LlmJson.stringify}: Format validation errors for LLM feedback
|
|
12
|
-
* - {@link LlmJson.validate}: Create a reusable validator from schema
|
|
13
|
-
*
|
|
14
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
15
|
-
*/
|
|
16
|
-
var LlmJson;
|
|
17
|
-
(function (LlmJson) {
|
|
18
|
-
/**
|
|
19
|
-
* Coerce LLM arguments to match expected schema types.
|
|
20
|
-
*
|
|
21
|
-
* LLMs often return values with incorrect types (e.g., numbers as strings).
|
|
22
|
-
* This function recursively coerces values based on the schema:
|
|
23
|
-
*
|
|
24
|
-
* - `"42"` → `42` (when schema expects number)
|
|
25
|
-
* - `"true"` → `true` (when schema expects boolean)
|
|
26
|
-
* - `"null"` → `null` (when schema expects null)
|
|
27
|
-
* - `"{...}"` → `{...}` (when schema expects object)
|
|
28
|
-
* - `"[...]"` → `[...]` (when schema expects array)
|
|
29
|
-
*
|
|
30
|
-
* Use this when SDK provides already-parsed objects but values may have wrong
|
|
31
|
-
* types. For raw JSON strings, use {@link parse} instead.
|
|
32
|
-
*
|
|
33
|
-
* @param input Parsed arguments object from LLM
|
|
34
|
-
* @param parameters LLM function parameters schema for type coercion
|
|
35
|
-
* @returns Coerced arguments with corrected types
|
|
36
|
-
*/
|
|
37
|
-
function coerce(input, parameters) {
|
|
38
|
-
return coerceLlmArguments(input, parameters);
|
|
39
|
-
}
|
|
40
|
-
LlmJson.coerce = coerce;
|
|
41
|
-
/**
|
|
42
|
-
* Parse lenient JSON with optional schema-based coercion.
|
|
43
|
-
*
|
|
44
|
-
* Handles incomplete/malformed JSON commonly produced by LLMs:
|
|
45
|
-
*
|
|
46
|
-
* - Unclosed brackets, strings, trailing commas
|
|
47
|
-
* - JavaScript-style comments (`//` and multi-line)
|
|
48
|
-
* - Unquoted object keys, incomplete keywords (`tru`, `fal`, `nul`)
|
|
49
|
-
* - Markdown code block extraction, junk prefix skipping
|
|
50
|
-
*
|
|
51
|
-
* When `parameters` schema is provided, also coerces double-stringified
|
|
52
|
-
* values: `"42"` → `42`, `"true"` → `true`, `"{...}"` → `{...}` based on
|
|
53
|
-
* expected types.
|
|
54
|
-
*
|
|
55
|
-
* Type validation is NOT performed - use {@link ILlmFunction.validate}.
|
|
56
|
-
*
|
|
57
|
-
* @param input Raw JSON string (potentially incomplete or malformed)
|
|
58
|
-
* @param parameters Optional LLM parameters schema for type coercion
|
|
59
|
-
* @returns Parse result with data on success, or partial data with errors
|
|
60
|
-
*/
|
|
61
|
-
function parse(input, parameters) {
|
|
62
|
-
const result = parseLenientJson(input);
|
|
63
|
-
// Apply schema-based coercion if parameters provided and parsing succeeded
|
|
64
|
-
if (parameters !== undefined && result.success) {
|
|
65
|
-
return {
|
|
66
|
-
success: true,
|
|
67
|
-
data: coerceLlmArguments(result.data, parameters),
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
return result;
|
|
71
|
-
}
|
|
72
|
-
LlmJson.parse = parse;
|
|
73
|
-
/**
|
|
74
|
-
* Format validation failure for LLM auto-correction feedback.
|
|
75
|
-
*
|
|
76
|
-
* When LLM generates invalid function call arguments, this produces annotated
|
|
77
|
-
* JSON with inline `// ❌` error comments at each invalid property. The output
|
|
78
|
-
* is wrapped in a markdown code block so that LLM can understand and correct
|
|
79
|
-
* its mistakes in the next turn.
|
|
80
|
-
*
|
|
81
|
-
* Below is an example of the output format:
|
|
82
|
-
*
|
|
83
|
-
* ```json
|
|
84
|
-
* {
|
|
85
|
-
* "name": "John",
|
|
86
|
-
* "age": "twenty", // ❌ [{"path":"$input.age","expected":"number & Type<\"uint32\">"}]
|
|
87
|
-
* "email": "not-an-email", // ❌ [{"path":"$input.email","expected":"string & Format<\"email\">"}]
|
|
88
|
-
* "hobbies": "reading" // ❌ [{"path":"$input.hobbies","expected":"Array<string>"}]
|
|
89
|
-
* }
|
|
90
|
-
* ```
|
|
91
|
-
*
|
|
92
|
-
* @param failure Validation failure from {@link ILlmFunction.validate}
|
|
93
|
-
*/
|
|
94
|
-
function stringify(failure) {
|
|
95
|
-
return stringifyValidationFailure(failure);
|
|
96
|
-
}
|
|
97
|
-
LlmJson.stringify = stringify;
|
|
98
|
-
/**
|
|
99
|
-
* Create a reusable validator from LLM parameters schema.
|
|
100
|
-
*
|
|
101
|
-
* When validation fails, format the failure with {@link stringify} for LLM
|
|
102
|
-
* auto-correction feedback.
|
|
103
|
-
*
|
|
104
|
-
* @param parameters LLM function parameters schema
|
|
105
|
-
* @param equals If `true`, reject extraneous properties not defined in the
|
|
106
|
-
* schema. Otherwise, extra properties are ignored.
|
|
107
|
-
* @returns Validator function that checks data against the schema
|
|
108
|
-
*/
|
|
109
|
-
function validate(parameters, equals) {
|
|
110
|
-
const components = {
|
|
111
|
-
schemas: {},
|
|
112
|
-
};
|
|
113
|
-
const schema = LlmSchemaConverter.invert({
|
|
114
|
-
components,
|
|
115
|
-
schema: parameters,
|
|
116
|
-
$defs: parameters.$defs,
|
|
117
|
-
});
|
|
118
|
-
return OpenApiValidator.create({
|
|
119
|
-
components,
|
|
120
|
-
schema,
|
|
121
|
-
required: true,
|
|
122
|
-
equals,
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
LlmJson.validate = validate;
|
|
126
|
-
/**
|
|
127
|
-
* Convert LLM parameters schema to structured output interface.
|
|
128
|
-
*
|
|
129
|
-
* Creates an {@link ILlmStructuredOutput} containing everything needed for
|
|
130
|
-
* handling LLM structured outputs: the parameters schema for prompting, and
|
|
131
|
-
* functions for parsing, coercing, and validating responses.
|
|
132
|
-
*
|
|
133
|
-
* This is useful when you have a parameters schema (e.g., from
|
|
134
|
-
* `typia.llm.parameters()`) and need the full structured output interface
|
|
135
|
-
* with all utility functions.
|
|
136
|
-
*
|
|
137
|
-
* @template T The expected output type
|
|
138
|
-
* @param parameters LLM parameters schema
|
|
139
|
-
* @param equals If `true`, reject extraneous properties not defined in the
|
|
140
|
-
* schema during validation. Otherwise, extra properties are ignored.
|
|
141
|
-
* @returns Structured output interface with parse, coerce, and validate
|
|
142
|
-
*/
|
|
143
|
-
function structuredOutput(parameters, equals) {
|
|
144
|
-
const validator = validate(parameters, equals);
|
|
145
|
-
return {
|
|
146
|
-
parameters,
|
|
147
|
-
parse: (str) => parse(str, parameters),
|
|
148
|
-
coerce: (input) => coerce(input, parameters),
|
|
149
|
-
validate: (input) => validator(input),
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
LlmJson.structuredOutput = structuredOutput;
|
|
153
|
-
})(LlmJson || (LlmJson = {}));
|
|
4
|
+
var LlmJsonExports = requireLlmJson();
|
|
5
|
+
var LlmJson = /*@__PURE__*/getDefaultExportFromCjs(LlmJsonExports);
|
|
154
6
|
|
|
155
|
-
export { LlmJson };
|
|
7
|
+
export { LlmJson as default };
|
|
156
8
|
//# sourceMappingURL=LlmJson.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LlmJson.mjs","sources":["
|
|
1
|
+
{"version":3,"file":"LlmJson.mjs","sources":["LlmJson.js?commonjs-entry"],"sourcesContent":["import { getDefaultExportFromCjs } from \"\u0000commonjsHelpers.js\";\nimport { __require as requireLlmJson } from \"/home/samchon/github/samchon/typia@next/packages/utils/lib/utils/LlmJson.js\";\nvar LlmJsonExports = requireLlmJson();\nexport { LlmJsonExports as __moduleExports };\nexport default /*@__PURE__*/getDefaultExportFromCjs(LlmJsonExports);"],"names":[],"mappings":";;;AAEA,IAAI,cAAc,GAAG,cAAc,EAAE;AAErC,cAAe,aAAa,uBAAuB,CAAC,cAAc,CAAC;;;;"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { __exports as LlmJson } from '../_virtual/LlmJson.mjs';
|
|
2
|
+
import { __require as requireConverters } from '../converters/index2.mjs';
|
|
3
|
+
import { __require as requireValidators } from '../validators/index2.mjs';
|
|
4
|
+
import { __require as requireCoerceLlmArguments } from './internal/coerceLlmArguments2.mjs';
|
|
5
|
+
import { __require as requireParseLenientJson } from './internal/parseLenientJson2.mjs';
|
|
6
|
+
import { __require as requireStringifyValidationFailure } from './internal/stringifyValidationFailure2.mjs';
|
|
7
|
+
|
|
8
|
+
var hasRequiredLlmJson;
|
|
9
|
+
|
|
10
|
+
function requireLlmJson () {
|
|
11
|
+
if (hasRequiredLlmJson) return LlmJson;
|
|
12
|
+
hasRequiredLlmJson = 1;
|
|
13
|
+
Object.defineProperty(LlmJson, "__esModule", { value: true });
|
|
14
|
+
LlmJson.LlmJson = void 0;
|
|
15
|
+
const converters_1 = requireConverters();
|
|
16
|
+
const validators_1 = requireValidators();
|
|
17
|
+
const coerceLlmArguments_1 = requireCoerceLlmArguments();
|
|
18
|
+
const parseLenientJson_1 = requireParseLenientJson();
|
|
19
|
+
const stringifyValidationFailure_1 = requireStringifyValidationFailure();
|
|
20
|
+
/**
|
|
21
|
+
* JSON utilities for LLM function calling.
|
|
22
|
+
*
|
|
23
|
+
* - {@link LlmJson.parse}: Lenient JSON parser for incomplete/malformed JSON
|
|
24
|
+
* - {@link LlmJson.stringify}: Format validation errors for LLM feedback
|
|
25
|
+
* - {@link LlmJson.validate}: Create a reusable validator from schema
|
|
26
|
+
*
|
|
27
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
28
|
+
*/
|
|
29
|
+
var LlmJson$1;
|
|
30
|
+
(function (LlmJson) {
|
|
31
|
+
/**
|
|
32
|
+
* Coerce LLM arguments to match expected schema types.
|
|
33
|
+
*
|
|
34
|
+
* LLMs often return values with incorrect types (e.g., numbers as strings).
|
|
35
|
+
* This function recursively coerces values based on the schema:
|
|
36
|
+
*
|
|
37
|
+
* - `"42"` → `42` (when schema expects number)
|
|
38
|
+
* - `"true"` → `true` (when schema expects boolean)
|
|
39
|
+
* - `"null"` → `null` (when schema expects null)
|
|
40
|
+
* - `"{...}"` → `{...}` (when schema expects object)
|
|
41
|
+
* - `"[...]"` → `[...]` (when schema expects array)
|
|
42
|
+
*
|
|
43
|
+
* Use this when SDK provides already-parsed objects but values may have wrong
|
|
44
|
+
* types. For raw JSON strings, use {@link parse} instead.
|
|
45
|
+
*
|
|
46
|
+
* @param input Parsed arguments object from LLM
|
|
47
|
+
* @param parameters LLM function parameters schema for type coercion
|
|
48
|
+
* @returns Coerced arguments with corrected types
|
|
49
|
+
*/
|
|
50
|
+
function coerce(input, parameters) {
|
|
51
|
+
return (0, coerceLlmArguments_1.coerceLlmArguments)(input, parameters);
|
|
52
|
+
}
|
|
53
|
+
LlmJson.coerce = coerce;
|
|
54
|
+
/**
|
|
55
|
+
* Parse lenient JSON with optional schema-based coercion.
|
|
56
|
+
*
|
|
57
|
+
* Handles incomplete/malformed JSON commonly produced by LLMs:
|
|
58
|
+
*
|
|
59
|
+
* - Unclosed brackets, strings, trailing commas
|
|
60
|
+
* - JavaScript-style comments (`//` and multi-line)
|
|
61
|
+
* - Unquoted object keys, incomplete keywords (`tru`, `fal`, `nul`)
|
|
62
|
+
* - Markdown code block extraction, junk prefix skipping
|
|
63
|
+
*
|
|
64
|
+
* When `parameters` schema is provided, also coerces double-stringified
|
|
65
|
+
* values: `"42"` → `42`, `"true"` → `true`, `"{...}"` → `{...}` based on
|
|
66
|
+
* expected types.
|
|
67
|
+
*
|
|
68
|
+
* Type validation is NOT performed - use {@link ILlmFunction.validate}.
|
|
69
|
+
*
|
|
70
|
+
* @param input Raw JSON string (potentially incomplete or malformed)
|
|
71
|
+
* @param parameters Optional LLM parameters schema for type coercion
|
|
72
|
+
* @returns Parse result with data on success, or partial data with errors
|
|
73
|
+
*/
|
|
74
|
+
function parse(input, parameters) {
|
|
75
|
+
const result = (0, parseLenientJson_1.parseLenientJson)(input);
|
|
76
|
+
// Apply schema-based coercion if parameters provided and parsing succeeded
|
|
77
|
+
if (parameters !== undefined && result.success) {
|
|
78
|
+
return {
|
|
79
|
+
success: true,
|
|
80
|
+
data: (0, coerceLlmArguments_1.coerceLlmArguments)(result.data, parameters),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
return result;
|
|
84
|
+
}
|
|
85
|
+
LlmJson.parse = parse;
|
|
86
|
+
/**
|
|
87
|
+
* Format validation failure for LLM auto-correction feedback.
|
|
88
|
+
*
|
|
89
|
+
* When LLM generates invalid function call arguments, this produces annotated
|
|
90
|
+
* JSON with inline `// ❌` error comments at each invalid property. The output
|
|
91
|
+
* is wrapped in a markdown code block so that LLM can understand and correct
|
|
92
|
+
* its mistakes in the next turn.
|
|
93
|
+
*
|
|
94
|
+
* Below is an example of the output format:
|
|
95
|
+
*
|
|
96
|
+
* ```json
|
|
97
|
+
* {
|
|
98
|
+
* "name": "John",
|
|
99
|
+
* "age": "twenty", // ❌ [{"path":"$input.age","expected":"number & Type<\"uint32\">"}]
|
|
100
|
+
* "email": "not-an-email", // ❌ [{"path":"$input.email","expected":"string & Format<\"email\">"}]
|
|
101
|
+
* "hobbies": "reading" // ❌ [{"path":"$input.hobbies","expected":"Array<string>"}]
|
|
102
|
+
* }
|
|
103
|
+
* ```
|
|
104
|
+
*
|
|
105
|
+
* @param failure Validation failure from {@link ILlmFunction.validate}
|
|
106
|
+
*/
|
|
107
|
+
function stringify(failure) {
|
|
108
|
+
return (0, stringifyValidationFailure_1.stringifyValidationFailure)(failure);
|
|
109
|
+
}
|
|
110
|
+
LlmJson.stringify = stringify;
|
|
111
|
+
/**
|
|
112
|
+
* Create a reusable validator from LLM parameters schema.
|
|
113
|
+
*
|
|
114
|
+
* When validation fails, format the failure with {@link stringify} for LLM
|
|
115
|
+
* auto-correction feedback.
|
|
116
|
+
*
|
|
117
|
+
* @param parameters LLM function parameters schema
|
|
118
|
+
* @param equals If `true`, reject extraneous properties not defined in the
|
|
119
|
+
* schema. Otherwise, extra properties are ignored.
|
|
120
|
+
* @returns Validator function that checks data against the schema
|
|
121
|
+
*/
|
|
122
|
+
function validate(parameters, equals) {
|
|
123
|
+
const components = {
|
|
124
|
+
schemas: {},
|
|
125
|
+
};
|
|
126
|
+
const schema = converters_1.LlmSchemaConverter.invert({
|
|
127
|
+
components,
|
|
128
|
+
schema: parameters,
|
|
129
|
+
$defs: parameters.$defs,
|
|
130
|
+
});
|
|
131
|
+
return validators_1.OpenApiValidator.create({
|
|
132
|
+
components,
|
|
133
|
+
schema,
|
|
134
|
+
required: true,
|
|
135
|
+
equals,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
LlmJson.validate = validate;
|
|
139
|
+
/**
|
|
140
|
+
* Convert LLM parameters schema to structured output interface.
|
|
141
|
+
*
|
|
142
|
+
* Creates an {@link ILlmStructuredOutput} containing everything needed for
|
|
143
|
+
* handling LLM structured outputs: the parameters schema for prompting, and
|
|
144
|
+
* functions for parsing, coercing, and validating responses.
|
|
145
|
+
*
|
|
146
|
+
* This is useful when you have a parameters schema (e.g., from
|
|
147
|
+
* `typia.llm.parameters()`) and need the full structured output interface
|
|
148
|
+
* with all utility functions.
|
|
149
|
+
*
|
|
150
|
+
* @template T The expected output type
|
|
151
|
+
* @param parameters LLM parameters schema
|
|
152
|
+
* @param equals If `true`, reject extraneous properties not defined in the
|
|
153
|
+
* schema during validation. Otherwise, extra properties are ignored.
|
|
154
|
+
* @returns Structured output interface with parse, coerce, and validate
|
|
155
|
+
*/
|
|
156
|
+
function structuredOutput(parameters, equals) {
|
|
157
|
+
const validator = validate(parameters, equals);
|
|
158
|
+
return {
|
|
159
|
+
parameters,
|
|
160
|
+
parse: (str) => parse(str, parameters),
|
|
161
|
+
coerce: (input) => coerce(input, parameters),
|
|
162
|
+
validate: (input) => validator(input),
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
LlmJson.structuredOutput = structuredOutput;
|
|
166
|
+
})(LlmJson$1 || (LlmJson.LlmJson = LlmJson$1 = {}));
|
|
167
|
+
|
|
168
|
+
return LlmJson;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export { requireLlmJson as __require };
|
|
172
|
+
//# sourceMappingURL=LlmJson2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LlmJson2.mjs","sources":["LlmJson.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LlmJson = void 0;\nconst converters_1 = require(\"../converters\");\nconst validators_1 = require(\"../validators\");\nconst coerceLlmArguments_1 = require(\"./internal/coerceLlmArguments\");\nconst parseLenientJson_1 = require(\"./internal/parseLenientJson\");\nconst stringifyValidationFailure_1 = require(\"./internal/stringifyValidationFailure\");\n/**\n * JSON utilities for LLM function calling.\n *\n * - {@link LlmJson.parse}: Lenient JSON parser for incomplete/malformed JSON\n * - {@link LlmJson.stringify}: Format validation errors for LLM feedback\n * - {@link LlmJson.validate}: Create a reusable validator from schema\n *\n * @author Jeongho Nam - https://github.com/samchon\n */\nvar LlmJson;\n(function (LlmJson) {\n /**\n * Coerce LLM arguments to match expected schema types.\n *\n * LLMs often return values with incorrect types (e.g., numbers as strings).\n * This function recursively coerces values based on the schema:\n *\n * - `\"42\"` → `42` (when schema expects number)\n * - `\"true\"` → `true` (when schema expects boolean)\n * - `\"null\"` → `null` (when schema expects null)\n * - `\"{...}\"` → `{...}` (when schema expects object)\n * - `\"[...]\"` → `[...]` (when schema expects array)\n *\n * Use this when SDK provides already-parsed objects but values may have wrong\n * types. For raw JSON strings, use {@link parse} instead.\n *\n * @param input Parsed arguments object from LLM\n * @param parameters LLM function parameters schema for type coercion\n * @returns Coerced arguments with corrected types\n */\n function coerce(input, parameters) {\n return (0, coerceLlmArguments_1.coerceLlmArguments)(input, parameters);\n }\n LlmJson.coerce = coerce;\n /**\n * Parse lenient JSON with optional schema-based coercion.\n *\n * Handles incomplete/malformed JSON commonly produced by LLMs:\n *\n * - Unclosed brackets, strings, trailing commas\n * - JavaScript-style comments (`//` and multi-line)\n * - Unquoted object keys, incomplete keywords (`tru`, `fal`, `nul`)\n * - Markdown code block extraction, junk prefix skipping\n *\n * When `parameters` schema is provided, also coerces double-stringified\n * values: `\"42\"` → `42`, `\"true\"` → `true`, `\"{...}\"` → `{...}` based on\n * expected types.\n *\n * Type validation is NOT performed - use {@link ILlmFunction.validate}.\n *\n * @param input Raw JSON string (potentially incomplete or malformed)\n * @param parameters Optional LLM parameters schema for type coercion\n * @returns Parse result with data on success, or partial data with errors\n */\n function parse(input, parameters) {\n const result = (0, parseLenientJson_1.parseLenientJson)(input);\n // Apply schema-based coercion if parameters provided and parsing succeeded\n if (parameters !== undefined && result.success) {\n return {\n success: true,\n data: (0, coerceLlmArguments_1.coerceLlmArguments)(result.data, parameters),\n };\n }\n return result;\n }\n LlmJson.parse = parse;\n /**\n * Format validation failure for LLM auto-correction feedback.\n *\n * When LLM generates invalid function call arguments, this produces annotated\n * JSON with inline `// ❌` error comments at each invalid property. The output\n * is wrapped in a markdown code block so that LLM can understand and correct\n * its mistakes in the next turn.\n *\n * Below is an example of the output format:\n *\n * ```json\n * {\n * \"name\": \"John\",\n * \"age\": \"twenty\", // ❌ [{\"path\":\"$input.age\",\"expected\":\"number & Type<\\\"uint32\\\">\"}]\n * \"email\": \"not-an-email\", // ❌ [{\"path\":\"$input.email\",\"expected\":\"string & Format<\\\"email\\\">\"}]\n * \"hobbies\": \"reading\" // ❌ [{\"path\":\"$input.hobbies\",\"expected\":\"Array<string>\"}]\n * }\n * ```\n *\n * @param failure Validation failure from {@link ILlmFunction.validate}\n */\n function stringify(failure) {\n return (0, stringifyValidationFailure_1.stringifyValidationFailure)(failure);\n }\n LlmJson.stringify = stringify;\n /**\n * Create a reusable validator from LLM parameters schema.\n *\n * When validation fails, format the failure with {@link stringify} for LLM\n * auto-correction feedback.\n *\n * @param parameters LLM function parameters schema\n * @param equals If `true`, reject extraneous properties not defined in the\n * schema. Otherwise, extra properties are ignored.\n * @returns Validator function that checks data against the schema\n */\n function validate(parameters, equals) {\n const components = {\n schemas: {},\n };\n const schema = converters_1.LlmSchemaConverter.invert({\n components,\n schema: parameters,\n $defs: parameters.$defs,\n });\n return validators_1.OpenApiValidator.create({\n components,\n schema,\n required: true,\n equals,\n });\n }\n LlmJson.validate = validate;\n /**\n * Convert LLM parameters schema to structured output interface.\n *\n * Creates an {@link ILlmStructuredOutput} containing everything needed for\n * handling LLM structured outputs: the parameters schema for prompting, and\n * functions for parsing, coercing, and validating responses.\n *\n * This is useful when you have a parameters schema (e.g., from\n * `typia.llm.parameters()`) and need the full structured output interface\n * with all utility functions.\n *\n * @template T The expected output type\n * @param parameters LLM parameters schema\n * @param equals If `true`, reject extraneous properties not defined in the\n * schema during validation. Otherwise, extra properties are ignored.\n * @returns Structured output interface with parse, coerce, and validate\n */\n function structuredOutput(parameters, equals) {\n const validator = validate(parameters, equals);\n return {\n parameters,\n parse: (str) => parse(str, parameters),\n coerce: (input) => coerce(input, parameters),\n validate: (input) => validator(input),\n };\n }\n LlmJson.structuredOutput = structuredOutput;\n})(LlmJson || (exports.LlmJson = LlmJson = {}));\n//# sourceMappingURL=LlmJson.js.map"],"names":["LlmJson_1","require$$0","require$$1","require$$2","require$$3","require$$4","LlmJson"],"mappings":";;;;;;;;;;;;AACA,CAAA,MAAM,CAAC,cAAc,CAACA,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,CAAAA,OAAA,CAAA,OAAe,GAAG,MAAM;CACxB,MAAM,YAAY,GAAGC,iBAAA,EAAwB;CAC7C,MAAM,YAAY,GAAGC,iBAAA,EAAwB;CAC7C,MAAM,oBAAoB,GAAGC,yBAAA,EAAwC;CACrE,MAAM,kBAAkB,GA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/MapUtil.ts"],"names":[],"mappings":";;;AAAA,gBAAgB;AAChB,IAAiB,OAAO,CAavB;AAbD,WAAiB,OAAO;IACT,YAAI,GAAG,CAClB,IAAiB,EACjB,GAAQ,EACR,SAAkB,EACf,EAAE;QACL,MAAM,MAAM,GAAkB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,MAAM;YAAE,OAAO,MAAM,CAAC;QAE1B,MAAM,KAAK,GAAM,SAAS,EAAE,CAAC;QAC7B,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACrB,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;AACJ,CAAC,EAbgB,OAAO,
|
|
1
|
+
{"version":3,"file":"MapUtil.js","sourceRoot":"","sources":["../../src/utils/MapUtil.ts"],"names":[],"mappings":";;;AAAA,gBAAgB;AAChB,IAAiB,OAAO,CAavB;AAbD,WAAiB,OAAO;IACT,YAAI,GAAG,CAClB,IAAiB,EACjB,GAAQ,EACR,SAAkB,EACf,EAAE;QACL,MAAM,MAAM,GAAkB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,MAAM;YAAE,OAAO,MAAM,CAAC;QAE1B,MAAM,KAAK,GAAM,SAAS,EAAE,CAAC;QAC7B,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACrB,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;AACJ,CAAC,EAbgB,OAAO,aAAP,OAAO,GAAP,OAAO,QAavB"}
|
package/lib/utils/MapUtil.mjs
CHANGED
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
(function (MapUtil) {
|
|
4
|
-
MapUtil.take = (dict, key, generator) => {
|
|
5
|
-
const oldbie = dict.get(key);
|
|
6
|
-
if (oldbie)
|
|
7
|
-
return oldbie;
|
|
8
|
-
const value = generator();
|
|
9
|
-
dict.set(key, value);
|
|
10
|
-
return value;
|
|
11
|
-
};
|
|
12
|
-
})(MapUtil || (MapUtil = {}));
|
|
1
|
+
import { getDefaultExportFromCjs } from '../_virtual/_commonjsHelpers.mjs';
|
|
2
|
+
import { __require as requireMapUtil } from './MapUtil2.mjs';
|
|
13
3
|
|
|
14
|
-
|
|
4
|
+
var MapUtilExports = requireMapUtil();
|
|
5
|
+
var MapUtil = /*@__PURE__*/getDefaultExportFromCjs(MapUtilExports);
|
|
6
|
+
|
|
7
|
+
export { MapUtil as default };
|
|
15
8
|
//# sourceMappingURL=MapUtil.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapUtil.mjs","sources":["
|
|
1
|
+
{"version":3,"file":"MapUtil.mjs","sources":["MapUtil.js?commonjs-entry"],"sourcesContent":["import { getDefaultExportFromCjs } from \"\u0000commonjsHelpers.js\";\nimport { __require as requireMapUtil } from \"/home/samchon/github/samchon/typia@next/packages/utils/lib/utils/MapUtil.js\";\nvar MapUtilExports = requireMapUtil();\nexport { MapUtilExports as __moduleExports };\nexport default /*@__PURE__*/getDefaultExportFromCjs(MapUtilExports);"],"names":[],"mappings":";;;AAEA,IAAI,cAAc,GAAG,cAAc,EAAE;AAErC,cAAe,aAAa,uBAAuB,CAAC,cAAc,CAAC;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { __exports as MapUtil } from '../_virtual/MapUtil.mjs';
|
|
2
|
+
|
|
3
|
+
var hasRequiredMapUtil;
|
|
4
|
+
|
|
5
|
+
function requireMapUtil () {
|
|
6
|
+
if (hasRequiredMapUtil) return MapUtil;
|
|
7
|
+
hasRequiredMapUtil = 1;
|
|
8
|
+
Object.defineProperty(MapUtil, "__esModule", { value: true });
|
|
9
|
+
MapUtil.MapUtil = void 0;
|
|
10
|
+
/** @internal */
|
|
11
|
+
var MapUtil$1;
|
|
12
|
+
(function (MapUtil) {
|
|
13
|
+
MapUtil.take = (dict, key, generator) => {
|
|
14
|
+
const oldbie = dict.get(key);
|
|
15
|
+
if (oldbie)
|
|
16
|
+
return oldbie;
|
|
17
|
+
const value = generator();
|
|
18
|
+
dict.set(key, value);
|
|
19
|
+
return value;
|
|
20
|
+
};
|
|
21
|
+
})(MapUtil$1 || (MapUtil.MapUtil = MapUtil$1 = {}));
|
|
22
|
+
|
|
23
|
+
return MapUtil;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { requireMapUtil as __require };
|
|
27
|
+
//# sourceMappingURL=MapUtil2.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapUtil2.mjs","sources":["MapUtil.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MapUtil = void 0;\n/** @internal */\nvar MapUtil;\n(function (MapUtil) {\n MapUtil.take = (dict, key, generator) => {\n const oldbie = dict.get(key);\n if (oldbie)\n return oldbie;\n const value = generator();\n dict.set(key, value);\n return value;\n };\n})(MapUtil || (exports.MapUtil = MapUtil = {}));\n//# sourceMappingURL=MapUtil.js.map"],"names":["MapUtil_1","MapUtil"],"mappings":";;;;;;;AACA,CAAA,MAAM,CAAC,cAAc,CAACA,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,CAAAA,OAAA,CAAA,OAAe,GAAG,MAAM;AACxB;AACA,CAAA,IAAIC,SAAO;CACX,CAAC,UAAU,OAAO,EAAE;KAChB,OAAO,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,SAAS,KAAK;SACrC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;AACpC,SAAQ,IAAI,MAAM;AAClB,aAAY,OAAO,MAAM;AACzB,SAAQ,MAAM,KAAK,GAAG,SAAS,EAAE;AACjC,SAAQ,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC;AAC5B,SAAQ,OAAO,KAAK;KACpB,CAAK;CACL,CAAC,EAAEA,SAAO,KAAKD,OAAA,CAAA,OAAe,GAAGC,SAAO,GAAG,EAAE,CAAC,CAAC;AAC/C;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NamingConvention.js","sourceRoot":"","sources":["../../src/utils/NamingConvention.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,IAAiB,gBAAgB,CAsHhC;AAtHD,WAAiB,gBAAgB;IAC/B;;;;;OAKG;IACH,SAAgB,KAAK,CAAC,GAAW;QAC/B,OAAO,OAAO,CAAC;YACb,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE,CACb,GAAG,CAAC,MAAM;gBACR,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,WAAW,EAAE;oBACzB,CAAC,CAAC,GAAG,CAAC,iBAAiB,EAAE;oBACzB,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAE,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE;gBACjD,CAAC,CAAC,GAAG;YACT,KAAK,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAChB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"NamingConvention.js","sourceRoot":"","sources":["../../src/utils/NamingConvention.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,IAAiB,gBAAgB,CAsHhC;AAtHD,WAAiB,gBAAgB;IAC/B;;;;;OAKG;IACH,SAAgB,KAAK,CAAC,GAAW;QAC/B,OAAO,OAAO,CAAC;YACb,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE,CACb,GAAG,CAAC,MAAM;gBACR,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,WAAW,EAAE;oBACzB,CAAC,CAAC,GAAG,CAAC,iBAAiB,EAAE;oBACzB,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,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AAG,CAAC,EAAE,CAAC;IAC3C,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,GAAG,CAAC,EAAE,CAAC,CAAC;IAErC,MAAM,KAAK,GAAa,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;IACrE,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;QACvB,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;QACT,CAAC,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;YAClB,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,CAAC;YAC7B,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AAC7C,CAAC,CAAC"}
|
|
@@ -1,198 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* `NamingConvention` converts between common code naming conventions:
|
|
5
|
-
* camelCase, PascalCase, and snake_case. Handles edge cases like consecutive
|
|
6
|
-
* uppercase letters (e.g., `XMLParser` → `xml_parser`) and leading
|
|
7
|
-
* underscores.
|
|
8
|
-
*
|
|
9
|
-
* Functions:
|
|
10
|
-
*
|
|
11
|
-
* - {@link camel}: Convert to camelCase (`fooBar`)
|
|
12
|
-
* - {@link pascal}: Convert to PascalCase (`FooBar`)
|
|
13
|
-
* - {@link snake}: Convert to snake_case (`foo_bar`)
|
|
14
|
-
* - {@link variable}: Test if string is valid JavaScript variable name
|
|
15
|
-
*
|
|
16
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
17
|
-
*/
|
|
18
|
-
var NamingConvention;
|
|
19
|
-
(function (NamingConvention) {
|
|
20
|
-
/**
|
|
21
|
-
* Convert to camelCase.
|
|
22
|
-
*
|
|
23
|
-
* @param str Input string
|
|
24
|
-
* @returns CamelCase string
|
|
25
|
-
*/
|
|
26
|
-
function camel(str) {
|
|
27
|
-
return unsnake({
|
|
28
|
-
plain: (str) => str.length
|
|
29
|
-
? str === str.toUpperCase()
|
|
30
|
-
? str.toLocaleLowerCase()
|
|
31
|
-
: `${str[0].toLowerCase()}${str.substring(1)}`
|
|
32
|
-
: str,
|
|
33
|
-
snake: (str, i) => i === 0 ? str.toLowerCase() : NamingConvention.capitalize(str.toLowerCase()),
|
|
34
|
-
})(str);
|
|
35
|
-
}
|
|
36
|
-
NamingConvention.camel = camel;
|
|
37
|
-
/**
|
|
38
|
-
* Convert to PascalCase.
|
|
39
|
-
*
|
|
40
|
-
* @param str Input string
|
|
41
|
-
* @returns PascalCase string
|
|
42
|
-
*/
|
|
43
|
-
function pascal(str) {
|
|
44
|
-
return unsnake({
|
|
45
|
-
plain: (str) => str.length ? `${str[0].toUpperCase()}${str.substring(1)}` : str,
|
|
46
|
-
snake: NamingConvention.capitalize,
|
|
47
|
-
})(str);
|
|
48
|
-
}
|
|
49
|
-
NamingConvention.pascal = pascal;
|
|
50
|
-
/**
|
|
51
|
-
* Convert to snake_case.
|
|
52
|
-
*
|
|
53
|
-
* @param str Input string
|
|
54
|
-
* @returns Snake_case string
|
|
55
|
-
*/
|
|
56
|
-
function snake(str) {
|
|
57
|
-
if (str.length === 0)
|
|
58
|
-
return str;
|
|
59
|
-
// PREFIX
|
|
60
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
61
|
-
let prefix = "";
|
|
62
|
-
for (let i = 0; i < str.length; i++) {
|
|
63
|
-
if (str[i] === "_")
|
|
64
|
-
prefix += "_";
|
|
65
|
-
else
|
|
66
|
-
break;
|
|
67
|
-
}
|
|
68
|
-
if (prefix.length !== 0)
|
|
69
|
-
str = str.substring(prefix.length);
|
|
70
|
-
const out = (s) => `${prefix}${s}`;
|
|
71
|
-
// SNAKE CASE
|
|
72
|
-
const items = str.split("_");
|
|
73
|
-
if (items.length > 1)
|
|
74
|
-
return out(items.map((s) => s.toLowerCase()).join("_"));
|
|
75
|
-
// CAMEL OR PASCAL CASE
|
|
76
|
-
const indexes = [];
|
|
77
|
-
for (let i = 0; i < str.length; i++) {
|
|
78
|
-
const code = str.charCodeAt(i);
|
|
79
|
-
if (65 <= code && code <= 90)
|
|
80
|
-
indexes.push(i);
|
|
81
|
-
}
|
|
82
|
-
for (let i = indexes.length - 1; i > 0; --i) {
|
|
83
|
-
const now = indexes[i];
|
|
84
|
-
const prev = indexes[i - 1];
|
|
85
|
-
if (now - prev === 1)
|
|
86
|
-
indexes.splice(i, 1);
|
|
87
|
-
}
|
|
88
|
-
if (indexes.length !== 0 && indexes[0] === 0)
|
|
89
|
-
indexes.splice(0, 1);
|
|
90
|
-
if (indexes.length === 0)
|
|
91
|
-
return str.toLowerCase();
|
|
92
|
-
let ret = "";
|
|
93
|
-
for (let i = 0; i < indexes.length; i++) {
|
|
94
|
-
const first = i === 0 ? 0 : indexes[i - 1];
|
|
95
|
-
const last = indexes[i];
|
|
96
|
-
ret += str.substring(first, last).toLowerCase();
|
|
97
|
-
ret += "_";
|
|
98
|
-
}
|
|
99
|
-
ret += str.substring(indexes[indexes.length - 1]).toLowerCase();
|
|
100
|
-
return out(ret);
|
|
101
|
-
}
|
|
102
|
-
NamingConvention.snake = snake;
|
|
103
|
-
/**
|
|
104
|
-
* Capitalize first character.
|
|
105
|
-
*
|
|
106
|
-
* @param str Input string
|
|
107
|
-
* @returns Capitalized string
|
|
108
|
-
*/
|
|
109
|
-
NamingConvention.capitalize = (str) => str.length !== 0 ? str[0].toUpperCase() + str.slice(1) : str;
|
|
110
|
-
/**
|
|
111
|
-
* Lowercase first character.
|
|
112
|
-
*
|
|
113
|
-
* @param str Input string
|
|
114
|
-
* @returns Localized string
|
|
115
|
-
*/
|
|
116
|
-
NamingConvention.localize = (str) => str[0].toLowerCase() + str.slice(1);
|
|
117
|
-
/**
|
|
118
|
-
* Check if string is valid JavaScript variable name.
|
|
119
|
-
*
|
|
120
|
-
* @param str String to check
|
|
121
|
-
* @returns True if valid variable name
|
|
122
|
-
*/
|
|
123
|
-
NamingConvention.variable = (str) => NamingConvention.reserved(str) === false && /^[a-zA-Z_$][a-zA-Z_$0-9]*$/g.test(str);
|
|
124
|
-
/**
|
|
125
|
-
* Check if string is JavaScript reserved word.
|
|
126
|
-
*
|
|
127
|
-
* @param str String to check
|
|
128
|
-
* @returns True if reserved word
|
|
129
|
-
*/
|
|
130
|
-
NamingConvention.reserved = (str) => RESERVED.has(str);
|
|
131
|
-
})(NamingConvention || (NamingConvention = {}));
|
|
132
|
-
const RESERVED = new Set([
|
|
133
|
-
"break",
|
|
134
|
-
"case",
|
|
135
|
-
"catch",
|
|
136
|
-
"class",
|
|
137
|
-
"const",
|
|
138
|
-
"continue",
|
|
139
|
-
"debugger",
|
|
140
|
-
"default",
|
|
141
|
-
"delete",
|
|
142
|
-
"do",
|
|
143
|
-
"else",
|
|
144
|
-
"enum",
|
|
145
|
-
"export",
|
|
146
|
-
"extends",
|
|
147
|
-
"false",
|
|
148
|
-
"finally",
|
|
149
|
-
"for",
|
|
150
|
-
"function",
|
|
151
|
-
"if",
|
|
152
|
-
"import",
|
|
153
|
-
"in",
|
|
154
|
-
"instanceof",
|
|
155
|
-
"module",
|
|
156
|
-
"new",
|
|
157
|
-
"null",
|
|
158
|
-
"package",
|
|
159
|
-
"public",
|
|
160
|
-
"private",
|
|
161
|
-
"protected",
|
|
162
|
-
"return",
|
|
163
|
-
"super",
|
|
164
|
-
"switch",
|
|
165
|
-
"this",
|
|
166
|
-
"throw",
|
|
167
|
-
"true",
|
|
168
|
-
"try",
|
|
169
|
-
"typeof",
|
|
170
|
-
"var",
|
|
171
|
-
"void",
|
|
172
|
-
"while",
|
|
173
|
-
"with",
|
|
174
|
-
]);
|
|
175
|
-
const unsnake = (props) => (str) => {
|
|
176
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
177
|
-
let prefix = "";
|
|
178
|
-
for (let i = 0; i < str.length; i++) {
|
|
179
|
-
if (str[i] === "_")
|
|
180
|
-
prefix += "_";
|
|
181
|
-
else
|
|
182
|
-
break;
|
|
183
|
-
}
|
|
184
|
-
if (prefix.length !== 0)
|
|
185
|
-
str = str.substring(prefix.length);
|
|
186
|
-
const out = (s) => `${prefix}${s}`;
|
|
187
|
-
if (str.length === 0)
|
|
188
|
-
return out("");
|
|
189
|
-
const items = str.split("_").filter((s) => s.length !== 0);
|
|
190
|
-
return items.length === 0
|
|
191
|
-
? out("")
|
|
192
|
-
: items.length === 1
|
|
193
|
-
? out(props.plain(items[0]))
|
|
194
|
-
: out(items.map(props.snake).join(""));
|
|
195
|
-
};
|
|
1
|
+
import { getDefaultExportFromCjs } from '../_virtual/_commonjsHelpers.mjs';
|
|
2
|
+
import { __require as requireNamingConvention } from './NamingConvention2.mjs';
|
|
196
3
|
|
|
197
|
-
|
|
4
|
+
var NamingConventionExports = requireNamingConvention();
|
|
5
|
+
var NamingConvention = /*@__PURE__*/getDefaultExportFromCjs(NamingConventionExports);
|
|
6
|
+
|
|
7
|
+
export { NamingConvention as default };
|
|
198
8
|
//# sourceMappingURL=NamingConvention.mjs.map
|