typia 9.7.1 → 9.7.2
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/lib/AssertionGuard.d.mts +27 -25
- package/lib/AssertionGuard.d.ts +27 -25
- package/lib/CamelCase.d.mts +1 -1
- package/lib/CamelCase.d.ts +1 -1
- package/lib/IRandomGenerator.d.mts +44 -42
- package/lib/IRandomGenerator.d.ts +44 -42
- package/lib/IReadableURLSearchParams.d.mts +2 -2
- package/lib/IReadableURLSearchParams.d.ts +2 -2
- package/lib/PascalCase.d.mts +1 -1
- package/lib/PascalCase.d.ts +1 -1
- package/lib/Primitive.d.mts +20 -22
- package/lib/Primitive.d.ts +20 -22
- package/lib/Resolved.d.mts +16 -18
- package/lib/Resolved.d.ts +16 -18
- package/lib/SnakeCase.d.mts +3 -2
- package/lib/SnakeCase.d.ts +3 -2
- package/lib/TypeGuardError.d.mts +88 -61
- package/lib/TypeGuardError.d.ts +88 -61
- package/lib/TypeGuardError.js +40 -29
- package/lib/TypeGuardError.js.map +1 -1
- package/lib/TypeGuardError.mjs +70 -48
- package/lib/factories/MetadataCollection.js +4 -12
- package/lib/factories/MetadataCollection.js.map +1 -1
- package/lib/factories/MetadataCollection.mjs +4 -12
- package/lib/factories/MetadataCommentTagFactory.js +5 -15
- package/lib/factories/MetadataCommentTagFactory.js.map +1 -1
- package/lib/factories/MetadataCommentTagFactory.mjs +5 -15
- package/lib/factories/MetadataFactory.js +1 -3
- package/lib/factories/MetadataFactory.js.map +1 -1
- package/lib/factories/MetadataFactory.mjs +1 -3
- package/lib/factories/ProtobufFactory.js +1 -3
- package/lib/factories/ProtobufFactory.js.map +1 -1
- package/lib/factories/ProtobufFactory.mjs +1 -3
- package/lib/functional.d.mts +196 -195
- package/lib/functional.d.ts +196 -195
- package/lib/functional.js +18 -54
- package/lib/functional.js.map +1 -1
- package/lib/functional.mjs +18 -54
- package/lib/http.d.mts +303 -319
- package/lib/http.d.ts +303 -319
- package/lib/http.js +26 -78
- package/lib/http.js.map +1 -1
- package/lib/http.mjs +26 -78
- package/lib/internal/_ProtobufReader.d.mts +3 -9
- package/lib/internal/_ProtobufReader.d.ts +3 -9
- package/lib/internal/_ProtobufReader.js.map +1 -1
- package/lib/internal/_ProtobufReader.mjs +3 -9
- package/lib/internal/_ProtobufSizer.d.mts +4 -12
- package/lib/internal/_ProtobufSizer.d.ts +4 -12
- package/lib/internal/_ProtobufSizer.js.map +1 -1
- package/lib/internal/_ProtobufSizer.mjs +4 -12
- package/lib/internal/_ProtobufWriter.d.mts +5 -15
- package/lib/internal/_ProtobufWriter.d.ts +5 -15
- package/lib/internal/_ProtobufWriter.js.map +1 -1
- package/lib/internal/_ProtobufWriter.mjs +5 -15
- package/lib/internal/_jsonStringifyString.d.mts +4 -4
- package/lib/internal/_jsonStringifyString.d.ts +4 -4
- package/lib/internal/_jsonStringifyString.js +4 -4
- package/lib/internal/_jsonStringifyString.mjs +4 -4
- package/lib/json.d.mts +174 -195
- package/lib/json.d.ts +174 -195
- package/lib/json.js +16 -48
- package/lib/json.js.map +1 -1
- package/lib/json.mjs +16 -48
- package/lib/llm.d.mts +275 -192
- package/lib/llm.d.ts +275 -192
- package/lib/llm.js +4 -12
- package/lib/llm.js.map +1 -1
- package/lib/llm.mjs +4 -12
- package/lib/misc.d.mts +149 -172
- package/lib/misc.d.ts +149 -172
- package/lib/misc.js +17 -51
- package/lib/misc.js.map +1 -1
- package/lib/misc.mjs +17 -51
- package/lib/module.d.mts +263 -275
- package/lib/module.d.ts +263 -275
- package/lib/module.js +18 -54
- package/lib/module.js.map +1 -1
- package/lib/module.mjs +18 -54
- package/lib/notations.d.mts +153 -174
- package/lib/notations.d.ts +153 -174
- package/lib/notations.js +24 -72
- package/lib/notations.js.map +1 -1
- package/lib/notations.mjs +24 -72
- package/lib/programmers/FeatureProgrammer.d.mts +19 -41
- package/lib/programmers/FeatureProgrammer.d.ts +19 -41
- package/lib/programmers/FeatureProgrammer.js.map +1 -1
- package/lib/programmers/ImportProgrammer.js +3 -9
- package/lib/programmers/ImportProgrammer.js.map +1 -1
- package/lib/programmers/ImportProgrammer.mjs +3 -9
- package/lib/programmers/RandomProgrammer.js +6 -0
- package/lib/programmers/RandomProgrammer.js.map +1 -1
- package/lib/programmers/RandomProgrammer.mjs +6 -0
- package/lib/programmers/helpers/ProtobufWire.d.mts +13 -13
- package/lib/programmers/helpers/ProtobufWire.d.ts +13 -13
- package/lib/programmers/internal/check_array_length.js +2 -6
- package/lib/programmers/internal/check_array_length.js.map +1 -1
- package/lib/programmers/internal/check_array_length.mjs +2 -6
- package/lib/programmers/internal/check_bigint.js +2 -6
- package/lib/programmers/internal/check_bigint.js.map +1 -1
- package/lib/programmers/internal/check_bigint.mjs +2 -6
- package/lib/programmers/internal/check_dynamic_key.js +2 -6
- package/lib/programmers/internal/check_dynamic_key.js.map +1 -1
- package/lib/programmers/internal/check_dynamic_key.mjs +2 -6
- package/lib/programmers/internal/check_dynamic_properties.js +3 -9
- package/lib/programmers/internal/check_dynamic_properties.js.map +1 -1
- package/lib/programmers/internal/check_dynamic_properties.mjs +3 -9
- package/lib/programmers/internal/check_everything.js +1 -3
- package/lib/programmers/internal/check_everything.js.map +1 -1
- package/lib/programmers/internal/check_everything.mjs +1 -3
- package/lib/programmers/internal/check_native.js +2 -6
- package/lib/programmers/internal/check_native.js.map +1 -1
- package/lib/programmers/internal/check_native.mjs +2 -6
- package/lib/programmers/internal/check_number.js +2 -6
- package/lib/programmers/internal/check_number.js.map +1 -1
- package/lib/programmers/internal/check_number.mjs +2 -6
- package/lib/programmers/internal/check_object.js +2 -6
- package/lib/programmers/internal/check_object.js.map +1 -1
- package/lib/programmers/internal/check_object.mjs +2 -6
- package/lib/programmers/internal/check_string.js +2 -6
- package/lib/programmers/internal/check_string.js.map +1 -1
- package/lib/programmers/internal/check_string.mjs +2 -6
- package/lib/programmers/internal/check_template.js +1 -3
- package/lib/programmers/internal/check_template.js.map +1 -1
- package/lib/programmers/internal/check_template.mjs +1 -3
- package/lib/programmers/internal/check_union_array_like.js +1 -3
- package/lib/programmers/internal/check_union_array_like.js.map +1 -1
- package/lib/programmers/internal/check_union_array_like.mjs +1 -3
- package/lib/programmers/internal/decode_union_object.js +2 -6
- package/lib/programmers/internal/decode_union_object.js.map +1 -1
- package/lib/programmers/internal/decode_union_object.mjs +2 -6
- package/lib/programmers/internal/feature_object_entries.js +1 -3
- package/lib/programmers/internal/feature_object_entries.js.map +1 -1
- package/lib/programmers/internal/feature_object_entries.mjs +1 -3
- package/lib/programmers/internal/json_schema_escaped.js +2 -6
- package/lib/programmers/internal/json_schema_escaped.js.map +1 -1
- package/lib/programmers/internal/json_schema_escaped.mjs +2 -6
- package/lib/programmers/internal/json_schema_object.js +3 -9
- package/lib/programmers/internal/json_schema_object.js.map +1 -1
- package/lib/programmers/internal/json_schema_object.mjs +3 -9
- package/lib/programmers/internal/metadata_to_pattern.js +1 -3
- package/lib/programmers/internal/metadata_to_pattern.js.map +1 -1
- package/lib/programmers/internal/metadata_to_pattern.mjs +1 -3
- package/lib/programmers/internal/postfix_of_tuple.js +1 -3
- package/lib/programmers/internal/postfix_of_tuple.js.map +1 -1
- package/lib/programmers/internal/postfix_of_tuple.mjs +1 -3
- package/lib/programmers/internal/prune_object_properties.js +1 -3
- package/lib/programmers/internal/prune_object_properties.js.map +1 -1
- package/lib/programmers/internal/prune_object_properties.mjs +1 -3
- package/lib/programmers/internal/stringify_dynamic_properties.js +2 -6
- package/lib/programmers/internal/stringify_dynamic_properties.js.map +1 -1
- package/lib/programmers/internal/stringify_dynamic_properties.mjs +2 -6
- package/lib/programmers/internal/stringify_native.js +1 -3
- package/lib/programmers/internal/stringify_native.js.map +1 -1
- package/lib/programmers/internal/stringify_native.mjs +1 -3
- package/lib/programmers/internal/stringify_regular_properties.js +2 -6
- package/lib/programmers/internal/stringify_regular_properties.js.map +1 -1
- package/lib/programmers/internal/stringify_regular_properties.mjs +2 -6
- package/lib/programmers/internal/template_to_pattern.js +1 -3
- package/lib/programmers/internal/template_to_pattern.js.map +1 -1
- package/lib/programmers/internal/template_to_pattern.mjs +1 -3
- package/lib/programmers/internal/wrap_metadata_rest_tuple.js +1 -3
- package/lib/programmers/internal/wrap_metadata_rest_tuple.js.map +1 -1
- package/lib/programmers/internal/wrap_metadata_rest_tuple.mjs +1 -3
- package/lib/programmers/json/JsonStringifyProgrammer.js +2 -2
- package/lib/programmers/json/JsonStringifyProgrammer.js.map +1 -1
- package/lib/programmers/json/JsonStringifyProgrammer.mjs +2 -2
- package/lib/protobuf.d.mts +290 -297
- package/lib/protobuf.d.ts +290 -297
- package/lib/protobuf.js +17 -51
- package/lib/protobuf.js.map +1 -1
- package/lib/protobuf.mjs +17 -51
- package/lib/reflect.d.mts +2 -4
- package/lib/reflect.d.ts +2 -4
- package/lib/reflect.js +1 -3
- package/lib/reflect.js.map +1 -1
- package/lib/reflect.mjs +1 -3
- package/lib/schemas/json/IJsonApplication.d.mts +4 -4
- package/lib/schemas/json/IJsonApplication.d.ts +4 -4
- package/lib/schemas/json/IJsonSchemaCollection.d.mts +73 -56
- package/lib/schemas/json/IJsonSchemaCollection.d.ts +73 -56
- package/lib/schemas/json/IJsonSchemaUnit.d.mts +83 -70
- package/lib/schemas/json/IJsonSchemaUnit.d.ts +83 -70
- package/lib/schemas/metadata/Metadata.d.mts +1 -3
- package/lib/schemas/metadata/Metadata.d.ts +1 -3
- package/lib/schemas/metadata/Metadata.js +9 -27
- package/lib/schemas/metadata/Metadata.js.map +1 -1
- package/lib/schemas/metadata/Metadata.mjs +9 -27
- package/lib/schemas/metadata/MetadataAliasType.d.mts +1 -3
- package/lib/schemas/metadata/MetadataAliasType.d.ts +1 -3
- package/lib/schemas/metadata/MetadataAliasType.js +3 -9
- package/lib/schemas/metadata/MetadataAliasType.js.map +1 -1
- package/lib/schemas/metadata/MetadataAliasType.mjs +3 -9
- package/lib/schemas/metadata/MetadataApplication.d.mts +1 -3
- package/lib/schemas/metadata/MetadataApplication.d.ts +1 -3
- package/lib/schemas/metadata/MetadataApplication.js +2 -6
- package/lib/schemas/metadata/MetadataApplication.js.map +1 -1
- package/lib/schemas/metadata/MetadataApplication.mjs +2 -6
- package/lib/schemas/metadata/MetadataArray.d.mts +1 -3
- package/lib/schemas/metadata/MetadataArray.d.ts +1 -3
- package/lib/schemas/metadata/MetadataArray.js +1 -3
- package/lib/schemas/metadata/MetadataArray.js.map +1 -1
- package/lib/schemas/metadata/MetadataArray.mjs +1 -3
- package/lib/schemas/metadata/MetadataArrayType.d.mts +1 -3
- package/lib/schemas/metadata/MetadataArrayType.d.ts +1 -3
- package/lib/schemas/metadata/MetadataArrayType.js +3 -9
- package/lib/schemas/metadata/MetadataArrayType.js.map +1 -1
- package/lib/schemas/metadata/MetadataArrayType.mjs +3 -9
- package/lib/schemas/metadata/MetadataAtomic.js +1 -3
- package/lib/schemas/metadata/MetadataAtomic.js.map +1 -1
- package/lib/schemas/metadata/MetadataAtomic.mjs +1 -3
- package/lib/schemas/metadata/MetadataEscaped.d.mts +1 -3
- package/lib/schemas/metadata/MetadataEscaped.d.ts +1 -3
- package/lib/schemas/metadata/MetadataEscaped.js +3 -9
- package/lib/schemas/metadata/MetadataEscaped.js.map +1 -1
- package/lib/schemas/metadata/MetadataEscaped.mjs +3 -9
- package/lib/schemas/metadata/MetadataFunction.d.mts +1 -3
- package/lib/schemas/metadata/MetadataFunction.d.ts +1 -3
- package/lib/schemas/metadata/MetadataFunction.js +2 -6
- package/lib/schemas/metadata/MetadataFunction.js.map +1 -1
- package/lib/schemas/metadata/MetadataFunction.mjs +2 -6
- package/lib/schemas/metadata/MetadataObject.d.mts +1 -3
- package/lib/schemas/metadata/MetadataObject.d.ts +1 -3
- package/lib/schemas/metadata/MetadataObject.js +1 -3
- package/lib/schemas/metadata/MetadataObject.js.map +1 -1
- package/lib/schemas/metadata/MetadataObject.mjs +1 -3
- package/lib/schemas/metadata/MetadataObjectType.d.mts +1 -3
- package/lib/schemas/metadata/MetadataObjectType.d.ts +1 -3
- package/lib/schemas/metadata/MetadataObjectType.js +5 -15
- package/lib/schemas/metadata/MetadataObjectType.js.map +1 -1
- package/lib/schemas/metadata/MetadataObjectType.mjs +6 -18
- package/lib/schemas/metadata/MetadataParameter.js +1 -3
- package/lib/schemas/metadata/MetadataParameter.js.map +1 -1
- package/lib/schemas/metadata/MetadataParameter.mjs +1 -3
- package/lib/schemas/metadata/MetadataProperty.d.mts +1 -3
- package/lib/schemas/metadata/MetadataProperty.d.ts +1 -3
- package/lib/schemas/metadata/MetadataProperty.js +3 -9
- package/lib/schemas/metadata/MetadataProperty.js.map +1 -1
- package/lib/schemas/metadata/MetadataProperty.mjs +3 -9
- package/lib/schemas/metadata/MetadataTemplate.js +1 -3
- package/lib/schemas/metadata/MetadataTemplate.js.map +1 -1
- package/lib/schemas/metadata/MetadataTemplate.mjs +1 -3
- package/lib/schemas/metadata/MetadataTuple.d.mts +1 -3
- package/lib/schemas/metadata/MetadataTuple.d.ts +1 -3
- package/lib/schemas/metadata/MetadataTuple.js +2 -6
- package/lib/schemas/metadata/MetadataTuple.js.map +1 -1
- package/lib/schemas/metadata/MetadataTuple.mjs +2 -6
- package/lib/schemas/metadata/MetadataTupleType.js +2 -6
- package/lib/schemas/metadata/MetadataTupleType.js.map +1 -1
- package/lib/schemas/metadata/MetadataTupleType.mjs +3 -9
- package/lib/tags/Constant.d.mts +16 -16
- package/lib/tags/Constant.d.ts +16 -16
- package/lib/tags/ContentMediaType.d.mts +7 -7
- package/lib/tags/ContentMediaType.d.ts +7 -7
- package/lib/tags/Default.d.mts +19 -19
- package/lib/tags/Default.d.ts +19 -19
- package/lib/tags/Example.d.mts +18 -18
- package/lib/tags/Example.d.ts +18 -18
- package/lib/tags/Examples.d.mts +23 -23
- package/lib/tags/Examples.d.ts +23 -23
- package/lib/tags/ExclusiveMaximum.d.mts +8 -5
- package/lib/tags/ExclusiveMaximum.d.ts +8 -5
- package/lib/tags/ExclusiveMinimum.d.mts +8 -5
- package/lib/tags/ExclusiveMinimum.d.ts +8 -5
- package/lib/tags/Format.d.mts +12 -8
- package/lib/tags/Format.d.ts +12 -8
- package/lib/tags/JsonSchemaPlugin.d.mts +20 -18
- package/lib/tags/JsonSchemaPlugin.d.ts +20 -18
- package/lib/tags/MaxItems.d.mts +9 -9
- package/lib/tags/MaxItems.d.ts +9 -9
- package/lib/tags/MaxLength.d.mts +6 -5
- package/lib/tags/MaxLength.d.ts +6 -5
- package/lib/tags/Maximum.d.mts +9 -7
- package/lib/tags/Maximum.d.ts +9 -7
- package/lib/tags/MinItems.d.mts +9 -9
- package/lib/tags/MinItems.d.ts +9 -9
- package/lib/tags/MinLength.d.mts +6 -5
- package/lib/tags/MinLength.d.ts +6 -5
- package/lib/tags/Minimum.d.mts +9 -7
- package/lib/tags/Minimum.d.ts +9 -7
- package/lib/tags/MultipleOf.d.mts +10 -7
- package/lib/tags/MultipleOf.d.ts +10 -7
- package/lib/tags/Pattern.d.mts +7 -4
- package/lib/tags/Pattern.d.ts +7 -4
- package/lib/tags/Sequence.d.mts +19 -17
- package/lib/tags/Sequence.d.ts +19 -17
- package/lib/tags/TagBase.d.mts +21 -28
- package/lib/tags/TagBase.d.ts +21 -28
- package/lib/tags/Type.d.mts +12 -11
- package/lib/tags/Type.d.ts +12 -11
- package/lib/tags/UniqueItems.d.mts +10 -9
- package/lib/tags/UniqueItems.d.ts +10 -9
- package/lib/tags/internal/FormatCheatSheet.d.mts +1 -3
- package/lib/tags/internal/FormatCheatSheet.d.ts +1 -3
- package/lib/tags/internal/FormatCheatSheet.js +1 -3
- package/lib/tags/internal/FormatCheatSheet.js.map +1 -1
- package/lib/tags/internal/FormatCheatSheet.mjs +1 -3
- package/lib/transformers/ITransformOptions.d.mts +27 -19
- package/lib/transformers/ITransformOptions.d.ts +27 -19
- package/lib/transformers/ImportTransformer.js +5 -10
- package/lib/transformers/ImportTransformer.js.map +1 -1
- package/lib/transformers/ImportTransformer.mjs +5 -10
- package/lib/transformers/NoTransformConfigurationError.js +1 -3
- package/lib/transformers/NoTransformConfigurationError.js.map +1 -1
- package/lib/transformers/NoTransformConfigurationError.mjs +1 -3
- package/lib/transformers/features/llm/LlmApplicationTransformer.js +1 -3
- package/lib/transformers/features/llm/LlmApplicationTransformer.js.map +1 -1
- package/lib/transformers/features/llm/LlmApplicationTransformer.mjs +1 -3
- package/lib/typings/Equal.d.mts +6 -6
- package/lib/typings/Equal.d.ts +6 -6
- package/package.json +2 -1
- package/src/AssertionGuard.ts +27 -25
- package/src/CamelCase.ts +1 -1
- package/src/IRandomGenerator.ts +44 -42
- package/src/IReadableURLSearchParams.ts +2 -2
- package/src/PascalCase.ts +1 -1
- package/src/Primitive.ts +20 -22
- package/src/Resolved.ts +16 -18
- package/src/SnakeCase.ts +3 -2
- package/src/TypeGuardError.ts +101 -64
- package/src/factories/MetadataCollection.ts +4 -12
- package/src/factories/MetadataCommentTagFactory.ts +8 -24
- package/src/factories/MetadataFactory.ts +1 -3
- package/src/factories/ProtobufFactory.ts +1 -3
- package/src/functional.ts +214 -249
- package/src/http.ts +329 -397
- package/src/internal/_ProtobufReader.ts +3 -9
- package/src/internal/_ProtobufSizer.ts +4 -12
- package/src/internal/_ProtobufWriter.ts +5 -15
- package/src/internal/_jsonStringifyString.ts +4 -4
- package/src/json.ts +190 -243
- package/src/llm.ts +279 -204
- package/src/misc.ts +166 -223
- package/src/module.ts +281 -329
- package/src/notations.ts +177 -246
- package/src/programmers/FeatureProgrammer.ts +19 -41
- package/src/programmers/ImportProgrammer.ts +3 -9
- package/src/programmers/RandomProgrammer.ts +6 -1
- package/src/programmers/helpers/ProtobufWire.ts +13 -13
- package/src/programmers/internal/check_array_length.ts +2 -6
- package/src/programmers/internal/check_bigint.ts +2 -6
- package/src/programmers/internal/check_dynamic_key.ts +2 -6
- package/src/programmers/internal/check_dynamic_properties.ts +3 -9
- package/src/programmers/internal/check_everything.ts +1 -3
- package/src/programmers/internal/check_native.ts +2 -6
- package/src/programmers/internal/check_number.ts +2 -6
- package/src/programmers/internal/check_object.ts +3 -9
- package/src/programmers/internal/check_string.ts +2 -6
- package/src/programmers/internal/check_template.ts +1 -3
- package/src/programmers/internal/check_union_array_like.ts +2 -6
- package/src/programmers/internal/decode_union_object.ts +3 -9
- package/src/programmers/internal/feature_object_entries.ts +1 -3
- package/src/programmers/internal/json_schema_escaped.ts +2 -6
- package/src/programmers/internal/json_schema_object.ts +4 -12
- package/src/programmers/internal/metadata_to_pattern.ts +1 -3
- package/src/programmers/internal/postfix_of_tuple.ts +1 -3
- package/src/programmers/internal/prune_object_properties.ts +1 -3
- package/src/programmers/internal/stringify_dynamic_properties.ts +2 -6
- package/src/programmers/internal/stringify_native.ts +1 -3
- package/src/programmers/internal/stringify_regular_properties.ts +2 -6
- package/src/programmers/internal/template_to_pattern.ts +1 -3
- package/src/programmers/internal/wrap_metadata_rest_tuple.ts +1 -3
- package/src/programmers/json/JsonStringifyProgrammer.ts +2 -2
- package/src/protobuf.ts +307 -348
- package/src/reflect.ts +3 -7
- package/src/schemas/json/IJsonApplication.ts +4 -4
- package/src/schemas/json/IJsonSchemaCollection.ts +73 -56
- package/src/schemas/json/IJsonSchemaUnit.ts +83 -70
- package/src/schemas/metadata/IMetadataTypeTag.ts +1 -3
- package/src/schemas/metadata/Metadata.ts +9 -27
- package/src/schemas/metadata/MetadataAliasType.ts +3 -9
- package/src/schemas/metadata/MetadataApplication.ts +2 -6
- package/src/schemas/metadata/MetadataArray.ts +1 -3
- package/src/schemas/metadata/MetadataArrayType.ts +3 -9
- package/src/schemas/metadata/MetadataAtomic.ts +1 -3
- package/src/schemas/metadata/MetadataEscaped.ts +3 -9
- package/src/schemas/metadata/MetadataFunction.ts +2 -6
- package/src/schemas/metadata/MetadataObject.ts +1 -3
- package/src/schemas/metadata/MetadataObjectType.ts +6 -18
- package/src/schemas/metadata/MetadataParameter.ts +1 -3
- package/src/schemas/metadata/MetadataProperty.ts +3 -9
- package/src/schemas/metadata/MetadataTemplate.ts +1 -3
- package/src/schemas/metadata/MetadataTuple.ts +2 -6
- package/src/schemas/metadata/MetadataTupleType.ts +3 -9
- package/src/tags/Constant.ts +16 -16
- package/src/tags/ContentMediaType.ts +7 -7
- package/src/tags/Default.ts +19 -19
- package/src/tags/Example.ts +18 -18
- package/src/tags/Examples.ts +23 -23
- package/src/tags/ExclusiveMaximum.ts +8 -5
- package/src/tags/ExclusiveMinimum.ts +8 -5
- package/src/tags/Format.ts +12 -8
- package/src/tags/JsonSchemaPlugin.ts +20 -18
- package/src/tags/MaxItems.ts +9 -9
- package/src/tags/MaxLength.ts +6 -5
- package/src/tags/Maximum.ts +9 -7
- package/src/tags/MinItems.ts +9 -9
- package/src/tags/MinLength.ts +6 -5
- package/src/tags/Minimum.ts +9 -7
- package/src/tags/MultipleOf.ts +10 -7
- package/src/tags/Pattern.ts +7 -4
- package/src/tags/Sequence.ts +19 -17
- package/src/tags/TagBase.ts +21 -28
- package/src/tags/Type.ts +12 -11
- package/src/tags/UniqueItems.ts +10 -9
- package/src/tags/internal/FormatCheatSheet.ts +1 -3
- package/src/transformers/ITransformOptions.ts +27 -19
- package/src/transformers/ImportTransformer.ts +5 -10
- package/src/transformers/NoTransformConfigurationError.ts +1 -3
- package/src/transformers/features/llm/LlmApplicationTransformer.ts +1 -3
- package/src/typings/Equal.ts +6 -6
package/lib/functional.d.ts
CHANGED
|
@@ -4,138 +4,139 @@ import { TypeGuardError } from "./TypeGuardError";
|
|
|
4
4
|
* Asserts a function.
|
|
5
5
|
*
|
|
6
6
|
* Asserts a function, by wrapping the function and checking its parameters and
|
|
7
|
-
* return value through {@link assert} function. If some parameter or return
|
|
8
|
-
* does not match the expected type, it throws an {@link TypeGuardError} or
|
|
9
|
-
* error generated by the
|
|
7
|
+
* return value through {@link assert} function. If some parameter or return
|
|
8
|
+
* value does not match the expected type, it throws an {@link TypeGuardError} or
|
|
9
|
+
* a custom error generated by the _errorFactory_ parameter.
|
|
10
10
|
*
|
|
11
|
-
* For reference, {@link TypeGuardError.path} would be a little bit different
|
|
12
|
-
* individual {@link assert} function. If the {@link TypeGuardError} occurs
|
|
13
|
-
* some parameter, the path would start from `$input.parameters[number]`.
|
|
14
|
-
* the path would start from `$input.return`.
|
|
11
|
+
* For reference, {@link TypeGuardError.path} would be a little bit different
|
|
12
|
+
* with individual {@link assert} function. If the {@link TypeGuardError} occurs
|
|
13
|
+
* from some parameter, the path would start from `$input.parameters[number]`.
|
|
14
|
+
* Otherwise the path would start from `$input.return`.
|
|
15
15
|
*
|
|
16
16
|
* - `$input.parameters[0].~`
|
|
17
17
|
* - `$input.return.~`
|
|
18
18
|
*
|
|
19
19
|
* By the way, if what you want is not just finding the 1st type error through
|
|
20
|
-
* assertion, but also finding every type errors, then use
|
|
21
|
-
* instead. Otherwise, what you want is just asserting
|
|
22
|
-
* only, you can use {@link assertParameters} or
|
|
20
|
+
* assertion, but also finding every type errors, then use
|
|
21
|
+
* {@link validateFunction} instead. Otherwise, what you want is just asserting
|
|
22
|
+
* parameters or return value only, you can use {@link assertParameters} or
|
|
23
|
+
* {@link assertReturn} instead.
|
|
23
24
|
*
|
|
24
25
|
* On the other hand, if don't want to allow any superfluous properties, utilize
|
|
25
26
|
* {@link assertEqualsFunction} or {@link validateEqualsFunction} instead.
|
|
26
27
|
*
|
|
28
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
27
29
|
* @template T Target function type
|
|
28
30
|
* @param func Target function to assert
|
|
29
31
|
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
30
32
|
* @returns The wrapper function with type assertions
|
|
31
|
-
* @throws A {@link TypeGuardError} or a custom error generated by
|
|
32
|
-
*
|
|
33
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
33
|
+
* @throws A {@link TypeGuardError} or a custom error generated by _errorFactory_
|
|
34
34
|
*/
|
|
35
35
|
export declare function assertFunction<T extends (...args: any[]) => any>(func: T, errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)): T;
|
|
36
36
|
/**
|
|
37
37
|
* Asserts parameters.
|
|
38
38
|
*
|
|
39
|
-
* Asserts a function, by wrapping the function and checking its parameters
|
|
40
|
-
* {@link assert} function. If some parameter does not match the expected
|
|
41
|
-
* throws an {@link TypeGuardError} or a custom error generated by the
|
|
42
|
-
* parameter.
|
|
39
|
+
* Asserts a function, by wrapping the function and checking its parameters
|
|
40
|
+
* through {@link assert} function. If some parameter does not match the expected
|
|
41
|
+
* type, it throws an {@link TypeGuardError} or a custom error generated by the
|
|
42
|
+
* _errorFactory_ parameter.
|
|
43
43
|
*
|
|
44
|
-
* For reference, {@link TypeGuardError.path} would be a little bit different
|
|
45
|
-
* individual {@link assert} function. If the {@link TypeGuardError} occurs
|
|
46
|
-
* some parameter, the path would start from `$input.parameters[number]`.
|
|
44
|
+
* For reference, {@link TypeGuardError.path} would be a little bit different
|
|
45
|
+
* with individual {@link assert} function. If the {@link TypeGuardError} occurs
|
|
46
|
+
* from some parameter, the path would start from `$input.parameters[number]`.
|
|
47
47
|
*
|
|
48
48
|
* By the way, if what you want is not just finding the 1st type error through
|
|
49
|
-
* assertion, but also finding every type errors, then use
|
|
50
|
-
* instead. Otherwise, what you want is not only
|
|
51
|
-
* asserting return value, you can use
|
|
49
|
+
* assertion, but also finding every type errors, then use
|
|
50
|
+
* {@link validateParameters} instead. Otherwise, what you want is not only
|
|
51
|
+
* asserting parameters, but also asserting return value, you can use
|
|
52
|
+
* {@link assertFunction} instead.
|
|
52
53
|
*
|
|
53
54
|
* On the other hand, if don't want to allow any superfluous properties, utilize
|
|
54
55
|
* {@link assertEqualsParameters} or {@link validateEqualsParameters} instead.
|
|
55
56
|
*
|
|
57
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
56
58
|
* @template T Target function type
|
|
57
59
|
* @param func Target function to assert
|
|
58
60
|
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
59
61
|
* @returns The wrapper function with type assertions
|
|
60
|
-
* @throws A {@link TypeGuardError} or a custom error generated by
|
|
61
|
-
*
|
|
62
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
62
|
+
* @throws A {@link TypeGuardError} or a custom error generated by _errorFactory_
|
|
63
63
|
*/
|
|
64
64
|
export declare function assertParameters<T extends (...args: any[]) => any>(func: T, errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)): T;
|
|
65
65
|
/**
|
|
66
66
|
* Asserts return value.
|
|
67
67
|
*
|
|
68
|
-
* Asserts a function, by wrapping the function and checking its return value
|
|
69
|
-
* {@link assert} function. If the return value does not match the
|
|
70
|
-
* throws an {@link TypeGuardError} or a custom error generated
|
|
71
|
-
* parameter.
|
|
68
|
+
* Asserts a function, by wrapping the function and checking its return value
|
|
69
|
+
* through {@link assert} function. If the return value does not match the
|
|
70
|
+
* expected type, it throws an {@link TypeGuardError} or a custom error generated
|
|
71
|
+
* by the _errorFactory_ parameter.
|
|
72
72
|
*
|
|
73
|
-
* For reference, {@link TypeGuardError.path} would be a little bit different
|
|
74
|
-
* individual {@link assert} function. If the {@link TypeGuardError} occurs
|
|
75
|
-
* the return value, the path would start from `$input.return`.
|
|
73
|
+
* For reference, {@link TypeGuardError.path} would be a little bit different
|
|
74
|
+
* with individual {@link assert} function. If the {@link TypeGuardError} occurs
|
|
75
|
+
* from the return value, the path would start from `$input.return`.
|
|
76
76
|
*
|
|
77
77
|
* By the way, if what you want is not just finding the 1st type error through
|
|
78
78
|
* assertion, but also finding every type errors, then use {@link validateReturn}
|
|
79
|
-
* instead. Otherwise, what you want is not only asserting return value, but
|
|
80
|
-
* asserting parameters, you can use {@link assertFunction} instead.
|
|
79
|
+
* instead. Otherwise, what you want is not only asserting return value, but
|
|
80
|
+
* also asserting parameters, you can use {@link assertFunction} instead.
|
|
81
81
|
*
|
|
82
82
|
* On the other hand, if don't want to allow any superfluous properties, utilize
|
|
83
83
|
* {@link assertEqualsReturn} or {@link validateEqualsReturn} instead.
|
|
84
84
|
*
|
|
85
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
85
86
|
* @template T Target function type
|
|
86
87
|
* @param func Target function to assert
|
|
87
88
|
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
88
89
|
* @returns The wrapper function with type assertions
|
|
89
|
-
* @throws A {@link TypeGuardError} or a custom error generated by
|
|
90
|
-
*
|
|
91
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
90
|
+
* @throws A {@link TypeGuardError} or a custom error generated by _errorFactory_
|
|
92
91
|
*/
|
|
93
92
|
export declare function assertReturn<T extends (...args: any[]) => any>(func: T, errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)): T;
|
|
94
93
|
/**
|
|
95
94
|
* Asserts a function with strict equality.
|
|
96
95
|
*
|
|
97
|
-
* Asserts a function with strict equality, by wrapping the function and
|
|
98
|
-
* its parameters and return value through {@link assertEquals}
|
|
99
|
-
* parameter or return value does not match the expected type,
|
|
100
|
-
* {@link TypeGuardError} or a custom error generated by the
|
|
96
|
+
* Asserts a function with strict equality, by wrapping the function and
|
|
97
|
+
* checking its parameters and return value through {@link assertEquals}
|
|
98
|
+
* function. If some parameter or return value does not match the expected type,
|
|
99
|
+
* it throws an {@link TypeGuardError} or a custom error generated by the
|
|
100
|
+
* _errorFactory_ parameter.
|
|
101
101
|
*
|
|
102
|
-
* For reference, {@link TypeGuardError.path} would be a little bit different
|
|
103
|
-
* individual {@link assertEquals} function. If the {@link TypeGuardError}
|
|
104
|
-
* some parameter, the path would start from
|
|
105
|
-
* the path would start from
|
|
102
|
+
* For reference, {@link TypeGuardError.path} would be a little bit different
|
|
103
|
+
* with individual {@link assertEquals} function. If the {@link TypeGuardError}
|
|
104
|
+
* occurs from some parameter, the path would start from
|
|
105
|
+
* `$input.parameters[number]`. Otherwise the path would start from
|
|
106
|
+
* `$input.return`.
|
|
106
107
|
*
|
|
107
108
|
* - `$input.parameters[0].~`
|
|
108
109
|
* - `$input.return.~`
|
|
109
110
|
*
|
|
110
111
|
* By the way, if what you want is not just finding the 1st type error through
|
|
111
112
|
* assertion, but also finding every type errors, then use
|
|
112
|
-
* {@link validateEqualsFunction} instead. Otherwise, what you want is just
|
|
113
|
-
* parameters or return value only, you can use
|
|
114
|
-
* {@link assertEqualsReturn} instead.
|
|
113
|
+
* {@link validateEqualsFunction} instead. Otherwise, what you want is just
|
|
114
|
+
* asserting parameters or return value only, you can use
|
|
115
|
+
* {@link assertEqualsParameters} or {@link assertEqualsReturn} instead.
|
|
115
116
|
*
|
|
116
117
|
* On the other hand, if you want to allow any superfluous properties, utilize
|
|
117
118
|
* {@link assertFunction} or {@link validateFunction} instead.
|
|
118
119
|
*
|
|
120
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
119
121
|
* @template T Target function type
|
|
120
122
|
* @param func Target function to assert
|
|
121
123
|
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
122
124
|
* @returns The wrapper function with type assertions
|
|
123
|
-
* @throws A {@link TypeGuardError} or a custom error generated by
|
|
124
|
-
*
|
|
125
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
125
|
+
* @throws A {@link TypeGuardError} or a custom error generated by _errorFactory_
|
|
126
126
|
*/
|
|
127
127
|
export declare function assertEqualsFunction<T extends (...args: any[]) => any>(func: T, errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)): T;
|
|
128
128
|
/**
|
|
129
129
|
* Asserts parameters with strict equality.
|
|
130
130
|
*
|
|
131
|
-
* Asserts a function, by wrapping the function and checking its parameters
|
|
132
|
-
* {@link assertEquals} function. If some parameter does not match the
|
|
133
|
-
* it throws an {@link TypeGuardError} or a custom error generated
|
|
134
|
-
* parameter.
|
|
131
|
+
* Asserts a function, by wrapping the function and checking its parameters
|
|
132
|
+
* through {@link assertEquals} function. If some parameter does not match the
|
|
133
|
+
* expected type, it throws an {@link TypeGuardError} or a custom error generated
|
|
134
|
+
* by the _errorFactory_ parameter.
|
|
135
135
|
*
|
|
136
|
-
* For reference, {@link TypeGuardError.path} would be a little bit different
|
|
137
|
-
* individual {@link assertEquals} function. If the {@link TypeGuardError}
|
|
138
|
-
* some parameter, the path would start from
|
|
136
|
+
* For reference, {@link TypeGuardError.path} would be a little bit different
|
|
137
|
+
* with individual {@link assertEquals} function. If the {@link TypeGuardError}
|
|
138
|
+
* occurs from some parameter, the path would start from
|
|
139
|
+
* `$input.parameters[number]`.
|
|
139
140
|
*
|
|
140
141
|
* By the way, if what you want is not just finding the 1st type error through
|
|
141
142
|
* assertion, but also finding every type errors, then use
|
|
@@ -146,42 +147,41 @@ export declare function assertEqualsFunction<T extends (...args: any[]) => any>(
|
|
|
146
147
|
* On the other hand, if you want to allow any superfluous properties, utilize
|
|
147
148
|
* {@link assertParameters} or {@link validateParameters} instead.
|
|
148
149
|
*
|
|
150
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
149
151
|
* @template T Target function type
|
|
150
152
|
* @param func Target function to assert
|
|
151
153
|
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
152
154
|
* @returns The wrapper function with type assertions
|
|
153
|
-
* @throws A {@link TypeGuardError} or a custom error generated by
|
|
154
|
-
*
|
|
155
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
155
|
+
* @throws A {@link TypeGuardError} or a custom error generated by _errorFactory_
|
|
156
156
|
*/
|
|
157
157
|
export declare function assertEqualsParameters<T extends (...args: any[]) => any>(func: T, errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)): T;
|
|
158
158
|
/**
|
|
159
159
|
* Asserts return value with strict equality.
|
|
160
160
|
*
|
|
161
|
-
* Asserts a function, by wrapping the function and checking its return value
|
|
162
|
-
* {@link assertEquals} function. If the return value does not match the
|
|
163
|
-
* it throws an {@link TypeGuardError} or a custom error generated
|
|
164
|
-
* parameter.
|
|
161
|
+
* Asserts a function, by wrapping the function and checking its return value
|
|
162
|
+
* through {@link assertEquals} function. If the return value does not match the
|
|
163
|
+
* expected type, it throws an {@link TypeGuardError} or a custom error generated
|
|
164
|
+
* by the _errorFactory_ parameter.
|
|
165
165
|
*
|
|
166
|
-
* For reference, {@link TypeGuardError.path} would be a little bit different
|
|
167
|
-
* individual {@link assertEquals} function. If the {@link TypeGuardError}
|
|
168
|
-
* the return value, the path would start from `$input.return`.
|
|
166
|
+
* For reference, {@link TypeGuardError.path} would be a little bit different
|
|
167
|
+
* with individual {@link assertEquals} function. If the {@link TypeGuardError}
|
|
168
|
+
* occurs from the return value, the path would start from `$input.return`.
|
|
169
169
|
*
|
|
170
170
|
* By the way, if what you want is not just finding the 1st type error through
|
|
171
|
-
* assertion, but also finding every type errors, then use
|
|
172
|
-
* instead. Otherwise, what you want is not only
|
|
173
|
-
* asserting parameters, you can use
|
|
171
|
+
* assertion, but also finding every type errors, then use
|
|
172
|
+
* {@link validateEqualsReturn} instead. Otherwise, what you want is not only
|
|
173
|
+
* asserting return value, but also asserting parameters, you can use
|
|
174
|
+
* {@link assertEqualsFunction} instead.
|
|
174
175
|
*
|
|
175
176
|
* On the other hand, if you want to allow any superfluous properties, utilize
|
|
176
177
|
* {@link assertReturn} or {@link validateReturn} instead.
|
|
177
178
|
*
|
|
179
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
178
180
|
* @template T Target function type
|
|
179
181
|
* @param func Target function to assert
|
|
180
182
|
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
181
183
|
* @returns The wrapper function with type assertions
|
|
182
|
-
* @throws A {@link TypeGuardError} or a custom error generated by
|
|
183
|
-
*
|
|
184
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
184
|
+
* @throws A {@link TypeGuardError} or a custom error generated by _errorFactory_
|
|
185
185
|
*/
|
|
186
186
|
export declare function assertEqualsReturn<T extends (...args: any[]) => any>(func: T, errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error)): T;
|
|
187
187
|
/**
|
|
@@ -200,20 +200,19 @@ export declare function assertEqualsReturn<T extends (...args: any[]) => any>(fu
|
|
|
200
200
|
* utilize {@link equalsFunction}, {@link assertEqualsFunction} or
|
|
201
201
|
* {@link validateEqualsFunction} instead.
|
|
202
202
|
*
|
|
203
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
203
204
|
* @template T Target function type
|
|
204
205
|
* @param func Target function to test
|
|
205
206
|
* @returns The wrapper function with type tests
|
|
206
|
-
*
|
|
207
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
208
207
|
*/
|
|
209
208
|
export declare function isFunction<T extends (...args: any[]) => any>(func: T): T extends (...args: infer Arguments) => infer Output ? Output extends Promise<infer R> ? (...args: Arguments) => Promise<R | null> : (...args: Arguments) => Output | null : never;
|
|
210
209
|
/**
|
|
211
210
|
* Tests parameters.
|
|
212
211
|
*
|
|
213
|
-
* Tests a function, by wrapping the function and checking its parameters
|
|
214
|
-
* {@link is} function. If some parameter does not match the expected
|
|
215
|
-
* returns `null`. Otherwise there's no type error, it returns the
|
|
216
|
-
* function.
|
|
212
|
+
* Tests a function, by wrapping the function and checking its parameters
|
|
213
|
+
* through {@link is} function. If some parameter does not match the expected
|
|
214
|
+
* type, it returns `null`. Otherwise there's no type error, it returns the
|
|
215
|
+
* result of the function.
|
|
217
216
|
*
|
|
218
217
|
* By the way, if you want is not just testing type checking, but also finding
|
|
219
218
|
* detailed type error reason(s), then use {@link assertParameters} or
|
|
@@ -223,20 +222,19 @@ export declare function isFunction<T extends (...args: any[]) => any>(func: T):
|
|
|
223
222
|
* utilize {@link equalsParameters}, {@link assertEqualsParameters} or
|
|
224
223
|
* {@link validateEqualsParameters} instead.
|
|
225
224
|
*
|
|
225
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
226
226
|
* @template T Target function type
|
|
227
227
|
* @param func Target function to test
|
|
228
228
|
* @returns The wrapper function with type tests
|
|
229
|
-
*
|
|
230
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
231
229
|
*/
|
|
232
230
|
export declare function isParameters<T extends (...args: any[]) => any>(func: T): T extends (...args: infer Arguments) => infer Output ? Output extends Promise<infer R> ? (...args: Arguments) => Promise<R | null> : (...args: Arguments) => Output | null : never;
|
|
233
231
|
/**
|
|
234
232
|
* Tests return value.
|
|
235
233
|
*
|
|
236
|
-
* Tests a function, by wrapping the function and checking its return value
|
|
237
|
-
* {@link is} function. If the return value does not match the expected
|
|
238
|
-
* returns `null`. Otherwise there's no type error, it returns the
|
|
239
|
-
* function.
|
|
234
|
+
* Tests a function, by wrapping the function and checking its return value
|
|
235
|
+
* through {@link is} function. If the return value does not match the expected
|
|
236
|
+
* type, it returns `null`. Otherwise there's no type error, it returns the
|
|
237
|
+
* result of the function.
|
|
240
238
|
*
|
|
241
239
|
* By the way, if you want is not just testing type checking, but also finding
|
|
242
240
|
* detailed type error reason(s), then use {@link assertReturn} or
|
|
@@ -246,20 +244,20 @@ export declare function isParameters<T extends (...args: any[]) => any>(func: T)
|
|
|
246
244
|
* utilize {@link equalsReturn}, {@link assertEqualsReturn} or
|
|
247
245
|
* {@link validateEqualsReturn} instead.
|
|
248
246
|
*
|
|
247
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
249
248
|
* @template T Target function type
|
|
250
249
|
* @param func Target function to test
|
|
251
250
|
* @returns The wrapper function with type tests
|
|
252
|
-
*
|
|
253
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
254
251
|
*/
|
|
255
252
|
export declare function isReturn<T extends (...args: any[]) => any>(func: T): T extends (...args: infer Arguments) => infer Output ? Output extends Promise<infer R> ? (...args: Arguments) => Promise<R | null> : (...args: Arguments) => Output | null : never;
|
|
256
253
|
/**
|
|
257
254
|
* Tests a function with strict equality.
|
|
258
255
|
*
|
|
259
|
-
* Tests a function with strict equality, by wrapping the function and checking
|
|
260
|
-
* parameters and return value through {@link isEquals} function. If some
|
|
261
|
-
* or return value does not match the expected type, it returns
|
|
262
|
-
* there's no type error, it returns the result of the
|
|
256
|
+
* Tests a function with strict equality, by wrapping the function and checking
|
|
257
|
+
* its parameters and return value through {@link isEquals} function. If some
|
|
258
|
+
* parameter or return value does not match the expected type, it returns
|
|
259
|
+
* `null`. Otherwise there's no type error, it returns the result of the
|
|
260
|
+
* function.
|
|
263
261
|
*
|
|
264
262
|
* By the way, if you want is not just testing type checking, but also finding
|
|
265
263
|
* detailed type error reason(s), then use {@link assertEqualsFunction} or
|
|
@@ -268,39 +266,37 @@ export declare function isReturn<T extends (...args: any[]) => any>(func: T): T
|
|
|
268
266
|
* On the other hand, if you want to allow any superfluous properties, utilize
|
|
269
267
|
* {@link isFunction}, {@link assertFunction} or {@link validateFunction} instead.
|
|
270
268
|
*
|
|
269
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
271
270
|
* @template T Target function type
|
|
272
271
|
* @param func Target function to test
|
|
273
272
|
* @returns The wrapper function with type tests
|
|
274
|
-
*
|
|
275
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
276
273
|
*/
|
|
277
274
|
export declare function equalsFunction<T extends (...args: any[]) => any>(func: T): T extends (...args: infer Arguments) => infer Output ? Output extends Promise<infer R> ? (...args: Arguments) => Promise<R | null> : (...args: Arguments) => Output | null : never;
|
|
278
275
|
/**
|
|
279
276
|
* Tests parameters with strict equality.
|
|
280
277
|
*
|
|
281
|
-
* Tests a function, by wrapping the function and checking its parameters
|
|
282
|
-
* {@link isEquals} function. If some parameter does not match the
|
|
283
|
-
* it returns `null`. Otherwise there's no type error, it returns
|
|
284
|
-
* function.
|
|
278
|
+
* Tests a function, by wrapping the function and checking its parameters
|
|
279
|
+
* through {@link isEquals} function. If some parameter does not match the
|
|
280
|
+
* expected type, it returns `null`. Otherwise there's no type error, it returns
|
|
281
|
+
* the result of the function.
|
|
285
282
|
*
|
|
286
283
|
* By the way, if you want is not just testing type checking, but also finding
|
|
287
284
|
* detailed type error reason(s), then use {@link assertEqualsParameters} or
|
|
288
285
|
* {@link validateEqualsParameters} instead.
|
|
289
286
|
*
|
|
287
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
290
288
|
* @template T Target function type
|
|
291
289
|
* @param func Target function to test
|
|
292
290
|
* @returns The wrapper function with type tests
|
|
293
|
-
*
|
|
294
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
295
291
|
*/
|
|
296
292
|
export declare function equalsParameters<T extends (...args: any[]) => any>(func: T): T extends (...args: infer Arguments) => infer Output ? Output extends Promise<infer R> ? (...args: Arguments) => Promise<R | null> : (...args: Arguments) => Output | null : never;
|
|
297
293
|
/**
|
|
298
294
|
* Tests return value with strict equality.
|
|
299
295
|
*
|
|
300
|
-
* Tests a function, by wrapping the function and checking its return value
|
|
301
|
-
* {@link isEquals} function. If the return value does not match the
|
|
302
|
-
* it returns `null`. Otherwise there's no type error, it returns
|
|
303
|
-
* function.
|
|
296
|
+
* Tests a function, by wrapping the function and checking its return value
|
|
297
|
+
* through {@link isEquals} function. If the return value does not match the
|
|
298
|
+
* expected type, it returns `null`. Otherwise there's no type error, it returns
|
|
299
|
+
* the result of the function.
|
|
304
300
|
*
|
|
305
301
|
* By the way, if you want is not just testing type checking, but also finding
|
|
306
302
|
* detailed type error reason(s), then use {@link assertEqualsReturn} or
|
|
@@ -309,182 +305,187 @@ export declare function equalsParameters<T extends (...args: any[]) => any>(func
|
|
|
309
305
|
* On the other hand, if you want to allow any superfluous properties, utilize
|
|
310
306
|
* {@link isReturn}, {@link assertReturn} or {@link validateReturn} instead.
|
|
311
307
|
*
|
|
308
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
312
309
|
* @template T Target function type
|
|
313
310
|
* @param func Target function to test
|
|
314
311
|
* @returns The wrapper function with type tests
|
|
315
|
-
*
|
|
316
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
317
312
|
*/
|
|
318
313
|
export declare function equalsReturn<T extends (...args: any[]) => any>(func: T): T extends (...args: infer Arguments) => infer Output ? Output extends Promise<infer R> ? (...args: Arguments) => Promise<R | null> : (...args: Arguments) => Output | null : never;
|
|
319
314
|
/**
|
|
320
315
|
* Validates a function.
|
|
321
316
|
*
|
|
322
|
-
* Validates a function, by wrapping the function and checking its parameters
|
|
323
|
-
* return value through {@link validate} function. If some parameter or
|
|
324
|
-
* does not match the expected type, it returns
|
|
325
|
-
* object. Otherwise there's no type error, it
|
|
326
|
-
* typed object instead.
|
|
317
|
+
* Validates a function, by wrapping the function and checking its parameters
|
|
318
|
+
* and return value through {@link validate} function. If some parameter or
|
|
319
|
+
* return value does not match the expected type, it returns
|
|
320
|
+
* {@link IValidation.IError} typed object. Otherwise there's no type error, it
|
|
321
|
+
* returns {@link IValidation.ISuccess} typed object instead.
|
|
327
322
|
*
|
|
328
|
-
* For reference, {@link IValidation.IError.path} would be a little bit different
|
|
329
|
-
* individual {@link validate} function. If the {@link IValidation.IError}
|
|
330
|
-
* some parameter, the path would start from
|
|
331
|
-
* the path would start from
|
|
323
|
+
* For reference, {@link IValidation.IError.path} would be a little bit different
|
|
324
|
+
* with individual {@link validate} function. If the {@link IValidation.IError}
|
|
325
|
+
* occurs from some parameter, the path would start from
|
|
326
|
+
* `$input.parameters[number]`. Otherwise the path would start from
|
|
327
|
+
* `$input.return`.
|
|
332
328
|
*
|
|
333
329
|
* - `$input.parameters[0].~`
|
|
334
330
|
* - `$input.return.~`
|
|
335
331
|
*
|
|
336
|
-
* By the way, if what you want is not finding every type errors, but just
|
|
337
|
-
* the 1st type error, then use {@link assertFunction} instead.
|
|
338
|
-
* want is just validating parameters or return value only,
|
|
339
|
-
* {@link validateParameters} or {@link validateReturn} instead.
|
|
332
|
+
* By the way, if what you want is not finding every type errors, but just
|
|
333
|
+
* finding the 1st type error, then use {@link assertFunction} instead.
|
|
334
|
+
* Otherwise, what you want is just validating parameters or return value only,
|
|
335
|
+
* you can use {@link validateParameters} or {@link validateReturn} instead.
|
|
340
336
|
*
|
|
341
|
-
* On the other hand, if you don't want to allow any superfluous properties,
|
|
342
|
-
* {@link validateEqualsFunction} or {@link assertEqualsFunction}
|
|
337
|
+
* On the other hand, if you don't want to allow any superfluous properties,
|
|
338
|
+
* utilize {@link validateEqualsFunction} or {@link assertEqualsFunction}
|
|
339
|
+
* instead.
|
|
343
340
|
*
|
|
341
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
344
342
|
* @template T Target function type
|
|
345
343
|
* @param func Target function to validate
|
|
346
344
|
* @returns The wrapper function with type validations
|
|
347
|
-
*
|
|
348
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
349
345
|
*/
|
|
350
346
|
export declare function validateFunction<T extends (...args: any[]) => any>(func: T): T extends (...args: infer Arguments) => infer Output ? Output extends Promise<infer R> ? (...args: Arguments) => Promise<IValidation<R>> : (...args: Arguments) => IValidation<Output> : never;
|
|
351
347
|
/**
|
|
352
348
|
* Validates parameters.
|
|
353
349
|
*
|
|
354
|
-
* Validates a function, by wrapping the function and checking its parameters
|
|
355
|
-
* {@link validate} function. If some parameter does not match the
|
|
356
|
-
* returns {@link IValidation.IError} typed object. Otherwise
|
|
357
|
-
* it returns {@link IValidation.ISuccess} typed object
|
|
350
|
+
* Validates a function, by wrapping the function and checking its parameters
|
|
351
|
+
* through {@link validate} function. If some parameter does not match the
|
|
352
|
+
* expected type, it returns {@link IValidation.IError} typed object. Otherwise
|
|
353
|
+
* there's no type error, it returns {@link IValidation.ISuccess} typed object
|
|
354
|
+
* instead.
|
|
358
355
|
*
|
|
359
|
-
* For reference, {@link IValidation.IError.path} would be a little bit different
|
|
360
|
-
* individual {@link validate} function. If the {@link IValidation.IError}
|
|
361
|
-
* some parameter, the path would start from
|
|
356
|
+
* For reference, {@link IValidation.IError.path} would be a little bit different
|
|
357
|
+
* with individual {@link validate} function. If the {@link IValidation.IError}
|
|
358
|
+
* occurs from some parameter, the path would start from
|
|
359
|
+
* `$input.parameters[number]`.
|
|
362
360
|
*
|
|
363
|
-
* By the way, if what you want is not finding every type errors, but just
|
|
364
|
-
* the 1st type error, then use {@link assertParameters} instead.
|
|
365
|
-
* want is not only validating parameters, but also
|
|
366
|
-
* use {@link validateFunction} instead.
|
|
361
|
+
* By the way, if what you want is not finding every type errors, but just
|
|
362
|
+
* finding the 1st type error, then use {@link assertParameters} instead.
|
|
363
|
+
* Otherwise, what you want is not only validating parameters, but also
|
|
364
|
+
* validating return value, you can use {@link validateFunction} instead.
|
|
367
365
|
*
|
|
368
|
-
* On the other hand, if you don't want to allow any superfluous properties,
|
|
369
|
-
* {@link validateEqualsParameters} or {@link assertEqualsParameters}
|
|
366
|
+
* On the other hand, if you don't want to allow any superfluous properties,
|
|
367
|
+
* utilize {@link validateEqualsParameters} or {@link assertEqualsParameters}
|
|
368
|
+
* instead.
|
|
370
369
|
*
|
|
370
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
371
371
|
* @template T Target function type
|
|
372
372
|
* @param func Target function to validate
|
|
373
373
|
* @returns The wrapper function with type validations
|
|
374
|
-
*
|
|
375
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
376
374
|
*/
|
|
377
375
|
export declare function validateParameters<T extends (...args: any[]) => any>(func: T): T extends (...args: infer Arguments) => infer Output ? Output extends Promise<infer R> ? (...args: Arguments) => Promise<IValidation<R>> : (...args: Arguments) => IValidation<Output> : never;
|
|
378
376
|
/**
|
|
379
377
|
* Validates return value.
|
|
380
378
|
*
|
|
381
|
-
* Validates a function, by wrapping the function and checking its return value
|
|
382
|
-
* {@link validate} function. If the return value does not match the
|
|
383
|
-
* returns {@link IValidation.IError} typed object. Otherwise
|
|
384
|
-
* it returns {@link IValidation.ISuccess} typed object
|
|
379
|
+
* Validates a function, by wrapping the function and checking its return value
|
|
380
|
+
* through {@link validate} function. If the return value does not match the
|
|
381
|
+
* expected type, it returns {@link IValidation.IError} typed object. Otherwise
|
|
382
|
+
* there's no type error, it returns {@link IValidation.ISuccess} typed object
|
|
383
|
+
* instead.
|
|
385
384
|
*
|
|
386
|
-
* For reference, {@link IValidation.IError.path} would be a little bit different
|
|
387
|
-
* individual {@link validate} function. If the {@link IValidation.IError}
|
|
388
|
-
* the return value, the path would start from `$input.return`.
|
|
385
|
+
* For reference, {@link IValidation.IError.path} would be a little bit different
|
|
386
|
+
* with individual {@link validate} function. If the {@link IValidation.IError}
|
|
387
|
+
* occurs from the return value, the path would start from `$input.return`.
|
|
389
388
|
*
|
|
390
|
-
* By the way, if what you want is not finding every type errors, but just
|
|
391
|
-
* the 1st type error, then use {@link assertReturn} instead. Otherwise,
|
|
392
|
-
* is not only validating return value, but also validating
|
|
393
|
-
* {@link validateFunction} instead.
|
|
389
|
+
* By the way, if what you want is not finding every type errors, but just
|
|
390
|
+
* finding the 1st type error, then use {@link assertReturn} instead. Otherwise,
|
|
391
|
+
* what you want is not only validating return value, but also validating
|
|
392
|
+
* parameters, you can use {@link validateFunction} instead.
|
|
394
393
|
*
|
|
395
|
-
* On the other hand, if you don't want to allow any superfluous properties,
|
|
396
|
-
* {@link validateEqualsReturn} or {@link assertEqualsReturn} instead.
|
|
394
|
+
* On the other hand, if you don't want to allow any superfluous properties,
|
|
395
|
+
* utilize {@link validateEqualsReturn} or {@link assertEqualsReturn} instead.
|
|
397
396
|
*
|
|
397
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
398
398
|
* @template T Target function type
|
|
399
399
|
* @param func Target function to validate
|
|
400
400
|
* @returns The wrapper function with type validations
|
|
401
|
-
*
|
|
402
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
403
401
|
*/
|
|
404
402
|
export declare function validateReturn<T extends (...args: any[]) => any>(func: T): T extends (...args: infer Arguments) => infer Output ? Output extends Promise<infer R> ? (...args: Arguments) => Promise<IValidation<R>> : (...args: Arguments) => IValidation<Output> : never;
|
|
405
403
|
/**
|
|
406
404
|
* Validates a function with strict equality.
|
|
407
405
|
*
|
|
408
|
-
* Validates a function with strict equality, by wrapping the function and
|
|
409
|
-
* its parameters and return value through {@link validateEquals}
|
|
410
|
-
* parameter or return value does not match the expected type,
|
|
411
|
-
* {@link IValidation.IError} typed object. Otherwise there's no type
|
|
412
|
-
* returns {@link IValidation.ISuccess} typed object instead.
|
|
406
|
+
* Validates a function with strict equality, by wrapping the function and
|
|
407
|
+
* checking its parameters and return value through {@link validateEquals}
|
|
408
|
+
* function. If some parameter or return value does not match the expected type,
|
|
409
|
+
* it returns {@link IValidation.IError} typed object. Otherwise there's no type
|
|
410
|
+
* error, it returns {@link IValidation.ISuccess} typed object instead.
|
|
413
411
|
*
|
|
414
|
-
* For reference, {@link IValidation.IError.path} would be a little bit different
|
|
415
|
-
* individual {@link validateEquals} function. If the
|
|
416
|
-
* from some parameter, the path would start
|
|
417
|
-
* the path would start from
|
|
412
|
+
* For reference, {@link IValidation.IError.path} would be a little bit different
|
|
413
|
+
* with individual {@link validateEquals} function. If the
|
|
414
|
+
* {@link IValidation.IError} occurs from some parameter, the path would start
|
|
415
|
+
* from `$input.parameters[number]`. Otherwise the path would start from
|
|
416
|
+
* `$input.return`.
|
|
418
417
|
*
|
|
419
418
|
* - `$input.parameters[0].~`
|
|
420
419
|
* - `$input.return.~`
|
|
421
420
|
*
|
|
422
|
-
* By the way, if what you want is not finding every type errors, but just
|
|
423
|
-
* the 1st type error, then use {@link assertEqualsFunction} instead.
|
|
424
|
-
* you want is just validating parameters or return value only,
|
|
425
|
-
* {@link validateEqualsParameters} or {@link validateEqualsReturn}
|
|
421
|
+
* By the way, if what you want is not finding every type errors, but just
|
|
422
|
+
* finding the 1st type error, then use {@link assertEqualsFunction} instead.
|
|
423
|
+
* Otherwise, what you want is just validating parameters or return value only,
|
|
424
|
+
* you can use {@link validateEqualsParameters} or {@link validateEqualsReturn}
|
|
425
|
+
* instead.
|
|
426
426
|
*
|
|
427
427
|
* On the other hand, if you want to allow any superfluous properties, utilize
|
|
428
428
|
* {@link validateFunction} or {@link assertFunction} instead.
|
|
429
429
|
*
|
|
430
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
430
431
|
* @template T Target function type
|
|
431
432
|
* @param func Target function to validate
|
|
432
433
|
* @returns The wrapper function with type validations
|
|
433
|
-
*
|
|
434
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
435
434
|
*/
|
|
436
435
|
export declare function validateEqualsFunction<T extends (...args: any[]) => any>(func: T): T extends (...args: infer Arguments) => infer Output ? Output extends Promise<infer R> ? (...args: Arguments) => Promise<IValidation<R>> : (...args: Arguments) => IValidation<Output> : never;
|
|
437
436
|
/**
|
|
438
437
|
* Validates parameters with strict equality.
|
|
439
438
|
*
|
|
440
|
-
* Validates a function, by wrapping the function and checking its parameters
|
|
441
|
-
* {@link validateEquals} function. If some parameter does not match the
|
|
442
|
-
* it returns {@link IValidation.IError} typed object. Otherwise
|
|
443
|
-
* it returns {@link IValidation.ISuccess} typed object
|
|
439
|
+
* Validates a function, by wrapping the function and checking its parameters
|
|
440
|
+
* through {@link validateEquals} function. If some parameter does not match the
|
|
441
|
+
* expected type, it returns {@link IValidation.IError} typed object. Otherwise
|
|
442
|
+
* there's no type error, it returns {@link IValidation.ISuccess} typed object
|
|
443
|
+
* instead.
|
|
444
444
|
*
|
|
445
|
-
* For reference, {@link IValidation.IError.path} would be a little bit different
|
|
446
|
-
* individual {@link validateEquals} function. If the
|
|
447
|
-
* from some parameter, the path would start
|
|
445
|
+
* For reference, {@link IValidation.IError.path} would be a little bit different
|
|
446
|
+
* with individual {@link validateEquals} function. If the
|
|
447
|
+
* {@link IValidation.IError} occurs from some parameter, the path would start
|
|
448
|
+
* from `$input.parameters[number]`.
|
|
448
449
|
*
|
|
449
|
-
* By the way, if what you want is not finding every type errors, but just
|
|
450
|
-
* the 1st type error, then use {@link assertEqualsParameters} instead.
|
|
451
|
-
* what you want is not only validating parameters, but also
|
|
452
|
-
* you can use {@link validateEqualsFunction} instead.
|
|
450
|
+
* By the way, if what you want is not finding every type errors, but just
|
|
451
|
+
* finding the 1st type error, then use {@link assertEqualsParameters} instead.
|
|
452
|
+
* Otherwise, what you want is not only validating parameters, but also
|
|
453
|
+
* validating return value, you can use {@link validateEqualsFunction} instead.
|
|
453
454
|
*
|
|
454
455
|
* On the other hand, if you want to allow any superfluous properties, utilize
|
|
455
456
|
* {@link validateParameters} or {@link assertParameters} instead.
|
|
456
457
|
*
|
|
458
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
457
459
|
* @template T Target function type
|
|
458
460
|
* @param func Target function to validate
|
|
459
461
|
* @returns The wrapper function with type validations
|
|
460
|
-
*
|
|
461
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
462
462
|
*/
|
|
463
463
|
export declare function validateEqualsParameters<T extends (...args: any[]) => any>(func: T): T extends (...args: infer Arguments) => infer Output ? Output extends Promise<infer R> ? (...args: Arguments) => Promise<IValidation<R>> : (...args: Arguments) => IValidation<Output> : never;
|
|
464
464
|
/**
|
|
465
465
|
* Validates return value with strict equality.
|
|
466
466
|
*
|
|
467
|
-
* Validates a function, by wrapping the function and checking its return value
|
|
468
|
-
* {@link validateEquals} function. If the return value does not match
|
|
469
|
-
* it returns {@link IValidation.IError} typed object.
|
|
470
|
-
* it returns {@link IValidation.ISuccess} typed
|
|
467
|
+
* Validates a function, by wrapping the function and checking its return value
|
|
468
|
+
* through {@link validateEquals} function. If the return value does not match
|
|
469
|
+
* the expected type, it returns {@link IValidation.IError} typed object.
|
|
470
|
+
* Otherwise there's no type error, it returns {@link IValidation.ISuccess} typed
|
|
471
|
+
* object instead.
|
|
471
472
|
*
|
|
472
|
-
* For reference, {@link IValidation.IError.path} would be a little bit different
|
|
473
|
-
* individual {@link validateEquals} function. If the
|
|
474
|
-
* from the return value, the path would start
|
|
473
|
+
* For reference, {@link IValidation.IError.path} would be a little bit different
|
|
474
|
+
* with individual {@link validateEquals} function. If the
|
|
475
|
+
* {@link IValidation.IError} occurs from the return value, the path would start
|
|
476
|
+
* from `$input.return`.
|
|
475
477
|
*
|
|
476
|
-
* By the way, if what you want is not finding every type errors, but just
|
|
477
|
-
* the 1st type error, then use {@link assertEqualsReturn} instead.
|
|
478
|
-
* want is not only validating return value, but also
|
|
479
|
-
* {@link validateEqualsFunction} instead.
|
|
478
|
+
* By the way, if what you want is not finding every type errors, but just
|
|
479
|
+
* finding the 1st type error, then use {@link assertEqualsReturn} instead.
|
|
480
|
+
* Otherwise, what you want is not only validating return value, but also
|
|
481
|
+
* validating parameters, you can use {@link validateEqualsFunction} instead.
|
|
480
482
|
*
|
|
481
483
|
* On the other hand, if you want to allow any superfluous properties, utilize
|
|
482
484
|
* {@link validateReturn} or {@link assertReturn} instead.
|
|
483
485
|
*
|
|
486
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
484
487
|
* @template T Target function type
|
|
485
488
|
* @param func Target function to validate
|
|
486
489
|
* @returns The wrapper function with type validations
|
|
487
|
-
*
|
|
488
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
489
490
|
*/
|
|
490
491
|
export declare function validateEqualsReturn<T extends (...args: any[]) => any>(func: T): T extends (...args: infer Arguments) => infer Output ? Output extends Promise<infer R> ? (...args: Arguments) => Promise<IValidation<R>> : (...args: Arguments) => IValidation<Output> : never;
|