typia 9.7.0 → 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/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 +32 -0
- package/lib/tags/Constant.d.ts +32 -0
- package/lib/tags/ContentMediaType.d.mts +17 -0
- package/lib/tags/ContentMediaType.d.ts +17 -0
- package/lib/tags/Default.d.mts +30 -0
- package/lib/tags/Default.d.ts +30 -0
- package/lib/tags/Example.d.mts +32 -0
- package/lib/tags/Example.d.ts +32 -0
- package/lib/tags/Examples.d.mts +40 -0
- package/lib/tags/Examples.d.ts +40 -0
- package/lib/tags/ExclusiveMaximum.d.mts +21 -0
- package/lib/tags/ExclusiveMaximum.d.ts +21 -0
- package/lib/tags/ExclusiveMinimum.d.mts +21 -0
- package/lib/tags/ExclusiveMinimum.d.ts +21 -0
- package/lib/tags/Format.d.mts +28 -0
- package/lib/tags/Format.d.ts +28 -0
- package/lib/tags/JsonSchemaPlugin.d.mts +28 -0
- package/lib/tags/JsonSchemaPlugin.d.ts +28 -0
- package/lib/tags/MaxItems.d.mts +19 -0
- package/lib/tags/MaxItems.d.ts +19 -0
- package/lib/tags/MaxLength.d.mts +13 -0
- package/lib/tags/MaxLength.d.ts +13 -0
- package/lib/tags/Maximum.d.mts +20 -0
- package/lib/tags/Maximum.d.ts +20 -0
- package/lib/tags/MinItems.d.mts +19 -0
- package/lib/tags/MinItems.d.ts +19 -0
- package/lib/tags/MinLength.d.mts +13 -0
- package/lib/tags/MinLength.d.ts +13 -0
- package/lib/tags/Minimum.d.mts +20 -0
- package/lib/tags/Minimum.d.ts +20 -0
- package/lib/tags/MultipleOf.d.mts +21 -0
- package/lib/tags/MultipleOf.d.ts +21 -0
- package/lib/tags/Pattern.d.mts +18 -0
- package/lib/tags/Pattern.d.ts +18 -0
- package/lib/tags/Sequence.d.mts +27 -0
- package/lib/tags/Sequence.d.ts +27 -0
- package/lib/tags/TagBase.d.mts +38 -18
- package/lib/tags/TagBase.d.ts +38 -18
- package/lib/tags/Type.d.mts +27 -0
- package/lib/tags/Type.d.ts +27 -0
- package/lib/tags/UniqueItems.d.mts +20 -0
- package/lib/tags/UniqueItems.d.ts +20 -0
- 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 +114 -1
- package/lib/transformers/ImportTransformer.js.map +1 -1
- package/lib/transformers/ImportTransformer.mjs +114 -1
- 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 +57 -47
- 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/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 +32 -0
- package/src/tags/ContentMediaType.ts +17 -0
- package/src/tags/Default.ts +30 -0
- package/src/tags/Example.ts +32 -0
- package/src/tags/Examples.ts +40 -0
- package/src/tags/ExclusiveMaximum.ts +21 -0
- package/src/tags/ExclusiveMinimum.ts +21 -0
- package/src/tags/Format.ts +28 -0
- package/src/tags/JsonSchemaPlugin.ts +28 -0
- package/src/tags/MaxItems.ts +19 -0
- package/src/tags/MaxLength.ts +13 -0
- package/src/tags/Maximum.ts +20 -0
- package/src/tags/MinItems.ts +19 -0
- package/src/tags/MinLength.ts +13 -0
- package/src/tags/Minimum.ts +20 -0
- package/src/tags/MultipleOf.ts +21 -0
- package/src/tags/Pattern.ts +18 -0
- package/src/tags/Sequence.ts +27 -0
- package/src/tags/TagBase.ts +38 -18
- package/src/tags/Type.ts +27 -0
- package/src/tags/UniqueItems.ts +20 -0
- package/src/tags/internal/FormatCheatSheet.ts +1 -3
- package/src/transformers/ITransformOptions.ts +27 -19
- package/src/transformers/ImportTransformer.ts +173 -1
- package/src/transformers/NoTransformConfigurationError.ts +1 -3
- package/src/transformers/features/llm/LlmApplicationTransformer.ts +1 -3
- package/src/typings/Equal.ts +6 -6
package/src/module.ts
CHANGED
|
@@ -40,26 +40,28 @@ export * from "./IReadableURLSearchParams";
|
|
|
40
40
|
/**
|
|
41
41
|
* Asserts a value type.
|
|
42
42
|
*
|
|
43
|
-
* Asserts a parametric value type and throws a {@link TypeGuardError} with a
|
|
44
|
-
* reason, if the parametric value is not following the type `T`.
|
|
45
|
-
* value is following the type `T`, the input parameter will
|
|
43
|
+
* Asserts a parametric value type and throws a {@link TypeGuardError} with a
|
|
44
|
+
* detailed reason, if the parametric value is not following the type `T`.
|
|
45
|
+
* Otherwise, if the value is following the type `T`, the input parameter will
|
|
46
|
+
* be returned.
|
|
46
47
|
*
|
|
47
|
-
* If what you want is not asserting but just knowing whether the parametric
|
|
48
|
-
* following the type `T` or not, you can choose the {@link is} function
|
|
49
|
-
* Otherwise, if you want to know all the errors, {@link validate} is
|
|
50
|
-
* Also, if you want to automatically cast the parametric value
|
|
51
|
-
* when there is no problem (perform the assertion guard of
|
|
48
|
+
* If what you want is not asserting but just knowing whether the parametric
|
|
49
|
+
* value is following the type `T` or not, you can choose the {@link is} function
|
|
50
|
+
* instead. Otherwise, if you want to know all the errors, {@link validate} is
|
|
51
|
+
* the way to go. Also, if you want to automatically cast the parametric value
|
|
52
|
+
* to the type `T` when there is no problem (perform the assertion guard of
|
|
53
|
+
* type).
|
|
52
54
|
*
|
|
53
|
-
* On the other hand, if you don't want to allow any superfluous property that
|
|
54
|
-
* enrolled to the type `T`, you can use {@link assertEquals} function
|
|
55
|
+
* On the other hand, if you don't want to allow any superfluous property that
|
|
56
|
+
* is not enrolled to the type `T`, you can use {@link assertEquals} function
|
|
57
|
+
* instead.
|
|
55
58
|
*
|
|
59
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
56
60
|
* @template T Type of the input value
|
|
57
61
|
* @param input A value to be asserted
|
|
58
62
|
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
59
63
|
* @returns Parametric input value
|
|
60
64
|
* @throws A {@link TypeGuardError} instance with a detailed reason
|
|
61
|
-
*
|
|
62
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
63
65
|
*/
|
|
64
66
|
export function assert<T>(
|
|
65
67
|
input: T,
|
|
@@ -69,33 +71,33 @@ export function assert<T>(
|
|
|
69
71
|
/**
|
|
70
72
|
* Asserts a value type.
|
|
71
73
|
*
|
|
72
|
-
* Asserts a parametric value type and throws a {@link TypeGuardError} with a
|
|
73
|
-
* reason, if the parametric value is not following the type `T`.
|
|
74
|
-
* value is following the type `T`, the input parameter will
|
|
74
|
+
* Asserts a parametric value type and throws a {@link TypeGuardError} with a
|
|
75
|
+
* detailed reason, if the parametric value is not following the type `T`.
|
|
76
|
+
* Otherwise, if the value is following the type `T`, the input parameter will
|
|
77
|
+
* be returned.
|
|
75
78
|
*
|
|
76
|
-
* If what you want is not asserting but just knowing whether the parametric
|
|
77
|
-
* following the type `T` or not, you can choose the {@link is} function
|
|
78
|
-
* Otherwise, if you want to know all the errors, {@link validate} is
|
|
79
|
+
* If what you want is not asserting but just knowing whether the parametric
|
|
80
|
+
* value is following the type `T` or not, you can choose the {@link is} function
|
|
81
|
+
* instead. Otherwise, if you want to know all the errors, {@link validate} is
|
|
82
|
+
* the way to go.
|
|
79
83
|
*
|
|
80
|
-
* On the other hand, if you don't want to allow any superfluous property that
|
|
81
|
-
* enrolled to the type `T`, you can use {@link assertEquals} function
|
|
84
|
+
* On the other hand, if you don't want to allow any superfluous property that
|
|
85
|
+
* is not enrolled to the type `T`, you can use {@link assertEquals} function
|
|
86
|
+
* instead.
|
|
82
87
|
*
|
|
88
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
83
89
|
* @template T Type of the input value
|
|
84
90
|
* @param input A value to be asserted
|
|
85
91
|
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
86
92
|
* @returns Parametric input value casted as `T`
|
|
87
93
|
* @throws A {@link TypeGuardError} instance with a detailed reason
|
|
88
|
-
*
|
|
89
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
90
94
|
*/
|
|
91
95
|
export function assert<T>(
|
|
92
96
|
input: unknown,
|
|
93
97
|
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
94
98
|
): T;
|
|
95
99
|
|
|
96
|
-
/**
|
|
97
|
-
* @internal
|
|
98
|
-
*/
|
|
100
|
+
/** @internal */
|
|
99
101
|
export function assert(): never {
|
|
100
102
|
NoTransformConfigurationError("assert");
|
|
101
103
|
}
|
|
@@ -103,27 +105,27 @@ export function assert(): never {
|
|
|
103
105
|
/**
|
|
104
106
|
* Assertion guard of a value type.
|
|
105
107
|
*
|
|
106
|
-
* Asserts a parametric value type and throws a {@link TypeGuardError} with a
|
|
107
|
-
* reason, if the parametric value is not following the type `T`.
|
|
108
|
-
* value is following the type `T`, nothing will be returned,
|
|
109
|
-
* will be automatically casted to the type `T`. This is the
|
|
110
|
-
* "Assertion Guard" of a value type.
|
|
108
|
+
* Asserts a parametric value type and throws a {@link TypeGuardError} with a
|
|
109
|
+
* detailed reason, if the parametric value is not following the type `T`.
|
|
110
|
+
* Otherwise, if the value is following the type `T`, nothing will be returned,
|
|
111
|
+
* but the input value will be automatically casted to the type `T`. This is the
|
|
112
|
+
* concept of "Assertion Guard" of a value type.
|
|
111
113
|
*
|
|
112
|
-
* If what you want is not asserting but just knowing whether the parametric
|
|
113
|
-
* following the type `T` or not, you can choose the {@link is} function
|
|
114
|
-
* Otherwise, if you want to know all the errors, {@link validate} is
|
|
115
|
-
* Also, if you want to return the parametric value when there is
|
|
116
|
-
* {@link assert} function instead.
|
|
114
|
+
* If what you want is not asserting but just knowing whether the parametric
|
|
115
|
+
* value is following the type `T` or not, you can choose the {@link is} function
|
|
116
|
+
* instead. Otherwise, if you want to know all the errors, {@link validate} is
|
|
117
|
+
* the way to go. Also, if you want to return the parametric value when there is
|
|
118
|
+
* no problem, you can use {@link assert} function instead.
|
|
117
119
|
*
|
|
118
|
-
* On the other hand, if you don't want to allow any superfluous property that
|
|
119
|
-
* enrolled to the type `T`, you can use {@link assertGuardEquals}
|
|
120
|
+
* On the other hand, if you don't want to allow any superfluous property that
|
|
121
|
+
* is not enrolled to the type `T`, you can use {@link assertGuardEquals}
|
|
122
|
+
* function instead.
|
|
120
123
|
*
|
|
124
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
121
125
|
* @template T Type of the input value
|
|
122
126
|
* @param input A value to be asserted
|
|
123
127
|
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
124
128
|
* @throws A {@link TypeGuardError} instance with a detailed reason
|
|
125
|
-
*
|
|
126
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
127
129
|
*/
|
|
128
130
|
export function assertGuard<T>(
|
|
129
131
|
input: T,
|
|
@@ -133,36 +135,34 @@ export function assertGuard<T>(
|
|
|
133
135
|
/**
|
|
134
136
|
* Assertion guard of a value type.
|
|
135
137
|
*
|
|
136
|
-
* Asserts a parametric value type and throws a {@link TypeGuardError} with a
|
|
137
|
-
* reason, if the parametric value is not following the type `T`.
|
|
138
|
-
* value is following the type `T`, nothing will be returned,
|
|
139
|
-
* will be automatically casted to the type `T`. This is the
|
|
140
|
-
* "Assertion Guard" of a value type.
|
|
138
|
+
* Asserts a parametric value type and throws a {@link TypeGuardError} with a
|
|
139
|
+
* detailed reason, if the parametric value is not following the type `T`.
|
|
140
|
+
* Otherwise, if the value is following the type `T`, nothing will be returned,
|
|
141
|
+
* but the input value will be automatically casted to the type `T`. This is the
|
|
142
|
+
* concept of "Assertion Guard" of a value type.
|
|
141
143
|
*
|
|
142
|
-
* If what you want is not asserting but just knowing whether the parametric
|
|
143
|
-
* following the type `T` or not, you can choose the {@link is} function
|
|
144
|
-
* Otherwise, if you want to know all the errors, {@link validate} is
|
|
145
|
-
* Also, if you want to return the parametric value when there is
|
|
146
|
-
* {@link assert} function instead.
|
|
144
|
+
* If what you want is not asserting but just knowing whether the parametric
|
|
145
|
+
* value is following the type `T` or not, you can choose the {@link is} function
|
|
146
|
+
* instead. Otherwise, if you want to know all the errors, {@link validate} is
|
|
147
|
+
* the way to go. Also, if you want to return the parametric value when there is
|
|
148
|
+
* no problem, you can use {@link assert} function instead.
|
|
147
149
|
*
|
|
148
|
-
* On the other hand, if you don't want to allow any superfluous property that
|
|
149
|
-
* enrolled to the type `T`, you can use {@link assertGuardEquals}
|
|
150
|
+
* On the other hand, if you don't want to allow any superfluous property that
|
|
151
|
+
* is not enrolled to the type `T`, you can use {@link assertGuardEquals}
|
|
152
|
+
* function instead.
|
|
150
153
|
*
|
|
154
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
151
155
|
* @template T Type of the input value
|
|
152
156
|
* @param input A value to be asserted
|
|
153
157
|
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
154
158
|
* @throws A {@link TypeGuardError} instance with a detailed reason
|
|
155
|
-
*
|
|
156
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
157
159
|
*/
|
|
158
160
|
export function assertGuard<T>(
|
|
159
161
|
input: unknown,
|
|
160
162
|
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
161
163
|
): asserts input is T;
|
|
162
164
|
|
|
163
|
-
/**
|
|
164
|
-
* @internal
|
|
165
|
-
*/
|
|
165
|
+
/** @internal */
|
|
166
166
|
export function assertGuard(): never {
|
|
167
167
|
NoTransformConfigurationError("assertGuard");
|
|
168
168
|
}
|
|
@@ -170,55 +170,53 @@ export function assertGuard(): never {
|
|
|
170
170
|
/**
|
|
171
171
|
* Tests a value type.
|
|
172
172
|
*
|
|
173
|
-
* Tests a parametric value type and returns whether it's following the type `T`
|
|
174
|
-
* If the parametric value is matched with the type `T`, `true` value
|
|
175
|
-
* Otherwise, if the parametric value is not following the
|
|
176
|
-
* returned.
|
|
173
|
+
* Tests a parametric value type and returns whether it's following the type `T`
|
|
174
|
+
* or not. If the parametric value is matched with the type `T`, `true` value
|
|
175
|
+
* will be returned. Otherwise, if the parametric value is not following the
|
|
176
|
+
* type `T`, `false` value will be returned.
|
|
177
177
|
*
|
|
178
|
-
* If what you want is not just knowing whether the parametric value is
|
|
179
|
-
* type `T` or not, but throwing an exception with a detailed
|
|
180
|
-
* {@link assert} function instead. Also, if you want to
|
|
181
|
-
* detailed reasons, {@link validate} function will be
|
|
178
|
+
* If what you want is not just knowing whether the parametric value is
|
|
179
|
+
* following the type `T` or not, but throwing an exception with a detailed
|
|
180
|
+
* reason, you can choose {@link assert} function instead. Also, if you want to
|
|
181
|
+
* know all the errors with detailed reasons, {@link validate} function will be
|
|
182
|
+
* useful.
|
|
182
183
|
*
|
|
183
|
-
* On the other hand, if you don't want to allow any superfluous property that
|
|
184
|
-
* enrolled to the type `T`, you can use {@link equals} function instead.
|
|
184
|
+
* On the other hand, if you don't want to allow any superfluous property that
|
|
185
|
+
* is not enrolled to the type `T`, you can use {@link equals} function instead.
|
|
185
186
|
*
|
|
187
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
186
188
|
* @template T Type of the input value
|
|
187
189
|
* @param input A value to be tested
|
|
188
190
|
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
189
191
|
* @returns Whether the parametric value is following the type `T` or not
|
|
190
|
-
*
|
|
191
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
192
192
|
*/
|
|
193
193
|
export function is<T>(input: T): input is T;
|
|
194
194
|
|
|
195
195
|
/**
|
|
196
196
|
* Tests a value type.
|
|
197
197
|
*
|
|
198
|
-
* Tests a parametric value type and returns whether it's following the type `T`
|
|
199
|
-
* If the parametric value is matched with the type `T`, `true` value
|
|
200
|
-
* Otherwise, if the parametric value is not following the
|
|
201
|
-
* returned.
|
|
198
|
+
* Tests a parametric value type and returns whether it's following the type `T`
|
|
199
|
+
* or not. If the parametric value is matched with the type `T`, `true` value
|
|
200
|
+
* will be returned. Otherwise, if the parametric value is not following the
|
|
201
|
+
* type `T`, `false` value will be returned.
|
|
202
202
|
*
|
|
203
|
-
* If what you want is not just knowing whether the parametric value is
|
|
204
|
-
* type `T` or not, but throwing an exception with a detailed
|
|
205
|
-
* {@link assert} function instead. Also, if you want to
|
|
206
|
-
* detailed reasons, {@link validate} function will be
|
|
203
|
+
* If what you want is not just knowing whether the parametric value is
|
|
204
|
+
* following the type `T` or not, but throwing an exception with a detailed
|
|
205
|
+
* reason, you can choose {@link assert} function instead. Also, if you want to
|
|
206
|
+
* know all the errors with detailed reasons, {@link validate} function will be
|
|
207
|
+
* useful.
|
|
207
208
|
*
|
|
208
|
-
* On the other hand, if you don't want to allow any superfluous property that
|
|
209
|
-
* enrolled to the type `T`, you can use {@link equals} function instead.
|
|
209
|
+
* On the other hand, if you don't want to allow any superfluous property that
|
|
210
|
+
* is not enrolled to the type `T`, you can use {@link equals} function instead.
|
|
210
211
|
*
|
|
212
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
211
213
|
* @template T Type of the input value
|
|
212
214
|
* @param input A value to be tested
|
|
213
215
|
* @returns Whether the parametric value is following the type `T` or not
|
|
214
|
-
*
|
|
215
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
216
216
|
*/
|
|
217
217
|
export function is<T>(input: unknown): input is T;
|
|
218
218
|
|
|
219
|
-
/**
|
|
220
|
-
* @internal
|
|
221
|
-
*/
|
|
219
|
+
/** @internal */
|
|
222
220
|
export function is(): never {
|
|
223
221
|
NoTransformConfigurationError("is");
|
|
224
222
|
}
|
|
@@ -232,19 +230,19 @@ export function is(): never {
|
|
|
232
230
|
* {@link IValidation.errors} array will be empty and {@link IValidation.success}
|
|
233
231
|
* will have the `true` value.
|
|
234
232
|
*
|
|
235
|
-
* If what you want is not finding all the errors, but asserting the parametric
|
|
236
|
-
* type with exception throwing, you can choose {@link assert} function
|
|
237
|
-
* Otherwise, if you just want to know whether the parametric value is
|
|
238
|
-
* type `T`, {@link is} function is the way to go.
|
|
233
|
+
* If what you want is not finding all the errors, but asserting the parametric
|
|
234
|
+
* value type with exception throwing, you can choose {@link assert} function
|
|
235
|
+
* instead. Otherwise, if you just want to know whether the parametric value is
|
|
236
|
+
* matched with the type `T`, {@link is} function is the way to go.
|
|
239
237
|
*
|
|
240
|
-
* On the other hand, if you don't want to allow any superfluous property that
|
|
241
|
-
* enrolled to the type `T`, you can use {@link validateEquals} function
|
|
238
|
+
* On the other hand, if you don't want to allow any superfluous property that
|
|
239
|
+
* is not enrolled to the type `T`, you can use {@link validateEquals} function
|
|
240
|
+
* instead.
|
|
242
241
|
*
|
|
242
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
243
243
|
* @template T Type of the input value
|
|
244
244
|
* @param input A value to be validated
|
|
245
245
|
* @returns Validation result
|
|
246
|
-
*
|
|
247
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
248
246
|
*/
|
|
249
247
|
export function validate<T>(input: T): IValidation<T>;
|
|
250
248
|
|
|
@@ -257,25 +255,23 @@ export function validate<T>(input: T): IValidation<T>;
|
|
|
257
255
|
* {@link IValidation.errors} array will be empty and {@link IValidation.success}
|
|
258
256
|
* will have the `true` value.
|
|
259
257
|
*
|
|
260
|
-
* If what you want is not finding all the errors, but asserting the parametric
|
|
261
|
-
* type with exception throwing, you can choose {@link assert} function
|
|
262
|
-
* Otherwise, if you just want to know whether the parametric value is
|
|
263
|
-
* type `T`, {@link is} function is the way to go.
|
|
258
|
+
* If what you want is not finding all the errors, but asserting the parametric
|
|
259
|
+
* value type with exception throwing, you can choose {@link assert} function
|
|
260
|
+
* instead. Otherwise, if you just want to know whether the parametric value is
|
|
261
|
+
* matched with the type `T`, {@link is} function is the way to go.
|
|
264
262
|
*
|
|
265
|
-
* On the other hand, if you don't want to allow any superfluous property that
|
|
266
|
-
* enrolled to the type `T`, you can use {@link validateEquals} function
|
|
263
|
+
* On the other hand, if you don't want to allow any superfluous property that
|
|
264
|
+
* is not enrolled to the type `T`, you can use {@link validateEquals} function
|
|
265
|
+
* instead.
|
|
267
266
|
*
|
|
267
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
268
268
|
* @template T Type of the input value
|
|
269
269
|
* @param input A value to be validated
|
|
270
270
|
* @returns Validation result
|
|
271
|
-
*
|
|
272
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
273
271
|
*/
|
|
274
272
|
export function validate<T>(input: unknown): IValidation<T>;
|
|
275
273
|
|
|
276
|
-
/**
|
|
277
|
-
* @internal
|
|
278
|
-
*/
|
|
274
|
+
/** @internal */
|
|
279
275
|
export function validate(): never {
|
|
280
276
|
NoTransformConfigurationError("validate");
|
|
281
277
|
}
|
|
@@ -286,26 +282,26 @@ export function validate(): never {
|
|
|
286
282
|
/**
|
|
287
283
|
* Asserts equality between a value and its type.
|
|
288
284
|
*
|
|
289
|
-
* Asserts a parametric value type and throws a {@link TypeGuardError} with
|
|
290
|
-
* reason, if the parametric value is not following the type `T` or
|
|
291
|
-
* property that is not listed on the type `T` has been found.
|
|
292
|
-
* following the type `T` without any superfluous
|
|
293
|
-
* be returned.
|
|
285
|
+
* Asserts a parametric value type and throws a {@link TypeGuardError} with
|
|
286
|
+
* detailed reason, if the parametric value is not following the type `T` or
|
|
287
|
+
* some superfluous property that is not listed on the type `T` has been found.
|
|
288
|
+
* Otherwise, the value is following the type `T` without any superfluous
|
|
289
|
+
* property, just input parameter would be returned.
|
|
294
290
|
*
|
|
295
|
-
* If what you want is not asserting but just knowing whether the parametric
|
|
296
|
-
* following the type `T` or not, you can choose the {@link equals}
|
|
297
|
-
* Otherwise, if you want to know all the errors,
|
|
291
|
+
* If what you want is not asserting but just knowing whether the parametric
|
|
292
|
+
* value is following the type `T` or not, you can choose the {@link equals}
|
|
293
|
+
* function instead. Otherwise, if you want to know all the errors,
|
|
294
|
+
* {@link validateEquals} is the way to go.
|
|
298
295
|
*
|
|
299
|
-
* On the other hand, if you want to allow superfluous property that is not
|
|
300
|
-
* to the type `T`, you can use {@link assert} function instead.
|
|
296
|
+
* On the other hand, if you want to allow superfluous property that is not
|
|
297
|
+
* enrolled to the type `T`, you can use {@link assert} function instead.
|
|
301
298
|
*
|
|
299
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
302
300
|
* @template T Type of the input value
|
|
303
301
|
* @param input A value to be asserted
|
|
304
302
|
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
305
303
|
* @returns Parametric input value
|
|
306
304
|
* @throws A {@link TypeGuardError} instance with a detailed reason
|
|
307
|
-
*
|
|
308
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
309
305
|
*/
|
|
310
306
|
export function assertEquals<T>(
|
|
311
307
|
input: T,
|
|
@@ -315,35 +311,33 @@ export function assertEquals<T>(
|
|
|
315
311
|
/**
|
|
316
312
|
* Asserts equality between a value and its type.
|
|
317
313
|
*
|
|
318
|
-
* Asserts a parametric value type and throws a {@link TypeGuardError} with
|
|
319
|
-
* reason, if the parametric value is not following the type `T` or
|
|
320
|
-
* property that is not listed on the type `T` has been found.
|
|
321
|
-
* following the type `T` without any superfluous
|
|
322
|
-
* be returned.
|
|
314
|
+
* Asserts a parametric value type and throws a {@link TypeGuardError} with
|
|
315
|
+
* detailed reason, if the parametric value is not following the type `T` or
|
|
316
|
+
* some superfluous property that is not listed on the type `T` has been found.
|
|
317
|
+
* Otherwise, the value is following the type `T` without any superfluous
|
|
318
|
+
* property, just input parameter would be returned.
|
|
323
319
|
*
|
|
324
|
-
* If what you want is not asserting but just knowing whether the parametric
|
|
325
|
-
* following the type `T` or not, you can choose the {@link equals}
|
|
326
|
-
* Otherwise, if you want to know all the errors,
|
|
320
|
+
* If what you want is not asserting but just knowing whether the parametric
|
|
321
|
+
* value is following the type `T` or not, you can choose the {@link equals}
|
|
322
|
+
* function instead. Otherwise, if you want to know all the errors,
|
|
323
|
+
* {@link validateEquals} is the way to go.
|
|
327
324
|
*
|
|
328
|
-
* On the other hand, if you want to allow superfluous property that is not
|
|
329
|
-
* to the type `T`, you can use {@link assert} function instead.
|
|
325
|
+
* On the other hand, if you want to allow superfluous property that is not
|
|
326
|
+
* enrolled to the type `T`, you can use {@link assert} function instead.
|
|
330
327
|
*
|
|
328
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
331
329
|
* @template T Type of the input value
|
|
332
330
|
* @param input A value to be asserted
|
|
333
331
|
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
334
332
|
* @returns Parametric input value casted as `T`
|
|
335
333
|
* @throws A {@link TypeGuardError} instance with a detailed reason
|
|
336
|
-
*
|
|
337
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
338
334
|
*/
|
|
339
335
|
export function assertEquals<T>(
|
|
340
336
|
input: unknown,
|
|
341
337
|
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
342
338
|
): T;
|
|
343
339
|
|
|
344
|
-
/**
|
|
345
|
-
* @internal
|
|
346
|
-
*/
|
|
340
|
+
/** @internal */
|
|
347
341
|
export function assertEquals(): never {
|
|
348
342
|
NoTransformConfigurationError("assertEquals");
|
|
349
343
|
}
|
|
@@ -351,30 +345,31 @@ export function assertEquals(): never {
|
|
|
351
345
|
/**
|
|
352
346
|
* Assertion guard of a type with equality.
|
|
353
347
|
*
|
|
354
|
-
* Asserts a parametric value type and throws a {@link TypeGuardError} with
|
|
355
|
-
* reason, if the parametric value is not following the type `T` or
|
|
356
|
-
* property that is not listed on the type `T` has been found.
|
|
348
|
+
* Asserts a parametric value type and throws a {@link TypeGuardError} with
|
|
349
|
+
* detailed reason, if the parametric value is not following the type `T` or
|
|
350
|
+
* some superfluous property that is not listed on the type `T` has been found.
|
|
357
351
|
*
|
|
358
|
-
* Otherwise, the value is following the type `T` without any superfluous
|
|
359
|
-
* nothing will be returned, but the input value would be
|
|
360
|
-
* the type `T`. This is the concept of "Assertion
|
|
352
|
+
* Otherwise, the value is following the type `T` without any superfluous
|
|
353
|
+
* property, nothing will be returned, but the input value would be
|
|
354
|
+
* automatically casted to the type `T`. This is the concept of "Assertion
|
|
355
|
+
* Guard" of a value type.
|
|
361
356
|
*
|
|
362
|
-
* If what you want is not asserting but just knowing whether the parametric
|
|
363
|
-
* following the type `T` or not, you can choose the {@link equals}
|
|
364
|
-
* Otherwise, if you want to know all the errors,
|
|
365
|
-
* Also, if you want to returns the
|
|
366
|
-
* {@link assert} function
|
|
357
|
+
* If what you want is not asserting but just knowing whether the parametric
|
|
358
|
+
* value is following the type `T` or not, you can choose the {@link equals}
|
|
359
|
+
* function instead. Otherwise, if you want to know all the errors,
|
|
360
|
+
* {@link validateEquals} is the way to go. Also, if you want to returns the
|
|
361
|
+
* parametric value when no problem, you can use {@link assert} function
|
|
362
|
+
* instead.
|
|
367
363
|
*
|
|
368
|
-
* On the other hand, if you want to allow superfluous property that is not
|
|
369
|
-
* to the type `T`, you can use {@link assertEquals} function instead.
|
|
364
|
+
* On the other hand, if you want to allow superfluous property that is not
|
|
365
|
+
* enrolled to the type `T`, you can use {@link assertEquals} function instead.
|
|
370
366
|
*
|
|
367
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
371
368
|
* @template T Type of the input value
|
|
372
369
|
* @param input A value to be asserted
|
|
373
370
|
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
374
371
|
* @returns Parametric input value casted as `T`
|
|
375
372
|
* @throws A {@link TypeGuardError} instance with a detailed reason
|
|
376
|
-
*
|
|
377
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
378
373
|
*/
|
|
379
374
|
export function assertGuardEquals<T>(
|
|
380
375
|
input: T,
|
|
@@ -384,39 +379,38 @@ export function assertGuardEquals<T>(
|
|
|
384
379
|
/**
|
|
385
380
|
* Assertion guard of a type with equality.
|
|
386
381
|
*
|
|
387
|
-
* Asserts a parametric value type and throws a {@link TypeGuardError} with
|
|
388
|
-
* reason, if the parametric value is not following the type `T` or
|
|
389
|
-
* property that is not listed on the type `T` has been found.
|
|
382
|
+
* Asserts a parametric value type and throws a {@link TypeGuardError} with
|
|
383
|
+
* detailed reason, if the parametric value is not following the type `T` or
|
|
384
|
+
* some superfluous property that is not listed on the type `T` has been found.
|
|
390
385
|
*
|
|
391
|
-
* Otherwise, the value is following the type `T` without any superfluous
|
|
392
|
-
* nothing will be returned, but the input value would be
|
|
393
|
-
* the type `T`. This is the concept of "Assertion
|
|
386
|
+
* Otherwise, the value is following the type `T` without any superfluous
|
|
387
|
+
* property, nothing will be returned, but the input value would be
|
|
388
|
+
* automatically casted to the type `T`. This is the concept of "Assertion
|
|
389
|
+
* Guard" of a value type.
|
|
394
390
|
*
|
|
395
|
-
* If what you want is not asserting but just knowing whether the parametric
|
|
396
|
-
* following the type `T` or not, you can choose the {@link equals}
|
|
397
|
-
* Otherwise, if you want to know all the errors,
|
|
398
|
-
* Also, if you want to returns the
|
|
399
|
-
* {@link assertEquals} function
|
|
391
|
+
* If what you want is not asserting but just knowing whether the parametric
|
|
392
|
+
* value is following the type `T` or not, you can choose the {@link equals}
|
|
393
|
+
* function instead. Otherwise, if you want to know all the errors,
|
|
394
|
+
* {@link validateEquals} is the way to go. Also, if you want to returns the
|
|
395
|
+
* parametric value when no problem, you can use {@link assertEquals} function
|
|
396
|
+
* instead.
|
|
400
397
|
*
|
|
401
|
-
* On the other hand, if you want to allow superfluous property that is not
|
|
402
|
-
* to the type `T`, you can use {@link assertGuard} function instead.
|
|
398
|
+
* On the other hand, if you want to allow superfluous property that is not
|
|
399
|
+
* enrolled to the type `T`, you can use {@link assertGuard} function instead.
|
|
403
400
|
*
|
|
401
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
404
402
|
* @template T Type of the input value
|
|
405
403
|
* @param input A value to be asserted
|
|
406
404
|
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
407
405
|
* @returns Parametric input value casted as `T`
|
|
408
406
|
* @throws A {@link TypeGuardError} instance with a detailed reason
|
|
409
|
-
*
|
|
410
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
411
407
|
*/
|
|
412
408
|
export function assertGuardEquals<T>(
|
|
413
409
|
input: unknown,
|
|
414
410
|
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
415
411
|
): asserts input is T;
|
|
416
412
|
|
|
417
|
-
/**
|
|
418
|
-
* @internal
|
|
419
|
-
*/
|
|
413
|
+
/** @internal */
|
|
420
414
|
export function assertGuardEquals(): never {
|
|
421
415
|
NoTransformConfigurationError("assertGuardEquals");
|
|
422
416
|
}
|
|
@@ -424,56 +418,56 @@ export function assertGuardEquals(): never {
|
|
|
424
418
|
/**
|
|
425
419
|
* Tests equality between a value and its type.
|
|
426
420
|
*
|
|
427
|
-
* Tests a parametric value type and returns whether it's equivalent to the type
|
|
428
|
-
* or not. If the parametric value is matched with the type `T` and there's
|
|
429
|
-
* superfluous property that is not listed on the type `T`, `true` value
|
|
430
|
-
* returned. Otherwise, if the parametric value is not following the
|
|
431
|
-
* superfluous property exists, `false` value will be
|
|
421
|
+
* Tests a parametric value type and returns whether it's equivalent to the type
|
|
422
|
+
* `T` or not. If the parametric value is matched with the type `T` and there's
|
|
423
|
+
* not any superfluous property that is not listed on the type `T`, `true` value
|
|
424
|
+
* will be returned. Otherwise, if the parametric value is not following the
|
|
425
|
+
* type `T` or some superfluous property exists, `false` value will be
|
|
426
|
+
* returned.
|
|
432
427
|
*
|
|
433
|
-
* If what you want is not just knowing whether the parametric value is
|
|
434
|
-
* type `T` or not, but throwing an exception with a detailed
|
|
435
|
-
* {@link assertEquals} function instead. Also, if you
|
|
436
|
-
* detailed reasons, {@link validateEquals}
|
|
428
|
+
* If what you want is not just knowing whether the parametric value is
|
|
429
|
+
* following the type `T` or not, but throwing an exception with a detailed
|
|
430
|
+
* reason, you can choose {@link assertEquals} function instead. Also, if you
|
|
431
|
+
* want to know all the errors with detailed reasons, {@link validateEquals}
|
|
432
|
+
* function will be useful.
|
|
437
433
|
*
|
|
438
|
-
* On the other hand, if you want to allow superfluous property that is not
|
|
439
|
-
* to the type `T`, you can use {@link is} function instead.
|
|
434
|
+
* On the other hand, if you want to allow superfluous property that is not
|
|
435
|
+
* enrolled to the type `T`, you can use {@link is} function instead.
|
|
440
436
|
*
|
|
437
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
441
438
|
* @template T Type of the input value
|
|
442
439
|
* @param input A value to be tested
|
|
443
440
|
* @returns Whether the parametric value is equivalent to the type `T` or not
|
|
444
|
-
*
|
|
445
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
446
441
|
*/
|
|
447
442
|
export function equals<T>(input: T): input is T;
|
|
448
443
|
|
|
449
444
|
/**
|
|
450
445
|
* Tests equality between a value and its type.
|
|
451
446
|
*
|
|
452
|
-
* Tests a parametric value type and returns whether it's equivalent to the type
|
|
453
|
-
* or not. If the parametric value is matched with the type `T` and there's
|
|
454
|
-
* superfluous property that is not listed on the type `T`, `true` value
|
|
455
|
-
* returned. Otherwise, if the parametric value is not following the
|
|
456
|
-
* superfluous property exists, `false` value will be
|
|
447
|
+
* Tests a parametric value type and returns whether it's equivalent to the type
|
|
448
|
+
* `T` or not. If the parametric value is matched with the type `T` and there's
|
|
449
|
+
* not any superfluous property that is not listed on the type `T`, `true` value
|
|
450
|
+
* will be returned. Otherwise, if the parametric value is not following the
|
|
451
|
+
* type `T` or some superfluous property exists, `false` value will be
|
|
452
|
+
* returned.
|
|
457
453
|
*
|
|
458
|
-
* If what you want is not just knowing whether the parametric value is
|
|
459
|
-
* type `T` or not, but throwing an exception with a detailed
|
|
460
|
-
* {@link assertEquals} function instead. Also, if you
|
|
461
|
-
* detailed reasons, {@link validateEquals}
|
|
454
|
+
* If what you want is not just knowing whether the parametric value is
|
|
455
|
+
* following the type `T` or not, but throwing an exception with a detailed
|
|
456
|
+
* reason, you can choose {@link assertEquals} function instead. Also, if you
|
|
457
|
+
* want to know all the errors with detailed reasons, {@link validateEquals}
|
|
458
|
+
* function will be useful.
|
|
462
459
|
*
|
|
463
|
-
* On the other hand, if you want to allow superfluous property that is not
|
|
464
|
-
* to the type `T`, you can use {@link is} function instead.
|
|
460
|
+
* On the other hand, if you want to allow superfluous property that is not
|
|
461
|
+
* enrolled to the type `T`, you can use {@link is} function instead.
|
|
465
462
|
*
|
|
463
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
466
464
|
* @template T Type of the input value
|
|
467
465
|
* @param input A value to be tested
|
|
468
466
|
* @returns Whether the parametric value is equivalent to the type `T` or not
|
|
469
|
-
*
|
|
470
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
471
467
|
*/
|
|
472
468
|
export function equals<T>(input: unknown): input is T;
|
|
473
469
|
|
|
474
|
-
/**
|
|
475
|
-
* @internal
|
|
476
|
-
*/
|
|
470
|
+
/** @internal */
|
|
477
471
|
export function equals(): never {
|
|
478
472
|
NoTransformConfigurationError("equals");
|
|
479
473
|
}
|
|
@@ -483,24 +477,24 @@ export function equals(): never {
|
|
|
483
477
|
*
|
|
484
478
|
* Validates a parametric value type and archives all the type errors into an
|
|
485
479
|
* {@link IValidation.errors} array, if the parametric value is not following the
|
|
486
|
-
* type `T` or some superfluous property that is not listed on the type `T` has
|
|
487
|
-
* found. Of course, if the parametric value is following the type `T` and
|
|
488
|
-
* superfluous property exists, the {@link IValidation.errors} array would be
|
|
489
|
-
* and {@link IValidation.success} would have the `true` value.
|
|
480
|
+
* type `T` or some superfluous property that is not listed on the type `T` has
|
|
481
|
+
* been found. Of course, if the parametric value is following the type `T` and
|
|
482
|
+
* no superfluous property exists, the {@link IValidation.errors} array would be
|
|
483
|
+
* empty and {@link IValidation.success} would have the `true` value.
|
|
490
484
|
*
|
|
491
|
-
* If what you want is not finding all the error, but asserting the parametric
|
|
492
|
-
* type with exception throwing, you can choose {@link assert} function
|
|
493
|
-
* Otherwise, you just want to know whether the parametric value is
|
|
494
|
-
* type `T`, {@link is} function is the way to go.
|
|
485
|
+
* If what you want is not finding all the error, but asserting the parametric
|
|
486
|
+
* value type with exception throwing, you can choose {@link assert} function
|
|
487
|
+
* instead. Otherwise, you just want to know whether the parametric value is
|
|
488
|
+
* matched with the type `T`, {@link is} function is the way to go.
|
|
495
489
|
*
|
|
496
|
-
* On the other hand, if you don't want to allow any superfluous property that
|
|
497
|
-
* enrolled to the type `T`, you can use {@link validateEquals} function
|
|
490
|
+
* On the other hand, if you don't want to allow any superfluous property that
|
|
491
|
+
* is not enrolled to the type `T`, you can use {@link validateEquals} function
|
|
492
|
+
* instead.
|
|
498
493
|
*
|
|
499
|
-
* @
|
|
494
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
495
|
+
* @template Type Of the input value
|
|
500
496
|
* @param input A value to be validated
|
|
501
497
|
* @returns Validation result
|
|
502
|
-
*
|
|
503
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
504
498
|
*/
|
|
505
499
|
export function validateEquals<T>(input: T): IValidation<T>;
|
|
506
500
|
|
|
@@ -509,30 +503,28 @@ export function validateEquals<T>(input: T): IValidation<T>;
|
|
|
509
503
|
*
|
|
510
504
|
* Validates a parametric value type and archives all the type errors into an
|
|
511
505
|
* {@link IValidation.errors} array, if the parametric value is not following the
|
|
512
|
-
* type `T` or some superfluous property that is not listed on the type `T` has
|
|
513
|
-
* found. Of course, if the parametric value is following the type `T` and
|
|
514
|
-
* superfluous property exists, the {@link IValidation.errors} array would be
|
|
515
|
-
* and {@link IValidation.success} would have the `true` value.
|
|
506
|
+
* type `T` or some superfluous property that is not listed on the type `T` has
|
|
507
|
+
* been found. Of course, if the parametric value is following the type `T` and
|
|
508
|
+
* no superfluous property exists, the {@link IValidation.errors} array would be
|
|
509
|
+
* empty and {@link IValidation.success} would have the `true` value.
|
|
516
510
|
*
|
|
517
|
-
* If what you want is not finding all the error, but asserting the parametric
|
|
518
|
-
* type with exception throwing, you can choose {@link assert} function
|
|
519
|
-
* Otherwise, you just want to know whether the parametric value is
|
|
520
|
-
* type `T`, {@link is} function is the way to go.
|
|
511
|
+
* If what you want is not finding all the error, but asserting the parametric
|
|
512
|
+
* value type with exception throwing, you can choose {@link assert} function
|
|
513
|
+
* instead. Otherwise, you just want to know whether the parametric value is
|
|
514
|
+
* matched with the type `T`, {@link is} function is the way to go.
|
|
521
515
|
*
|
|
522
|
-
* On the other hand, if you don't want to allow any superfluous property that
|
|
523
|
-
* enrolled to the type `T`, you can use {@link validateEquals} function
|
|
516
|
+
* On the other hand, if you don't want to allow any superfluous property that
|
|
517
|
+
* is not enrolled to the type `T`, you can use {@link validateEquals} function
|
|
518
|
+
* instead.
|
|
524
519
|
*
|
|
525
|
-
* @
|
|
520
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
521
|
+
* @template Type Of the input value
|
|
526
522
|
* @param input A value to be validated
|
|
527
523
|
* @returns Validation result
|
|
528
|
-
*
|
|
529
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
530
524
|
*/
|
|
531
525
|
export function validateEquals<T>(input: unknown): IValidation<T>;
|
|
532
526
|
|
|
533
|
-
/**
|
|
534
|
-
* @internal
|
|
535
|
-
*/
|
|
527
|
+
/** @internal */
|
|
536
528
|
export function validateEquals(): never {
|
|
537
529
|
NoTransformConfigurationError("validateEquals");
|
|
538
530
|
}
|
|
@@ -552,11 +544,10 @@ export function validateEquals(): never {
|
|
|
552
544
|
* be ignored. Also, when the type `T` has a `toJSON()` method, its return type
|
|
553
545
|
* will be generated instead.
|
|
554
546
|
*
|
|
547
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
555
548
|
* @template T Type of data to generate
|
|
556
549
|
* @param generator Random data generator
|
|
557
|
-
* @
|
|
558
|
-
*
|
|
559
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
550
|
+
* @returns Randomly generated data
|
|
560
551
|
*/
|
|
561
552
|
export function random(generator?: Partial<IRandomGenerator>): never;
|
|
562
553
|
|
|
@@ -570,17 +561,14 @@ export function random(generator?: Partial<IRandomGenerator>): never;
|
|
|
570
561
|
* be ignored. Also, when the type `T` has a `toJSON()` method, its return type
|
|
571
562
|
* will be generated instead.
|
|
572
563
|
*
|
|
564
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
573
565
|
* @template T Type of data to generate
|
|
574
566
|
* @param generator Random data generator
|
|
575
|
-
* @
|
|
576
|
-
*
|
|
577
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
567
|
+
* @returns Randomly generated data
|
|
578
568
|
*/
|
|
579
569
|
export function random<T>(generator?: Partial<IRandomGenerator>): Resolved<T>;
|
|
580
570
|
|
|
581
|
-
/**
|
|
582
|
-
* @internal
|
|
583
|
-
*/
|
|
571
|
+
/** @internal */
|
|
584
572
|
export function random(): never {
|
|
585
573
|
NoTransformConfigurationError("random");
|
|
586
574
|
}
|
|
@@ -591,12 +579,11 @@ export function random(): never {
|
|
|
591
579
|
/**
|
|
592
580
|
* Creates a reusable {@link assert} function.
|
|
593
581
|
*
|
|
594
|
-
* @
|
|
582
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
595
583
|
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
596
584
|
* @returns Nothing until you configure the generic argument `T`
|
|
597
|
-
* @throws
|
|
598
|
-
*
|
|
599
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
585
|
+
* @throws Compile error
|
|
586
|
+
* @danger You must configure the generic argument `T`
|
|
600
587
|
*/
|
|
601
588
|
export function createAssert(
|
|
602
589
|
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
@@ -605,19 +592,16 @@ export function createAssert(
|
|
|
605
592
|
/**
|
|
606
593
|
* Creates a reusable {@link assert} function.
|
|
607
594
|
*
|
|
595
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
608
596
|
* @template T Type of the input value
|
|
609
597
|
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
610
598
|
* @returns A reusable `assert` function
|
|
611
|
-
*
|
|
612
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
613
599
|
*/
|
|
614
600
|
export function createAssert<T>(
|
|
615
601
|
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
616
602
|
): (input: unknown) => T;
|
|
617
603
|
|
|
618
|
-
/**
|
|
619
|
-
* @internal
|
|
620
|
-
*/
|
|
604
|
+
/** @internal */
|
|
621
605
|
export function createAssert<T>(): (input: unknown) => T {
|
|
622
606
|
NoTransformConfigurationError("createAssert");
|
|
623
607
|
}
|
|
@@ -626,8 +610,8 @@ export function createAssert<T>(): (input: unknown) => T {
|
|
|
626
610
|
* Creates a reusable {@link assertGuard} function.
|
|
627
611
|
*
|
|
628
612
|
* Note that, you've to declare the variable type of the factory function caller
|
|
629
|
-
* like below. If you don't declare the variable type, compilation error be
|
|
630
|
-
* This is the special rule of the TypeScript compiler.
|
|
613
|
+
* like below. If you don't declare the variable type, compilation error be
|
|
614
|
+
* thrown. This is the special rule of the TypeScript compiler.
|
|
631
615
|
*
|
|
632
616
|
* ```typescript
|
|
633
617
|
* // MUST DECLARE THE VARIABLE TYPE
|
|
@@ -637,15 +621,14 @@ export function createAssert<T>(): (input: unknown) => T {
|
|
|
637
621
|
* const func = typia.createAssertGuard<number>();
|
|
638
622
|
* ```
|
|
639
623
|
*
|
|
640
|
-
* >
|
|
641
|
-
* >
|
|
624
|
+
* > _Assertions require every name in the call target to be declared with an_
|
|
625
|
+
* > _explicit type annotation._
|
|
642
626
|
*
|
|
643
|
-
* @
|
|
627
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
644
628
|
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
645
629
|
* @returns Nothing until you configure the generic argument `T`
|
|
646
|
-
* @throws
|
|
647
|
-
*
|
|
648
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
630
|
+
* @throws Compile error
|
|
631
|
+
* @danger You must configure the generic argument `T`
|
|
649
632
|
*/
|
|
650
633
|
export function createAssertGuard(
|
|
651
634
|
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
@@ -655,8 +638,8 @@ export function createAssertGuard(
|
|
|
655
638
|
* Creates a reusable {@link assertGuard} function.
|
|
656
639
|
*
|
|
657
640
|
* Note that, you've to declare the variable type of the factory function caller
|
|
658
|
-
* like below. If you don't declare the variable type, compilation error be
|
|
659
|
-
* This is the special rule of the TypeScript compiler.
|
|
641
|
+
* like below. If you don't declare the variable type, compilation error be
|
|
642
|
+
* thrown. This is the special rule of the TypeScript compiler.
|
|
660
643
|
*
|
|
661
644
|
* ```typescript
|
|
662
645
|
* // MUST DECLARE THE VARIABLE TYPE
|
|
@@ -666,22 +649,19 @@ export function createAssertGuard(
|
|
|
666
649
|
* const func = typia.createAssertGuard<number>();
|
|
667
650
|
* ```
|
|
668
651
|
*
|
|
669
|
-
* >
|
|
670
|
-
* >
|
|
671
|
-
*
|
|
672
|
-
* @returns Nothing until you configure the generic argument `T`
|
|
673
|
-
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
674
|
-
* @throws compile error
|
|
652
|
+
* > _Assertions require every name in the call target to be declared with an_
|
|
653
|
+
* > _explicit type annotation._
|
|
675
654
|
*
|
|
676
655
|
* @author Jeongho Nam - https://github.com/samchon
|
|
656
|
+
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
657
|
+
* @returns Nothing until you configure the generic argument `T`
|
|
658
|
+
* @throws Compile error
|
|
677
659
|
*/
|
|
678
660
|
export function createAssertGuard<T>(
|
|
679
661
|
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
680
662
|
): (input: unknown) => AssertionGuard<T>;
|
|
681
663
|
|
|
682
|
-
/**
|
|
683
|
-
* @internal
|
|
684
|
-
*/
|
|
664
|
+
/** @internal */
|
|
685
665
|
export function createAssertGuard<T>(): (input: unknown) => AssertionGuard<T> {
|
|
686
666
|
NoTransformConfigurationError("createAssertGuard");
|
|
687
667
|
}
|
|
@@ -689,27 +669,23 @@ export function createAssertGuard<T>(): (input: unknown) => AssertionGuard<T> {
|
|
|
689
669
|
/**
|
|
690
670
|
* Creates a reusable {@link is} function.
|
|
691
671
|
*
|
|
692
|
-
* @danger You must configure the generic argument `T`
|
|
693
|
-
* @returns Nothing until you configure the generic argument `T`
|
|
694
|
-
* @throws compile error
|
|
695
|
-
*
|
|
696
672
|
* @author Jeongho Nam - https://github.com/samchon
|
|
673
|
+
* @returns Nothing until you configure the generic argument `T`
|
|
674
|
+
* @throws Compile error
|
|
675
|
+
* @danger You must configure the generic argument `T`
|
|
697
676
|
*/
|
|
698
677
|
export function createIs(): never;
|
|
699
678
|
|
|
700
679
|
/**
|
|
701
680
|
* Creates a reusable {@link is} function.
|
|
702
681
|
*
|
|
682
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
703
683
|
* @template T Type of the input value
|
|
704
684
|
* @returns A reusable `is` function
|
|
705
|
-
*
|
|
706
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
707
685
|
*/
|
|
708
686
|
export function createIs<T>(): (input: unknown) => input is T;
|
|
709
687
|
|
|
710
|
-
/**
|
|
711
|
-
* @internal
|
|
712
|
-
*/
|
|
688
|
+
/** @internal */
|
|
713
689
|
export function createIs<T>(): (input: unknown) => input is T {
|
|
714
690
|
NoTransformConfigurationError("createIs");
|
|
715
691
|
}
|
|
@@ -717,28 +693,24 @@ export function createIs<T>(): (input: unknown) => input is T {
|
|
|
717
693
|
/**
|
|
718
694
|
* Creates a reusable {@link validate} function.
|
|
719
695
|
*
|
|
720
|
-
* @danger You must configure the generic argument `T`
|
|
721
|
-
* @returns Nothing until you configure the generic argument `T`
|
|
722
|
-
* @throws compile error
|
|
723
|
-
*
|
|
724
696
|
* @author Jeongho Nam - https://github.com/samchon
|
|
697
|
+
* @returns Nothing until you configure the generic argument `T`
|
|
698
|
+
* @throws Compile error
|
|
699
|
+
* @danger You must configure the generic argument `T`
|
|
725
700
|
*/
|
|
726
701
|
export function createValidate(): never;
|
|
727
702
|
|
|
728
703
|
/**
|
|
729
704
|
* Creates a reusable {@link validate} function.
|
|
730
705
|
*
|
|
706
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
731
707
|
* @template T Type of the input value
|
|
732
708
|
* @returns A reusable `validate` function
|
|
733
|
-
*
|
|
734
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
735
709
|
*/
|
|
736
710
|
export function createValidate<T>(): ((input: unknown) => IValidation<T>) &
|
|
737
711
|
StandardSchemaV1<unknown, T>;
|
|
738
712
|
|
|
739
|
-
/**
|
|
740
|
-
* @internal
|
|
741
|
-
*/
|
|
713
|
+
/** @internal */
|
|
742
714
|
export function createValidate(): ((input: unknown) => IValidation) &
|
|
743
715
|
StandardSchemaV1<unknown, unknown> {
|
|
744
716
|
NoTransformConfigurationError("createValidate");
|
|
@@ -747,12 +719,11 @@ export function createValidate(): ((input: unknown) => IValidation) &
|
|
|
747
719
|
/**
|
|
748
720
|
* Creates a reusable {@link assertEquals} function.
|
|
749
721
|
*
|
|
750
|
-
* @
|
|
722
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
751
723
|
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
752
724
|
* @returns Nothing until you configure the generic argument `T`
|
|
753
|
-
* @throws
|
|
754
|
-
*
|
|
755
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
725
|
+
* @throws Compile error
|
|
726
|
+
* @danger You must configure the generic argument `T`
|
|
756
727
|
*/
|
|
757
728
|
export function createAssertEquals(
|
|
758
729
|
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
@@ -761,19 +732,16 @@ export function createAssertEquals(
|
|
|
761
732
|
/**
|
|
762
733
|
* Creates a reusable {@link assertEquals} function.
|
|
763
734
|
*
|
|
735
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
764
736
|
* @template T Type of the input value
|
|
765
737
|
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
766
738
|
* @returns A reusable `assertEquals` function
|
|
767
|
-
*
|
|
768
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
769
739
|
*/
|
|
770
740
|
export function createAssertEquals<T>(
|
|
771
741
|
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
772
742
|
): (input: unknown) => T;
|
|
773
743
|
|
|
774
|
-
/**
|
|
775
|
-
* @internal
|
|
776
|
-
*/
|
|
744
|
+
/** @internal */
|
|
777
745
|
export function createAssertEquals<T>(): (input: unknown) => T {
|
|
778
746
|
NoTransformConfigurationError("createAssertEquals");
|
|
779
747
|
}
|
|
@@ -782,8 +750,8 @@ export function createAssertEquals<T>(): (input: unknown) => T {
|
|
|
782
750
|
* Creates a reusable {@link assertGuardEquals} function.
|
|
783
751
|
*
|
|
784
752
|
* Note that, you've to declare the variable type of the factory function caller
|
|
785
|
-
* like below. If you don't declare the variable type, compilation error be
|
|
786
|
-
* This is the special rule of the TypeScript compiler.
|
|
753
|
+
* like below. If you don't declare the variable type, compilation error be
|
|
754
|
+
* thrown. This is the special rule of the TypeScript compiler.
|
|
787
755
|
*
|
|
788
756
|
* ```typescript
|
|
789
757
|
* // MUST DECLARE THE VARIABLE TYPE
|
|
@@ -793,15 +761,14 @@ export function createAssertEquals<T>(): (input: unknown) => T {
|
|
|
793
761
|
* const func = typia.createAssertGuardEquals<number>();
|
|
794
762
|
* ```
|
|
795
763
|
*
|
|
796
|
-
* >
|
|
797
|
-
* >
|
|
764
|
+
* > _Assertions require every name in the call target to be declared with an_
|
|
765
|
+
* > _explicit type annotation._
|
|
798
766
|
*
|
|
799
|
-
* @
|
|
767
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
800
768
|
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
801
769
|
* @returns Nothing until you configure the generic argument `T`
|
|
802
|
-
* @throws
|
|
803
|
-
*
|
|
804
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
770
|
+
* @throws Compile error
|
|
771
|
+
* @danger You must configure the generic argument `T`
|
|
805
772
|
*/
|
|
806
773
|
export function createAssertGuardEquals(
|
|
807
774
|
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
@@ -811,8 +778,8 @@ export function createAssertGuardEquals(
|
|
|
811
778
|
* Creates a reusable {@link assertGuardEquals} function.
|
|
812
779
|
*
|
|
813
780
|
* Note that, you've to declare the variable type of the factory function caller
|
|
814
|
-
* like below. If you don't declare the variable type, compilation error be
|
|
815
|
-
* This is the special rule of the TypeScript compiler.
|
|
781
|
+
* like below. If you don't declare the variable type, compilation error be
|
|
782
|
+
* thrown. This is the special rule of the TypeScript compiler.
|
|
816
783
|
*
|
|
817
784
|
* ```typescript
|
|
818
785
|
* // MUST DECLARE THE VARIABLE TYPE
|
|
@@ -822,22 +789,19 @@ export function createAssertGuardEquals(
|
|
|
822
789
|
* const func = typia.createAssertGuardEquals<number>();
|
|
823
790
|
* ```
|
|
824
791
|
*
|
|
825
|
-
* >
|
|
826
|
-
* >
|
|
792
|
+
* > _Assertions require every name in the call target to be declared with an_
|
|
793
|
+
* > _explicit type annotation._
|
|
827
794
|
*
|
|
795
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
828
796
|
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
829
797
|
* @returns Nothing until you configure the generic argument `T`
|
|
830
|
-
* @throws
|
|
831
|
-
*
|
|
832
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
798
|
+
* @throws Compile error
|
|
833
799
|
*/
|
|
834
800
|
export function createAssertGuardEquals<T>(
|
|
835
801
|
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
836
802
|
): (input: unknown) => AssertionGuard<T>;
|
|
837
803
|
|
|
838
|
-
/**
|
|
839
|
-
* @internal
|
|
840
|
-
*/
|
|
804
|
+
/** @internal */
|
|
841
805
|
export function createAssertGuardEquals<T>(): (
|
|
842
806
|
input: unknown,
|
|
843
807
|
) => AssertionGuard<T> {
|
|
@@ -847,27 +811,23 @@ export function createAssertGuardEquals<T>(): (
|
|
|
847
811
|
/**
|
|
848
812
|
* Creates a reusable {@link equals} function.
|
|
849
813
|
*
|
|
850
|
-
* @danger You must configure the generic argument `T`
|
|
851
|
-
* @returns Nothing until you configure the generic argument `T`
|
|
852
|
-
* @throws compile error
|
|
853
|
-
*
|
|
854
814
|
* @author Jeongho Nam - https://github.com/samchon
|
|
815
|
+
* @returns Nothing until you configure the generic argument `T`
|
|
816
|
+
* @throws Compile error
|
|
817
|
+
* @danger You must configure the generic argument `T`
|
|
855
818
|
*/
|
|
856
819
|
export function createEquals(): never;
|
|
857
820
|
|
|
858
821
|
/**
|
|
859
822
|
* Creates a reusable {@link equals} function.
|
|
860
823
|
*
|
|
824
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
861
825
|
* @template T Type of the input value
|
|
862
826
|
* @returns A reusable `equals` function
|
|
863
|
-
*
|
|
864
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
865
827
|
*/
|
|
866
828
|
export function createEquals<T>(): (input: unknown) => input is T;
|
|
867
829
|
|
|
868
|
-
/**
|
|
869
|
-
* @internal
|
|
870
|
-
*/
|
|
830
|
+
/** @internal */
|
|
871
831
|
export function createEquals<T>(): (input: unknown) => input is T {
|
|
872
832
|
NoTransformConfigurationError("createEquals");
|
|
873
833
|
}
|
|
@@ -875,30 +835,26 @@ export function createEquals<T>(): (input: unknown) => input is T {
|
|
|
875
835
|
/**
|
|
876
836
|
* Creates a reusable {@link validateEquals} function.
|
|
877
837
|
*
|
|
878
|
-
* @danger You must configure the generic argument `T`
|
|
879
|
-
* @returns Nothing until you configure the generic argument `T`
|
|
880
|
-
* @throws compile error
|
|
881
|
-
*
|
|
882
838
|
* @author Jeongho Nam - https://github.com/samchon
|
|
839
|
+
* @returns Nothing until you configure the generic argument `T`
|
|
840
|
+
* @throws Compile error
|
|
841
|
+
* @danger You must configure the generic argument `T`
|
|
883
842
|
*/
|
|
884
843
|
export function createValidateEquals(): never;
|
|
885
844
|
|
|
886
845
|
/**
|
|
887
846
|
* Creates a reusable {@link validateEquals} function.
|
|
888
847
|
*
|
|
848
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
889
849
|
* @template T Type of the input value
|
|
890
850
|
* @returns A reusable `validateEquals` function
|
|
891
|
-
*
|
|
892
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
893
851
|
*/
|
|
894
852
|
export function createValidateEquals<T>(): ((
|
|
895
853
|
input: unknown,
|
|
896
854
|
) => IValidation<T>) &
|
|
897
855
|
StandardSchemaV1<unknown, T>;
|
|
898
856
|
|
|
899
|
-
/**
|
|
900
|
-
* @internal
|
|
901
|
-
*/
|
|
857
|
+
/** @internal */
|
|
902
858
|
export function createValidateEquals(): ((input: unknown) => IValidation) &
|
|
903
859
|
StandardSchemaV1<unknown, unknown> {
|
|
904
860
|
NoTransformConfigurationError("createValidateEquals");
|
|
@@ -907,31 +863,27 @@ export function createValidateEquals(): ((input: unknown) => IValidation) &
|
|
|
907
863
|
/**
|
|
908
864
|
* Creates a reusable {@link random} function.
|
|
909
865
|
*
|
|
910
|
-
* @
|
|
866
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
911
867
|
* @param generator Random data generator
|
|
912
868
|
* @returns Nothing until you configure the generic argument `T`
|
|
913
|
-
* @throws
|
|
914
|
-
*
|
|
915
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
869
|
+
* @throws Compile error
|
|
870
|
+
* @danger You must configure the generic argument `T`
|
|
916
871
|
*/
|
|
917
872
|
export function createRandom(generator?: Partial<IRandomGenerator>): never;
|
|
918
873
|
|
|
919
874
|
/**
|
|
920
875
|
* Creates a reusable {@link random} function.
|
|
921
876
|
*
|
|
877
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
922
878
|
* @template T Type of the input value
|
|
923
879
|
* @param generator Random data generator
|
|
924
880
|
* @returns A reusable `random` function
|
|
925
|
-
*
|
|
926
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
927
881
|
*/
|
|
928
882
|
export function createRandom<T>(
|
|
929
883
|
generator?: Partial<IRandomGenerator>,
|
|
930
884
|
): () => Resolved<T>;
|
|
931
885
|
|
|
932
|
-
/**
|
|
933
|
-
* @internal
|
|
934
|
-
*/
|
|
886
|
+
/** @internal */
|
|
935
887
|
export function createRandom(): never {
|
|
936
888
|
NoTransformConfigurationError("createRandom");
|
|
937
889
|
}
|