typia 6.10.2-dev.20240920 → 6.10.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/LICENSE +21 -21
- package/README.md +118 -118
- package/package.json +1 -1
- package/src/AssertionGuard.ts +1 -1
- package/src/CamelCase.ts +75 -75
- package/src/IRandomGenerator.ts +66 -66
- package/src/IValidation.ts +21 -21
- package/src/PascalCase.ts +71 -71
- package/src/Primitive.ts +92 -92
- package/src/Resolved.ts +74 -74
- package/src/SnakeCase.ts +126 -126
- package/src/TypeGuardError.ts +37 -37
- package/src/executable/TypiaGenerateWizard.ts +83 -83
- package/src/executable/TypiaPatchWizard.ts +42 -42
- package/src/executable/TypiaSetupWizard.ts +174 -174
- package/src/executable/setup/ArgumentParser.ts +43 -43
- package/src/executable/setup/CommandExecutor.ts +8 -8
- package/src/executable/setup/FileRetriever.ts +22 -22
- package/src/executable/setup/PackageManager.ts +86 -86
- package/src/executable/setup/PluginConfigurator.ts +69 -69
- package/src/executable/typia.ts +55 -55
- package/src/factories/CommentFactory.ts +79 -79
- package/src/factories/ExpressionFactory.ts +150 -150
- package/src/factories/IdentifierFactory.ts +70 -70
- package/src/factories/JsonMetadataFactory.ts +53 -53
- package/src/factories/LiteralFactory.ts +47 -47
- package/src/factories/MetadataCollection.ts +274 -274
- package/src/factories/MetadataCommentTagFactory.ts +534 -534
- package/src/factories/MetadataFactory.ts +314 -314
- package/src/factories/MetadataTypeTagFactory.ts +336 -336
- package/src/factories/MetadataTypeTagSchemaFactory.ts +59 -59
- package/src/factories/NumericRangeFactory.ts +72 -72
- package/src/factories/ProtobufFactory.ts +267 -267
- package/src/factories/StatementFactory.ts +74 -74
- package/src/factories/TemplateFactory.ts +56 -56
- package/src/factories/TypeFactory.ts +118 -118
- package/src/factories/ValueFactory.ts +12 -12
- package/src/factories/internal/metadata/MetadataHelper.ts +21 -21
- package/src/factories/internal/metadata/emend_metadata_atomics.ts +45 -45
- package/src/factories/internal/metadata/emplace_metadata_alias.ts +41 -41
- package/src/factories/internal/metadata/emplace_metadata_array_type.ts +42 -42
- package/src/factories/internal/metadata/emplace_metadata_object.ts +186 -186
- package/src/factories/internal/metadata/emplace_metadata_tuple.ts +57 -57
- package/src/factories/internal/metadata/explore_metadata.ts +28 -28
- package/src/factories/internal/metadata/iterate_metadata.ts +100 -100
- package/src/factories/internal/metadata/iterate_metadata_alias.ts +34 -34
- package/src/factories/internal/metadata/iterate_metadata_array.ts +63 -63
- package/src/factories/internal/metadata/iterate_metadata_atomic.ts +62 -62
- package/src/factories/internal/metadata/iterate_metadata_coalesce.ts +28 -28
- package/src/factories/internal/metadata/iterate_metadata_collection.ts +131 -131
- package/src/factories/internal/metadata/iterate_metadata_comment_tags.ts +28 -28
- package/src/factories/internal/metadata/iterate_metadata_constant.ts +76 -76
- package/src/factories/internal/metadata/iterate_metadata_escape.ts +52 -52
- package/src/factories/internal/metadata/iterate_metadata_function.ts +89 -89
- package/src/factories/internal/metadata/iterate_metadata_intersection.ts +213 -213
- package/src/factories/internal/metadata/iterate_metadata_map.ts +50 -50
- package/src/factories/internal/metadata/iterate_metadata_native.ts +220 -220
- package/src/factories/internal/metadata/iterate_metadata_object.ts +33 -33
- package/src/factories/internal/metadata/iterate_metadata_set.ts +41 -41
- package/src/factories/internal/metadata/iterate_metadata_sort.ts +74 -74
- package/src/factories/internal/metadata/iterate_metadata_template.ts +44 -44
- package/src/factories/internal/metadata/iterate_metadata_tuple.ts +37 -37
- package/src/factories/internal/metadata/iterate_metadata_union.ts +27 -27
- package/src/functional/$FormDataReader/$FormDataReader.ts +83 -83
- package/src/functional/$FormDataReader/index.ts +1 -1
- package/src/functional/$HeadersReader/$HeadersReader.ts +26 -26
- package/src/functional/$HeadersReader/index.ts +1 -1
- package/src/functional/$ParameterReader/$ParameterReader.ts +29 -29
- package/src/functional/$ParameterReader/index.ts +1 -1
- package/src/functional/$ProtobufReader.ts +194 -194
- package/src/functional/$ProtobufSizer.ts +144 -144
- package/src/functional/$ProtobufWriter.ts +145 -145
- package/src/functional/$QueryReader/$QueryReader.ts +46 -46
- package/src/functional/$QueryReader/index.ts +1 -1
- package/src/functional/$any.ts +3 -3
- package/src/functional/$clone.ts +48 -48
- package/src/functional/$convention.ts +37 -37
- package/src/functional/$dictionary.ts +22 -22
- package/src/functional/$every.ts +11 -11
- package/src/functional/$guard.ts +21 -21
- package/src/functional/$is_between.ts +2 -2
- package/src/functional/$join.ts +46 -46
- package/src/functional/$number.ts +12 -12
- package/src/functional/$report.ts +13 -13
- package/src/functional/$rest.ts +3 -3
- package/src/functional/$stoll.ts +8 -8
- package/src/functional/$string.ts +43 -43
- package/src/functional/$strlen.ts +7 -7
- package/src/functional/$tail.ts +5 -5
- package/src/functional/$throws.ts +10 -10
- package/src/functional/$varint.ts +130 -130
- package/src/functional/$zigzag.ts +39 -39
- package/src/functional/IProtobufWriter.ts +18 -18
- package/src/functional/Namespace/functional.ts +5 -5
- package/src/functional/Namespace/http.ts +9 -9
- package/src/functional/Namespace/index.ts +77 -77
- package/src/functional/Namespace/json.ts +15 -15
- package/src/functional/Namespace/llm.ts +20 -20
- package/src/functional/Namespace/misc.ts +14 -14
- package/src/functional/Namespace/notations.ts +23 -23
- package/src/functional/Namespace/protobuf.ts +20 -20
- package/src/functional/is.ts +10 -10
- package/src/functional.ts +872 -872
- package/src/http.ts +1266 -1266
- package/src/index.ts +4 -4
- package/src/json.ts +738 -738
- package/src/llm.ts +186 -186
- package/src/misc.ts +757 -757
- package/src/module.ts +1023 -1023
- package/src/notations.ts +1020 -1020
- package/src/programmers/AssertProgrammer.ts +397 -397
- package/src/programmers/CheckerProgrammer.ts +1138 -1138
- package/src/programmers/FeatureProgrammer.ts +549 -549
- package/src/programmers/IsProgrammer.ts +220 -220
- package/src/programmers/RandomProgrammer.ts +955 -955
- package/src/programmers/TypiaProgrammer.ts +157 -157
- package/src/programmers/ValidateProgrammer.ts +382 -382
- package/src/programmers/functional/FunctionalAssertFunctionProgrammer.ts +141 -141
- package/src/programmers/functional/FunctionalAssertParametersProgrammer.ts +108 -108
- package/src/programmers/functional/FunctionalAssertReturnProgrammer.ts +98 -98
- package/src/programmers/functional/FunctionalIsFunctionProgrammer.ts +72 -72
- package/src/programmers/functional/FunctionalIsParametersProgrammer.ts +101 -101
- package/src/programmers/functional/FunctionalIsReturnProgrammer.ts +106 -106
- package/src/programmers/functional/FunctionalValidateFunctionProgrammer.ts +123 -123
- package/src/programmers/functional/FunctionalValidateParametersProgrammer.ts +267 -267
- package/src/programmers/functional/FunctionalValidateReturnProgrammer.ts +126 -126
- package/src/programmers/functional/internal/FunctionalGeneralProgrammer.ts +34 -34
- package/src/programmers/helpers/AtomicPredicator.ts +24 -24
- package/src/programmers/helpers/CloneJoiner.ts +130 -130
- package/src/programmers/helpers/FunctionImporeter.ts +1 -1
- package/src/programmers/helpers/FunctionImporter.ts +97 -97
- package/src/programmers/helpers/HttpMetadataUtil.ts +21 -21
- package/src/programmers/helpers/ICheckEntry.ts +13 -13
- package/src/programmers/helpers/IExpressionEntry.ts +12 -12
- package/src/programmers/helpers/NotationJoiner.ts +132 -132
- package/src/programmers/helpers/OptionPredicator.ts +15 -15
- package/src/programmers/helpers/ProtobufUtil.ts +125 -125
- package/src/programmers/helpers/ProtobufWire.ts +34 -34
- package/src/programmers/helpers/PruneJoiner.ts +139 -139
- package/src/programmers/helpers/RandomJoiner.ts +145 -145
- package/src/programmers/helpers/RandomRanger.ts +171 -171
- package/src/programmers/helpers/StringifyJoinder.ts +105 -105
- package/src/programmers/helpers/StringifyPredicator.ts +12 -12
- package/src/programmers/helpers/UnionExplorer.ts +269 -269
- package/src/programmers/helpers/UnionPredicator.ts +77 -77
- package/src/programmers/helpers/disable_function_importer_declare.ts +33 -33
- package/src/programmers/http/HttpAssertFormDataProgrammer.ts +91 -91
- package/src/programmers/http/HttpAssertHeadersProgrammer.ts +91 -91
- package/src/programmers/http/HttpAssertQueryProgrammer.ts +93 -93
- package/src/programmers/http/HttpFormDataProgrammer.ts +278 -278
- package/src/programmers/http/HttpHeadersProgrammer.ts +347 -347
- package/src/programmers/http/HttpIsFormDataProgrammer.ts +102 -102
- package/src/programmers/http/HttpIsHeadersProgrammer.ts +102 -102
- package/src/programmers/http/HttpIsQueryProgrammer.ts +104 -104
- package/src/programmers/http/HttpParameterProgrammer.ts +97 -97
- package/src/programmers/http/HttpQueryProgrammer.ts +298 -298
- package/src/programmers/http/HttpValidateFormDataProgrammer.ts +85 -85
- package/src/programmers/http/HttpValidateHeadersProgrammer.ts +85 -85
- package/src/programmers/http/HttpValidateQueryProgrammer.ts +87 -87
- package/src/programmers/internal/application_array.ts +61 -61
- package/src/programmers/internal/application_bigint.ts +25 -25
- package/src/programmers/internal/application_boolean.ts +25 -25
- package/src/programmers/internal/application_description.ts +12 -12
- package/src/programmers/internal/application_escaped.ts +74 -74
- package/src/programmers/internal/application_number.ts +25 -25
- package/src/programmers/internal/application_plugin.ts +19 -19
- package/src/programmers/internal/application_string.ts +25 -25
- package/src/programmers/internal/application_templates.ts +62 -62
- package/src/programmers/internal/application_title.ts +20 -20
- package/src/programmers/internal/application_union_discriminator.ts +35 -35
- package/src/programmers/internal/application_v30_alias.ts +52 -52
- package/src/programmers/internal/application_v30_constant.ts +18 -18
- package/src/programmers/internal/application_v30_native.ts +28 -28
- package/src/programmers/internal/application_v30_object.ts +149 -149
- package/src/programmers/internal/application_v30_schema.ts +161 -161
- package/src/programmers/internal/application_v30_tuple.ts +33 -33
- package/src/programmers/internal/application_v31_alias.ts +41 -41
- package/src/programmers/internal/application_v31_constant.ts +29 -29
- package/src/programmers/internal/application_v31_native.ts +24 -24
- package/src/programmers/internal/application_v31_object.ts +130 -130
- package/src/programmers/internal/application_v31_schema.ts +159 -159
- package/src/programmers/internal/application_v31_tuple.ts +21 -21
- package/src/programmers/internal/check_array_length.ts +45 -45
- package/src/programmers/internal/check_bigint.ts +49 -49
- package/src/programmers/internal/check_dynamic_key.ts +174 -174
- package/src/programmers/internal/check_dynamic_properties.ts +211 -211
- package/src/programmers/internal/check_everything.ts +23 -23
- package/src/programmers/internal/check_native.ts +21 -21
- package/src/programmers/internal/check_number.ts +107 -107
- package/src/programmers/internal/check_object.ts +61 -61
- package/src/programmers/internal/check_string.ts +48 -48
- package/src/programmers/internal/check_template.ts +46 -46
- package/src/programmers/internal/check_union_array_like.ts +307 -307
- package/src/programmers/internal/decode_union_object.ts +99 -99
- package/src/programmers/internal/feature_object_entries.ts +58 -58
- package/src/programmers/internal/llm_schema_array.ts +22 -22
- package/src/programmers/internal/llm_schema_escaped.ts +61 -61
- package/src/programmers/internal/llm_schema_native.ts +17 -17
- package/src/programmers/internal/llm_schema_object.ts +129 -129
- package/src/programmers/internal/llm_schema_station.ts +185 -185
- package/src/programmers/internal/llm_schema_tuple.ts +31 -31
- package/src/programmers/internal/metadata_to_pattern.ts +34 -34
- package/src/programmers/internal/postfix_of_tuple.ts +2 -2
- package/src/programmers/internal/prune_object_properties.ts +60 -60
- package/src/programmers/internal/random_custom.ts +37 -37
- package/src/programmers/internal/stringify_dynamic_properties.ts +157 -157
- package/src/programmers/internal/stringify_native.ts +7 -7
- package/src/programmers/internal/stringify_regular_properties.ts +81 -81
- package/src/programmers/internal/template_to_pattern.ts +15 -15
- package/src/programmers/internal/wrap_metadata_rest_tuple.ts +20 -20
- package/src/programmers/json/JsonApplicationProgrammer.ts +82 -82
- package/src/programmers/json/JsonAssertParseProgrammer.ts +96 -96
- package/src/programmers/json/JsonAssertStringifyProgrammer.ts +104 -104
- package/src/programmers/json/JsonIsParseProgrammer.ts +110 -110
- package/src/programmers/json/JsonIsStringifyProgrammer.ts +102 -102
- package/src/programmers/json/JsonStringifyProgrammer.ts +909 -909
- package/src/programmers/json/JsonValidateParseProgrammer.ts +87 -87
- package/src/programmers/json/JsonValidateStringifyProgrammer.ts +111 -111
- package/src/programmers/llm/LlmApplicationProgrammer.ts +216 -216
- package/src/programmers/llm/LlmSchemaProgrammer.ts +49 -49
- package/src/programmers/misc/MiscAssertCloneProgrammer.ts +87 -87
- package/src/programmers/misc/MiscAssertPruneProgrammer.ts +105 -105
- package/src/programmers/misc/MiscCloneProgrammer.ts +781 -781
- package/src/programmers/misc/MiscIsCloneProgrammer.ts +93 -93
- package/src/programmers/misc/MiscIsPruneProgrammer.ts +91 -91
- package/src/programmers/misc/MiscLiteralsProgrammer.ts +70 -70
- package/src/programmers/misc/MiscPruneProgrammer.ts +560 -560
- package/src/programmers/misc/MiscValidateCloneProgrammer.ts +104 -104
- package/src/programmers/misc/MiscValidatePruneProgrammer.ts +101 -101
- package/src/programmers/notations/NotationAssertGeneralProgrammer.ts +91 -91
- package/src/programmers/notations/NotationGeneralProgrammer.ts +714 -714
- package/src/programmers/notations/NotationIsGeneralProgrammer.ts +97 -97
- package/src/programmers/notations/NotationValidateGeneralProgrammer.ts +110 -110
- package/src/programmers/protobuf/ProtobufAssertDecodeProgrammer.ts +91 -91
- package/src/programmers/protobuf/ProtobufAssertEncodeProgrammer.ts +95 -95
- package/src/programmers/protobuf/ProtobufDecodeProgrammer.ts +646 -646
- package/src/programmers/protobuf/ProtobufEncodeProgrammer.ts +852 -852
- package/src/programmers/protobuf/ProtobufIsDecodeProgrammer.ts +104 -104
- package/src/programmers/protobuf/ProtobufIsEncodeProgrammer.ts +93 -93
- package/src/programmers/protobuf/ProtobufMessageProgrammer.ts +160 -160
- package/src/programmers/protobuf/ProtobufValidateDecodeProgrammer.ts +85 -85
- package/src/programmers/protobuf/ProtobufValidateEncodeProgrammer.ts +109 -109
- package/src/protobuf.ts +999 -999
- package/src/reflect.ts +63 -63
- package/src/schemas/json/IJsonApplication.ts +22 -22
- package/src/schemas/metadata/IJsDocTagInfo.ts +10 -10
- package/src/schemas/metadata/IMetadata.ts +36 -36
- package/src/schemas/metadata/IMetadataAlias.ts +12 -12
- package/src/schemas/metadata/IMetadataApplication.ts +7 -7
- package/src/schemas/metadata/IMetadataArray.ts +7 -7
- package/src/schemas/metadata/IMetadataArrayType.ts +10 -10
- package/src/schemas/metadata/IMetadataAtomic.ts +6 -6
- package/src/schemas/metadata/IMetadataComponents.ts +11 -11
- package/src/schemas/metadata/IMetadataConstant.ts +18 -18
- package/src/schemas/metadata/IMetadataConstantValue.ts +11 -11
- package/src/schemas/metadata/IMetadataDictionary.ts +11 -11
- package/src/schemas/metadata/IMetadataEntry.ts +6 -6
- package/src/schemas/metadata/IMetadataEscaped.ts +6 -6
- package/src/schemas/metadata/IMetadataFunction.ts +8 -8
- package/src/schemas/metadata/IMetadataObject.ts +13 -13
- package/src/schemas/metadata/IMetadataParameter.ts +9 -9
- package/src/schemas/metadata/IMetadataProperty.ts +9 -9
- package/src/schemas/metadata/IMetadataTemplate.ts +7 -7
- package/src/schemas/metadata/IMetadataTuple.ts +7 -7
- package/src/schemas/metadata/IMetadataTupleType.ts +10 -10
- package/src/schemas/metadata/IMetadataTypeTag.ts +16 -16
- package/src/schemas/metadata/Metadata.ts +616 -616
- package/src/schemas/metadata/MetadataAlias.ts +61 -61
- package/src/schemas/metadata/MetadataApplication.ts +44 -44
- package/src/schemas/metadata/MetadataArray.ts +49 -49
- package/src/schemas/metadata/MetadataArrayType.ts +57 -57
- package/src/schemas/metadata/MetadataAtomic.ts +87 -87
- package/src/schemas/metadata/MetadataComponents.ts +98 -98
- package/src/schemas/metadata/MetadataConstant.ts +34 -34
- package/src/schemas/metadata/MetadataConstantValue.ts +62 -62
- package/src/schemas/metadata/MetadataEscaped.ts +51 -51
- package/src/schemas/metadata/MetadataFunction.ts +49 -49
- package/src/schemas/metadata/MetadataObject.ts +139 -139
- package/src/schemas/metadata/MetadataParameter.ts +50 -50
- package/src/schemas/metadata/MetadataProperty.ts +56 -56
- package/src/schemas/metadata/MetadataTemplate.ts +80 -80
- package/src/schemas/metadata/MetadataTuple.ts +32 -32
- package/src/schemas/metadata/MetadataTupleType.ts +67 -67
- package/src/tags/Constant.ts +15 -15
- package/src/tags/ContentMediaType.ts +10 -10
- package/src/tags/Default.ts +22 -22
- package/src/tags/ExclusiveMaximum.ts +25 -25
- package/src/tags/ExclusiveMinimum.ts +25 -25
- package/src/tags/Format.ts +16 -16
- package/src/tags/JsonSchemaPlugin.ts +8 -8
- package/src/tags/MaxItems.ts +12 -12
- package/src/tags/MaxLength.ts +12 -12
- package/src/tags/Maximum.ts +19 -19
- package/src/tags/MinItems.ts +12 -12
- package/src/tags/MinLength.ts +12 -12
- package/src/tags/Minimum.ts +19 -19
- package/src/tags/MultipleOf.ts +21 -21
- package/src/tags/Pattern.ts +31 -31
- package/src/tags/TagBase.ts +76 -76
- package/src/tags/Type.ts +32 -32
- package/src/tags/UniqueItems.ts +14 -14
- package/src/tags/index.ts +18 -18
- package/src/tags/internal/FormatCheatSheet.ts +73 -73
- package/src/transform.ts +35 -35
- package/src/transformers/CallExpressionTransformer.ts +508 -508
- package/src/transformers/FileTransformer.ts +91 -91
- package/src/transformers/IProject.ts +15 -15
- package/src/transformers/ITransformOptions.ts +62 -62
- package/src/transformers/ImportTransformer.ts +66 -66
- package/src/transformers/NodeTransformer.ts +13 -13
- package/src/transformers/TransformerError.ts +60 -60
- package/src/transformers/features/AssertTransformer.ts +16 -16
- package/src/transformers/features/CreateAssertTransformer.ts +16 -16
- package/src/transformers/features/CreateIsTransformer.ts +10 -10
- package/src/transformers/features/CreateRandomTransformer.ts +40 -40
- package/src/transformers/features/CreateValidateTransformer.ts +13 -13
- package/src/transformers/features/IsTransformer.ts +10 -10
- package/src/transformers/features/RandomTransformer.ts +44 -44
- package/src/transformers/features/ValidateTransformer.ts +11 -11
- package/src/transformers/features/functional/FunctionalGenericTransformer.ts +57 -57
- package/src/transformers/features/http/CreateHttpAssertFormDataTransformer.ts +12 -12
- package/src/transformers/features/http/CreateHttpAssertHeadersTransformer.ts +11 -11
- package/src/transformers/features/http/CreateHttpAssertQueryTransformer.ts +9 -9
- package/src/transformers/features/http/CreateHttpFormDataTransformer.ts +9 -9
- package/src/transformers/features/http/CreateHttpHeadersTransformer.ts +9 -9
- package/src/transformers/features/http/CreateHttpIsFormDataTransformer.ts +9 -9
- package/src/transformers/features/http/CreateHttpIsHeadersTransformer.ts +9 -9
- package/src/transformers/features/http/CreateHttpIsQueryTransformer.ts +9 -9
- package/src/transformers/features/http/CreateHttpParameterTransformer.ts +9 -9
- package/src/transformers/features/http/CreateHttpQueryTransformer.ts +9 -9
- package/src/transformers/features/http/CreateHttpValidateFormDataTransformer.ts +12 -12
- package/src/transformers/features/http/CreateHttpValidateHeadersTransformer.ts +12 -12
- package/src/transformers/features/http/CreateHttpValidateQueryTransformer.ts +11 -11
- package/src/transformers/features/http/HttpAssertFormDataTransformer.ts +10 -10
- package/src/transformers/features/http/HttpAssertHeadersTransformer.ts +9 -9
- package/src/transformers/features/http/HttpAssertQueryTransformer.ts +9 -9
- package/src/transformers/features/http/HttpFormDataTransformer.ts +9 -9
- package/src/transformers/features/http/HttpHeadersTransformer.ts +9 -9
- package/src/transformers/features/http/HttpIsFormDataTransformer.ts +9 -9
- package/src/transformers/features/http/HttpIsHeadersTransformer.ts +9 -9
- package/src/transformers/features/http/HttpIsQueryTransformer.ts +9 -9
- package/src/transformers/features/http/HttpParameterTransformer.ts +9 -9
- package/src/transformers/features/http/HttpQueryTransformer.ts +9 -9
- package/src/transformers/features/http/HttpValidateFormDataTransformer.ts +10 -10
- package/src/transformers/features/http/HttpValidateHeadersTransformer.ts +10 -10
- package/src/transformers/features/http/HttpValidateQueryTransformer.ts +9 -9
- package/src/transformers/features/json/JsonApplicationTransformer.ts +124 -124
- package/src/transformers/features/json/JsonAssertParseTransformer.ts +9 -9
- package/src/transformers/features/json/JsonAssertStringifyTransformer.ts +10 -10
- package/src/transformers/features/json/JsonCreateAssertParseTransformer.ts +9 -9
- package/src/transformers/features/json/JsonCreateAssertStringifyTransformer.ts +12 -12
- package/src/transformers/features/json/JsonCreateIsParseTransformer.ts +9 -9
- package/src/transformers/features/json/JsonCreateIsStringifyTransformer.ts +9 -9
- package/src/transformers/features/json/JsonCreateStringifyTransformer.ts +9 -9
- package/src/transformers/features/json/JsonCreateValidateParseTransformer.ts +11 -11
- package/src/transformers/features/json/JsonCreateValidateStringifyProgrammer.ts +12 -12
- package/src/transformers/features/json/JsonIsParseTransformer.ts +9 -9
- package/src/transformers/features/json/JsonIsStringifyTransformer.ts +9 -9
- package/src/transformers/features/json/JsonStringifyTransformer.ts +9 -9
- package/src/transformers/features/json/JsonValidateParseTransformer.ts +9 -9
- package/src/transformers/features/json/JsonValidateStringifyTransformer.ts +10 -10
- package/src/transformers/features/llm/LlmApplicationTransformer.ts +83 -83
- package/src/transformers/features/llm/LlmSchemaTransformer.ts +53 -53
- package/src/transformers/features/misc/MiscAssertCloneTransformer.ts +9 -9
- package/src/transformers/features/misc/MiscAssertPruneTransformer.ts +9 -9
- package/src/transformers/features/misc/MiscCloneTransformer.ts +9 -9
- package/src/transformers/features/misc/MiscCreateAssertCloneTransformer.ts +9 -9
- package/src/transformers/features/misc/MiscCreateAssertPruneTransformer.ts +9 -9
- package/src/transformers/features/misc/MiscCreateCloneTransformer.ts +9 -9
- package/src/transformers/features/misc/MiscCreateIsCloneTransformer.ts +9 -9
- package/src/transformers/features/misc/MiscCreateIsPruneTransformer.ts +9 -9
- package/src/transformers/features/misc/MiscCreatePruneTransformer.ts +9 -9
- package/src/transformers/features/misc/MiscCreateValidateCloneTransformer.ts +11 -11
- package/src/transformers/features/misc/MiscCreateValidatePruneTransformer.ts +11 -11
- package/src/transformers/features/misc/MiscIsCloneTransformer.ts +9 -9
- package/src/transformers/features/misc/MiscIsPruneTransformer.ts +9 -9
- package/src/transformers/features/misc/MiscLiteralsTransformer.ts +32 -32
- package/src/transformers/features/misc/MiscPruneTransformer.ts +9 -9
- package/src/transformers/features/misc/MiscValidateCloneTransformer.ts +9 -9
- package/src/transformers/features/misc/MiscValidatePruneTransformer.ts +9 -9
- package/src/transformers/features/notations/NotationAssertGeneralTransformer.ts +15 -15
- package/src/transformers/features/notations/NotationCreateAssertGeneralTransformer.ts +15 -15
- package/src/transformers/features/notations/NotationCreateGeneralTransformer.ts +15 -15
- package/src/transformers/features/notations/NotationCreateIsGeneralTransformer.ts +15 -15
- package/src/transformers/features/notations/NotationCreateValidateGeneralTransformer.ts +15 -15
- package/src/transformers/features/notations/NotationGeneralTransformer.ts +11 -11
- package/src/transformers/features/notations/NotationIsGeneralTransformer.ts +15 -15
- package/src/transformers/features/notations/NotationValidateGeneralTransformer.ts +15 -15
- package/src/transformers/features/protobuf/ProtobufAssertDecodeTransformer.ts +10 -10
- package/src/transformers/features/protobuf/ProtobufAssertEncodeTransformer.ts +10 -10
- package/src/transformers/features/protobuf/ProtobufCreateAssertDecodeTransformer.ts +12 -12
- package/src/transformers/features/protobuf/ProtobufCreateAssertEncodeTransformer.ts +12 -12
- package/src/transformers/features/protobuf/ProtobufCreateDecodeTransformer.ts +9 -9
- package/src/transformers/features/protobuf/ProtobufCreateEncodeTransformer.ts +9 -9
- package/src/transformers/features/protobuf/ProtobufCreateIsDecodeTransformer.ts +9 -9
- package/src/transformers/features/protobuf/ProtobufCreateIsEncodeTransformer.ts +9 -9
- package/src/transformers/features/protobuf/ProtobufCreateValidateDecodeTransformer.ts +12 -12
- package/src/transformers/features/protobuf/ProtobufCreateValidateEncodeTransformer.ts +12 -12
- package/src/transformers/features/protobuf/ProtobufDecodeTransformer.ts +9 -9
- package/src/transformers/features/protobuf/ProtobufEncodeTransformer.ts +9 -9
- package/src/transformers/features/protobuf/ProtobufIsDecodeTransformer.ts +9 -9
- package/src/transformers/features/protobuf/ProtobufIsEncodeTransformer.ts +9 -9
- package/src/transformers/features/protobuf/ProtobufMessageTransformer.ts +33 -33
- package/src/transformers/features/protobuf/ProtobufValidateDecodeTransformer.ts +10 -10
- package/src/transformers/features/protobuf/ProtobufValidateEncodeTransformer.ts +10 -10
- package/src/transformers/features/reflect/ReflectMetadataTransformer.ts +63 -63
- package/src/transformers/features/reflect/ReflectNameTransformer.ts +66 -66
- package/src/transformers/internal/GenericTransformer.ts +104 -104
- package/src/typings/Atomic.ts +13 -13
- package/src/typings/ClassProperties.ts +5 -5
- package/src/typings/Customizable.ts +5 -5
- package/src/typings/Equal.ts +18 -18
- package/src/typings/IsTuple.ts +9 -9
- package/src/typings/NativeClass.ts +23 -23
- package/src/typings/OmitNever.ts +3 -3
- package/src/typings/ProtobufAtomic.ts +19 -19
- package/src/typings/SpecialFields.ts +3 -3
- package/src/typings/ValidationPipe.ts +9 -9
- package/src/typings/ValueOf.ts +20 -20
- package/src/typings/Writable.ts +11 -11
- package/src/utils/ArrayUtil.ts +41 -41
- package/src/utils/Escaper.ts +50 -50
- package/src/utils/MapUtil.ts +12 -12
- package/src/utils/NameEncoder.ts +32 -32
- package/src/utils/NamingConvention/NamingConvention.ts +89 -89
- package/src/utils/NamingConvention/index.ts +1 -1
- package/src/utils/PatternUtil.ts +29 -29
- package/src/utils/RandomGenerator/RandomGenerator.ts +119 -119
- package/src/utils/RandomGenerator/index.ts +1 -1
- package/src/utils/Singleton.ts +16 -16
- package/src/utils/StringUtil/StringUtil.ts +7 -7
- package/src/utils/StringUtil/index.ts +1 -1
package/src/notations.ts
CHANGED
|
@@ -1,1020 +1,1020 @@
|
|
|
1
|
-
import * as Namespace from "./functional/Namespace";
|
|
2
|
-
|
|
3
|
-
import { CamelCase } from "./CamelCase";
|
|
4
|
-
import { IValidation } from "./IValidation";
|
|
5
|
-
import { PascalCase } from "./PascalCase";
|
|
6
|
-
import { SnakeCase } from "./SnakeCase";
|
|
7
|
-
import { TypeGuardError } from "./TypeGuardError";
|
|
8
|
-
|
|
9
|
-
/* ===========================================================
|
|
10
|
-
NOTATIONS (NAMING CONVENTIONS)
|
|
11
|
-
- CAMEL CASE
|
|
12
|
-
- PASCAL CASE
|
|
13
|
-
- SNAKE CASE
|
|
14
|
-
- FACTORY FUNCTIONS
|
|
15
|
-
==============================================================
|
|
16
|
-
CAMEL CASE
|
|
17
|
-
----------------------------------------------------------- */
|
|
18
|
-
/**
|
|
19
|
-
* Convert to camel case.
|
|
20
|
-
*
|
|
21
|
-
* Convert every property names of nested objects to follow the camel case convention.
|
|
22
|
-
*
|
|
23
|
-
* For reference, this `typia.notations.camel()` function does not validate the input value
|
|
24
|
-
* type. It just believes that the input value is following the type `T`. Therefore,
|
|
25
|
-
* if you can't ensure the input value type, it would be better to call one of them below:
|
|
26
|
-
*
|
|
27
|
-
* - {@link assertCamel}
|
|
28
|
-
* - {@link isCamel}
|
|
29
|
-
* - {@link validateCamel}
|
|
30
|
-
*
|
|
31
|
-
* @template T Type of the input value
|
|
32
|
-
* @param input Target object
|
|
33
|
-
* @returns Camel case object
|
|
34
|
-
*
|
|
35
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
36
|
-
*/
|
|
37
|
-
function camel<T>(input: T): CamelCase<T>;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* @internal
|
|
41
|
-
*/
|
|
42
|
-
function camel(): never {
|
|
43
|
-
return halt("camel");
|
|
44
|
-
}
|
|
45
|
-
const camelPure = /** @__PURE__ */ Object.assign<typeof camel, {}>(
|
|
46
|
-
camel,
|
|
47
|
-
/** @__PURE__ */ Namespace.notations.camel("camel"),
|
|
48
|
-
);
|
|
49
|
-
export { camelPure as camel };
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Converts to camel case with type assertion.
|
|
53
|
-
*
|
|
54
|
-
* Convert every property names of nested objects to follow the camel case convention.
|
|
55
|
-
* If the input value does not follow the type `T`, it throws {@link TypeGuardError}.
|
|
56
|
-
*
|
|
57
|
-
* @template T Type of the input value
|
|
58
|
-
* @param input Target object
|
|
59
|
-
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
60
|
-
* @returns Camel case object
|
|
61
|
-
*
|
|
62
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
63
|
-
*/
|
|
64
|
-
function assertCamel<T>(
|
|
65
|
-
input: T,
|
|
66
|
-
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
67
|
-
): CamelCase<T>;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Converts to camel case with type assertion.
|
|
71
|
-
*
|
|
72
|
-
* Convert every property names of nested objects to follow the camel case convention.
|
|
73
|
-
* If the input value does not follow the type `T`, it throws {@link TypeGuardError}.
|
|
74
|
-
*
|
|
75
|
-
* @template T Type of the input value
|
|
76
|
-
* @param input Target object
|
|
77
|
-
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
78
|
-
* @returns Camel case object
|
|
79
|
-
*
|
|
80
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
81
|
-
*/
|
|
82
|
-
function assertCamel<T>(
|
|
83
|
-
input: unknown,
|
|
84
|
-
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
85
|
-
): CamelCase<T>;
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* @internal
|
|
89
|
-
*/
|
|
90
|
-
function assertCamel(): never {
|
|
91
|
-
return halt("assertCamel");
|
|
92
|
-
}
|
|
93
|
-
const assertCamelPure = /** @__PURE__ */ Object.assign<
|
|
94
|
-
typeof assertCamel,
|
|
95
|
-
{},
|
|
96
|
-
{}
|
|
97
|
-
>(
|
|
98
|
-
assertCamel,
|
|
99
|
-
/** @__PURE__ */ Namespace.notations.camel("assertCamel"),
|
|
100
|
-
/** @__PURE__ */ Namespace.assert("notations.assertCamel"),
|
|
101
|
-
);
|
|
102
|
-
export { assertCamelPure as assertCamel };
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Converts to camel case with type checking.
|
|
106
|
-
*
|
|
107
|
-
* Convert every property names of nested objects to follow the camel case convention.
|
|
108
|
-
* If the input value does not follow the type `T`, it returns `null` value instead.
|
|
109
|
-
*
|
|
110
|
-
* @template T Type of the input value
|
|
111
|
-
* @param input Target object
|
|
112
|
-
* @returns Camel case object when exact type, otherwise null
|
|
113
|
-
*
|
|
114
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
115
|
-
*/
|
|
116
|
-
function isCamel<T>(input: T): CamelCase<T> | null;
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Converts to camel case with type checking.
|
|
120
|
-
*
|
|
121
|
-
* Convert every property names of nested objects to follow the camel case convention.
|
|
122
|
-
* If the input value does not follow the type `T`, it returns `null` value instead.
|
|
123
|
-
*
|
|
124
|
-
* @template T Type of the input value
|
|
125
|
-
* @param input Target object
|
|
126
|
-
* @returns Camel case object when exact type, otherwise null
|
|
127
|
-
*
|
|
128
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
129
|
-
*/
|
|
130
|
-
function isCamel<T>(input: unknown): CamelCase<T> | null;
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* @internal
|
|
134
|
-
*/
|
|
135
|
-
function isCamel(): never {
|
|
136
|
-
return halt("isCamel");
|
|
137
|
-
}
|
|
138
|
-
const isCamelPure = /** @__PURE__ */ Object.assign<typeof isCamel, {}, {}>(
|
|
139
|
-
isCamel,
|
|
140
|
-
/** @__PURE__ */ Namespace.notations.camel("isCamel"),
|
|
141
|
-
/** @__PURE__ */ Namespace.is(),
|
|
142
|
-
);
|
|
143
|
-
export { isCamelPure as isCamel };
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Converts to camel case with type validation.
|
|
147
|
-
*
|
|
148
|
-
* Convert every property names of nested objects to follow the camel case convention.
|
|
149
|
-
* If the input value does not follow the type `T`, it returns {@link IValidation.Failure}
|
|
150
|
-
* object. Otherwise, there's no problem on the input value, camel cased converted data
|
|
151
|
-
* would be stored in the `data` property of the output {@link IValidation.Success} object.
|
|
152
|
-
*
|
|
153
|
-
* @template T Type of the input value
|
|
154
|
-
* @param input Target object
|
|
155
|
-
* @returns Validation result with camel case object
|
|
156
|
-
*
|
|
157
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
158
|
-
*/
|
|
159
|
-
function validateCamel<T>(input: T): IValidation<CamelCase<T>>;
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Converts to camel case with type validation.
|
|
163
|
-
*
|
|
164
|
-
* Convert every property names of nested objects to follow the camel case convention.
|
|
165
|
-
* If the input value does not follow the type `T`, it returns {@link IValidation.Failure}
|
|
166
|
-
* object. Otherwise, there's no problem on the input value, camel cased converted data
|
|
167
|
-
* would be stored in the `data` property of the output {@link IValidation.Success} object.
|
|
168
|
-
*
|
|
169
|
-
* @template T Type of the input value
|
|
170
|
-
* @param input Target object
|
|
171
|
-
* @returns Validation result with camel case object
|
|
172
|
-
*
|
|
173
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
174
|
-
*/
|
|
175
|
-
function validateCamel<T>(input: unknown): IValidation<CamelCase<T>>;
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* @internal
|
|
179
|
-
*/
|
|
180
|
-
function validateCamel(): never {
|
|
181
|
-
return halt("validateCamel");
|
|
182
|
-
}
|
|
183
|
-
const validateCamelPure = /** @__PURE__ */ Object.assign<
|
|
184
|
-
typeof validateCamel,
|
|
185
|
-
{},
|
|
186
|
-
{}
|
|
187
|
-
>(
|
|
188
|
-
validateCamel,
|
|
189
|
-
/** @__PURE__ */ Namespace.notations.camel("validateCamel"),
|
|
190
|
-
/** @__PURE__ */ Namespace.validate(),
|
|
191
|
-
);
|
|
192
|
-
export { validateCamelPure as validateCamel };
|
|
193
|
-
|
|
194
|
-
/* -----------------------------------------------------------
|
|
195
|
-
PASCAL CASE
|
|
196
|
-
----------------------------------------------------------- */
|
|
197
|
-
/**
|
|
198
|
-
* Convert to pascal case.
|
|
199
|
-
*
|
|
200
|
-
* Convert every property names of nested objects to follow the pascal case convention.
|
|
201
|
-
*
|
|
202
|
-
* For reference, this `typia.notations.pascal()` function does not validate the input value
|
|
203
|
-
* type. It just believes that the input value is following the type `T`. Therefore,
|
|
204
|
-
* if you can't ensure the input value type, it would be better to call one of them below:
|
|
205
|
-
*
|
|
206
|
-
* - {@link assertPascal}
|
|
207
|
-
* - {@link isPascal}
|
|
208
|
-
* - {@link validatePascal}
|
|
209
|
-
*
|
|
210
|
-
* @template T Type of the input value
|
|
211
|
-
* @param input Target object
|
|
212
|
-
* @returns Pascal case object
|
|
213
|
-
*
|
|
214
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
215
|
-
*/
|
|
216
|
-
function pascal<T>(input: T): PascalCase<T>;
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* @internal
|
|
220
|
-
*/
|
|
221
|
-
function pascal(): never {
|
|
222
|
-
return halt("pascal");
|
|
223
|
-
}
|
|
224
|
-
const pascalPure = /** @__PURE__ */ Object.assign<typeof pascal, {}>(
|
|
225
|
-
pascal,
|
|
226
|
-
/** @__PURE__ */ Namespace.notations.pascal("pascal"),
|
|
227
|
-
);
|
|
228
|
-
export { pascalPure as pascal };
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* Converts to pascal case with type assertion.
|
|
232
|
-
*
|
|
233
|
-
* Convert every property names of nested objects to follow the pascal case convention.
|
|
234
|
-
* If the input value does not follow the type `T`, it throws {@link TypeGuardError}.
|
|
235
|
-
*
|
|
236
|
-
* @template T Type of the input value
|
|
237
|
-
* @param input Target object
|
|
238
|
-
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
239
|
-
* @returns Pascal case object
|
|
240
|
-
*
|
|
241
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
242
|
-
*/
|
|
243
|
-
function assertPascal<T>(
|
|
244
|
-
input: T,
|
|
245
|
-
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
246
|
-
): PascalCase<T>;
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* Converts to pascal case with type assertion.
|
|
250
|
-
*
|
|
251
|
-
* Convert every property names of nested objects to follow the pascal case convention.
|
|
252
|
-
* If the input value does not follow the type `T`, it throws {@link TypeGuardError}.
|
|
253
|
-
*
|
|
254
|
-
* @template T Type of the input value
|
|
255
|
-
* @param input Target object
|
|
256
|
-
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
257
|
-
* @returns Pascal case object
|
|
258
|
-
*
|
|
259
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
260
|
-
*/
|
|
261
|
-
function assertPascal<T>(
|
|
262
|
-
input: unknown,
|
|
263
|
-
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
264
|
-
): PascalCase<T>;
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* @internal
|
|
268
|
-
*/
|
|
269
|
-
function assertPascal(): never {
|
|
270
|
-
return halt("assertPascal");
|
|
271
|
-
}
|
|
272
|
-
const assertPascalPure = /** @__PURE__ */ Object.assign<
|
|
273
|
-
typeof assertPascal,
|
|
274
|
-
{},
|
|
275
|
-
{}
|
|
276
|
-
>(
|
|
277
|
-
assertPascal,
|
|
278
|
-
/** @__PURE__ */ Namespace.notations.pascal("assertPascal"),
|
|
279
|
-
/** @__PURE__ */ Namespace.assert("notations.assertPascal"),
|
|
280
|
-
);
|
|
281
|
-
export { assertPascalPure as assertPascal };
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* Converts to pascal case with type checking.
|
|
285
|
-
*
|
|
286
|
-
* Convert every property names of nested objects to follow the pascal case convention.
|
|
287
|
-
* If the input value does not follow the type `T`, it returns `null` value instead.
|
|
288
|
-
*
|
|
289
|
-
* @template T Type of the input value
|
|
290
|
-
* @param input Target object
|
|
291
|
-
* @returns Pascal case object when exact type, otherwise null
|
|
292
|
-
*
|
|
293
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
294
|
-
*/
|
|
295
|
-
function isPascal<T>(input: T): PascalCase<T> | null;
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* Converts to pascal case with type checking.
|
|
299
|
-
*
|
|
300
|
-
* Convert every property names of nested objects to follow the pascal case convention.
|
|
301
|
-
* If the input value does not follow the type `T`, it returns `null` value instead.
|
|
302
|
-
*
|
|
303
|
-
* @template T Type of the input value
|
|
304
|
-
* @param input Target object
|
|
305
|
-
* @returns Pascal case object when exact type, otherwise null
|
|
306
|
-
*
|
|
307
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
308
|
-
*/
|
|
309
|
-
function isPascal<T>(input: unknown): PascalCase<T> | null;
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
* @internal
|
|
313
|
-
*/
|
|
314
|
-
function isPascal(): never {
|
|
315
|
-
return halt("isPascal");
|
|
316
|
-
}
|
|
317
|
-
const isPascalPure = /** @__PURE__ */ Object.assign<typeof isPascal, {}, {}>(
|
|
318
|
-
isPascal,
|
|
319
|
-
/** @__PURE__ */ Namespace.notations.pascal("isPascal"),
|
|
320
|
-
/** @__PURE__ */ Namespace.is(),
|
|
321
|
-
);
|
|
322
|
-
export { isPascalPure as isPascal };
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* Converts to pascal case with type validation.
|
|
326
|
-
*
|
|
327
|
-
* Convert every property names of nested objects to follow the pascal case convention.
|
|
328
|
-
* If the input value does not follow the type `T`, it returns {@link IValidation.Failure}
|
|
329
|
-
* object. Otherwise, there's no problem on the input value, pascal cased converted data
|
|
330
|
-
* would be stored in the `data` property of the output {@link IValidation.Success} object.
|
|
331
|
-
*
|
|
332
|
-
* @template T Type of the input value
|
|
333
|
-
* @param input Target object
|
|
334
|
-
* @returns Validation result with pascal case object
|
|
335
|
-
*
|
|
336
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
337
|
-
*/
|
|
338
|
-
function validatePascal<T>(input: T): IValidation<PascalCase<T>>;
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* Converts to pascal case with type validation.
|
|
342
|
-
*
|
|
343
|
-
* Convert every property names of nested objects to follow the pascal case convention.
|
|
344
|
-
* If the input value does not follow the type `T`, it returns {@link IValidation.Failure}
|
|
345
|
-
* object. Otherwise, there's no problem on the input value, pascal cased converted data
|
|
346
|
-
* would be stored in the `data` property of the output {@link IValidation.Success} object.
|
|
347
|
-
*
|
|
348
|
-
* @template T Type of the input value
|
|
349
|
-
* @param input Target object
|
|
350
|
-
* @returns Validation result with pascal case object
|
|
351
|
-
*
|
|
352
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
353
|
-
*/
|
|
354
|
-
function validatePascal<T>(input: unknown): IValidation<PascalCase<T>>;
|
|
355
|
-
|
|
356
|
-
/**
|
|
357
|
-
* @internal
|
|
358
|
-
*/
|
|
359
|
-
function validatePascal(): never {
|
|
360
|
-
return halt("validatePascal");
|
|
361
|
-
}
|
|
362
|
-
const validatePascalPure = /** @__PURE__ */ Object.assign<
|
|
363
|
-
typeof validatePascal,
|
|
364
|
-
{},
|
|
365
|
-
{}
|
|
366
|
-
>(
|
|
367
|
-
validatePascal,
|
|
368
|
-
/** @__PURE__ */ Namespace.notations.pascal("validatePascal"),
|
|
369
|
-
/** @__PURE__ */ Namespace.validate(),
|
|
370
|
-
);
|
|
371
|
-
export { validatePascalPure as validatePascal };
|
|
372
|
-
|
|
373
|
-
/* -----------------------------------------------------------
|
|
374
|
-
SNAKE CASE
|
|
375
|
-
----------------------------------------------------------- */
|
|
376
|
-
/**
|
|
377
|
-
* Convert to snake case.
|
|
378
|
-
*
|
|
379
|
-
* Convert every property names of nested objects to follow the snake case convention.
|
|
380
|
-
*
|
|
381
|
-
* For reference, this `typia.notations.snake()` function does not validate the input value
|
|
382
|
-
* type. It just believes that the input value is following the type `T`. Therefore,
|
|
383
|
-
* if you can't ensure the input value type, it would be better to call one of them below:
|
|
384
|
-
*
|
|
385
|
-
* - {@link assertSnake}
|
|
386
|
-
* - {@link isSnake}
|
|
387
|
-
* - {@link validateSnake}
|
|
388
|
-
*
|
|
389
|
-
* @template T Type of the input value
|
|
390
|
-
* @param input Target object
|
|
391
|
-
* @returns Snake case object
|
|
392
|
-
*
|
|
393
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
394
|
-
*/
|
|
395
|
-
function snake<T>(input: T): SnakeCase<T>;
|
|
396
|
-
|
|
397
|
-
/**
|
|
398
|
-
* @internal
|
|
399
|
-
*/
|
|
400
|
-
function snake(): never {
|
|
401
|
-
return halt("snake");
|
|
402
|
-
}
|
|
403
|
-
const snakePure = /** @__PURE__ */ Object.assign<typeof snake, {}>(
|
|
404
|
-
snake,
|
|
405
|
-
/** @__PURE__ */ Namespace.notations.snake("snake"),
|
|
406
|
-
);
|
|
407
|
-
export { snakePure as snake };
|
|
408
|
-
|
|
409
|
-
/**
|
|
410
|
-
* Converts to snake case with type assertion.
|
|
411
|
-
*
|
|
412
|
-
* Convert every property names of nested objects to follow the snake case convention.
|
|
413
|
-
* If the input value does not follow the type `T`, it throws {@link TypeGuardError}.
|
|
414
|
-
*
|
|
415
|
-
* @template T Type of the input value
|
|
416
|
-
* @param input Target object
|
|
417
|
-
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
418
|
-
* @returns Snake case object
|
|
419
|
-
*
|
|
420
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
421
|
-
*/
|
|
422
|
-
function assertSnake<T>(
|
|
423
|
-
input: T,
|
|
424
|
-
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
425
|
-
): SnakeCase<T>;
|
|
426
|
-
|
|
427
|
-
/**
|
|
428
|
-
* Converts to snake case with type assertion.
|
|
429
|
-
*
|
|
430
|
-
* Convert every property names of nested objects to follow the snake case convention.
|
|
431
|
-
* If the input value does not follow the type `T`, it throws {@link TypeGuardError}.
|
|
432
|
-
*
|
|
433
|
-
* @template T Type of the input value
|
|
434
|
-
* @param input Target object
|
|
435
|
-
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
436
|
-
* @returns Snake case object
|
|
437
|
-
*
|
|
438
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
439
|
-
*/
|
|
440
|
-
function assertSnake<T>(
|
|
441
|
-
input: unknown,
|
|
442
|
-
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
443
|
-
): SnakeCase<T>;
|
|
444
|
-
|
|
445
|
-
/**
|
|
446
|
-
* @internal
|
|
447
|
-
*/
|
|
448
|
-
function assertSnake(): never {
|
|
449
|
-
return halt("assertSnake");
|
|
450
|
-
}
|
|
451
|
-
const assertSnakePure = /** @__PURE__ */ Object.assign<
|
|
452
|
-
typeof assertSnake,
|
|
453
|
-
{},
|
|
454
|
-
{}
|
|
455
|
-
>(
|
|
456
|
-
assertSnake,
|
|
457
|
-
/** @__PURE__ */ Namespace.notations.snake("assertSnake"),
|
|
458
|
-
/** @__PURE__ */ Namespace.assert("notations.assertSnake"),
|
|
459
|
-
);
|
|
460
|
-
export { assertSnakePure as assertSnake };
|
|
461
|
-
|
|
462
|
-
/**
|
|
463
|
-
* Converts to snake case with type checking.
|
|
464
|
-
*
|
|
465
|
-
* Convert every property names of nested objects to follow the snake case convention.
|
|
466
|
-
* If the input value does not follow the type `T`, it returns `null` value instead.
|
|
467
|
-
*
|
|
468
|
-
* @template T Type of the input value
|
|
469
|
-
* @param input Target object
|
|
470
|
-
* @returns Snake case object when exact type, otherwise null
|
|
471
|
-
*
|
|
472
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
473
|
-
*/
|
|
474
|
-
function isSnake<T>(input: T): SnakeCase<T> | null;
|
|
475
|
-
|
|
476
|
-
/**
|
|
477
|
-
* Converts to snake case with type checking.
|
|
478
|
-
*
|
|
479
|
-
* Convert every property names of nested objects to follow the snake case convention.
|
|
480
|
-
* If the input value does not follow the type `T`, it returns `null` value instead.
|
|
481
|
-
*
|
|
482
|
-
* @template T Type of the input value
|
|
483
|
-
* @param input Target object
|
|
484
|
-
* @returns Snake case object when exact type, otherwise null
|
|
485
|
-
*
|
|
486
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
487
|
-
*/
|
|
488
|
-
function isSnake<T>(input: unknown): SnakeCase<T> | null;
|
|
489
|
-
|
|
490
|
-
/**
|
|
491
|
-
* @internal
|
|
492
|
-
*/
|
|
493
|
-
function isSnake(): never {
|
|
494
|
-
return halt("isSnake");
|
|
495
|
-
}
|
|
496
|
-
const isSnakePure = /** @__PURE__ */ Object.assign<typeof isSnake, {}, {}>(
|
|
497
|
-
isSnake,
|
|
498
|
-
/** @__PURE__ */ Namespace.notations.snake("isSnake"),
|
|
499
|
-
/** @__PURE__ */ Namespace.is(),
|
|
500
|
-
);
|
|
501
|
-
export { isSnakePure as isSnake };
|
|
502
|
-
|
|
503
|
-
/**
|
|
504
|
-
* Converts to snake case with type validation.
|
|
505
|
-
*
|
|
506
|
-
* Convert every property names of nested objects to follow the snake case convention.
|
|
507
|
-
* If the input value does not follow the type `T`, it returns {@link IValidation.Failure}
|
|
508
|
-
* object. Otherwise, there's no problem on the input value, snake cased converted data
|
|
509
|
-
* would be stored in the `data` property of the output {@link IValidation.Success} object.
|
|
510
|
-
*
|
|
511
|
-
* @template T Type of the input value
|
|
512
|
-
* @param input Target object
|
|
513
|
-
* @returns Validation result with snake case object
|
|
514
|
-
*
|
|
515
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
516
|
-
*/
|
|
517
|
-
function validateSnake<T>(input: T): IValidation<SnakeCase<T>>;
|
|
518
|
-
|
|
519
|
-
/**
|
|
520
|
-
* Converts to snake case with type validation.
|
|
521
|
-
*
|
|
522
|
-
* Convert every property names of nested objects to follow the snake case convention.
|
|
523
|
-
* If the input value does not follow the type `T`, it returns {@link IValidation.Failure}
|
|
524
|
-
* object. Otherwise, there's no problem on the input value, snake cased converted data
|
|
525
|
-
* would be stored in the `data` property of the output {@link IValidation.Success} object.
|
|
526
|
-
*
|
|
527
|
-
* @template T Type of the input value
|
|
528
|
-
* @param input Target object
|
|
529
|
-
* @returns Validation result with snake case object
|
|
530
|
-
*
|
|
531
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
532
|
-
*/
|
|
533
|
-
function validateSnake<T>(input: unknown): IValidation<SnakeCase<T>>;
|
|
534
|
-
|
|
535
|
-
/**
|
|
536
|
-
* @internal
|
|
537
|
-
*/
|
|
538
|
-
function validateSnake(): never {
|
|
539
|
-
return halt("validateSnake");
|
|
540
|
-
}
|
|
541
|
-
const validateSnakePure = /** @__PURE__ */ Object.assign<
|
|
542
|
-
typeof validateSnake,
|
|
543
|
-
{},
|
|
544
|
-
{}
|
|
545
|
-
>(
|
|
546
|
-
validateSnake,
|
|
547
|
-
/** @__PURE__ */ Namespace.notations.snake("validateSnake"),
|
|
548
|
-
/** @__PURE__ */ Namespace.validate(),
|
|
549
|
-
);
|
|
550
|
-
export { validateSnakePure as validateSnake };
|
|
551
|
-
/* -----------------------------------------------------------
|
|
552
|
-
FACTORY FUNCTIONS
|
|
553
|
-
----------------------------------------------------------- */
|
|
554
|
-
/**
|
|
555
|
-
* Creates a reusable {@link camel} function.
|
|
556
|
-
*
|
|
557
|
-
* @danger You must configure the generic argument `T`
|
|
558
|
-
* @returns Nothing until be configure the generic argument `T`
|
|
559
|
-
* @throws compile error
|
|
560
|
-
*
|
|
561
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
562
|
-
*/
|
|
563
|
-
function createCamel(): never;
|
|
564
|
-
|
|
565
|
-
/**
|
|
566
|
-
* Creates a reusable {@link camel} function.
|
|
567
|
-
*
|
|
568
|
-
* @template T Type of the input value
|
|
569
|
-
* @returns A reusable `camel` function
|
|
570
|
-
*
|
|
571
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
572
|
-
*/
|
|
573
|
-
function createCamel<T>(): (input: T) => CamelCase<T>;
|
|
574
|
-
|
|
575
|
-
/**
|
|
576
|
-
* @internal
|
|
577
|
-
*/
|
|
578
|
-
function createCamel(): never {
|
|
579
|
-
halt("createCamel");
|
|
580
|
-
}
|
|
581
|
-
const createCamelPure = /** @__PURE__ */ Object.assign<typeof createCamel, {}>(
|
|
582
|
-
createCamel,
|
|
583
|
-
/** @__PURE__ */ Namespace.notations.camel("createCamel"),
|
|
584
|
-
);
|
|
585
|
-
export { createCamelPure as createCamel };
|
|
586
|
-
|
|
587
|
-
/**
|
|
588
|
-
* Creates a reusable {@link assertCamel} function.
|
|
589
|
-
*
|
|
590
|
-
* @danger You must configure the generic argument `T`
|
|
591
|
-
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
592
|
-
* @returns Nothing until be configure the generic argument `T`
|
|
593
|
-
* @throws compile error
|
|
594
|
-
*
|
|
595
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
596
|
-
*/
|
|
597
|
-
function createAssertCamel(
|
|
598
|
-
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
599
|
-
): never;
|
|
600
|
-
|
|
601
|
-
/**
|
|
602
|
-
* Creates a reusable {@link assertCamel} function.
|
|
603
|
-
*
|
|
604
|
-
* @template T Type of the input value
|
|
605
|
-
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
606
|
-
* @returns A reusable `assertCamel` function
|
|
607
|
-
*
|
|
608
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
609
|
-
*/
|
|
610
|
-
function createAssertCamel<T>(
|
|
611
|
-
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
612
|
-
): (input: T) => CamelCase<T>;
|
|
613
|
-
|
|
614
|
-
/**
|
|
615
|
-
* @internal
|
|
616
|
-
*/
|
|
617
|
-
function createAssertCamel(): never {
|
|
618
|
-
halt("createAssertCamel");
|
|
619
|
-
}
|
|
620
|
-
const createAssertCamelPure = /** @__PURE__ */ Object.assign<
|
|
621
|
-
typeof createAssertCamel,
|
|
622
|
-
{},
|
|
623
|
-
{}
|
|
624
|
-
>(
|
|
625
|
-
createAssertCamel,
|
|
626
|
-
/** @__PURE__ */ Namespace.notations.camel("createAssertCamel"),
|
|
627
|
-
/** @__PURE__ */ Namespace.assert("notations.createAssertCamel"),
|
|
628
|
-
);
|
|
629
|
-
export { createAssertCamelPure as createAssertCamel };
|
|
630
|
-
|
|
631
|
-
/**
|
|
632
|
-
* Creates a reusable {@link isCamel} function.
|
|
633
|
-
*
|
|
634
|
-
* @danger You must configure the generic argument `T`
|
|
635
|
-
* @returns Nothing until be configure the generic argument `T`
|
|
636
|
-
* @throws compile error
|
|
637
|
-
*
|
|
638
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
639
|
-
*/
|
|
640
|
-
function createIsCamel(): never;
|
|
641
|
-
|
|
642
|
-
/**
|
|
643
|
-
* Creates a reusable {@link isCamel} function.
|
|
644
|
-
*
|
|
645
|
-
* @template T Type of the input value
|
|
646
|
-
* @returns A reusable `isCamel` function
|
|
647
|
-
*
|
|
648
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
649
|
-
*/
|
|
650
|
-
function createIsCamel<T>(): (input: T) => CamelCase<T> | null;
|
|
651
|
-
|
|
652
|
-
/**
|
|
653
|
-
* @internal
|
|
654
|
-
*/
|
|
655
|
-
function createIsCamel(): never {
|
|
656
|
-
halt("createIsCamel");
|
|
657
|
-
}
|
|
658
|
-
const createIsCamelPure = /** @__PURE__ */ Object.assign<
|
|
659
|
-
typeof createIsCamel,
|
|
660
|
-
{},
|
|
661
|
-
{}
|
|
662
|
-
>(
|
|
663
|
-
createIsCamel,
|
|
664
|
-
/** @__PURE__ */ Namespace.notations.camel("createIsCamel"),
|
|
665
|
-
/** @__PURE__ */ Namespace.is(),
|
|
666
|
-
);
|
|
667
|
-
export { createIsCamelPure as createIsCamel };
|
|
668
|
-
|
|
669
|
-
/**
|
|
670
|
-
* Creates a reusable {@link validateCamel} function.
|
|
671
|
-
*
|
|
672
|
-
* @danger You must configure the generic argument `T`
|
|
673
|
-
* @returns Nothing until be configure the generic argument `T`
|
|
674
|
-
* @throws compile error
|
|
675
|
-
*
|
|
676
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
677
|
-
*/
|
|
678
|
-
function createValidateCamel(): never;
|
|
679
|
-
|
|
680
|
-
/**
|
|
681
|
-
* Creates a reusable {@link validateCamel} function.
|
|
682
|
-
*
|
|
683
|
-
* @template T Type of the input value
|
|
684
|
-
* @returns A reusable `validateCamel` function
|
|
685
|
-
*
|
|
686
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
687
|
-
*/
|
|
688
|
-
function createValidateCamel<T>(): (input: T) => IValidation<CamelCase<T>>;
|
|
689
|
-
|
|
690
|
-
/**
|
|
691
|
-
* @internal
|
|
692
|
-
*/
|
|
693
|
-
function createValidateCamel(): never {
|
|
694
|
-
halt("createValidateCamel");
|
|
695
|
-
}
|
|
696
|
-
const createValidateCamelPure = /** @__PURE__ */ Object.assign<
|
|
697
|
-
typeof createValidateCamel,
|
|
698
|
-
{},
|
|
699
|
-
{}
|
|
700
|
-
>(
|
|
701
|
-
createValidateCamel,
|
|
702
|
-
/** @__PURE__ */ Namespace.notations.camel("createValidateCamel"),
|
|
703
|
-
/** @__PURE__ */ Namespace.validate(),
|
|
704
|
-
);
|
|
705
|
-
export { createValidateCamelPure as createValidateCamel };
|
|
706
|
-
|
|
707
|
-
/**
|
|
708
|
-
* Creates a reusable {@link pascal} function.
|
|
709
|
-
*
|
|
710
|
-
* @danger You must configure the generic argument `T`
|
|
711
|
-
* @returns Nothing until be configure the generic argument `T`
|
|
712
|
-
* @throws compile error
|
|
713
|
-
*
|
|
714
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
715
|
-
*/
|
|
716
|
-
function createPascal(): never;
|
|
717
|
-
|
|
718
|
-
/**
|
|
719
|
-
* Creates a reusable {@link pascal} function.
|
|
720
|
-
*
|
|
721
|
-
* @template T Type of the input value
|
|
722
|
-
* @returns A reusable `pascal` function
|
|
723
|
-
*
|
|
724
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
725
|
-
*/
|
|
726
|
-
function createPascal<T>(): (input: T) => PascalCase<T>;
|
|
727
|
-
|
|
728
|
-
/**
|
|
729
|
-
* @internal
|
|
730
|
-
*/
|
|
731
|
-
function createPascal(): never {
|
|
732
|
-
halt("createPascal");
|
|
733
|
-
}
|
|
734
|
-
const createPascalPure = /** @__PURE__ */ Object.assign<
|
|
735
|
-
typeof createPascal,
|
|
736
|
-
{}
|
|
737
|
-
>(createPascal, /** @__PURE__ */ Namespace.notations.pascal("createPascal"));
|
|
738
|
-
export { createPascalPure as createPascal };
|
|
739
|
-
|
|
740
|
-
/**
|
|
741
|
-
* Creates a reusable {@link assertPascal} function.
|
|
742
|
-
*
|
|
743
|
-
* @danger You must configure the generic argument `T`
|
|
744
|
-
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
745
|
-
* @returns Nothing until be configure the generic argument `T`
|
|
746
|
-
* @throws compile error
|
|
747
|
-
*
|
|
748
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
749
|
-
*/
|
|
750
|
-
function createAssertPascal(
|
|
751
|
-
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
752
|
-
): never;
|
|
753
|
-
|
|
754
|
-
/**
|
|
755
|
-
* Creates a reusable {@link assertPascal} function.
|
|
756
|
-
*
|
|
757
|
-
* @template T Type of the input value
|
|
758
|
-
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
759
|
-
* @returns A reusable `assertPascal` function
|
|
760
|
-
*
|
|
761
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
762
|
-
*/
|
|
763
|
-
function createAssertPascal<T>(
|
|
764
|
-
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
765
|
-
): (input: T) => PascalCase<T>;
|
|
766
|
-
|
|
767
|
-
/**
|
|
768
|
-
* @internal
|
|
769
|
-
*/
|
|
770
|
-
function createAssertPascal(): never {
|
|
771
|
-
halt("createAssertPascal");
|
|
772
|
-
}
|
|
773
|
-
const createAssertPascalPure = /** @__PURE__ */ Object.assign<
|
|
774
|
-
typeof createAssertPascal,
|
|
775
|
-
{},
|
|
776
|
-
{}
|
|
777
|
-
>(
|
|
778
|
-
createAssertPascal,
|
|
779
|
-
/** @__PURE__ */ Namespace.notations.pascal("createAssertPascal"),
|
|
780
|
-
/** @__PURE__ */ Namespace.assert("notations.createAssertPascal"),
|
|
781
|
-
);
|
|
782
|
-
export { createAssertPascalPure as createAssertPascal };
|
|
783
|
-
|
|
784
|
-
/**
|
|
785
|
-
* Creates a reusable {@link isPascal} function.
|
|
786
|
-
*
|
|
787
|
-
* @danger You must configure the generic argument `T`
|
|
788
|
-
* @returns Nothing until be configure the generic argument `T`
|
|
789
|
-
* @throws compile error
|
|
790
|
-
*
|
|
791
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
792
|
-
*/
|
|
793
|
-
function createIsPascal(): never;
|
|
794
|
-
|
|
795
|
-
/**
|
|
796
|
-
* Creates a reusable {@link isPascal} function.
|
|
797
|
-
*
|
|
798
|
-
* @template T Type of the input value
|
|
799
|
-
* @returns A reusable `isPascal` function
|
|
800
|
-
*
|
|
801
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
802
|
-
*/
|
|
803
|
-
function createIsPascal<T>(): (input: T) => PascalCase<T> | null;
|
|
804
|
-
|
|
805
|
-
/**
|
|
806
|
-
* @internal
|
|
807
|
-
*/
|
|
808
|
-
function createIsPascal(): never {
|
|
809
|
-
halt("createIsPascal");
|
|
810
|
-
}
|
|
811
|
-
const createIsPascalPure = /** @__PURE__ */ Object.assign<
|
|
812
|
-
typeof createIsPascal,
|
|
813
|
-
{},
|
|
814
|
-
{}
|
|
815
|
-
>(
|
|
816
|
-
createIsPascal,
|
|
817
|
-
/** @__PURE__ */ Namespace.notations.pascal("createIsPascal"),
|
|
818
|
-
/** @__PURE__ */ Namespace.is(),
|
|
819
|
-
);
|
|
820
|
-
export { createIsPascalPure as createIsPascal };
|
|
821
|
-
|
|
822
|
-
/**
|
|
823
|
-
* Creates a reusable {@link validatePascal} function.
|
|
824
|
-
*
|
|
825
|
-
* @danger You must configure the generic argument `T`
|
|
826
|
-
* @returns Nothing until be configure the generic argument `T`
|
|
827
|
-
* @throws compile error
|
|
828
|
-
*
|
|
829
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
830
|
-
*/
|
|
831
|
-
function createValidatePascal(): never;
|
|
832
|
-
|
|
833
|
-
/**
|
|
834
|
-
* Creates a reusable {@link validatePascal} function.
|
|
835
|
-
*
|
|
836
|
-
* @template T Type of the input value
|
|
837
|
-
* @returns A reusable `validatePascal` function
|
|
838
|
-
*
|
|
839
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
840
|
-
*/
|
|
841
|
-
function createValidatePascal<T>(): (input: T) => IValidation<PascalCase<T>>;
|
|
842
|
-
|
|
843
|
-
/**
|
|
844
|
-
* @internal
|
|
845
|
-
*/
|
|
846
|
-
function createValidatePascal(): never {
|
|
847
|
-
halt("createValidatePascal");
|
|
848
|
-
}
|
|
849
|
-
const createValidatePascalPure = /** @__PURE__ */ Object.assign<
|
|
850
|
-
typeof createValidatePascal,
|
|
851
|
-
{},
|
|
852
|
-
{}
|
|
853
|
-
>(
|
|
854
|
-
createValidatePascal,
|
|
855
|
-
/** @__PURE__ */ Namespace.notations.pascal("createValidatePascal"),
|
|
856
|
-
/** @__PURE__ */ Namespace.validate(),
|
|
857
|
-
);
|
|
858
|
-
export { createValidatePascalPure as createValidatePascal };
|
|
859
|
-
|
|
860
|
-
/**
|
|
861
|
-
* Creates a reusable {@link snake} function.
|
|
862
|
-
*
|
|
863
|
-
* @danger You must configure the generic argument `T`
|
|
864
|
-
* @returns Nothing until be configure the generic argument `T`
|
|
865
|
-
* @throws compile error
|
|
866
|
-
*
|
|
867
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
868
|
-
*/
|
|
869
|
-
function createSnake(): never;
|
|
870
|
-
|
|
871
|
-
/**
|
|
872
|
-
* Creates a reusable {@link snake} function.
|
|
873
|
-
*
|
|
874
|
-
* @template T Type of the input value
|
|
875
|
-
* @returns A reusable `snake` function
|
|
876
|
-
*
|
|
877
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
878
|
-
*/
|
|
879
|
-
function createSnake<T>(): (input: T) => SnakeCase<T>;
|
|
880
|
-
|
|
881
|
-
/**
|
|
882
|
-
* @internal
|
|
883
|
-
*/
|
|
884
|
-
function createSnake(): never {
|
|
885
|
-
halt("createSnake");
|
|
886
|
-
}
|
|
887
|
-
const createSnakePure = /** @__PURE__ */ Object.assign<typeof createSnake, {}>(
|
|
888
|
-
createSnake,
|
|
889
|
-
/** @__PURE__ */ Namespace.notations.snake("createSnake"),
|
|
890
|
-
);
|
|
891
|
-
export { createSnakePure as createSnake };
|
|
892
|
-
|
|
893
|
-
/**
|
|
894
|
-
* Creates a reusable {@link assertSnake} function.
|
|
895
|
-
*
|
|
896
|
-
* @danger You must configure the generic argument `T`
|
|
897
|
-
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
898
|
-
* @returns Nothing until be configure the generic argument `T`
|
|
899
|
-
* @throws compile error
|
|
900
|
-
*
|
|
901
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
902
|
-
*/
|
|
903
|
-
function createAssertSnake(
|
|
904
|
-
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
905
|
-
): never;
|
|
906
|
-
|
|
907
|
-
/**
|
|
908
|
-
* Creates a reusable {@link assertSnake} function.
|
|
909
|
-
*
|
|
910
|
-
* @template T Type of the input value
|
|
911
|
-
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
912
|
-
* @returns A reusable `assertSnake` function
|
|
913
|
-
*
|
|
914
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
915
|
-
*/
|
|
916
|
-
function createAssertSnake<T>(
|
|
917
|
-
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
918
|
-
): (input: T) => SnakeCase<T>;
|
|
919
|
-
|
|
920
|
-
/**
|
|
921
|
-
* @internal
|
|
922
|
-
*/
|
|
923
|
-
function createAssertSnake(): never {
|
|
924
|
-
halt("createAssertSnake");
|
|
925
|
-
}
|
|
926
|
-
const createAssertSnakePure = /** @__PURE__ */ Object.assign<
|
|
927
|
-
typeof createAssertSnake,
|
|
928
|
-
{},
|
|
929
|
-
{}
|
|
930
|
-
>(
|
|
931
|
-
createAssertSnake,
|
|
932
|
-
/** @__PURE__ */ Namespace.notations.snake("createAssertSnake"),
|
|
933
|
-
/** @__PURE__ */ Namespace.assert("notations.createAssertSnake"),
|
|
934
|
-
);
|
|
935
|
-
export { createAssertSnakePure as createAssertSnake };
|
|
936
|
-
|
|
937
|
-
/**
|
|
938
|
-
* Creates a reusable {@link isSnake} function.
|
|
939
|
-
*
|
|
940
|
-
* @danger You must configure the generic argument `T`
|
|
941
|
-
* @returns Nothing until be configure the generic argument `T`
|
|
942
|
-
* @throws compile error
|
|
943
|
-
*
|
|
944
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
945
|
-
*/
|
|
946
|
-
function createIsSnake(): never;
|
|
947
|
-
|
|
948
|
-
/**
|
|
949
|
-
* Creates a reusable {@link isSnake} function.
|
|
950
|
-
*
|
|
951
|
-
* @template T Type of the input value
|
|
952
|
-
* @returns A reusable `isSnake` function
|
|
953
|
-
*
|
|
954
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
955
|
-
*/
|
|
956
|
-
function createIsSnake<T>(): (input: T) => SnakeCase<T> | null;
|
|
957
|
-
|
|
958
|
-
/**
|
|
959
|
-
* @internal
|
|
960
|
-
*/
|
|
961
|
-
function createIsSnake(): never {
|
|
962
|
-
halt("createIsSnake");
|
|
963
|
-
}
|
|
964
|
-
const createIsSnakePure = /** @__PURE__ */ Object.assign<
|
|
965
|
-
typeof createIsSnake,
|
|
966
|
-
{},
|
|
967
|
-
{}
|
|
968
|
-
>(
|
|
969
|
-
createIsSnake,
|
|
970
|
-
/** @__PURE__ */ Namespace.notations.snake("createIsSnake"),
|
|
971
|
-
/** @__PURE__ */ Namespace.is(),
|
|
972
|
-
);
|
|
973
|
-
export { createIsSnakePure as createIsSnake };
|
|
974
|
-
|
|
975
|
-
/**
|
|
976
|
-
* Creates a reusable {@link validateSnake} function.
|
|
977
|
-
*
|
|
978
|
-
* @danger You must configure the generic argument `T`
|
|
979
|
-
* @returns Nothing until be configure the generic argument `T`
|
|
980
|
-
* @throws compile error
|
|
981
|
-
*
|
|
982
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
983
|
-
*/
|
|
984
|
-
function createValidateSnake(): never;
|
|
985
|
-
|
|
986
|
-
/**
|
|
987
|
-
* Creates a reusable {@link validateSnake} function.
|
|
988
|
-
*
|
|
989
|
-
* @template T Type of the input value
|
|
990
|
-
* @returns A reusable `validateSnake` function
|
|
991
|
-
*
|
|
992
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
993
|
-
*/
|
|
994
|
-
function createValidateSnake<T>(): (input: T) => IValidation<SnakeCase<T>>;
|
|
995
|
-
|
|
996
|
-
/**
|
|
997
|
-
* @internal
|
|
998
|
-
*/
|
|
999
|
-
function createValidateSnake(): never {
|
|
1000
|
-
halt("createValidateSnake");
|
|
1001
|
-
}
|
|
1002
|
-
const createValidateSnakePure = /** @__PURE__ */ Object.assign<
|
|
1003
|
-
typeof createValidateSnake,
|
|
1004
|
-
{},
|
|
1005
|
-
{}
|
|
1006
|
-
>(
|
|
1007
|
-
createValidateSnake,
|
|
1008
|
-
/** @__PURE__ */ Namespace.notations.snake("createValidateSnake"),
|
|
1009
|
-
/** @__PURE__ */ Namespace.validate(),
|
|
1010
|
-
);
|
|
1011
|
-
export { createValidateSnakePure as createValidateSnake };
|
|
1012
|
-
|
|
1013
|
-
/**
|
|
1014
|
-
* @internal
|
|
1015
|
-
*/
|
|
1016
|
-
function halt(name: string): never {
|
|
1017
|
-
throw new Error(
|
|
1018
|
-
`Error on typia.notations.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`,
|
|
1019
|
-
);
|
|
1020
|
-
}
|
|
1
|
+
import * as Namespace from "./functional/Namespace";
|
|
2
|
+
|
|
3
|
+
import { CamelCase } from "./CamelCase";
|
|
4
|
+
import { IValidation } from "./IValidation";
|
|
5
|
+
import { PascalCase } from "./PascalCase";
|
|
6
|
+
import { SnakeCase } from "./SnakeCase";
|
|
7
|
+
import { TypeGuardError } from "./TypeGuardError";
|
|
8
|
+
|
|
9
|
+
/* ===========================================================
|
|
10
|
+
NOTATIONS (NAMING CONVENTIONS)
|
|
11
|
+
- CAMEL CASE
|
|
12
|
+
- PASCAL CASE
|
|
13
|
+
- SNAKE CASE
|
|
14
|
+
- FACTORY FUNCTIONS
|
|
15
|
+
==============================================================
|
|
16
|
+
CAMEL CASE
|
|
17
|
+
----------------------------------------------------------- */
|
|
18
|
+
/**
|
|
19
|
+
* Convert to camel case.
|
|
20
|
+
*
|
|
21
|
+
* Convert every property names of nested objects to follow the camel case convention.
|
|
22
|
+
*
|
|
23
|
+
* For reference, this `typia.notations.camel()` function does not validate the input value
|
|
24
|
+
* type. It just believes that the input value is following the type `T`. Therefore,
|
|
25
|
+
* if you can't ensure the input value type, it would be better to call one of them below:
|
|
26
|
+
*
|
|
27
|
+
* - {@link assertCamel}
|
|
28
|
+
* - {@link isCamel}
|
|
29
|
+
* - {@link validateCamel}
|
|
30
|
+
*
|
|
31
|
+
* @template T Type of the input value
|
|
32
|
+
* @param input Target object
|
|
33
|
+
* @returns Camel case object
|
|
34
|
+
*
|
|
35
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
36
|
+
*/
|
|
37
|
+
function camel<T>(input: T): CamelCase<T>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
function camel(): never {
|
|
43
|
+
return halt("camel");
|
|
44
|
+
}
|
|
45
|
+
const camelPure = /** @__PURE__ */ Object.assign<typeof camel, {}>(
|
|
46
|
+
camel,
|
|
47
|
+
/** @__PURE__ */ Namespace.notations.camel("camel"),
|
|
48
|
+
);
|
|
49
|
+
export { camelPure as camel };
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Converts to camel case with type assertion.
|
|
53
|
+
*
|
|
54
|
+
* Convert every property names of nested objects to follow the camel case convention.
|
|
55
|
+
* If the input value does not follow the type `T`, it throws {@link TypeGuardError}.
|
|
56
|
+
*
|
|
57
|
+
* @template T Type of the input value
|
|
58
|
+
* @param input Target object
|
|
59
|
+
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
60
|
+
* @returns Camel case object
|
|
61
|
+
*
|
|
62
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
63
|
+
*/
|
|
64
|
+
function assertCamel<T>(
|
|
65
|
+
input: T,
|
|
66
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
67
|
+
): CamelCase<T>;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Converts to camel case with type assertion.
|
|
71
|
+
*
|
|
72
|
+
* Convert every property names of nested objects to follow the camel case convention.
|
|
73
|
+
* If the input value does not follow the type `T`, it throws {@link TypeGuardError}.
|
|
74
|
+
*
|
|
75
|
+
* @template T Type of the input value
|
|
76
|
+
* @param input Target object
|
|
77
|
+
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
78
|
+
* @returns Camel case object
|
|
79
|
+
*
|
|
80
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
81
|
+
*/
|
|
82
|
+
function assertCamel<T>(
|
|
83
|
+
input: unknown,
|
|
84
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
85
|
+
): CamelCase<T>;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* @internal
|
|
89
|
+
*/
|
|
90
|
+
function assertCamel(): never {
|
|
91
|
+
return halt("assertCamel");
|
|
92
|
+
}
|
|
93
|
+
const assertCamelPure = /** @__PURE__ */ Object.assign<
|
|
94
|
+
typeof assertCamel,
|
|
95
|
+
{},
|
|
96
|
+
{}
|
|
97
|
+
>(
|
|
98
|
+
assertCamel,
|
|
99
|
+
/** @__PURE__ */ Namespace.notations.camel("assertCamel"),
|
|
100
|
+
/** @__PURE__ */ Namespace.assert("notations.assertCamel"),
|
|
101
|
+
);
|
|
102
|
+
export { assertCamelPure as assertCamel };
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Converts to camel case with type checking.
|
|
106
|
+
*
|
|
107
|
+
* Convert every property names of nested objects to follow the camel case convention.
|
|
108
|
+
* If the input value does not follow the type `T`, it returns `null` value instead.
|
|
109
|
+
*
|
|
110
|
+
* @template T Type of the input value
|
|
111
|
+
* @param input Target object
|
|
112
|
+
* @returns Camel case object when exact type, otherwise null
|
|
113
|
+
*
|
|
114
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
115
|
+
*/
|
|
116
|
+
function isCamel<T>(input: T): CamelCase<T> | null;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Converts to camel case with type checking.
|
|
120
|
+
*
|
|
121
|
+
* Convert every property names of nested objects to follow the camel case convention.
|
|
122
|
+
* If the input value does not follow the type `T`, it returns `null` value instead.
|
|
123
|
+
*
|
|
124
|
+
* @template T Type of the input value
|
|
125
|
+
* @param input Target object
|
|
126
|
+
* @returns Camel case object when exact type, otherwise null
|
|
127
|
+
*
|
|
128
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
129
|
+
*/
|
|
130
|
+
function isCamel<T>(input: unknown): CamelCase<T> | null;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @internal
|
|
134
|
+
*/
|
|
135
|
+
function isCamel(): never {
|
|
136
|
+
return halt("isCamel");
|
|
137
|
+
}
|
|
138
|
+
const isCamelPure = /** @__PURE__ */ Object.assign<typeof isCamel, {}, {}>(
|
|
139
|
+
isCamel,
|
|
140
|
+
/** @__PURE__ */ Namespace.notations.camel("isCamel"),
|
|
141
|
+
/** @__PURE__ */ Namespace.is(),
|
|
142
|
+
);
|
|
143
|
+
export { isCamelPure as isCamel };
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Converts to camel case with type validation.
|
|
147
|
+
*
|
|
148
|
+
* Convert every property names of nested objects to follow the camel case convention.
|
|
149
|
+
* If the input value does not follow the type `T`, it returns {@link IValidation.Failure}
|
|
150
|
+
* object. Otherwise, there's no problem on the input value, camel cased converted data
|
|
151
|
+
* would be stored in the `data` property of the output {@link IValidation.Success} object.
|
|
152
|
+
*
|
|
153
|
+
* @template T Type of the input value
|
|
154
|
+
* @param input Target object
|
|
155
|
+
* @returns Validation result with camel case object
|
|
156
|
+
*
|
|
157
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
158
|
+
*/
|
|
159
|
+
function validateCamel<T>(input: T): IValidation<CamelCase<T>>;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Converts to camel case with type validation.
|
|
163
|
+
*
|
|
164
|
+
* Convert every property names of nested objects to follow the camel case convention.
|
|
165
|
+
* If the input value does not follow the type `T`, it returns {@link IValidation.Failure}
|
|
166
|
+
* object. Otherwise, there's no problem on the input value, camel cased converted data
|
|
167
|
+
* would be stored in the `data` property of the output {@link IValidation.Success} object.
|
|
168
|
+
*
|
|
169
|
+
* @template T Type of the input value
|
|
170
|
+
* @param input Target object
|
|
171
|
+
* @returns Validation result with camel case object
|
|
172
|
+
*
|
|
173
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
174
|
+
*/
|
|
175
|
+
function validateCamel<T>(input: unknown): IValidation<CamelCase<T>>;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* @internal
|
|
179
|
+
*/
|
|
180
|
+
function validateCamel(): never {
|
|
181
|
+
return halt("validateCamel");
|
|
182
|
+
}
|
|
183
|
+
const validateCamelPure = /** @__PURE__ */ Object.assign<
|
|
184
|
+
typeof validateCamel,
|
|
185
|
+
{},
|
|
186
|
+
{}
|
|
187
|
+
>(
|
|
188
|
+
validateCamel,
|
|
189
|
+
/** @__PURE__ */ Namespace.notations.camel("validateCamel"),
|
|
190
|
+
/** @__PURE__ */ Namespace.validate(),
|
|
191
|
+
);
|
|
192
|
+
export { validateCamelPure as validateCamel };
|
|
193
|
+
|
|
194
|
+
/* -----------------------------------------------------------
|
|
195
|
+
PASCAL CASE
|
|
196
|
+
----------------------------------------------------------- */
|
|
197
|
+
/**
|
|
198
|
+
* Convert to pascal case.
|
|
199
|
+
*
|
|
200
|
+
* Convert every property names of nested objects to follow the pascal case convention.
|
|
201
|
+
*
|
|
202
|
+
* For reference, this `typia.notations.pascal()` function does not validate the input value
|
|
203
|
+
* type. It just believes that the input value is following the type `T`. Therefore,
|
|
204
|
+
* if you can't ensure the input value type, it would be better to call one of them below:
|
|
205
|
+
*
|
|
206
|
+
* - {@link assertPascal}
|
|
207
|
+
* - {@link isPascal}
|
|
208
|
+
* - {@link validatePascal}
|
|
209
|
+
*
|
|
210
|
+
* @template T Type of the input value
|
|
211
|
+
* @param input Target object
|
|
212
|
+
* @returns Pascal case object
|
|
213
|
+
*
|
|
214
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
215
|
+
*/
|
|
216
|
+
function pascal<T>(input: T): PascalCase<T>;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* @internal
|
|
220
|
+
*/
|
|
221
|
+
function pascal(): never {
|
|
222
|
+
return halt("pascal");
|
|
223
|
+
}
|
|
224
|
+
const pascalPure = /** @__PURE__ */ Object.assign<typeof pascal, {}>(
|
|
225
|
+
pascal,
|
|
226
|
+
/** @__PURE__ */ Namespace.notations.pascal("pascal"),
|
|
227
|
+
);
|
|
228
|
+
export { pascalPure as pascal };
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Converts to pascal case with type assertion.
|
|
232
|
+
*
|
|
233
|
+
* Convert every property names of nested objects to follow the pascal case convention.
|
|
234
|
+
* If the input value does not follow the type `T`, it throws {@link TypeGuardError}.
|
|
235
|
+
*
|
|
236
|
+
* @template T Type of the input value
|
|
237
|
+
* @param input Target object
|
|
238
|
+
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
239
|
+
* @returns Pascal case object
|
|
240
|
+
*
|
|
241
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
242
|
+
*/
|
|
243
|
+
function assertPascal<T>(
|
|
244
|
+
input: T,
|
|
245
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
246
|
+
): PascalCase<T>;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Converts to pascal case with type assertion.
|
|
250
|
+
*
|
|
251
|
+
* Convert every property names of nested objects to follow the pascal case convention.
|
|
252
|
+
* If the input value does not follow the type `T`, it throws {@link TypeGuardError}.
|
|
253
|
+
*
|
|
254
|
+
* @template T Type of the input value
|
|
255
|
+
* @param input Target object
|
|
256
|
+
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
257
|
+
* @returns Pascal case object
|
|
258
|
+
*
|
|
259
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
260
|
+
*/
|
|
261
|
+
function assertPascal<T>(
|
|
262
|
+
input: unknown,
|
|
263
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
264
|
+
): PascalCase<T>;
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* @internal
|
|
268
|
+
*/
|
|
269
|
+
function assertPascal(): never {
|
|
270
|
+
return halt("assertPascal");
|
|
271
|
+
}
|
|
272
|
+
const assertPascalPure = /** @__PURE__ */ Object.assign<
|
|
273
|
+
typeof assertPascal,
|
|
274
|
+
{},
|
|
275
|
+
{}
|
|
276
|
+
>(
|
|
277
|
+
assertPascal,
|
|
278
|
+
/** @__PURE__ */ Namespace.notations.pascal("assertPascal"),
|
|
279
|
+
/** @__PURE__ */ Namespace.assert("notations.assertPascal"),
|
|
280
|
+
);
|
|
281
|
+
export { assertPascalPure as assertPascal };
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Converts to pascal case with type checking.
|
|
285
|
+
*
|
|
286
|
+
* Convert every property names of nested objects to follow the pascal case convention.
|
|
287
|
+
* If the input value does not follow the type `T`, it returns `null` value instead.
|
|
288
|
+
*
|
|
289
|
+
* @template T Type of the input value
|
|
290
|
+
* @param input Target object
|
|
291
|
+
* @returns Pascal case object when exact type, otherwise null
|
|
292
|
+
*
|
|
293
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
294
|
+
*/
|
|
295
|
+
function isPascal<T>(input: T): PascalCase<T> | null;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Converts to pascal case with type checking.
|
|
299
|
+
*
|
|
300
|
+
* Convert every property names of nested objects to follow the pascal case convention.
|
|
301
|
+
* If the input value does not follow the type `T`, it returns `null` value instead.
|
|
302
|
+
*
|
|
303
|
+
* @template T Type of the input value
|
|
304
|
+
* @param input Target object
|
|
305
|
+
* @returns Pascal case object when exact type, otherwise null
|
|
306
|
+
*
|
|
307
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
308
|
+
*/
|
|
309
|
+
function isPascal<T>(input: unknown): PascalCase<T> | null;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* @internal
|
|
313
|
+
*/
|
|
314
|
+
function isPascal(): never {
|
|
315
|
+
return halt("isPascal");
|
|
316
|
+
}
|
|
317
|
+
const isPascalPure = /** @__PURE__ */ Object.assign<typeof isPascal, {}, {}>(
|
|
318
|
+
isPascal,
|
|
319
|
+
/** @__PURE__ */ Namespace.notations.pascal("isPascal"),
|
|
320
|
+
/** @__PURE__ */ Namespace.is(),
|
|
321
|
+
);
|
|
322
|
+
export { isPascalPure as isPascal };
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Converts to pascal case with type validation.
|
|
326
|
+
*
|
|
327
|
+
* Convert every property names of nested objects to follow the pascal case convention.
|
|
328
|
+
* If the input value does not follow the type `T`, it returns {@link IValidation.Failure}
|
|
329
|
+
* object. Otherwise, there's no problem on the input value, pascal cased converted data
|
|
330
|
+
* would be stored in the `data` property of the output {@link IValidation.Success} object.
|
|
331
|
+
*
|
|
332
|
+
* @template T Type of the input value
|
|
333
|
+
* @param input Target object
|
|
334
|
+
* @returns Validation result with pascal case object
|
|
335
|
+
*
|
|
336
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
337
|
+
*/
|
|
338
|
+
function validatePascal<T>(input: T): IValidation<PascalCase<T>>;
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Converts to pascal case with type validation.
|
|
342
|
+
*
|
|
343
|
+
* Convert every property names of nested objects to follow the pascal case convention.
|
|
344
|
+
* If the input value does not follow the type `T`, it returns {@link IValidation.Failure}
|
|
345
|
+
* object. Otherwise, there's no problem on the input value, pascal cased converted data
|
|
346
|
+
* would be stored in the `data` property of the output {@link IValidation.Success} object.
|
|
347
|
+
*
|
|
348
|
+
* @template T Type of the input value
|
|
349
|
+
* @param input Target object
|
|
350
|
+
* @returns Validation result with pascal case object
|
|
351
|
+
*
|
|
352
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
353
|
+
*/
|
|
354
|
+
function validatePascal<T>(input: unknown): IValidation<PascalCase<T>>;
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* @internal
|
|
358
|
+
*/
|
|
359
|
+
function validatePascal(): never {
|
|
360
|
+
return halt("validatePascal");
|
|
361
|
+
}
|
|
362
|
+
const validatePascalPure = /** @__PURE__ */ Object.assign<
|
|
363
|
+
typeof validatePascal,
|
|
364
|
+
{},
|
|
365
|
+
{}
|
|
366
|
+
>(
|
|
367
|
+
validatePascal,
|
|
368
|
+
/** @__PURE__ */ Namespace.notations.pascal("validatePascal"),
|
|
369
|
+
/** @__PURE__ */ Namespace.validate(),
|
|
370
|
+
);
|
|
371
|
+
export { validatePascalPure as validatePascal };
|
|
372
|
+
|
|
373
|
+
/* -----------------------------------------------------------
|
|
374
|
+
SNAKE CASE
|
|
375
|
+
----------------------------------------------------------- */
|
|
376
|
+
/**
|
|
377
|
+
* Convert to snake case.
|
|
378
|
+
*
|
|
379
|
+
* Convert every property names of nested objects to follow the snake case convention.
|
|
380
|
+
*
|
|
381
|
+
* For reference, this `typia.notations.snake()` function does not validate the input value
|
|
382
|
+
* type. It just believes that the input value is following the type `T`. Therefore,
|
|
383
|
+
* if you can't ensure the input value type, it would be better to call one of them below:
|
|
384
|
+
*
|
|
385
|
+
* - {@link assertSnake}
|
|
386
|
+
* - {@link isSnake}
|
|
387
|
+
* - {@link validateSnake}
|
|
388
|
+
*
|
|
389
|
+
* @template T Type of the input value
|
|
390
|
+
* @param input Target object
|
|
391
|
+
* @returns Snake case object
|
|
392
|
+
*
|
|
393
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
394
|
+
*/
|
|
395
|
+
function snake<T>(input: T): SnakeCase<T>;
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* @internal
|
|
399
|
+
*/
|
|
400
|
+
function snake(): never {
|
|
401
|
+
return halt("snake");
|
|
402
|
+
}
|
|
403
|
+
const snakePure = /** @__PURE__ */ Object.assign<typeof snake, {}>(
|
|
404
|
+
snake,
|
|
405
|
+
/** @__PURE__ */ Namespace.notations.snake("snake"),
|
|
406
|
+
);
|
|
407
|
+
export { snakePure as snake };
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Converts to snake case with type assertion.
|
|
411
|
+
*
|
|
412
|
+
* Convert every property names of nested objects to follow the snake case convention.
|
|
413
|
+
* If the input value does not follow the type `T`, it throws {@link TypeGuardError}.
|
|
414
|
+
*
|
|
415
|
+
* @template T Type of the input value
|
|
416
|
+
* @param input Target object
|
|
417
|
+
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
418
|
+
* @returns Snake case object
|
|
419
|
+
*
|
|
420
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
421
|
+
*/
|
|
422
|
+
function assertSnake<T>(
|
|
423
|
+
input: T,
|
|
424
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
425
|
+
): SnakeCase<T>;
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Converts to snake case with type assertion.
|
|
429
|
+
*
|
|
430
|
+
* Convert every property names of nested objects to follow the snake case convention.
|
|
431
|
+
* If the input value does not follow the type `T`, it throws {@link TypeGuardError}.
|
|
432
|
+
*
|
|
433
|
+
* @template T Type of the input value
|
|
434
|
+
* @param input Target object
|
|
435
|
+
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
436
|
+
* @returns Snake case object
|
|
437
|
+
*
|
|
438
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
439
|
+
*/
|
|
440
|
+
function assertSnake<T>(
|
|
441
|
+
input: unknown,
|
|
442
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
443
|
+
): SnakeCase<T>;
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* @internal
|
|
447
|
+
*/
|
|
448
|
+
function assertSnake(): never {
|
|
449
|
+
return halt("assertSnake");
|
|
450
|
+
}
|
|
451
|
+
const assertSnakePure = /** @__PURE__ */ Object.assign<
|
|
452
|
+
typeof assertSnake,
|
|
453
|
+
{},
|
|
454
|
+
{}
|
|
455
|
+
>(
|
|
456
|
+
assertSnake,
|
|
457
|
+
/** @__PURE__ */ Namespace.notations.snake("assertSnake"),
|
|
458
|
+
/** @__PURE__ */ Namespace.assert("notations.assertSnake"),
|
|
459
|
+
);
|
|
460
|
+
export { assertSnakePure as assertSnake };
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Converts to snake case with type checking.
|
|
464
|
+
*
|
|
465
|
+
* Convert every property names of nested objects to follow the snake case convention.
|
|
466
|
+
* If the input value does not follow the type `T`, it returns `null` value instead.
|
|
467
|
+
*
|
|
468
|
+
* @template T Type of the input value
|
|
469
|
+
* @param input Target object
|
|
470
|
+
* @returns Snake case object when exact type, otherwise null
|
|
471
|
+
*
|
|
472
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
473
|
+
*/
|
|
474
|
+
function isSnake<T>(input: T): SnakeCase<T> | null;
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* Converts to snake case with type checking.
|
|
478
|
+
*
|
|
479
|
+
* Convert every property names of nested objects to follow the snake case convention.
|
|
480
|
+
* If the input value does not follow the type `T`, it returns `null` value instead.
|
|
481
|
+
*
|
|
482
|
+
* @template T Type of the input value
|
|
483
|
+
* @param input Target object
|
|
484
|
+
* @returns Snake case object when exact type, otherwise null
|
|
485
|
+
*
|
|
486
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
487
|
+
*/
|
|
488
|
+
function isSnake<T>(input: unknown): SnakeCase<T> | null;
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* @internal
|
|
492
|
+
*/
|
|
493
|
+
function isSnake(): never {
|
|
494
|
+
return halt("isSnake");
|
|
495
|
+
}
|
|
496
|
+
const isSnakePure = /** @__PURE__ */ Object.assign<typeof isSnake, {}, {}>(
|
|
497
|
+
isSnake,
|
|
498
|
+
/** @__PURE__ */ Namespace.notations.snake("isSnake"),
|
|
499
|
+
/** @__PURE__ */ Namespace.is(),
|
|
500
|
+
);
|
|
501
|
+
export { isSnakePure as isSnake };
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Converts to snake case with type validation.
|
|
505
|
+
*
|
|
506
|
+
* Convert every property names of nested objects to follow the snake case convention.
|
|
507
|
+
* If the input value does not follow the type `T`, it returns {@link IValidation.Failure}
|
|
508
|
+
* object. Otherwise, there's no problem on the input value, snake cased converted data
|
|
509
|
+
* would be stored in the `data` property of the output {@link IValidation.Success} object.
|
|
510
|
+
*
|
|
511
|
+
* @template T Type of the input value
|
|
512
|
+
* @param input Target object
|
|
513
|
+
* @returns Validation result with snake case object
|
|
514
|
+
*
|
|
515
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
516
|
+
*/
|
|
517
|
+
function validateSnake<T>(input: T): IValidation<SnakeCase<T>>;
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Converts to snake case with type validation.
|
|
521
|
+
*
|
|
522
|
+
* Convert every property names of nested objects to follow the snake case convention.
|
|
523
|
+
* If the input value does not follow the type `T`, it returns {@link IValidation.Failure}
|
|
524
|
+
* object. Otherwise, there's no problem on the input value, snake cased converted data
|
|
525
|
+
* would be stored in the `data` property of the output {@link IValidation.Success} object.
|
|
526
|
+
*
|
|
527
|
+
* @template T Type of the input value
|
|
528
|
+
* @param input Target object
|
|
529
|
+
* @returns Validation result with snake case object
|
|
530
|
+
*
|
|
531
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
532
|
+
*/
|
|
533
|
+
function validateSnake<T>(input: unknown): IValidation<SnakeCase<T>>;
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* @internal
|
|
537
|
+
*/
|
|
538
|
+
function validateSnake(): never {
|
|
539
|
+
return halt("validateSnake");
|
|
540
|
+
}
|
|
541
|
+
const validateSnakePure = /** @__PURE__ */ Object.assign<
|
|
542
|
+
typeof validateSnake,
|
|
543
|
+
{},
|
|
544
|
+
{}
|
|
545
|
+
>(
|
|
546
|
+
validateSnake,
|
|
547
|
+
/** @__PURE__ */ Namespace.notations.snake("validateSnake"),
|
|
548
|
+
/** @__PURE__ */ Namespace.validate(),
|
|
549
|
+
);
|
|
550
|
+
export { validateSnakePure as validateSnake };
|
|
551
|
+
/* -----------------------------------------------------------
|
|
552
|
+
FACTORY FUNCTIONS
|
|
553
|
+
----------------------------------------------------------- */
|
|
554
|
+
/**
|
|
555
|
+
* Creates a reusable {@link camel} function.
|
|
556
|
+
*
|
|
557
|
+
* @danger You must configure the generic argument `T`
|
|
558
|
+
* @returns Nothing until be configure the generic argument `T`
|
|
559
|
+
* @throws compile error
|
|
560
|
+
*
|
|
561
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
562
|
+
*/
|
|
563
|
+
function createCamel(): never;
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* Creates a reusable {@link camel} function.
|
|
567
|
+
*
|
|
568
|
+
* @template T Type of the input value
|
|
569
|
+
* @returns A reusable `camel` function
|
|
570
|
+
*
|
|
571
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
572
|
+
*/
|
|
573
|
+
function createCamel<T>(): (input: T) => CamelCase<T>;
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* @internal
|
|
577
|
+
*/
|
|
578
|
+
function createCamel(): never {
|
|
579
|
+
halt("createCamel");
|
|
580
|
+
}
|
|
581
|
+
const createCamelPure = /** @__PURE__ */ Object.assign<typeof createCamel, {}>(
|
|
582
|
+
createCamel,
|
|
583
|
+
/** @__PURE__ */ Namespace.notations.camel("createCamel"),
|
|
584
|
+
);
|
|
585
|
+
export { createCamelPure as createCamel };
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
* Creates a reusable {@link assertCamel} function.
|
|
589
|
+
*
|
|
590
|
+
* @danger You must configure the generic argument `T`
|
|
591
|
+
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
592
|
+
* @returns Nothing until be configure the generic argument `T`
|
|
593
|
+
* @throws compile error
|
|
594
|
+
*
|
|
595
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
596
|
+
*/
|
|
597
|
+
function createAssertCamel(
|
|
598
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
599
|
+
): never;
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Creates a reusable {@link assertCamel} function.
|
|
603
|
+
*
|
|
604
|
+
* @template T Type of the input value
|
|
605
|
+
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
606
|
+
* @returns A reusable `assertCamel` function
|
|
607
|
+
*
|
|
608
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
609
|
+
*/
|
|
610
|
+
function createAssertCamel<T>(
|
|
611
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
612
|
+
): (input: T) => CamelCase<T>;
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* @internal
|
|
616
|
+
*/
|
|
617
|
+
function createAssertCamel(): never {
|
|
618
|
+
halt("createAssertCamel");
|
|
619
|
+
}
|
|
620
|
+
const createAssertCamelPure = /** @__PURE__ */ Object.assign<
|
|
621
|
+
typeof createAssertCamel,
|
|
622
|
+
{},
|
|
623
|
+
{}
|
|
624
|
+
>(
|
|
625
|
+
createAssertCamel,
|
|
626
|
+
/** @__PURE__ */ Namespace.notations.camel("createAssertCamel"),
|
|
627
|
+
/** @__PURE__ */ Namespace.assert("notations.createAssertCamel"),
|
|
628
|
+
);
|
|
629
|
+
export { createAssertCamelPure as createAssertCamel };
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* Creates a reusable {@link isCamel} function.
|
|
633
|
+
*
|
|
634
|
+
* @danger You must configure the generic argument `T`
|
|
635
|
+
* @returns Nothing until be configure the generic argument `T`
|
|
636
|
+
* @throws compile error
|
|
637
|
+
*
|
|
638
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
639
|
+
*/
|
|
640
|
+
function createIsCamel(): never;
|
|
641
|
+
|
|
642
|
+
/**
|
|
643
|
+
* Creates a reusable {@link isCamel} function.
|
|
644
|
+
*
|
|
645
|
+
* @template T Type of the input value
|
|
646
|
+
* @returns A reusable `isCamel` function
|
|
647
|
+
*
|
|
648
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
649
|
+
*/
|
|
650
|
+
function createIsCamel<T>(): (input: T) => CamelCase<T> | null;
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* @internal
|
|
654
|
+
*/
|
|
655
|
+
function createIsCamel(): never {
|
|
656
|
+
halt("createIsCamel");
|
|
657
|
+
}
|
|
658
|
+
const createIsCamelPure = /** @__PURE__ */ Object.assign<
|
|
659
|
+
typeof createIsCamel,
|
|
660
|
+
{},
|
|
661
|
+
{}
|
|
662
|
+
>(
|
|
663
|
+
createIsCamel,
|
|
664
|
+
/** @__PURE__ */ Namespace.notations.camel("createIsCamel"),
|
|
665
|
+
/** @__PURE__ */ Namespace.is(),
|
|
666
|
+
);
|
|
667
|
+
export { createIsCamelPure as createIsCamel };
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* Creates a reusable {@link validateCamel} function.
|
|
671
|
+
*
|
|
672
|
+
* @danger You must configure the generic argument `T`
|
|
673
|
+
* @returns Nothing until be configure the generic argument `T`
|
|
674
|
+
* @throws compile error
|
|
675
|
+
*
|
|
676
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
677
|
+
*/
|
|
678
|
+
function createValidateCamel(): never;
|
|
679
|
+
|
|
680
|
+
/**
|
|
681
|
+
* Creates a reusable {@link validateCamel} function.
|
|
682
|
+
*
|
|
683
|
+
* @template T Type of the input value
|
|
684
|
+
* @returns A reusable `validateCamel` function
|
|
685
|
+
*
|
|
686
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
687
|
+
*/
|
|
688
|
+
function createValidateCamel<T>(): (input: T) => IValidation<CamelCase<T>>;
|
|
689
|
+
|
|
690
|
+
/**
|
|
691
|
+
* @internal
|
|
692
|
+
*/
|
|
693
|
+
function createValidateCamel(): never {
|
|
694
|
+
halt("createValidateCamel");
|
|
695
|
+
}
|
|
696
|
+
const createValidateCamelPure = /** @__PURE__ */ Object.assign<
|
|
697
|
+
typeof createValidateCamel,
|
|
698
|
+
{},
|
|
699
|
+
{}
|
|
700
|
+
>(
|
|
701
|
+
createValidateCamel,
|
|
702
|
+
/** @__PURE__ */ Namespace.notations.camel("createValidateCamel"),
|
|
703
|
+
/** @__PURE__ */ Namespace.validate(),
|
|
704
|
+
);
|
|
705
|
+
export { createValidateCamelPure as createValidateCamel };
|
|
706
|
+
|
|
707
|
+
/**
|
|
708
|
+
* Creates a reusable {@link pascal} function.
|
|
709
|
+
*
|
|
710
|
+
* @danger You must configure the generic argument `T`
|
|
711
|
+
* @returns Nothing until be configure the generic argument `T`
|
|
712
|
+
* @throws compile error
|
|
713
|
+
*
|
|
714
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
715
|
+
*/
|
|
716
|
+
function createPascal(): never;
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* Creates a reusable {@link pascal} function.
|
|
720
|
+
*
|
|
721
|
+
* @template T Type of the input value
|
|
722
|
+
* @returns A reusable `pascal` function
|
|
723
|
+
*
|
|
724
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
725
|
+
*/
|
|
726
|
+
function createPascal<T>(): (input: T) => PascalCase<T>;
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* @internal
|
|
730
|
+
*/
|
|
731
|
+
function createPascal(): never {
|
|
732
|
+
halt("createPascal");
|
|
733
|
+
}
|
|
734
|
+
const createPascalPure = /** @__PURE__ */ Object.assign<
|
|
735
|
+
typeof createPascal,
|
|
736
|
+
{}
|
|
737
|
+
>(createPascal, /** @__PURE__ */ Namespace.notations.pascal("createPascal"));
|
|
738
|
+
export { createPascalPure as createPascal };
|
|
739
|
+
|
|
740
|
+
/**
|
|
741
|
+
* Creates a reusable {@link assertPascal} function.
|
|
742
|
+
*
|
|
743
|
+
* @danger You must configure the generic argument `T`
|
|
744
|
+
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
745
|
+
* @returns Nothing until be configure the generic argument `T`
|
|
746
|
+
* @throws compile error
|
|
747
|
+
*
|
|
748
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
749
|
+
*/
|
|
750
|
+
function createAssertPascal(
|
|
751
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
752
|
+
): never;
|
|
753
|
+
|
|
754
|
+
/**
|
|
755
|
+
* Creates a reusable {@link assertPascal} function.
|
|
756
|
+
*
|
|
757
|
+
* @template T Type of the input value
|
|
758
|
+
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
759
|
+
* @returns A reusable `assertPascal` function
|
|
760
|
+
*
|
|
761
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
762
|
+
*/
|
|
763
|
+
function createAssertPascal<T>(
|
|
764
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
765
|
+
): (input: T) => PascalCase<T>;
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* @internal
|
|
769
|
+
*/
|
|
770
|
+
function createAssertPascal(): never {
|
|
771
|
+
halt("createAssertPascal");
|
|
772
|
+
}
|
|
773
|
+
const createAssertPascalPure = /** @__PURE__ */ Object.assign<
|
|
774
|
+
typeof createAssertPascal,
|
|
775
|
+
{},
|
|
776
|
+
{}
|
|
777
|
+
>(
|
|
778
|
+
createAssertPascal,
|
|
779
|
+
/** @__PURE__ */ Namespace.notations.pascal("createAssertPascal"),
|
|
780
|
+
/** @__PURE__ */ Namespace.assert("notations.createAssertPascal"),
|
|
781
|
+
);
|
|
782
|
+
export { createAssertPascalPure as createAssertPascal };
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* Creates a reusable {@link isPascal} function.
|
|
786
|
+
*
|
|
787
|
+
* @danger You must configure the generic argument `T`
|
|
788
|
+
* @returns Nothing until be configure the generic argument `T`
|
|
789
|
+
* @throws compile error
|
|
790
|
+
*
|
|
791
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
792
|
+
*/
|
|
793
|
+
function createIsPascal(): never;
|
|
794
|
+
|
|
795
|
+
/**
|
|
796
|
+
* Creates a reusable {@link isPascal} function.
|
|
797
|
+
*
|
|
798
|
+
* @template T Type of the input value
|
|
799
|
+
* @returns A reusable `isPascal` function
|
|
800
|
+
*
|
|
801
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
802
|
+
*/
|
|
803
|
+
function createIsPascal<T>(): (input: T) => PascalCase<T> | null;
|
|
804
|
+
|
|
805
|
+
/**
|
|
806
|
+
* @internal
|
|
807
|
+
*/
|
|
808
|
+
function createIsPascal(): never {
|
|
809
|
+
halt("createIsPascal");
|
|
810
|
+
}
|
|
811
|
+
const createIsPascalPure = /** @__PURE__ */ Object.assign<
|
|
812
|
+
typeof createIsPascal,
|
|
813
|
+
{},
|
|
814
|
+
{}
|
|
815
|
+
>(
|
|
816
|
+
createIsPascal,
|
|
817
|
+
/** @__PURE__ */ Namespace.notations.pascal("createIsPascal"),
|
|
818
|
+
/** @__PURE__ */ Namespace.is(),
|
|
819
|
+
);
|
|
820
|
+
export { createIsPascalPure as createIsPascal };
|
|
821
|
+
|
|
822
|
+
/**
|
|
823
|
+
* Creates a reusable {@link validatePascal} function.
|
|
824
|
+
*
|
|
825
|
+
* @danger You must configure the generic argument `T`
|
|
826
|
+
* @returns Nothing until be configure the generic argument `T`
|
|
827
|
+
* @throws compile error
|
|
828
|
+
*
|
|
829
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
830
|
+
*/
|
|
831
|
+
function createValidatePascal(): never;
|
|
832
|
+
|
|
833
|
+
/**
|
|
834
|
+
* Creates a reusable {@link validatePascal} function.
|
|
835
|
+
*
|
|
836
|
+
* @template T Type of the input value
|
|
837
|
+
* @returns A reusable `validatePascal` function
|
|
838
|
+
*
|
|
839
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
840
|
+
*/
|
|
841
|
+
function createValidatePascal<T>(): (input: T) => IValidation<PascalCase<T>>;
|
|
842
|
+
|
|
843
|
+
/**
|
|
844
|
+
* @internal
|
|
845
|
+
*/
|
|
846
|
+
function createValidatePascal(): never {
|
|
847
|
+
halt("createValidatePascal");
|
|
848
|
+
}
|
|
849
|
+
const createValidatePascalPure = /** @__PURE__ */ Object.assign<
|
|
850
|
+
typeof createValidatePascal,
|
|
851
|
+
{},
|
|
852
|
+
{}
|
|
853
|
+
>(
|
|
854
|
+
createValidatePascal,
|
|
855
|
+
/** @__PURE__ */ Namespace.notations.pascal("createValidatePascal"),
|
|
856
|
+
/** @__PURE__ */ Namespace.validate(),
|
|
857
|
+
);
|
|
858
|
+
export { createValidatePascalPure as createValidatePascal };
|
|
859
|
+
|
|
860
|
+
/**
|
|
861
|
+
* Creates a reusable {@link snake} function.
|
|
862
|
+
*
|
|
863
|
+
* @danger You must configure the generic argument `T`
|
|
864
|
+
* @returns Nothing until be configure the generic argument `T`
|
|
865
|
+
* @throws compile error
|
|
866
|
+
*
|
|
867
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
868
|
+
*/
|
|
869
|
+
function createSnake(): never;
|
|
870
|
+
|
|
871
|
+
/**
|
|
872
|
+
* Creates a reusable {@link snake} function.
|
|
873
|
+
*
|
|
874
|
+
* @template T Type of the input value
|
|
875
|
+
* @returns A reusable `snake` function
|
|
876
|
+
*
|
|
877
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
878
|
+
*/
|
|
879
|
+
function createSnake<T>(): (input: T) => SnakeCase<T>;
|
|
880
|
+
|
|
881
|
+
/**
|
|
882
|
+
* @internal
|
|
883
|
+
*/
|
|
884
|
+
function createSnake(): never {
|
|
885
|
+
halt("createSnake");
|
|
886
|
+
}
|
|
887
|
+
const createSnakePure = /** @__PURE__ */ Object.assign<typeof createSnake, {}>(
|
|
888
|
+
createSnake,
|
|
889
|
+
/** @__PURE__ */ Namespace.notations.snake("createSnake"),
|
|
890
|
+
);
|
|
891
|
+
export { createSnakePure as createSnake };
|
|
892
|
+
|
|
893
|
+
/**
|
|
894
|
+
* Creates a reusable {@link assertSnake} function.
|
|
895
|
+
*
|
|
896
|
+
* @danger You must configure the generic argument `T`
|
|
897
|
+
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
898
|
+
* @returns Nothing until be configure the generic argument `T`
|
|
899
|
+
* @throws compile error
|
|
900
|
+
*
|
|
901
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
902
|
+
*/
|
|
903
|
+
function createAssertSnake(
|
|
904
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
905
|
+
): never;
|
|
906
|
+
|
|
907
|
+
/**
|
|
908
|
+
* Creates a reusable {@link assertSnake} function.
|
|
909
|
+
*
|
|
910
|
+
* @template T Type of the input value
|
|
911
|
+
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
912
|
+
* @returns A reusable `assertSnake` function
|
|
913
|
+
*
|
|
914
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
915
|
+
*/
|
|
916
|
+
function createAssertSnake<T>(
|
|
917
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
918
|
+
): (input: T) => SnakeCase<T>;
|
|
919
|
+
|
|
920
|
+
/**
|
|
921
|
+
* @internal
|
|
922
|
+
*/
|
|
923
|
+
function createAssertSnake(): never {
|
|
924
|
+
halt("createAssertSnake");
|
|
925
|
+
}
|
|
926
|
+
const createAssertSnakePure = /** @__PURE__ */ Object.assign<
|
|
927
|
+
typeof createAssertSnake,
|
|
928
|
+
{},
|
|
929
|
+
{}
|
|
930
|
+
>(
|
|
931
|
+
createAssertSnake,
|
|
932
|
+
/** @__PURE__ */ Namespace.notations.snake("createAssertSnake"),
|
|
933
|
+
/** @__PURE__ */ Namespace.assert("notations.createAssertSnake"),
|
|
934
|
+
);
|
|
935
|
+
export { createAssertSnakePure as createAssertSnake };
|
|
936
|
+
|
|
937
|
+
/**
|
|
938
|
+
* Creates a reusable {@link isSnake} function.
|
|
939
|
+
*
|
|
940
|
+
* @danger You must configure the generic argument `T`
|
|
941
|
+
* @returns Nothing until be configure the generic argument `T`
|
|
942
|
+
* @throws compile error
|
|
943
|
+
*
|
|
944
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
945
|
+
*/
|
|
946
|
+
function createIsSnake(): never;
|
|
947
|
+
|
|
948
|
+
/**
|
|
949
|
+
* Creates a reusable {@link isSnake} function.
|
|
950
|
+
*
|
|
951
|
+
* @template T Type of the input value
|
|
952
|
+
* @returns A reusable `isSnake` function
|
|
953
|
+
*
|
|
954
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
955
|
+
*/
|
|
956
|
+
function createIsSnake<T>(): (input: T) => SnakeCase<T> | null;
|
|
957
|
+
|
|
958
|
+
/**
|
|
959
|
+
* @internal
|
|
960
|
+
*/
|
|
961
|
+
function createIsSnake(): never {
|
|
962
|
+
halt("createIsSnake");
|
|
963
|
+
}
|
|
964
|
+
const createIsSnakePure = /** @__PURE__ */ Object.assign<
|
|
965
|
+
typeof createIsSnake,
|
|
966
|
+
{},
|
|
967
|
+
{}
|
|
968
|
+
>(
|
|
969
|
+
createIsSnake,
|
|
970
|
+
/** @__PURE__ */ Namespace.notations.snake("createIsSnake"),
|
|
971
|
+
/** @__PURE__ */ Namespace.is(),
|
|
972
|
+
);
|
|
973
|
+
export { createIsSnakePure as createIsSnake };
|
|
974
|
+
|
|
975
|
+
/**
|
|
976
|
+
* Creates a reusable {@link validateSnake} function.
|
|
977
|
+
*
|
|
978
|
+
* @danger You must configure the generic argument `T`
|
|
979
|
+
* @returns Nothing until be configure the generic argument `T`
|
|
980
|
+
* @throws compile error
|
|
981
|
+
*
|
|
982
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
983
|
+
*/
|
|
984
|
+
function createValidateSnake(): never;
|
|
985
|
+
|
|
986
|
+
/**
|
|
987
|
+
* Creates a reusable {@link validateSnake} function.
|
|
988
|
+
*
|
|
989
|
+
* @template T Type of the input value
|
|
990
|
+
* @returns A reusable `validateSnake` function
|
|
991
|
+
*
|
|
992
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
993
|
+
*/
|
|
994
|
+
function createValidateSnake<T>(): (input: T) => IValidation<SnakeCase<T>>;
|
|
995
|
+
|
|
996
|
+
/**
|
|
997
|
+
* @internal
|
|
998
|
+
*/
|
|
999
|
+
function createValidateSnake(): never {
|
|
1000
|
+
halt("createValidateSnake");
|
|
1001
|
+
}
|
|
1002
|
+
const createValidateSnakePure = /** @__PURE__ */ Object.assign<
|
|
1003
|
+
typeof createValidateSnake,
|
|
1004
|
+
{},
|
|
1005
|
+
{}
|
|
1006
|
+
>(
|
|
1007
|
+
createValidateSnake,
|
|
1008
|
+
/** @__PURE__ */ Namespace.notations.snake("createValidateSnake"),
|
|
1009
|
+
/** @__PURE__ */ Namespace.validate(),
|
|
1010
|
+
);
|
|
1011
|
+
export { createValidateSnakePure as createValidateSnake };
|
|
1012
|
+
|
|
1013
|
+
/**
|
|
1014
|
+
* @internal
|
|
1015
|
+
*/
|
|
1016
|
+
function halt(name: string): never {
|
|
1017
|
+
throw new Error(
|
|
1018
|
+
`Error on typia.notations.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`,
|
|
1019
|
+
);
|
|
1020
|
+
}
|