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/lib/tags/Pattern.d.mts
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
import { TagBase } from "./TagBase";
|
|
2
|
+
/**
|
|
3
|
+
* String pattern (regular expression) constraint tag.
|
|
4
|
+
*
|
|
5
|
+
* Validates that a string matches a specified regular expression pattern. Use
|
|
6
|
+
* this tag to enforce custom string formats through regex validation.
|
|
7
|
+
*
|
|
8
|
+
* Examples:
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* type PhoneNumber = string & Pattern<"^\d{3}-\d{3}-\d{4}$">; // 123-456-7890
|
|
12
|
+
* type HexColor = string & Pattern<"^#[0-9A-Fa-f]{6}$">; // #FF5733
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* Note: This tag is mutually exclusive with the Format tag. You cannot use both
|
|
16
|
+
* Pattern and Format on the same type.
|
|
17
|
+
*
|
|
18
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
19
|
+
*/
|
|
2
20
|
export type Pattern<Value extends string> = TagBase<{
|
|
3
21
|
target: "string";
|
|
4
22
|
kind: "pattern";
|
package/lib/tags/Pattern.d.ts
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
import { TagBase } from "./TagBase";
|
|
2
|
+
/**
|
|
3
|
+
* String pattern (regular expression) constraint tag.
|
|
4
|
+
*
|
|
5
|
+
* Validates that a string matches a specified regular expression pattern. Use
|
|
6
|
+
* this tag to enforce custom string formats through regex validation.
|
|
7
|
+
*
|
|
8
|
+
* Examples:
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* type PhoneNumber = string & Pattern<"^\d{3}-\d{3}-\d{4}$">; // 123-456-7890
|
|
12
|
+
* type HexColor = string & Pattern<"^#[0-9A-Fa-f]{6}$">; // #FF5733
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* Note: This tag is mutually exclusive with the Format tag. You cannot use both
|
|
16
|
+
* Pattern and Format on the same type.
|
|
17
|
+
*
|
|
18
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
19
|
+
*/
|
|
2
20
|
export type Pattern<Value extends string> = TagBase<{
|
|
3
21
|
target: "string";
|
|
4
22
|
kind: "pattern";
|
package/lib/tags/Sequence.d.mts
CHANGED
|
@@ -1,4 +1,31 @@
|
|
|
1
1
|
import { TagBase } from "./TagBase";
|
|
2
|
+
/**
|
|
3
|
+
* Assigns unique field numbers for Protocol Buffer serialization.
|
|
4
|
+
*
|
|
5
|
+
* In Protocol Buffer encoding, each field in a message must have a unique
|
|
6
|
+
* numeric identifier. The Sequence tag assigns these field numbers to
|
|
7
|
+
* TypeScript properties, enabling proper Protocol Buffer serialization and
|
|
8
|
+
* deserialization. Field numbers 1-15 require only one byte to encode, making
|
|
9
|
+
* them ideal for frequently used fields. Numbers 19000-19999 are reserved by
|
|
10
|
+
* the Protocol Buffer specification and should not be used.
|
|
11
|
+
*
|
|
12
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* interface User {
|
|
16
|
+
* id: string & Sequence<1>; // Most frequent field uses 1
|
|
17
|
+
* email: string & Sequence<2>; // Common fields use low numbers
|
|
18
|
+
* createdAt: number & Sequence<3>;
|
|
19
|
+
* metadata?: object & Sequence<10>; // Optional fields work too
|
|
20
|
+
* }
|
|
21
|
+
*
|
|
22
|
+
* // Generate Protocol Buffer message
|
|
23
|
+
* const message = typia.protobuf.message<User>();
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @template N - Field number (positive integer from 1 to 536,870,911, excluding
|
|
27
|
+
* 19000-19999)
|
|
28
|
+
*/
|
|
2
29
|
export type Sequence<N extends number> = TagBase<{
|
|
3
30
|
target: "boolean" | "bigint" | "number" | "string" | "array" | "object";
|
|
4
31
|
kind: "sequence";
|
package/lib/tags/Sequence.d.ts
CHANGED
|
@@ -1,4 +1,31 @@
|
|
|
1
1
|
import { TagBase } from "./TagBase";
|
|
2
|
+
/**
|
|
3
|
+
* Assigns unique field numbers for Protocol Buffer serialization.
|
|
4
|
+
*
|
|
5
|
+
* In Protocol Buffer encoding, each field in a message must have a unique
|
|
6
|
+
* numeric identifier. The Sequence tag assigns these field numbers to
|
|
7
|
+
* TypeScript properties, enabling proper Protocol Buffer serialization and
|
|
8
|
+
* deserialization. Field numbers 1-15 require only one byte to encode, making
|
|
9
|
+
* them ideal for frequently used fields. Numbers 19000-19999 are reserved by
|
|
10
|
+
* the Protocol Buffer specification and should not be used.
|
|
11
|
+
*
|
|
12
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* interface User {
|
|
16
|
+
* id: string & Sequence<1>; // Most frequent field uses 1
|
|
17
|
+
* email: string & Sequence<2>; // Common fields use low numbers
|
|
18
|
+
* createdAt: number & Sequence<3>;
|
|
19
|
+
* metadata?: object & Sequence<10>; // Optional fields work too
|
|
20
|
+
* }
|
|
21
|
+
*
|
|
22
|
+
* // Generate Protocol Buffer message
|
|
23
|
+
* const message = typia.protobuf.message<User>();
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @template N - Field number (positive integer from 1 to 536,870,911, excluding
|
|
27
|
+
* 19000-19999)
|
|
28
|
+
*/
|
|
2
29
|
export type Sequence<N extends number> = TagBase<{
|
|
3
30
|
target: "boolean" | "bigint" | "number" | "string" | "array" | "object";
|
|
4
31
|
kind: "sequence";
|
package/lib/tags/TagBase.d.mts
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base type for all validation tags in typia.
|
|
3
|
+
*
|
|
4
|
+
* TagBase provides the foundation for all typia's validation tags. It attaches
|
|
5
|
+
* metadata to TypeScript types that typia's transformer processes at
|
|
6
|
+
* compile-time to generate optimized runtime validation code.
|
|
7
|
+
*
|
|
8
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* // Custom tag example
|
|
12
|
+
* type MyCustomTag<Value extends number> = TagBase<{
|
|
13
|
+
* target: "number";
|
|
14
|
+
* kind: "MyCustom";
|
|
15
|
+
* value: Value;
|
|
16
|
+
* validate: `$input === ${Value}`;
|
|
17
|
+
* }>;
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @template Props - Tag properties that define validation behavior
|
|
21
|
+
*/
|
|
1
22
|
export type TagBase<Props extends TagBase.IProps<any, any, any, any, any, any>> = {
|
|
2
23
|
/**
|
|
3
24
|
* This is a dummy property for compilation.
|
|
@@ -7,33 +28,34 @@ export type TagBase<Props extends TagBase.IProps<any, any, any, any, any, any>>
|
|
|
7
28
|
"typia.tag"?: Props;
|
|
8
29
|
};
|
|
9
30
|
export declare namespace TagBase {
|
|
31
|
+
/**
|
|
32
|
+
* Properties interface for validation tags.
|
|
33
|
+
*
|
|
34
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
35
|
+
*/
|
|
10
36
|
interface IProps<Target extends "boolean" | "bigint" | "number" | "string" | "array" | "object", Kind extends string, Value extends boolean | bigint | number | string | undefined, Validate extends string | {
|
|
11
37
|
[key in Target]?: string;
|
|
12
38
|
}, Exclusive extends boolean | string[], Schema extends object | undefined> {
|
|
13
39
|
/**
|
|
14
40
|
* Target type.
|
|
15
41
|
*
|
|
16
|
-
* If user tries to adapt this tag to a different type, it would be a
|
|
17
|
-
* error.
|
|
42
|
+
* If user tries to adapt this tag to a different type, it would be a
|
|
43
|
+
* compile error.
|
|
18
44
|
*
|
|
19
|
-
* For example, you've configured target type as `string`, but user adapted
|
|
20
|
-
* onto a `number` type (`number & YourCustomTag<Value>`), then it would
|
|
21
|
-
* blocked by TypeScript compiler.
|
|
45
|
+
* For example, you've configured target type as `string`, but user adapted
|
|
46
|
+
* it onto a `number` type (`number & YourCustomTag<Value>`), then it would
|
|
47
|
+
* be blocked by TypeScript compiler.
|
|
22
48
|
*/
|
|
23
49
|
target: Target;
|
|
24
|
-
/**
|
|
25
|
-
* What kind of tag is this?
|
|
26
|
-
*/
|
|
50
|
+
/** What kind of tag is this? */
|
|
27
51
|
kind: Kind;
|
|
28
|
-
/**
|
|
29
|
-
* Value to be configured by user.
|
|
30
|
-
*/
|
|
52
|
+
/** Value to be configured by user. */
|
|
31
53
|
value: Value;
|
|
32
54
|
/**
|
|
33
55
|
* Validation script.
|
|
34
56
|
*
|
|
35
|
-
* This script would be inserted into the generated validation function.
|
|
36
|
-
*
|
|
57
|
+
* This script would be inserted into the generated validation function. In
|
|
58
|
+
* here script, target variable name must be `$input`. The variable name
|
|
37
59
|
* `$input` would be transformed to the suitable when compilation.
|
|
38
60
|
*
|
|
39
61
|
* Also, If you've take a mistake on this script, compile error would be
|
|
@@ -46,15 +68,13 @@ export declare namespace TagBase {
|
|
|
46
68
|
*
|
|
47
69
|
* If this property configured as `true`, same {@link kind} tag cannot be
|
|
48
70
|
* duplicated in the target type. Otherwise, if you've configured this
|
|
49
|
-
* property as string array, all of the {@link kind} value assigned
|
|
50
|
-
*
|
|
71
|
+
* property as string array, all of the {@link kind} value assigned tags
|
|
72
|
+
* cannot be compatible in the target type.
|
|
51
73
|
*
|
|
52
74
|
* @default false
|
|
53
75
|
*/
|
|
54
76
|
exclusive?: Exclusive | string[];
|
|
55
|
-
/**
|
|
56
|
-
* Additional schema info assigned to the {@link IJsonSchema} object.
|
|
57
|
-
*/
|
|
77
|
+
/** Additional schema info assigned to the {@link IJsonSchema} object. */
|
|
58
78
|
schema?: Schema;
|
|
59
79
|
}
|
|
60
80
|
}
|
package/lib/tags/TagBase.d.ts
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base type for all validation tags in typia.
|
|
3
|
+
*
|
|
4
|
+
* TagBase provides the foundation for all typia's validation tags. It attaches
|
|
5
|
+
* metadata to TypeScript types that typia's transformer processes at
|
|
6
|
+
* compile-time to generate optimized runtime validation code.
|
|
7
|
+
*
|
|
8
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* // Custom tag example
|
|
12
|
+
* type MyCustomTag<Value extends number> = TagBase<{
|
|
13
|
+
* target: "number";
|
|
14
|
+
* kind: "MyCustom";
|
|
15
|
+
* value: Value;
|
|
16
|
+
* validate: `$input === ${Value}`;
|
|
17
|
+
* }>;
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @template Props - Tag properties that define validation behavior
|
|
21
|
+
*/
|
|
1
22
|
export type TagBase<Props extends TagBase.IProps<any, any, any, any, any, any>> = {
|
|
2
23
|
/**
|
|
3
24
|
* This is a dummy property for compilation.
|
|
@@ -7,33 +28,34 @@ export type TagBase<Props extends TagBase.IProps<any, any, any, any, any, any>>
|
|
|
7
28
|
"typia.tag"?: Props;
|
|
8
29
|
};
|
|
9
30
|
export declare namespace TagBase {
|
|
31
|
+
/**
|
|
32
|
+
* Properties interface for validation tags.
|
|
33
|
+
*
|
|
34
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
35
|
+
*/
|
|
10
36
|
interface IProps<Target extends "boolean" | "bigint" | "number" | "string" | "array" | "object", Kind extends string, Value extends boolean | bigint | number | string | undefined, Validate extends string | {
|
|
11
37
|
[key in Target]?: string;
|
|
12
38
|
}, Exclusive extends boolean | string[], Schema extends object | undefined> {
|
|
13
39
|
/**
|
|
14
40
|
* Target type.
|
|
15
41
|
*
|
|
16
|
-
* If user tries to adapt this tag to a different type, it would be a
|
|
17
|
-
* error.
|
|
42
|
+
* If user tries to adapt this tag to a different type, it would be a
|
|
43
|
+
* compile error.
|
|
18
44
|
*
|
|
19
|
-
* For example, you've configured target type as `string`, but user adapted
|
|
20
|
-
* onto a `number` type (`number & YourCustomTag<Value>`), then it would
|
|
21
|
-
* blocked by TypeScript compiler.
|
|
45
|
+
* For example, you've configured target type as `string`, but user adapted
|
|
46
|
+
* it onto a `number` type (`number & YourCustomTag<Value>`), then it would
|
|
47
|
+
* be blocked by TypeScript compiler.
|
|
22
48
|
*/
|
|
23
49
|
target: Target;
|
|
24
|
-
/**
|
|
25
|
-
* What kind of tag is this?
|
|
26
|
-
*/
|
|
50
|
+
/** What kind of tag is this? */
|
|
27
51
|
kind: Kind;
|
|
28
|
-
/**
|
|
29
|
-
* Value to be configured by user.
|
|
30
|
-
*/
|
|
52
|
+
/** Value to be configured by user. */
|
|
31
53
|
value: Value;
|
|
32
54
|
/**
|
|
33
55
|
* Validation script.
|
|
34
56
|
*
|
|
35
|
-
* This script would be inserted into the generated validation function.
|
|
36
|
-
*
|
|
57
|
+
* This script would be inserted into the generated validation function. In
|
|
58
|
+
* here script, target variable name must be `$input`. The variable name
|
|
37
59
|
* `$input` would be transformed to the suitable when compilation.
|
|
38
60
|
*
|
|
39
61
|
* Also, If you've take a mistake on this script, compile error would be
|
|
@@ -46,15 +68,13 @@ export declare namespace TagBase {
|
|
|
46
68
|
*
|
|
47
69
|
* If this property configured as `true`, same {@link kind} tag cannot be
|
|
48
70
|
* duplicated in the target type. Otherwise, if you've configured this
|
|
49
|
-
* property as string array, all of the {@link kind} value assigned
|
|
50
|
-
*
|
|
71
|
+
* property as string array, all of the {@link kind} value assigned tags
|
|
72
|
+
* cannot be compatible in the target type.
|
|
51
73
|
*
|
|
52
74
|
* @default false
|
|
53
75
|
*/
|
|
54
76
|
exclusive?: Exclusive | string[];
|
|
55
|
-
/**
|
|
56
|
-
* Additional schema info assigned to the {@link IJsonSchema} object.
|
|
57
|
-
*/
|
|
77
|
+
/** Additional schema info assigned to the {@link IJsonSchema} object. */
|
|
58
78
|
schema?: Schema;
|
|
59
79
|
}
|
|
60
80
|
}
|
package/lib/tags/Type.d.mts
CHANGED
|
@@ -1,4 +1,31 @@
|
|
|
1
1
|
import { TagBase } from "./TagBase";
|
|
2
|
+
/**
|
|
3
|
+
* Type tag for specifying numeric bit-width representations.
|
|
4
|
+
*
|
|
5
|
+
* Constrains numeric types to specific bit-width formats used in systems
|
|
6
|
+
* programming and protocol buffers. Ensures numbers conform to
|
|
7
|
+
* platform-specific representations.
|
|
8
|
+
*
|
|
9
|
+
* Supported types:
|
|
10
|
+
*
|
|
11
|
+
* - `int32`: 32-bit signed integer (-2^31 to 2^31-1)
|
|
12
|
+
* - `uint32`: 32-bit unsigned integer (0 to 2^32-1)
|
|
13
|
+
* - `int64`: 64-bit signed integer (supports both bigint and number)
|
|
14
|
+
* - `uint64`: 64-bit unsigned integer (supports both bigint and number)
|
|
15
|
+
* - `float`: 32-bit floating point (single precision)
|
|
16
|
+
* - `double`: 64-bit floating point (double precision, default JS number)
|
|
17
|
+
*
|
|
18
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* type Score = number & Type<"int32">; // -2,147,483,648 to 2,147,483,647
|
|
22
|
+
* type UserId = number & Type<"uint32">; // 0 to 4,294,967,295
|
|
23
|
+
* type FileSize = bigint & Type<"int64">; // Large file sizes
|
|
24
|
+
* type Coordinate = number & Type<"double">; // High precision coordinates
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @template Value - The numeric type representation
|
|
28
|
+
*/
|
|
2
29
|
export type Type<Value extends "int32" | "uint32" | "int64" | "uint64" | "float" | "double"> = TagBase<{
|
|
3
30
|
target: Value extends "int64" | "uint64" ? "bigint" | "number" : "number";
|
|
4
31
|
kind: "type";
|
package/lib/tags/Type.d.ts
CHANGED
|
@@ -1,4 +1,31 @@
|
|
|
1
1
|
import { TagBase } from "./TagBase";
|
|
2
|
+
/**
|
|
3
|
+
* Type tag for specifying numeric bit-width representations.
|
|
4
|
+
*
|
|
5
|
+
* Constrains numeric types to specific bit-width formats used in systems
|
|
6
|
+
* programming and protocol buffers. Ensures numbers conform to
|
|
7
|
+
* platform-specific representations.
|
|
8
|
+
*
|
|
9
|
+
* Supported types:
|
|
10
|
+
*
|
|
11
|
+
* - `int32`: 32-bit signed integer (-2^31 to 2^31-1)
|
|
12
|
+
* - `uint32`: 32-bit unsigned integer (0 to 2^32-1)
|
|
13
|
+
* - `int64`: 64-bit signed integer (supports both bigint and number)
|
|
14
|
+
* - `uint64`: 64-bit unsigned integer (supports both bigint and number)
|
|
15
|
+
* - `float`: 32-bit floating point (single precision)
|
|
16
|
+
* - `double`: 64-bit floating point (double precision, default JS number)
|
|
17
|
+
*
|
|
18
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* type Score = number & Type<"int32">; // -2,147,483,648 to 2,147,483,647
|
|
22
|
+
* type UserId = number & Type<"uint32">; // 0 to 4,294,967,295
|
|
23
|
+
* type FileSize = bigint & Type<"int64">; // Large file sizes
|
|
24
|
+
* type Coordinate = number & Type<"double">; // High precision coordinates
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @template Value - The numeric type representation
|
|
28
|
+
*/
|
|
2
29
|
export type Type<Value extends "int32" | "uint32" | "int64" | "uint64" | "float" | "double"> = TagBase<{
|
|
3
30
|
target: Value extends "int64" | "uint64" ? "bigint" | "number" : "number";
|
|
4
31
|
kind: "type";
|
|
@@ -1,4 +1,24 @@
|
|
|
1
1
|
import { TagBase } from "./TagBase";
|
|
2
|
+
/**
|
|
3
|
+
* Unique items validation tag for arrays.
|
|
4
|
+
*
|
|
5
|
+
* Enforces that all items in an array are unique, preventing duplicate values.
|
|
6
|
+
* Uniqueness is determined using strict equality (===) for primitives and deep
|
|
7
|
+
* structural comparison for objects and arrays. This means two objects with the
|
|
8
|
+
* same properties and values are considered duplicates.
|
|
9
|
+
*
|
|
10
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
11
|
+
* @example
|
|
12
|
+
* // Ensure all IDs are unique
|
|
13
|
+
* type UserIds = number[] & UniqueItems;
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // Prevent duplicate email addresses
|
|
17
|
+
* type EmailList = string[] & UniqueItems;
|
|
18
|
+
*
|
|
19
|
+
* @template Value - Boolean flag to enable/disable uniqueness validation
|
|
20
|
+
* (defaults to true)
|
|
21
|
+
*/
|
|
2
22
|
export type UniqueItems<Value extends boolean = true> = TagBase<{
|
|
3
23
|
target: "array";
|
|
4
24
|
kind: "uniqueItems";
|
|
@@ -1,4 +1,24 @@
|
|
|
1
1
|
import { TagBase } from "./TagBase";
|
|
2
|
+
/**
|
|
3
|
+
* Unique items validation tag for arrays.
|
|
4
|
+
*
|
|
5
|
+
* Enforces that all items in an array are unique, preventing duplicate values.
|
|
6
|
+
* Uniqueness is determined using strict equality (===) for primitives and deep
|
|
7
|
+
* structural comparison for objects and arrays. This means two objects with the
|
|
8
|
+
* same properties and values are considered duplicates.
|
|
9
|
+
*
|
|
10
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
11
|
+
* @example
|
|
12
|
+
* // Ensure all IDs are unique
|
|
13
|
+
* type UserIds = number[] & UniqueItems;
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // Prevent duplicate email addresses
|
|
17
|
+
* type EmailList = string[] & UniqueItems;
|
|
18
|
+
*
|
|
19
|
+
* @template Value - Boolean flag to enable/disable uniqueness validation
|
|
20
|
+
* (defaults to true)
|
|
21
|
+
*/
|
|
2
22
|
export type UniqueItems<Value extends boolean = true> = TagBase<{
|
|
3
23
|
target: "array";
|
|
4
24
|
kind: "uniqueItems";
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @reference https://github.dev/ajv-validator/ajv-formats/blob/master/src/formats.ts
|
|
3
|
-
*/
|
|
1
|
+
/** @reference https://github.dev/ajv-validator/ajv-formats/blob/master/src/formats.ts */
|
|
4
2
|
export declare const FormatCheatSheet: {
|
|
5
3
|
readonly byte: "/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm.test($input)";
|
|
6
4
|
readonly password: "true";
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @reference https://github.dev/ajv-validator/ajv-formats/blob/master/src/formats.ts
|
|
3
|
-
*/
|
|
1
|
+
/** @reference https://github.dev/ajv-validator/ajv-formats/blob/master/src/formats.ts */
|
|
4
2
|
export declare const FormatCheatSheet: {
|
|
5
3
|
readonly byte: "/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm.test($input)";
|
|
6
4
|
readonly password: "true";
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FormatCheatSheet = void 0;
|
|
4
4
|
const RegexCall = (text) => `${text}.test($input)`;
|
|
5
|
-
/**
|
|
6
|
-
* @reference https://github.dev/ajv-validator/ajv-formats/blob/master/src/formats.ts
|
|
7
|
-
*/
|
|
5
|
+
/** @reference https://github.dev/ajv-validator/ajv-formats/blob/master/src/formats.ts */
|
|
8
6
|
exports.FormatCheatSheet = {
|
|
9
7
|
// SPECIAL CHARACTERS
|
|
10
8
|
byte: RegexCall(`/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm`),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormatCheatSheet.js","sourceRoot":"","sources":["../../../src/tags/internal/FormatCheatSheet.ts"],"names":[],"mappings":";;;AAAA,MAAM,SAAS,GAAG,CAAsB,IAAU,EAAE,EAAE,CACpD,GAAG,IAAI,eAAwB,CAAC;AAElC
|
|
1
|
+
{"version":3,"file":"FormatCheatSheet.js","sourceRoot":"","sources":["../../../src/tags/internal/FormatCheatSheet.ts"],"names":[],"mappings":";;;AAAA,MAAM,SAAS,GAAG,CAAsB,IAAU,EAAE,EAAE,CACpD,GAAG,IAAI,eAAwB,CAAC;AAElC,yFAAyF;AAC5E,QAAA,gBAAgB,GAAG;IAC9B,qBAAqB;IACrB,IAAI,EAAE,SAAS,CACb,sEAAsE,CACvE;IACD,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,gFAAgF;IACvF,IAAI,EAAE,SAAS,CACb,gEAAgE,CACjE;IAED,YAAY;IACZ,KAAK,EAAE,SAAS,CACd,gJAAgJ,CACjJ;IACD,QAAQ,EAAE,SAAS,CACjB,4GAA4G,CAC7G;IACD,WAAW,EAAE,SAAS,CACpB,4IAA4I,CAC7I;IACD,cAAc,EAAE,SAAS,CACvB,+FAA+F,CAChG;IACD,GAAG,EAAE,SAAS,CACZ,+DAA+D,CAChE;IACD,eAAe,EAAE,SAAS,CACxB,+DAA+D,CAChE;IACD,IAAI,EAAE,SAAS,CACb,8FAA8F,CAC/F;IACD,IAAI,EAAE,SAAS,CACb,o/BAAo/B,CACr/B;IACD,GAAG,EAAE,GAAG,SAAS,CAAC,SAAS,CAAC,OAAO,SAAS,CAC1C,oqCAAoqC,CACrqC,EAAE;IACH,eAAe,EAAE,SAAS,CACxB,8qCAA8qC,CAC/qC;IACD,cAAc,EAAE,SAAS,CACvB,8LAA8L,CAC/L;IACD,GAAG,EAAE,SAAS,CACZ,+fAA+f,CAChgB;IAED,aAAa;IACb,WAAW,EAAE,SAAS,CACpB,8JAA8J,CAC/J;IACD,IAAI,EAAE,SAAS,CAAC,uDAAuD,CAAC;IACxE,IAAI,EAAE,SAAS,CACb,sGAAsG,CACvG;IACD,QAAQ,EAAE,SAAS,CACjB,kFAAkF,CACnF;IAED,WAAW;IACX,cAAc,EAAE,SAAS,CAAC,8BAA8B,CAAC;IACzD,uBAAuB,EAAE,SAAS,CAChC,qDAAqD,CACtD;CACO,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
const RegexCall = (text) => `${text}.test($input)`;
|
|
2
|
-
/**
|
|
3
|
-
* @reference https://github.dev/ajv-validator/ajv-formats/blob/master/src/formats.ts
|
|
4
|
-
*/
|
|
2
|
+
/** @reference https://github.dev/ajv-validator/ajv-formats/blob/master/src/formats.ts */
|
|
5
3
|
const FormatCheatSheet = {
|
|
6
4
|
// SPECIAL CHARACTERS
|
|
7
5
|
byte: RegexCall(`/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm`),
|
|
@@ -2,16 +2,20 @@ export interface ITransformOptions {
|
|
|
2
2
|
/**
|
|
3
3
|
* Whether to validate finite number or not.
|
|
4
4
|
*
|
|
5
|
-
* If configured true, number typed values would be validated by
|
|
5
|
+
* If configured true, number typed values would be validated by
|
|
6
|
+
* Number.isNaN().
|
|
6
7
|
*
|
|
7
|
-
* However, whatever you configure, it would be ignored when marshaling or
|
|
8
|
+
* However, whatever you configure, it would be ignored when marshaling or
|
|
9
|
+
* parsing.
|
|
8
10
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* -
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* - When marshaling, always be true
|
|
12
|
+
*
|
|
13
|
+
* - AssertStringify()
|
|
14
|
+
* - ValidateEncode()
|
|
15
|
+
* - When parsing, always be false
|
|
16
|
+
*
|
|
17
|
+
* - AssertParse()
|
|
18
|
+
* - IsDecode()
|
|
15
19
|
*
|
|
16
20
|
* @default false
|
|
17
21
|
*/
|
|
@@ -19,17 +23,20 @@ export interface ITransformOptions {
|
|
|
19
23
|
/**
|
|
20
24
|
* Whether to validate finite number or not.
|
|
21
25
|
*
|
|
22
|
-
* If configured true, number typed values would be validated by
|
|
26
|
+
* If configured true, number typed values would be validated by
|
|
27
|
+
* Number.isFinite().
|
|
23
28
|
*
|
|
24
29
|
* However, whatever you configure, it can be ignored in below case.
|
|
25
30
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* -
|
|
31
|
-
*
|
|
32
|
-
*
|
|
31
|
+
* - When `finite` option is true, this option would be ignored
|
|
32
|
+
* - When marshaling, always be true
|
|
33
|
+
*
|
|
34
|
+
* - AssertStringify()
|
|
35
|
+
* - ValidateEncode()
|
|
36
|
+
* - When parsing, always be false
|
|
37
|
+
*
|
|
38
|
+
* - AssertParse()
|
|
39
|
+
* - IsDecode()
|
|
33
40
|
*
|
|
34
41
|
* @default false
|
|
35
42
|
*/
|
|
@@ -37,7 +44,8 @@ export interface ITransformOptions {
|
|
|
37
44
|
/**
|
|
38
45
|
* Whether to validate functional type or not.
|
|
39
46
|
*
|
|
40
|
-
* However, whatever you configure, it becomes false when marshaling or
|
|
47
|
+
* However, whatever you configure, it becomes false when marshaling or
|
|
48
|
+
* parsing.
|
|
41
49
|
*
|
|
42
50
|
* @default false
|
|
43
51
|
*/
|
|
@@ -46,8 +54,8 @@ export interface ITransformOptions {
|
|
|
46
54
|
* Whether to check undefined value or not.
|
|
47
55
|
*
|
|
48
56
|
* JavaScript can assign `undefined` value to a specific property and it is an
|
|
49
|
-
* issue when validating without allowing superfluous properties. Should
|
|
50
|
-
* value assigned superfluous property be allowed or not?
|
|
57
|
+
* issue when validating without allowing superfluous properties. Should
|
|
58
|
+
* undefined value assigned superfluous property be allowed or not?
|
|
51
59
|
*
|
|
52
60
|
* Note that, this option only works on {@link equals} function. Other function
|
|
53
61
|
* like {@link assertEquals} or {@link validateEquals} would ignore this option
|
|
@@ -2,16 +2,20 @@ export interface ITransformOptions {
|
|
|
2
2
|
/**
|
|
3
3
|
* Whether to validate finite number or not.
|
|
4
4
|
*
|
|
5
|
-
* If configured true, number typed values would be validated by
|
|
5
|
+
* If configured true, number typed values would be validated by
|
|
6
|
+
* Number.isNaN().
|
|
6
7
|
*
|
|
7
|
-
* However, whatever you configure, it would be ignored when marshaling or
|
|
8
|
+
* However, whatever you configure, it would be ignored when marshaling or
|
|
9
|
+
* parsing.
|
|
8
10
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* -
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* - When marshaling, always be true
|
|
12
|
+
*
|
|
13
|
+
* - AssertStringify()
|
|
14
|
+
* - ValidateEncode()
|
|
15
|
+
* - When parsing, always be false
|
|
16
|
+
*
|
|
17
|
+
* - AssertParse()
|
|
18
|
+
* - IsDecode()
|
|
15
19
|
*
|
|
16
20
|
* @default false
|
|
17
21
|
*/
|
|
@@ -19,17 +23,20 @@ export interface ITransformOptions {
|
|
|
19
23
|
/**
|
|
20
24
|
* Whether to validate finite number or not.
|
|
21
25
|
*
|
|
22
|
-
* If configured true, number typed values would be validated by
|
|
26
|
+
* If configured true, number typed values would be validated by
|
|
27
|
+
* Number.isFinite().
|
|
23
28
|
*
|
|
24
29
|
* However, whatever you configure, it can be ignored in below case.
|
|
25
30
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* -
|
|
31
|
-
*
|
|
32
|
-
*
|
|
31
|
+
* - When `finite` option is true, this option would be ignored
|
|
32
|
+
* - When marshaling, always be true
|
|
33
|
+
*
|
|
34
|
+
* - AssertStringify()
|
|
35
|
+
* - ValidateEncode()
|
|
36
|
+
* - When parsing, always be false
|
|
37
|
+
*
|
|
38
|
+
* - AssertParse()
|
|
39
|
+
* - IsDecode()
|
|
33
40
|
*
|
|
34
41
|
* @default false
|
|
35
42
|
*/
|
|
@@ -37,7 +44,8 @@ export interface ITransformOptions {
|
|
|
37
44
|
/**
|
|
38
45
|
* Whether to validate functional type or not.
|
|
39
46
|
*
|
|
40
|
-
* However, whatever you configure, it becomes false when marshaling or
|
|
47
|
+
* However, whatever you configure, it becomes false when marshaling or
|
|
48
|
+
* parsing.
|
|
41
49
|
*
|
|
42
50
|
* @default false
|
|
43
51
|
*/
|
|
@@ -46,8 +54,8 @@ export interface ITransformOptions {
|
|
|
46
54
|
* Whether to check undefined value or not.
|
|
47
55
|
*
|
|
48
56
|
* JavaScript can assign `undefined` value to a specific property and it is an
|
|
49
|
-
* issue when validating without allowing superfluous properties. Should
|
|
50
|
-
* value assigned superfluous property be allowed or not?
|
|
57
|
+
* issue when validating without allowing superfluous properties. Should
|
|
58
|
+
* undefined value assigned superfluous property be allowed or not?
|
|
51
59
|
*
|
|
52
60
|
* Note that, this option only works on {@link equals} function. Other function
|
|
53
61
|
* like {@link assertEquals} or {@link validateEquals} would ignore this option
|