typia 6.0.0-dev.20240122 → 6.0.0
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/README.md +2 -1
- package/lib/CamelCase.d.ts +2 -2
- package/lib/IRandomGenerator.d.ts +19 -5
- package/lib/PascalCase.d.ts +2 -2
- package/lib/Resolved.d.ts +1 -1
- package/lib/SnakeCase.d.ts +1 -1
- package/lib/TypeGuardError.js +4 -1
- package/lib/TypeGuardError.js.map +1 -1
- package/lib/executable/TypiaGenerateWizard.js +24 -23
- package/lib/executable/TypiaGenerateWizard.js.map +1 -1
- package/lib/executable/TypiaPatchWizard.js +9 -9
- package/lib/executable/TypiaPatchWizard.js.map +1 -1
- package/lib/executable/TypiaSetupWizard.js +31 -22
- package/lib/executable/TypiaSetupWizard.js.map +1 -1
- package/lib/executable/setup/ArgumentParser.js +5 -5
- package/lib/executable/setup/ArgumentParser.js.map +1 -1
- package/lib/executable/setup/PackageManager.js +8 -8
- package/lib/executable/setup/PackageManager.js.map +1 -1
- package/lib/executable/setup/PluginConfigurator.js +5 -4
- package/lib/executable/setup/PluginConfigurator.js.map +1 -1
- package/lib/executable/typia.js +21 -21
- package/lib/executable/typia.js.map +1 -1
- package/lib/factories/CommentFactory.js +2 -0
- package/lib/factories/CommentFactory.js.map +1 -1
- package/lib/factories/IdentifierFactory.d.ts +1 -1
- package/lib/factories/IdentifierFactory.js +2 -0
- package/lib/factories/IdentifierFactory.js.map +1 -1
- package/lib/factories/LiteralFactory.js +1 -0
- package/lib/factories/LiteralFactory.js.map +1 -1
- package/lib/factories/MetadataCollection.js +19 -1
- package/lib/factories/MetadataCollection.js.map +1 -1
- package/lib/factories/MetadataCommentTagFactory.js +79 -39
- package/lib/factories/MetadataCommentTagFactory.js.map +1 -1
- package/lib/factories/MetadataFactory.js +9 -1
- package/lib/factories/MetadataFactory.js.map +1 -1
- package/lib/factories/MetadataTypeTagFactory.js +61 -17
- package/lib/factories/MetadataTypeTagFactory.js.map +1 -1
- package/lib/factories/MetadataTypeTagSchemaFactory.d.ts +4 -0
- package/lib/factories/MetadataTypeTagSchemaFactory.js +84 -0
- package/lib/factories/MetadataTypeTagSchemaFactory.js.map +1 -0
- package/lib/factories/ProtobufFactory.js +46 -1
- package/lib/factories/ProtobufFactory.js.map +1 -1
- package/lib/factories/TypeFactory.js +9 -0
- package/lib/factories/TypeFactory.js.map +1 -1
- package/lib/factories/internal/metadata/MetadataHelper.js +7 -1
- package/lib/factories/internal/metadata/MetadataHelper.js.map +1 -1
- package/lib/factories/internal/metadata/emend_metadata_atomics.js +15 -5
- package/lib/factories/internal/metadata/emend_metadata_atomics.js.map +1 -1
- package/lib/factories/internal/metadata/emplace_metadata_alias.js +2 -0
- package/lib/factories/internal/metadata/emplace_metadata_alias.js.map +1 -1
- package/lib/factories/internal/metadata/emplace_metadata_array_type.js +2 -0
- package/lib/factories/internal/metadata/emplace_metadata_array_type.js.map +1 -1
- package/lib/factories/internal/metadata/emplace_metadata_object.js +18 -2
- package/lib/factories/internal/metadata/emplace_metadata_object.js.map +1 -1
- package/lib/factories/internal/metadata/emplace_metadata_tuple.js +4 -0
- package/lib/factories/internal/metadata/emplace_metadata_tuple.js.map +1 -1
- package/lib/factories/internal/metadata/explore_metadata.js +2 -0
- package/lib/factories/internal/metadata/explore_metadata.js.map +1 -1
- package/lib/factories/internal/metadata/iterate_metadata.js +4 -2
- package/lib/factories/internal/metadata/iterate_metadata.js.map +1 -1
- package/lib/factories/internal/metadata/iterate_metadata_alias.js +1 -0
- package/lib/factories/internal/metadata/iterate_metadata_alias.js.map +1 -1
- package/lib/factories/internal/metadata/iterate_metadata_array.js +54 -1
- package/lib/factories/internal/metadata/iterate_metadata_array.js.map +1 -1
- package/lib/factories/internal/metadata/iterate_metadata_atomic.js +2 -0
- package/lib/factories/internal/metadata/iterate_metadata_atomic.js.map +1 -1
- package/lib/factories/internal/metadata/iterate_metadata_constant.js +9 -2
- package/lib/factories/internal/metadata/iterate_metadata_constant.js.map +1 -1
- package/lib/factories/internal/metadata/{iterate_metadata_resolve.d.ts → iterate_metadata_escape.d.ts} +1 -1
- package/lib/factories/internal/metadata/{iterate_metadata_resolve.js → iterate_metadata_escape.js} +4 -4
- package/lib/factories/internal/metadata/iterate_metadata_escape.js.map +1 -0
- package/lib/factories/internal/metadata/iterate_metadata_intersection.js +49 -138
- package/lib/factories/internal/metadata/iterate_metadata_intersection.js.map +1 -1
- package/lib/factories/internal/metadata/iterate_metadata_native.js +20 -21
- package/lib/factories/internal/metadata/iterate_metadata_native.js.map +1 -1
- package/lib/factories/internal/metadata/iterate_metadata_object.js.map +1 -1
- package/lib/factories/internal/metadata/iterate_metadata_sort.js +49 -23
- package/lib/factories/internal/metadata/iterate_metadata_sort.js.map +1 -1
- package/lib/factories/internal/metadata/iterate_metadata_template.js +2 -0
- package/lib/factories/internal/metadata/iterate_metadata_template.js.map +1 -1
- package/lib/functional/$FormDataReader/$FormDataReader.d.ts +7 -0
- package/lib/functional/$FormDataReader/$FormDataReader.js +86 -0
- package/lib/functional/$FormDataReader/$FormDataReader.js.map +1 -0
- package/lib/functional/$FormDataReader/index.d.ts +1 -0
- package/lib/functional/$FormDataReader/index.js +28 -0
- package/lib/functional/$FormDataReader/index.js.map +1 -0
- package/lib/functional/$HeadersReader/$HeadersReader.d.ts +4 -0
- package/lib/functional/$HeadersReader/$HeadersReader.js +36 -0
- package/lib/functional/$HeadersReader/$HeadersReader.js.map +1 -0
- package/lib/functional/$HeadersReader/index.d.ts +1 -0
- package/lib/functional/$HeadersReader/index.js +28 -0
- package/lib/functional/$HeadersReader/index.js.map +1 -0
- package/lib/functional/$ParameterReader/$ParameterReader.d.ts +4 -0
- package/lib/functional/$ParameterReader/$ParameterReader.js +36 -0
- package/lib/functional/$ParameterReader/$ParameterReader.js.map +1 -0
- package/lib/functional/$ParameterReader/index.d.ts +1 -0
- package/lib/functional/$ParameterReader/index.js +28 -0
- package/lib/functional/$ParameterReader/index.js.map +1 -0
- package/lib/functional/$ProtobufReader.d.ts +35 -1
- package/lib/functional/$ProtobufReader.js +13 -11
- package/lib/functional/$ProtobufReader.js.map +1 -1
- package/lib/functional/$ProtobufSizer.d.ts +36 -1
- package/lib/functional/$ProtobufSizer.js +28 -13
- package/lib/functional/$ProtobufSizer.js.map +1 -1
- package/lib/functional/$ProtobufWriter.d.ts +45 -1
- package/lib/functional/$ProtobufWriter.js +11 -9
- package/lib/functional/$ProtobufWriter.js.map +1 -1
- package/lib/functional/$QueryReader/$QueryReader.d.ts +6 -0
- package/lib/functional/$QueryReader/$QueryReader.js +55 -0
- package/lib/functional/$QueryReader/$QueryReader.js.map +1 -0
- package/lib/functional/$QueryReader/index.d.ts +1 -0
- package/lib/functional/$QueryReader/index.js +28 -0
- package/lib/functional/$QueryReader/index.js.map +1 -0
- package/lib/functional/$any.d.ts +1 -0
- package/lib/functional/$any.js +9 -0
- package/lib/functional/$any.js.map +1 -0
- package/lib/functional/$clone.d.ts +2 -1
- package/lib/functional/$clone.js +1 -1
- package/lib/functional/$clone.js.map +1 -1
- package/lib/functional/$convention.d.ts +1 -1
- package/lib/functional/$convention.js.map +1 -1
- package/lib/functional/$dictionary.d.ts +2 -0
- package/lib/functional/$dictionary.js +18 -0
- package/lib/functional/$dictionary.js.map +1 -0
- package/lib/functional/$every.d.ts +2 -0
- package/lib/functional/$every.js +12 -0
- package/lib/functional/$every.js.map +1 -0
- package/lib/functional/$guard.js +5 -2
- package/lib/functional/$guard.js.map +1 -1
- package/lib/functional/$is_between.d.ts +1 -1
- package/lib/functional/$is_between.js.map +1 -1
- package/lib/functional/$join.d.ts +1 -1
- package/lib/functional/$join.js.map +1 -1
- package/lib/functional/$number.d.ts +1 -1
- package/lib/functional/$number.js.map +1 -1
- package/lib/functional/$report.d.ts +2 -1
- package/lib/functional/$report.js.map +1 -1
- package/lib/functional/$rest.d.ts +1 -1
- package/lib/functional/$rest.js.map +1 -1
- package/lib/functional/$stoll.d.ts +1 -1
- package/lib/functional/$stoll.js.map +1 -1
- package/lib/functional/$string.js +20 -9
- package/lib/functional/$string.js.map +1 -1
- package/lib/functional/$strlen.d.ts +1 -1
- package/lib/functional/$strlen.js.map +1 -1
- package/lib/functional/$tail.js +3 -0
- package/lib/functional/$tail.js.map +1 -1
- package/lib/functional/$throws.d.ts +2 -1
- package/lib/functional/$throws.js.map +1 -1
- package/lib/functional/$varint.d.ts +6 -0
- package/lib/functional/$varint.js +100 -0
- package/lib/functional/$varint.js.map +1 -0
- package/lib/functional/$zigzag.d.ts +4 -0
- package/lib/functional/$zigzag.js +36 -0
- package/lib/functional/$zigzag.js.map +1 -0
- package/lib/functional/IProtobufWriter.d.ts +15 -1
- package/lib/functional/Namespace/functional.d.ts +4 -0
- package/lib/functional/Namespace/functional.js +9 -0
- package/lib/functional/Namespace/functional.js.map +1 -0
- package/lib/functional/Namespace/http.d.ts +8 -0
- package/lib/functional/Namespace/http.js +16 -0
- package/lib/functional/Namespace/http.js.map +1 -0
- package/lib/functional/Namespace/index.d.ts +30 -0
- package/lib/functional/Namespace/index.js +85 -0
- package/lib/functional/Namespace/index.js.map +1 -0
- package/lib/functional/Namespace/json.d.ts +9 -0
- package/lib/functional/Namespace/json.js +23 -0
- package/lib/functional/Namespace/json.js.map +1 -0
- package/lib/functional/Namespace/misc.d.ts +11 -0
- package/lib/functional/Namespace/misc.js +22 -0
- package/lib/functional/Namespace/misc.js.map +1 -0
- package/lib/functional/Namespace/notations.d.ts +18 -0
- package/lib/functional/Namespace/notations.js +26 -0
- package/lib/functional/Namespace/notations.js.map +1 -0
- package/lib/functional/Namespace/protobuf.d.ts +17 -0
- package/lib/functional/Namespace/protobuf.js +25 -0
- package/lib/functional/Namespace/protobuf.js.map +1 -0
- package/lib/functional/is.js +14 -0
- package/lib/functional/is.js.map +1 -0
- package/lib/functional.d.ts +526 -0
- package/lib/functional.js +195 -0
- package/lib/functional.js.map +1 -0
- package/lib/http.d.ts +265 -369
- package/lib/http.js +226 -19
- package/lib/http.js.map +1 -1
- package/lib/json.d.ts +81 -58
- package/lib/json.js +109 -14
- package/lib/json.js.map +1 -1
- package/lib/misc.d.ts +81 -38
- package/lib/misc.js +133 -16
- package/lib/misc.js.map +1 -1
- package/lib/module.d.ts +91 -38
- package/lib/module.js +102 -21
- package/lib/module.js.map +1 -1
- package/lib/notations.d.ts +106 -45
- package/lib/notations.js +188 -24
- package/lib/notations.js.map +1 -1
- package/lib/programmers/AssertProgrammer.d.ts +6 -1
- package/lib/programmers/AssertProgrammer.js +48 -5
- package/lib/programmers/AssertProgrammer.js.map +1 -1
- package/lib/programmers/CheckerProgrammer.js +57 -2
- package/lib/programmers/CheckerProgrammer.js.map +1 -1
- package/lib/programmers/FeatureProgrammer.js +11 -0
- package/lib/programmers/FeatureProgrammer.js.map +1 -1
- package/lib/programmers/IsProgrammer.js +10 -1
- package/lib/programmers/IsProgrammer.js.map +1 -1
- package/lib/programmers/RandomProgrammer.js +49 -4
- package/lib/programmers/RandomProgrammer.js.map +1 -1
- package/lib/programmers/TypiaProgrammer.js +41 -44
- package/lib/programmers/TypiaProgrammer.js.map +1 -1
- package/lib/programmers/ValidateProgrammer.js +5 -5
- package/lib/programmers/ValidateProgrammer.js.map +1 -1
- package/lib/programmers/functional/FunctionalAssertFunctionProgrammer.d.ts +14 -0
- package/lib/programmers/functional/FunctionalAssertFunctionProgrammer.js +81 -0
- package/lib/programmers/functional/FunctionalAssertFunctionProgrammer.js.map +1 -0
- package/lib/programmers/functional/FunctionalAssertParametersProgrammer.d.ts +7 -0
- package/lib/programmers/functional/FunctionalAssertParametersProgrammer.js +75 -0
- package/lib/programmers/functional/FunctionalAssertParametersProgrammer.js.map +1 -0
- package/lib/programmers/functional/FunctionalAssertReturnProgrammer.d.ts +10 -0
- package/lib/programmers/functional/FunctionalAssertReturnProgrammer.js +46 -0
- package/lib/programmers/functional/FunctionalAssertReturnProgrammer.js.map +1 -0
- package/lib/programmers/functional/FunctionalIsFunctionProgrammer.d.ts +7 -0
- package/lib/programmers/functional/FunctionalIsFunctionProgrammer.js +68 -0
- package/lib/programmers/functional/FunctionalIsFunctionProgrammer.js.map +1 -0
- package/lib/programmers/functional/FunctionalIsParametersProgrammer.d.ts +7 -0
- package/lib/programmers/functional/FunctionalIsParametersProgrammer.js +72 -0
- package/lib/programmers/functional/FunctionalIsParametersProgrammer.js.map +1 -0
- package/lib/programmers/functional/FunctionalIsReturnProgrammer.d.ts +10 -0
- package/lib/programmers/functional/FunctionalIsReturnProgrammer.js +46 -0
- package/lib/programmers/functional/FunctionalIsReturnProgrammer.js.map +1 -0
- package/lib/programmers/functional/FunctionalValidateFunctionProgrammer.d.ts +11 -0
- package/lib/programmers/functional/FunctionalValidateFunctionProgrammer.js +74 -0
- package/lib/programmers/functional/FunctionalValidateFunctionProgrammer.js.map +1 -0
- package/lib/programmers/functional/FunctionalValidateParametersProgrammer.d.ts +7 -0
- package/lib/programmers/functional/FunctionalValidateParametersProgrammer.js +98 -0
- package/lib/programmers/functional/FunctionalValidateParametersProgrammer.js.map +1 -0
- package/lib/programmers/functional/FunctionalValidateReturnProgrammer.d.ts +10 -0
- package/lib/programmers/functional/FunctionalValidateReturnProgrammer.js +53 -0
- package/lib/programmers/functional/FunctionalValidateReturnProgrammer.js.map +1 -0
- package/lib/programmers/functional/internal/FunctionalGeneralProgrammer.d.ts +9 -0
- package/lib/programmers/functional/internal/FunctionalGeneralProgrammer.js +25 -0
- package/lib/programmers/functional/internal/FunctionalGeneralProgrammer.js.map +1 -0
- package/lib/programmers/helpers/AtomicPredicator.js +2 -3
- package/lib/programmers/helpers/AtomicPredicator.js.map +1 -1
- package/lib/programmers/helpers/FunctionImporeter.d.ts +1 -0
- package/lib/programmers/helpers/FunctionImporeter.js +18 -0
- package/lib/programmers/helpers/FunctionImporeter.js.map +1 -0
- package/lib/programmers/helpers/FunctionImporter.d.ts +2 -2
- package/lib/programmers/helpers/FunctionImporter.js +8 -24
- package/lib/programmers/helpers/FunctionImporter.js.map +1 -1
- package/lib/programmers/helpers/ProtobufUtil.js +2 -2
- package/lib/programmers/helpers/ProtobufUtil.js.map +1 -1
- package/lib/programmers/helpers/PruneJoiner.js +9 -5
- package/lib/programmers/helpers/PruneJoiner.js.map +1 -1
- package/lib/programmers/helpers/RandomJoiner.js +2 -0
- package/lib/programmers/helpers/RandomJoiner.js.map +1 -1
- package/lib/programmers/helpers/RandomRanger.js +8 -0
- package/lib/programmers/helpers/RandomRanger.js.map +1 -1
- package/lib/programmers/helpers/StringifyJoinder.js +5 -1
- package/lib/programmers/helpers/StringifyJoinder.js.map +1 -1
- package/lib/programmers/helpers/UnionExplorer.js +10 -0
- package/lib/programmers/helpers/UnionExplorer.js.map +1 -1
- package/lib/programmers/helpers/UnionPredicator.js +5 -0
- package/lib/programmers/helpers/UnionPredicator.js.map +1 -1
- package/lib/programmers/helpers/disable_function_importer_declare.js +2 -4
- package/lib/programmers/helpers/disable_function_importer_declare.js.map +1 -1
- package/lib/programmers/http/HttpAssertFormDataProgrammer.d.ts +6 -0
- package/lib/programmers/http/HttpAssertFormDataProgrammer.js +47 -0
- package/lib/programmers/http/HttpAssertFormDataProgrammer.js.map +1 -0
- package/lib/programmers/http/HttpAssertHeadersProgrammer.d.ts +1 -1
- package/lib/programmers/http/HttpAssertHeadersProgrammer.js +9 -3
- package/lib/programmers/http/HttpAssertHeadersProgrammer.js.map +1 -1
- package/lib/programmers/http/HttpAssertQueryProgrammer.d.ts +1 -1
- package/lib/programmers/http/HttpAssertQueryProgrammer.js +9 -3
- package/lib/programmers/http/HttpAssertQueryProgrammer.js.map +1 -1
- package/lib/programmers/http/HttpFormDataProgrammer.d.ts +9 -0
- package/lib/programmers/http/HttpFormDataProgrammer.js +193 -0
- package/lib/programmers/http/HttpFormDataProgrammer.js.map +1 -0
- package/lib/programmers/http/HttpHeadersProgrammer.js +27 -9
- package/lib/programmers/http/HttpHeadersProgrammer.js.map +1 -1
- package/lib/programmers/http/HttpIsFormDataProgrammer.d.ts +6 -0
- package/lib/programmers/http/HttpIsFormDataProgrammer.js +47 -0
- package/lib/programmers/http/HttpIsFormDataProgrammer.js.map +1 -0
- package/lib/programmers/http/HttpIsHeadersProgrammer.js +5 -3
- package/lib/programmers/http/HttpIsHeadersProgrammer.js.map +1 -1
- package/lib/programmers/http/HttpIsQueryProgrammer.js +5 -3
- package/lib/programmers/http/HttpIsQueryProgrammer.js.map +1 -1
- package/lib/programmers/http/HttpParameterProgrammer.js +4 -2
- package/lib/programmers/http/HttpParameterProgrammer.js.map +1 -1
- package/lib/programmers/http/HttpQueryProgrammer.js +20 -5
- package/lib/programmers/http/HttpQueryProgrammer.js.map +1 -1
- package/lib/programmers/http/HttpValidateFormDataProgrammer.d.ts +6 -0
- package/lib/programmers/http/HttpValidateFormDataProgrammer.js +41 -0
- package/lib/programmers/http/HttpValidateFormDataProgrammer.js.map +1 -0
- package/lib/programmers/http/HttpValidateHeadersProgrammer.js +2 -2
- package/lib/programmers/http/HttpValidateHeadersProgrammer.js.map +1 -1
- package/lib/programmers/http/HttpValidateQueryProgrammer.js +2 -2
- package/lib/programmers/http/HttpValidateQueryProgrammer.js.map +1 -1
- package/lib/programmers/internal/application_array.js +10 -99
- package/lib/programmers/internal/application_array.js.map +1 -1
- package/lib/programmers/internal/application_boolean.js +8 -32
- package/lib/programmers/internal/application_boolean.js.map +1 -1
- package/lib/programmers/internal/application_escaped.d.ts +1 -4
- package/lib/programmers/internal/application_escaped.js +29 -22
- package/lib/programmers/internal/application_escaped.js.map +1 -1
- package/lib/programmers/internal/application_number.js +8 -137
- package/lib/programmers/internal/application_number.js.map +1 -1
- package/lib/programmers/internal/application_plugin.js +55 -0
- package/lib/programmers/internal/application_plugin.js.map +1 -0
- package/lib/programmers/internal/application_string.js +8 -107
- package/lib/programmers/internal/application_string.js.map +1 -1
- package/lib/programmers/internal/application_templates.js +7 -8
- package/lib/programmers/internal/application_templates.js.map +1 -1
- package/lib/programmers/internal/application_v30_alias.js +44 -0
- package/lib/programmers/internal/application_v30_alias.js.map +1 -0
- package/lib/programmers/internal/application_v30_constant.js +13 -0
- package/lib/programmers/internal/application_v30_constant.js.map +1 -0
- package/lib/programmers/internal/application_v30_native.js +34 -0
- package/lib/programmers/internal/application_v30_native.js.map +1 -0
- package/lib/programmers/internal/application_v30_object.js +154 -0
- package/lib/programmers/internal/application_v30_object.js.map +1 -0
- package/lib/programmers/internal/application_v30_schema.js +228 -0
- package/lib/programmers/internal/application_v30_schema.js.map +1 -0
- package/lib/programmers/internal/application_v30_tuple.js +33 -0
- package/lib/programmers/internal/application_v30_tuple.js.map +1 -0
- package/lib/programmers/internal/application_v31_alias.js +38 -0
- package/lib/programmers/internal/application_v31_alias.js.map +1 -0
- package/lib/programmers/internal/application_v31_constant.js +19 -0
- package/lib/programmers/internal/application_v31_constant.js.map +1 -0
- package/lib/programmers/internal/application_v31_native.js +29 -0
- package/lib/programmers/internal/application_v31_native.js.map +1 -0
- package/lib/programmers/internal/application_v31_object.js +146 -0
- package/lib/programmers/internal/application_v31_object.js.map +1 -0
- package/lib/programmers/internal/application_v31_schema.js +224 -0
- package/lib/programmers/internal/application_v31_schema.js.map +1 -0
- package/lib/programmers/internal/application_v31_tuple.js +22 -0
- package/lib/programmers/internal/application_v31_tuple.js.map +1 -0
- package/lib/programmers/internal/check_array_length.js +3 -0
- package/lib/programmers/internal/check_array_length.js.map +1 -1
- package/lib/programmers/internal/check_bigint.js +6 -0
- package/lib/programmers/internal/check_bigint.js.map +1 -1
- package/lib/programmers/internal/check_dynamic_key.js +7 -1
- package/lib/programmers/internal/check_dynamic_key.js.map +1 -1
- package/lib/programmers/internal/check_dynamic_properties.js +29 -4
- package/lib/programmers/internal/check_dynamic_properties.js.map +1 -1
- package/lib/programmers/internal/check_everything.js +3 -0
- package/lib/programmers/internal/check_everything.js.map +1 -1
- package/lib/programmers/internal/check_native.js +3 -0
- package/lib/programmers/internal/check_native.js.map +1 -1
- package/lib/programmers/internal/check_number.js +8 -1
- package/lib/programmers/internal/check_number.js.map +1 -1
- package/lib/programmers/internal/check_object.js +9 -0
- package/lib/programmers/internal/check_object.js.map +1 -1
- package/lib/programmers/internal/check_string.js +6 -0
- package/lib/programmers/internal/check_string.js.map +1 -1
- package/lib/programmers/internal/check_template.js +7 -1
- package/lib/programmers/internal/check_template.js.map +1 -1
- package/lib/programmers/internal/check_union_array_like.js +4 -0
- package/lib/programmers/internal/check_union_array_like.js.map +1 -1
- package/lib/programmers/internal/decode_union_object.js +52 -10
- package/lib/programmers/internal/decode_union_object.js.map +1 -1
- package/lib/programmers/internal/feature_object_entries.js +3 -0
- package/lib/programmers/internal/feature_object_entries.js.map +1 -1
- package/lib/programmers/internal/metadata_to_pattern.js +10 -4
- package/lib/programmers/internal/metadata_to_pattern.js.map +1 -1
- package/lib/programmers/internal/prune_object_properties.js +3 -0
- package/lib/programmers/internal/prune_object_properties.js.map +1 -1
- package/lib/programmers/internal/random_custom.js +3 -0
- package/lib/programmers/internal/random_custom.js.map +1 -1
- package/lib/programmers/internal/stringify_dynamic_properties.js +11 -0
- package/lib/programmers/internal/stringify_dynamic_properties.js.map +1 -1
- package/lib/programmers/internal/stringify_native.js +3 -0
- package/lib/programmers/internal/stringify_native.js.map +1 -1
- package/lib/programmers/internal/stringify_regular_properties.js +7 -0
- package/lib/programmers/internal/stringify_regular_properties.js.map +1 -1
- package/lib/programmers/internal/template_to_pattern.js +3 -0
- package/lib/programmers/internal/template_to_pattern.js.map +1 -1
- package/lib/programmers/json/JsonApplicationProgrammer.d.ts +2 -5
- package/lib/programmers/json/JsonApplicationProgrammer.js +85 -34
- package/lib/programmers/json/JsonApplicationProgrammer.js.map +1 -1
- package/lib/programmers/json/JsonAssertParseProgrammer.d.ts +1 -1
- package/lib/programmers/json/JsonAssertParseProgrammer.js +11 -3
- package/lib/programmers/json/JsonAssertParseProgrammer.js.map +1 -1
- package/lib/programmers/json/JsonAssertStringifyProgrammer.d.ts +1 -1
- package/lib/programmers/json/JsonAssertStringifyProgrammer.js +9 -3
- package/lib/programmers/json/JsonAssertStringifyProgrammer.js.map +1 -1
- package/lib/programmers/json/JsonIsParseProgrammer.js +3 -1
- package/lib/programmers/json/JsonIsParseProgrammer.js.map +1 -1
- package/lib/programmers/json/JsonStringifyProgrammer.js +43 -4
- package/lib/programmers/json/JsonStringifyProgrammer.js.map +1 -1
- package/lib/programmers/misc/MiscAssertCloneProgrammer.d.ts +1 -1
- package/lib/programmers/misc/MiscAssertCloneProgrammer.js +11 -3
- package/lib/programmers/misc/MiscAssertCloneProgrammer.js.map +1 -1
- package/lib/programmers/misc/MiscAssertPruneProgrammer.d.ts +1 -1
- package/lib/programmers/misc/MiscAssertPruneProgrammer.js +9 -3
- package/lib/programmers/misc/MiscAssertPruneProgrammer.js.map +1 -1
- package/lib/programmers/misc/MiscCloneProgrammer.js +30 -4
- package/lib/programmers/misc/MiscCloneProgrammer.js.map +1 -1
- package/lib/programmers/misc/MiscIsCloneProgrammer.js +3 -1
- package/lib/programmers/misc/MiscIsCloneProgrammer.js.map +1 -1
- package/lib/programmers/misc/MiscLiteralsProgrammer.js +1 -2
- package/lib/programmers/misc/MiscLiteralsProgrammer.js.map +1 -1
- package/lib/programmers/misc/MiscPruneProgrammer.js +21 -1
- package/lib/programmers/misc/MiscPruneProgrammer.js.map +1 -1
- package/lib/programmers/notations/NotationAssertGeneralProgrammer.d.ts +1 -1
- package/lib/programmers/notations/NotationAssertGeneralProgrammer.js +9 -3
- package/lib/programmers/notations/NotationAssertGeneralProgrammer.js.map +1 -1
- package/lib/programmers/notations/NotationGeneralProgrammer.js +189 -175
- package/lib/programmers/notations/NotationGeneralProgrammer.js.map +1 -1
- package/lib/programmers/protobuf/ProtobufAssertDecodeProgrammer.d.ts +1 -1
- package/lib/programmers/protobuf/ProtobufAssertDecodeProgrammer.js +9 -3
- package/lib/programmers/protobuf/ProtobufAssertDecodeProgrammer.js.map +1 -1
- package/lib/programmers/protobuf/ProtobufAssertEncodeProgrammer.d.ts +1 -1
- package/lib/programmers/protobuf/ProtobufAssertEncodeProgrammer.js +9 -3
- package/lib/programmers/protobuf/ProtobufAssertEncodeProgrammer.js.map +1 -1
- package/lib/programmers/protobuf/ProtobufDecodeProgrammer.js +16 -4
- package/lib/programmers/protobuf/ProtobufDecodeProgrammer.js.map +1 -1
- package/lib/programmers/protobuf/ProtobufEncodeProgrammer.js +39 -19
- package/lib/programmers/protobuf/ProtobufEncodeProgrammer.js.map +1 -1
- package/lib/programmers/protobuf/ProtobufIsDecodeProgrammer.js +3 -1
- package/lib/programmers/protobuf/ProtobufIsDecodeProgrammer.js.map +1 -1
- package/lib/programmers/protobuf/ProtobufMessageProgrammer.js +7 -1
- package/lib/programmers/protobuf/ProtobufMessageProgrammer.js.map +1 -1
- package/lib/protobuf.d.ts +72 -31
- package/lib/protobuf.js +136 -16
- package/lib/protobuf.js.map +1 -1
- package/lib/reflect.d.ts +4 -2
- package/lib/reflect.js +8 -1
- package/lib/reflect.js.map +1 -1
- package/lib/schemas/json/IJsonApplication.d.ts +13 -7
- package/lib/schemas/metadata/IMetadataConstant.d.ts +2 -1
- package/lib/schemas/metadata/IMetadataConstantValue.d.ts +6 -0
- package/lib/schemas/metadata/IMetadataConstantValue.js +3 -0
- package/lib/schemas/metadata/IMetadataConstantValue.js.map +1 -0
- package/lib/schemas/metadata/IMetadataTypeTag.d.ts +1 -0
- package/lib/schemas/metadata/Metadata.d.ts +1 -1
- package/lib/schemas/metadata/Metadata.js +84 -8
- package/lib/schemas/metadata/Metadata.js.map +1 -1
- package/lib/schemas/metadata/MetadataAlias.js +13 -1
- package/lib/schemas/metadata/MetadataAlias.js.map +1 -1
- package/lib/schemas/metadata/MetadataApplication.js +7 -1
- package/lib/schemas/metadata/MetadataApplication.js.map +1 -1
- package/lib/schemas/metadata/MetadataArray.js +4 -1
- package/lib/schemas/metadata/MetadataArray.js.map +1 -1
- package/lib/schemas/metadata/MetadataArrayType.js +10 -1
- package/lib/schemas/metadata/MetadataArrayType.js.map +1 -1
- package/lib/schemas/metadata/MetadataAtomic.js +20 -17
- package/lib/schemas/metadata/MetadataAtomic.js.map +1 -1
- package/lib/schemas/metadata/MetadataComponents.js +4 -1
- package/lib/schemas/metadata/MetadataComponents.js.map +1 -1
- package/lib/schemas/metadata/MetadataConstant.d.ts +2 -1
- package/lib/schemas/metadata/MetadataConstant.js +5 -9
- package/lib/schemas/metadata/MetadataConstant.js.map +1 -1
- package/lib/schemas/metadata/MetadataConstantValue.d.ts +13 -0
- package/lib/schemas/metadata/MetadataConstantValue.js +44 -0
- package/lib/schemas/metadata/MetadataConstantValue.js.map +1 -0
- package/lib/schemas/metadata/MetadataEscaped.js +10 -1
- package/lib/schemas/metadata/MetadataEscaped.js.map +1 -1
- package/lib/schemas/metadata/MetadataObject.js +28 -1
- package/lib/schemas/metadata/MetadataObject.js.map +1 -1
- package/lib/schemas/metadata/MetadataProperty.js +13 -1
- package/lib/schemas/metadata/MetadataProperty.js.map +1 -1
- package/lib/schemas/metadata/MetadataTuple.js +7 -1
- package/lib/schemas/metadata/MetadataTuple.js.map +1 -1
- package/lib/schemas/metadata/MetadataTupleType.js +7 -1
- package/lib/schemas/metadata/MetadataTupleType.js.map +1 -1
- package/lib/tags/Constant.d.ts +10 -0
- package/lib/{schemas/json/IJsonSchema.js → tags/Constant.js} +1 -1
- package/lib/tags/Constant.js.map +1 -0
- package/lib/tags/ContentMediaType.d.ts +9 -0
- package/lib/{schemas/json/IJsonComponents.js → tags/ContentMediaType.js} +1 -1
- package/lib/tags/ContentMediaType.js.map +1 -0
- package/lib/tags/Default.d.ts +3 -0
- package/lib/tags/ExclusiveMaximum.d.ts +4 -0
- package/lib/tags/ExclusiveMinimum.d.ts +4 -0
- package/lib/tags/Format.d.ts +10 -3
- package/lib/tags/JsonSchemaPlugin.d.ts +7 -0
- package/lib/tags/JsonSchemaPlugin.js +3 -0
- package/lib/tags/JsonSchemaPlugin.js.map +1 -0
- package/lib/tags/MaxItems.d.ts +3 -0
- package/lib/tags/MaxLength.d.ts +3 -0
- package/lib/tags/Maximum.d.ts +3 -0
- package/lib/tags/MinItems.d.ts +3 -0
- package/lib/tags/MinLength.d.ts +3 -0
- package/lib/tags/Minimum.d.ts +3 -0
- package/lib/tags/MultipleOf.d.ts +3 -0
- package/lib/tags/Pattern.d.ts +3 -0
- package/lib/tags/TagBase.d.ts +6 -2
- package/lib/tags/Type.d.ts +3 -0
- package/lib/tags/index.d.ts +3 -0
- package/lib/tags/index.js +3 -0
- package/lib/tags/index.js.map +1 -1
- package/lib/tags/internal/FormatCheatSheet.d.ts +27 -0
- package/lib/tags/internal/FormatCheatSheet.js +38 -0
- package/lib/tags/internal/FormatCheatSheet.js.map +1 -0
- package/lib/transformers/CallExpressionTransformer.js +195 -1
- package/lib/transformers/CallExpressionTransformer.js.map +1 -1
- package/lib/transformers/FileTransformer.js +2 -0
- package/lib/transformers/FileTransformer.js.map +1 -1
- package/lib/transformers/TransformerError.js +2 -1
- package/lib/transformers/TransformerError.js.map +1 -1
- package/lib/transformers/features/AssertTransformer.js.map +1 -1
- package/lib/transformers/features/CreateAssertTransformer.js.map +1 -1
- package/lib/transformers/features/CreateRandomTransformer.js +3 -0
- package/lib/transformers/features/CreateRandomTransformer.js.map +1 -1
- package/lib/transformers/features/RandomTransformer.js +3 -0
- package/lib/transformers/features/RandomTransformer.js.map +1 -1
- package/lib/transformers/features/functional/FunctionalGenericTransformer.d.ts +10 -0
- package/lib/transformers/features/functional/FunctionalGenericTransformer.js +39 -0
- package/lib/transformers/features/functional/FunctionalGenericTransformer.js.map +1 -0
- package/lib/transformers/features/http/CreateHttpAssertFormDataTransformer.d.ts +4 -0
- package/lib/transformers/features/http/CreateHttpAssertFormDataTransformer.js +12 -0
- package/lib/transformers/features/http/CreateHttpAssertFormDataTransformer.js.map +1 -0
- package/lib/transformers/features/http/CreateHttpFormDataTransformer.d.ts +4 -0
- package/lib/transformers/features/http/CreateHttpFormDataTransformer.js +10 -0
- package/lib/transformers/features/http/CreateHttpFormDataTransformer.js.map +1 -0
- package/lib/transformers/features/http/CreateHttpIsFormDataTransformer.d.ts +4 -0
- package/lib/transformers/features/http/CreateHttpIsFormDataTransformer.js +10 -0
- package/lib/transformers/features/http/CreateHttpIsFormDataTransformer.js.map +1 -0
- package/lib/transformers/features/http/CreateHttpValidateFormDataTransformer.d.ts +4 -0
- package/lib/transformers/features/http/CreateHttpValidateFormDataTransformer.js +12 -0
- package/lib/transformers/features/http/CreateHttpValidateFormDataTransformer.js.map +1 -0
- package/lib/transformers/features/http/HttpAssertFormDataTransformer.d.ts +4 -0
- package/lib/transformers/features/http/HttpAssertFormDataTransformer.js +12 -0
- package/lib/transformers/features/http/HttpAssertFormDataTransformer.js.map +1 -0
- package/lib/transformers/features/http/HttpFormDataTransformer.d.ts +4 -0
- package/lib/transformers/features/http/HttpFormDataTransformer.js +10 -0
- package/lib/transformers/features/http/HttpFormDataTransformer.js.map +1 -0
- package/lib/transformers/features/http/HttpIsFormDataTransformer.d.ts +4 -0
- package/lib/transformers/features/http/HttpIsFormDataTransformer.js +10 -0
- package/lib/transformers/features/http/HttpIsFormDataTransformer.js.map +1 -0
- package/lib/transformers/features/http/HttpValidateFormDataTransformer.d.ts +4 -0
- package/lib/transformers/features/http/HttpValidateFormDataTransformer.js +12 -0
- package/lib/transformers/features/http/HttpValidateFormDataTransformer.js.map +1 -0
- package/lib/transformers/features/json/JsonApplicationTransformer.js +20 -17
- package/lib/transformers/features/json/JsonApplicationTransformer.js.map +1 -1
- package/lib/transformers/features/misc/MiscLiteralsTransformer.js +3 -0
- package/lib/transformers/features/misc/MiscLiteralsTransformer.js.map +1 -1
- package/lib/transformers/features/protobuf/ProtobufMessageTransformer.js +3 -0
- package/lib/transformers/features/protobuf/ProtobufMessageTransformer.js.map +1 -1
- package/lib/transformers/features/reflect/ReflectMetadataTransformer.js +4 -0
- package/lib/transformers/features/reflect/ReflectMetadataTransformer.js.map +1 -1
- package/lib/transformers/internal/GenericTransformer.d.ts +1 -1
- package/lib/transformers/internal/GenericTransformer.js +9 -3
- package/lib/transformers/internal/GenericTransformer.js.map +1 -1
- package/lib/utils/ArrayUtil.d.ts +0 -1
- package/lib/utils/ArrayUtil.js +0 -29
- package/lib/utils/ArrayUtil.js.map +1 -1
- package/lib/utils/NamingConvention/NamingConvention.d.ts +3 -0
- package/lib/utils/{NamingConvention.js → NamingConvention/NamingConvention.js} +55 -51
- package/lib/utils/NamingConvention/NamingConvention.js.map +1 -0
- package/lib/utils/NamingConvention/index.d.ts +1 -0
- package/lib/utils/NamingConvention/index.js +28 -0
- package/lib/utils/NamingConvention/index.js.map +1 -0
- package/lib/utils/PatternUtil.js +3 -3
- package/lib/utils/PatternUtil.js.map +1 -1
- package/lib/utils/RandomGenerator/RandomGenerator.d.ts +31 -0
- package/lib/utils/RandomGenerator/RandomGenerator.js +167 -0
- package/lib/utils/RandomGenerator/RandomGenerator.js.map +1 -0
- package/lib/utils/RandomGenerator/index.d.ts +1 -0
- package/lib/utils/RandomGenerator/index.js +28 -0
- package/lib/utils/RandomGenerator/index.js.map +1 -0
- package/lib/utils/Singleton.js +1 -1
- package/lib/utils/StringUtil/StringUtil.d.ts +2 -0
- package/lib/utils/StringUtil/StringUtil.js +14 -0
- package/lib/utils/StringUtil/StringUtil.js.map +1 -0
- package/lib/utils/StringUtil/index.d.ts +1 -0
- package/lib/utils/StringUtil/index.js +28 -0
- package/lib/utils/StringUtil/index.js.map +1 -0
- package/package.json +14 -10
- package/src/CamelCase.ts +68 -61
- package/src/IRandomGenerator.ts +30 -5
- package/src/PascalCase.ts +68 -61
- package/src/Primitive.ts +48 -47
- package/src/Resolved.ts +61 -58
- package/src/SnakeCase.ts +67 -62
- package/src/executable/TypiaSetupWizard.ts +5 -5
- package/src/factories/IdentifierFactory.ts +1 -1
- package/src/factories/MetadataCommentTagFactory.ts +72 -157
- package/src/factories/MetadataFactory.ts +6 -1
- package/src/factories/MetadataTypeTagFactory.ts +38 -15
- package/src/factories/MetadataTypeTagSchemaFactory.ts +59 -0
- package/src/factories/ProtobufFactory.ts +9 -1
- package/src/factories/TypeFactory.ts +14 -14
- package/src/factories/internal/metadata/MetadataHelper.ts +7 -1
- package/src/factories/internal/metadata/emend_metadata_atomics.ts +15 -7
- package/src/factories/internal/metadata/emplace_metadata_object.ts +2 -1
- package/src/factories/internal/metadata/iterate_metadata.ts +2 -2
- package/src/factories/internal/metadata/iterate_metadata_array.ts +34 -1
- package/src/factories/internal/metadata/iterate_metadata_constant.ts +17 -2
- package/src/factories/internal/metadata/{iterate_metadata_resolve.ts → iterate_metadata_escape.ts} +1 -1
- package/src/factories/internal/metadata/iterate_metadata_intersection.ts +51 -97
- package/src/factories/internal/metadata/iterate_metadata_native.ts +21 -20
- package/src/factories/internal/metadata/iterate_metadata_object.ts +0 -10
- package/src/factories/internal/metadata/iterate_metadata_sort.ts +15 -2
- package/src/functional/$FormDataReader/$FormDataReader.ts +83 -0
- package/src/functional/$FormDataReader/index.ts +1 -0
- package/src/functional/$HeadersReader/$HeadersReader.ts +26 -0
- package/src/functional/$HeadersReader/index.ts +1 -0
- package/src/functional/$ParameterReader/$ParameterReader.ts +29 -0
- package/src/functional/$ParameterReader/index.ts +1 -0
- package/src/functional/$ProtobufReader.ts +5 -19
- package/src/functional/$ProtobufSizer.ts +11 -21
- package/src/functional/$ProtobufWriter.ts +8 -33
- package/src/functional/$QueryReader/$QueryReader.ts +46 -0
- package/src/functional/$QueryReader/index.ts +1 -0
- package/src/functional/$any.ts +4 -0
- package/src/functional/$clone.ts +1 -4
- package/src/functional/$convention.ts +0 -3
- package/src/functional/$dictionary.ts +22 -0
- package/src/functional/$every.ts +11 -0
- package/src/functional/$guard.ts +6 -20
- package/src/functional/$is_between.ts +0 -3
- package/src/functional/$join.ts +0 -12
- package/src/functional/$number.ts +0 -3
- package/src/functional/$report.ts +0 -3
- package/src/functional/$rest.ts +0 -3
- package/src/functional/$stoll.ts +0 -3
- package/src/functional/$string.ts +3 -10
- package/src/functional/$strlen.ts +0 -3
- package/src/functional/$throws.ts +0 -3
- package/src/functional/$varint.ts +130 -0
- package/src/functional/$zigzag.ts +39 -0
- package/src/functional/IProtobufWriter.ts +0 -3
- package/src/functional/Namespace/functional.ts +5 -0
- package/src/functional/Namespace/http.ts +9 -0
- package/src/functional/Namespace/index.ts +76 -0
- package/src/functional/Namespace/json.ts +15 -0
- package/src/functional/Namespace/misc.ts +14 -0
- package/src/functional/Namespace/notations.ts +23 -0
- package/src/functional/Namespace/protobuf.ts +20 -0
- package/src/functional/is.ts +10 -0
- package/src/functional.ts +872 -0
- package/src/http.ts +566 -412
- package/src/json.ts +181 -80
- package/src/misc.ts +190 -60
- package/src/module.ts +205 -60
- package/src/notations.ts +312 -76
- package/src/programmers/AssertProgrammer.ts +90 -46
- package/src/programmers/CheckerProgrammer.ts +57 -3
- package/src/programmers/FeatureProgrammer.ts +27 -27
- package/src/programmers/IsProgrammer.ts +1 -1
- package/src/programmers/RandomProgrammer.ts +85 -22
- package/src/programmers/TypiaProgrammer.ts +10 -18
- package/src/programmers/ValidateProgrammer.ts +47 -48
- package/src/programmers/functional/FunctionalAssertFunctionProgrammer.ts +130 -0
- package/src/programmers/functional/FunctionalAssertParametersProgrammer.ts +81 -0
- package/src/programmers/functional/FunctionalAssertReturnProgrammer.ts +77 -0
- package/src/programmers/functional/FunctionalIsFunctionProgrammer.ts +61 -0
- package/src/programmers/functional/FunctionalIsParametersProgrammer.ts +73 -0
- package/src/programmers/functional/FunctionalIsReturnProgrammer.ts +84 -0
- package/src/programmers/functional/FunctionalValidateFunctionProgrammer.ts +113 -0
- package/src/programmers/functional/FunctionalValidateParametersProgrammer.ts +203 -0
- package/src/programmers/functional/FunctionalValidateReturnProgrammer.ts +107 -0
- package/src/programmers/functional/internal/FunctionalGeneralProgrammer.ts +32 -0
- package/src/programmers/helpers/AtomicPredicator.ts +1 -2
- package/src/programmers/helpers/FunctionImporeter.ts +1 -0
- package/src/programmers/helpers/FunctionImporter.ts +17 -58
- package/src/programmers/helpers/ProtobufUtil.ts +2 -2
- package/src/programmers/helpers/PruneJoiner.ts +8 -10
- package/src/programmers/helpers/StringifyJoinder.ts +3 -2
- package/src/programmers/helpers/disable_function_importer_declare.ts +4 -5
- package/src/programmers/http/HttpAssertFormDataProgrammer.ts +87 -0
- package/src/programmers/http/HttpAssertHeadersProgrammer.ts +18 -6
- package/src/programmers/http/HttpAssertQueryProgrammer.ts +18 -6
- package/src/programmers/http/HttpFormDataProgrammer.ts +256 -0
- package/src/programmers/http/HttpHeadersProgrammer.ts +36 -25
- package/src/programmers/http/HttpIsFormDataProgrammer.ts +90 -0
- package/src/programmers/http/HttpIsHeadersProgrammer.ts +14 -6
- package/src/programmers/http/HttpIsQueryProgrammer.ts +14 -6
- package/src/programmers/http/HttpParameterProgrammer.ts +4 -6
- package/src/programmers/http/HttpQueryProgrammer.ts +38 -30
- package/src/programmers/http/HttpValidateFormDataProgrammer.ts +75 -0
- package/src/programmers/http/HttpValidateHeadersProgrammer.ts +2 -2
- package/src/programmers/http/HttpValidateQueryProgrammer.ts +2 -2
- package/src/programmers/internal/application_array.ts +27 -50
- package/src/programmers/internal/application_boolean.ts +18 -28
- package/src/programmers/internal/application_escaped.ts +40 -18
- package/src/programmers/internal/application_number.ts +17 -89
- package/src/programmers/internal/application_plugin.ts +19 -0
- package/src/programmers/internal/application_string.ts +17 -53
- package/src/programmers/internal/application_templates.ts +17 -16
- package/src/programmers/internal/application_v30_alias.ts +51 -0
- package/src/programmers/internal/application_v30_constant.ts +18 -0
- package/src/programmers/internal/application_v30_native.ts +28 -0
- package/src/programmers/internal/application_v30_object.ts +148 -0
- package/src/programmers/internal/application_v30_schema.ts +155 -0
- package/src/programmers/internal/application_v30_tuple.ts +33 -0
- package/src/programmers/internal/application_v31_alias.ts +43 -0
- package/src/programmers/internal/application_v31_constant.ts +22 -0
- package/src/programmers/internal/application_v31_native.ts +24 -0
- package/src/programmers/internal/application_v31_object.ts +141 -0
- package/src/programmers/internal/application_v31_schema.ts +150 -0
- package/src/programmers/internal/application_v31_tuple.ts +22 -0
- package/src/programmers/internal/check_dynamic_key.ts +5 -6
- package/src/programmers/internal/check_dynamic_properties.ts +20 -7
- package/src/programmers/internal/check_number.ts +35 -34
- package/src/programmers/internal/check_object.ts +5 -4
- package/src/programmers/internal/check_template.ts +1 -1
- package/src/programmers/internal/decode_union_object.ts +37 -16
- package/src/programmers/internal/feature_object_entries.ts +8 -8
- package/src/programmers/internal/metadata_to_pattern.ts +7 -6
- package/src/programmers/json/JsonApplicationProgrammer.ts +70 -37
- package/src/programmers/json/JsonAssertParseProgrammer.ts +21 -7
- package/src/programmers/json/JsonAssertStringifyProgrammer.ts +9 -3
- package/src/programmers/json/JsonIsParseProgrammer.ts +12 -4
- package/src/programmers/json/JsonStringifyProgrammer.ts +33 -26
- package/src/programmers/misc/MiscAssertCloneProgrammer.ts +21 -7
- package/src/programmers/misc/MiscAssertPruneProgrammer.ts +9 -3
- package/src/programmers/misc/MiscCloneProgrammer.ts +25 -19
- package/src/programmers/misc/MiscIsCloneProgrammer.ts +12 -4
- package/src/programmers/misc/MiscLiteralsProgrammer.ts +9 -11
- package/src/programmers/misc/MiscPruneProgrammer.ts +1 -1
- package/src/programmers/notations/NotationAssertGeneralProgrammer.ts +9 -3
- package/src/programmers/notations/NotationGeneralProgrammer.ts +12 -23
- package/src/programmers/protobuf/ProtobufAssertDecodeProgrammer.ts +18 -6
- package/src/programmers/protobuf/ProtobufAssertEncodeProgrammer.ts +9 -3
- package/src/programmers/protobuf/ProtobufDecodeProgrammer.ts +52 -41
- package/src/programmers/protobuf/ProtobufEncodeProgrammer.ts +55 -58
- package/src/programmers/protobuf/ProtobufIsDecodeProgrammer.ts +12 -4
- package/src/programmers/protobuf/ProtobufMessageProgrammer.ts +3 -3
- package/src/protobuf.ts +211 -51
- package/src/reflect.ts +9 -3
- package/src/schemas/json/IJsonApplication.ts +14 -7
- package/src/schemas/metadata/IMetadataConstant.ts +3 -1
- package/src/schemas/metadata/IMetadataConstantValue.ts +8 -0
- package/src/schemas/metadata/IMetadataTypeTag.ts +1 -0
- package/src/schemas/metadata/Metadata.ts +30 -13
- package/src/schemas/metadata/MetadataAtomic.ts +17 -15
- package/src/schemas/metadata/MetadataConstant.ts +5 -17
- package/src/schemas/metadata/MetadataConstantValue.ts +53 -0
- package/src/tags/Constant.ts +15 -0
- package/src/tags/ContentMediaType.ts +10 -0
- package/src/tags/Default.ts +7 -4
- package/src/tags/ExclusiveMaximum.ts +6 -0
- package/src/tags/ExclusiveMinimum.ts +6 -0
- package/src/tags/Format.ts +10 -24
- package/src/tags/JsonSchemaPlugin.ts +8 -0
- package/src/tags/MaxItems.ts +3 -0
- package/src/tags/MaxLength.ts +3 -0
- package/src/tags/Maximum.ts +5 -0
- package/src/tags/MinItems.ts +3 -0
- package/src/tags/MinLength.ts +3 -0
- package/src/tags/Minimum.ts +5 -0
- package/src/tags/MultipleOf.ts +5 -0
- package/src/tags/Pattern.ts +3 -0
- package/src/tags/TagBase.ts +9 -1
- package/src/tags/Type.ts +19 -14
- package/src/tags/index.ts +3 -0
- package/src/tags/internal/FormatCheatSheet.ts +71 -0
- package/src/transformers/CallExpressionTransformer.ts +146 -1
- package/src/transformers/features/AssertTransformer.ts +2 -2
- package/src/transformers/features/CreateAssertTransformer.ts +2 -2
- package/src/transformers/features/functional/FunctionalGenericTransformer.ts +57 -0
- package/src/transformers/features/http/CreateHttpAssertFormDataTransformer.ts +12 -0
- package/src/transformers/features/http/CreateHttpFormDataTransformer.ts +9 -0
- package/src/transformers/features/http/CreateHttpIsFormDataTransformer.ts +9 -0
- package/src/transformers/features/http/CreateHttpValidateFormDataTransformer.ts +12 -0
- package/src/transformers/features/http/HttpAssertFormDataTransformer.ts +10 -0
- package/src/transformers/features/http/HttpFormDataTransformer.ts +9 -0
- package/src/transformers/features/http/HttpIsFormDataTransformer.ts +9 -0
- package/src/transformers/features/http/HttpValidateFormDataTransformer.ts +10 -0
- package/src/transformers/features/json/JsonApplicationTransformer.ts +8 -18
- package/src/transformers/internal/GenericTransformer.ts +12 -4
- package/src/utils/ArrayUtil.ts +0 -2
- package/src/utils/NamingConvention/NamingConvention.ts +86 -0
- package/src/utils/NamingConvention/index.ts +1 -0
- package/src/utils/RandomGenerator/RandomGenerator.ts +105 -0
- package/src/utils/RandomGenerator/index.ts +1 -0
- package/src/utils/StringUtil/StringUtil.ts +7 -0
- package/src/utils/StringUtil/index.ts +1 -0
- package/lib/factories/internal/metadata/iterate_metadata_resolve.js.map +0 -1
- package/lib/functional/$HeadersReader.js +0 -35
- package/lib/functional/$HeadersReader.js.map +0 -1
- package/lib/functional/$ParameterReader.js +0 -35
- package/lib/functional/$ParameterReader.js.map +0 -1
- package/lib/functional/$QueryReader.js +0 -60
- package/lib/functional/$QueryReader.js.map +0 -1
- package/lib/functional/$camel.js +0 -7
- package/lib/functional/$camel.js.map +0 -1
- package/lib/functional/$generator.js +0 -6
- package/lib/functional/$generator.js.map +0 -1
- package/lib/functional/$pascal.js +0 -7
- package/lib/functional/$pascal.js.map +0 -1
- package/lib/functional/$snake.js +0 -7
- package/lib/functional/$snake.js.map +0 -1
- package/lib/programmers/internal/JSON_SCHEMA_PREFIX.d.ts +0 -1
- package/lib/programmers/internal/JSON_SCHEMA_PREFIX.js +0 -5
- package/lib/programmers/internal/JSON_SCHEMA_PREFIX.js.map +0 -1
- package/lib/programmers/internal/application_alias.d.ts +0 -5
- package/lib/programmers/internal/application_alias.js +0 -67
- package/lib/programmers/internal/application_alias.js.map +0 -1
- package/lib/programmers/internal/application_constant.js +0 -21
- package/lib/programmers/internal/application_constant.js.map +0 -1
- package/lib/programmers/internal/application_default.js +0 -40
- package/lib/programmers/internal/application_default.js.map +0 -1
- package/lib/programmers/internal/application_default_string.js +0 -63
- package/lib/programmers/internal/application_default_string.js.map +0 -1
- package/lib/programmers/internal/application_native.js +0 -33
- package/lib/programmers/internal/application_native.js.map +0 -1
- package/lib/programmers/internal/application_object.js +0 -202
- package/lib/programmers/internal/application_object.js.map +0 -1
- package/lib/programmers/internal/application_schema.js +0 -236
- package/lib/programmers/internal/application_schema.js.map +0 -1
- package/lib/programmers/internal/application_tuple.js +0 -46
- package/lib/programmers/internal/application_tuple.js.map +0 -1
- package/lib/schemas/json/IJsonComponents.d.ts +0 -18
- package/lib/schemas/json/IJsonComponents.js.map +0 -1
- package/lib/schemas/json/IJsonSchema.d.ts +0 -88
- package/lib/schemas/json/IJsonSchema.js.map +0 -1
- package/lib/utils/NamingConvention.d.ts +0 -5
- package/lib/utils/NamingConvention.js.map +0 -1
- package/lib/utils/RandomGenerator.d.ts +0 -1
- package/lib/utils/RandomGenerator.js +0 -66
- package/lib/utils/RandomGenerator.js.map +0 -1
- package/lib/utils/StringUtil.d.ts +0 -3
- package/lib/utils/StringUtil.js +0 -10
- package/lib/utils/StringUtil.js.map +0 -1
- package/src/functional/$HeadersReader.ts +0 -37
- package/src/functional/$ParameterReader.ts +0 -40
- package/src/functional/$QueryReader.ts +0 -65
- package/src/functional/$camel.ts +0 -8
- package/src/functional/$generator.ts +0 -6
- package/src/functional/$pascal.ts +0 -8
- package/src/functional/$snake.ts +0 -8
- package/src/programmers/internal/JSON_SCHEMA_PREFIX.ts +0 -1
- package/src/programmers/internal/application_alias.ts +0 -74
- package/src/programmers/internal/application_constant.ts +0 -25
- package/src/programmers/internal/application_default.ts +0 -17
- package/src/programmers/internal/application_default_string.ts +0 -33
- package/src/programmers/internal/application_native.ts +0 -34
- package/src/programmers/internal/application_object.ts +0 -183
- package/src/programmers/internal/application_schema.ts +0 -165
- package/src/programmers/internal/application_tuple.ts +0 -54
- package/src/schemas/json/IJsonComponents.ts +0 -19
- package/src/schemas/json/IJsonSchema.ts +0 -122
- package/src/utils/NamingConvention.ts +0 -87
- package/src/utils/RandomGenerator.ts +0 -83
- package/src/utils/StringUtil.ts +0 -4
- /package/lib/functional/{$HeadersReader.d.ts → is.d.ts} +0 -0
- /package/lib/{functional/$ParameterReader.d.ts → programmers/internal/application_plugin.d.ts} +0 -0
- /package/lib/{functional/$QueryReader.d.ts → programmers/internal/application_v30_alias.d.ts} +0 -0
- /package/lib/{functional/$camel.d.ts → programmers/internal/application_v30_constant.d.ts} +0 -0
- /package/lib/{functional/$generator.d.ts → programmers/internal/application_v30_native.d.ts} +0 -0
- /package/lib/{functional/$pascal.d.ts → programmers/internal/application_v30_object.d.ts} +0 -0
- /package/lib/{functional/$snake.d.ts → programmers/internal/application_v30_schema.d.ts} +0 -0
- /package/lib/programmers/internal/{application_constant.d.ts → application_v30_tuple.d.ts} +0 -0
- /package/lib/programmers/internal/{application_default.d.ts → application_v31_alias.d.ts} +0 -0
- /package/lib/programmers/internal/{application_default_string.d.ts → application_v31_constant.d.ts} +0 -0
- /package/lib/programmers/internal/{application_native.d.ts → application_v31_native.d.ts} +0 -0
- /package/lib/programmers/internal/{application_object.d.ts → application_v31_object.d.ts} +0 -0
- /package/lib/programmers/internal/{application_schema.d.ts → application_v31_schema.d.ts} +0 -0
- /package/lib/programmers/internal/{application_tuple.d.ts → application_v31_tuple.d.ts} +0 -0
package/src/http.ts
CHANGED
|
@@ -1,52 +1,212 @@
|
|
|
1
|
+
import * as Namespace from "./functional/Namespace";
|
|
2
|
+
|
|
1
3
|
import { Atomic } from "./typings/Atomic";
|
|
2
4
|
|
|
3
5
|
import { IValidation } from "./IValidation";
|
|
4
6
|
import { Resolved } from "./Resolved";
|
|
7
|
+
import { TypeGuardError } from "./TypeGuardError";
|
|
5
8
|
|
|
6
9
|
/* ===========================================================
|
|
7
10
|
HTTP
|
|
11
|
+
- FORM-DATA
|
|
8
12
|
- QUERY
|
|
9
13
|
- HEADERS
|
|
10
14
|
- PARAMETER
|
|
11
15
|
- FACTORY FUNCTIONS
|
|
12
16
|
==============================================================
|
|
13
|
-
|
|
17
|
+
FORM-DATA
|
|
14
18
|
----------------------------------------------------------- */
|
|
15
19
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* URL query decoder.
|
|
20
|
+
* Form data decoder.
|
|
19
21
|
*
|
|
20
|
-
* `typia.http.
|
|
21
|
-
*
|
|
22
|
-
*
|
|
22
|
+
* `typia.http.formData()` is a function decoding `FormData` instance, with
|
|
23
|
+
* automatic type casting to the expected type. When roperty type be defined
|
|
24
|
+
* as `boolean` or `Blob` type, `typia.http.formData()` will cast the value to
|
|
23
25
|
* the expected type when decoding.
|
|
24
26
|
*
|
|
25
|
-
* By the way, as
|
|
26
|
-
* `typia.http.
|
|
27
|
-
* following those restrictions, compilation errors would be occured.
|
|
27
|
+
* By the way, as `FormData` is not enough to express complex data structures,
|
|
28
|
+
* `typia.http.formData()` function has some limitations. If target type `T` is
|
|
29
|
+
* not following those restrictions, compilation errors would be occured.
|
|
28
30
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
31
|
+
* 1. Type `T` must be an object type
|
|
32
|
+
* 2. Do not allow dynamic property
|
|
33
|
+
* 3. Only `boolean`, `bigint`, `number`, `string`, `Blob`, `File` or their array types are allowed
|
|
34
|
+
* 4. By the way, union type never be not allowed
|
|
33
35
|
*
|
|
34
|
-
* Also, `typia.http.
|
|
35
|
-
* value. Therefore, if you can't sure that input data is following the
|
|
36
|
-
* it would better to call one of below functions intead.
|
|
36
|
+
* Also, `typia.http.formData()` function does not perform validation about the
|
|
37
|
+
* decoded value. Therefore, if you can't sure that input data is following the
|
|
38
|
+
* `T` type, it would better to call one of below functions intead.
|
|
37
39
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
40
|
+
* @template T Expected type of decoded value
|
|
41
|
+
* @param input FormData instance
|
|
42
|
+
* @returns Decoded form FormData
|
|
43
|
+
*
|
|
44
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
45
|
+
*/
|
|
46
|
+
function formData<T extends object>(input: FormData): Resolved<T>;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
51
|
+
function formData(): never {
|
|
52
|
+
halt("formData");
|
|
53
|
+
}
|
|
54
|
+
const formDataPure = /** @__PURE__ */ Object.assign<typeof formData, {}>(
|
|
55
|
+
formData,
|
|
56
|
+
/** @__PURE__ */ Namespace.http.formData(),
|
|
57
|
+
);
|
|
58
|
+
export { formDataPure as formData };
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Form data decoder with type assertion.
|
|
62
|
+
*
|
|
63
|
+
* `typia.http.assertFormData()` is a function decoding `FormData` instance, with
|
|
64
|
+
* automatic type casting to the expected type. When roperty type be defined
|
|
65
|
+
* as `boolean` or `Blob` type, `typia.http.assertFormData()` will cast the value
|
|
66
|
+
* to the expected type when decoding.
|
|
67
|
+
*
|
|
68
|
+
* Also, after decoding, `typia.http.assertFormData()` performs type assertion to
|
|
69
|
+
* the decoded value by combining with {@link assert} function. Therefore, when
|
|
70
|
+
* the decoded value is not following the `T` type, {@link TypeGuardError} or
|
|
71
|
+
* custom error generated by *errorFactory* would be thrown.
|
|
72
|
+
*
|
|
73
|
+
* By the way, as `FormData` is not enough to express complex data structures,
|
|
74
|
+
* `typia.http.assertFormData()` function has some limitations. If target type `T`
|
|
75
|
+
* is not following those restrictions, compilation errors would be occured.
|
|
76
|
+
*
|
|
77
|
+
* 1. Type `T` must be an object type
|
|
78
|
+
* 2. Do not allow dynamic property
|
|
79
|
+
* 3. Only `boolean`, `bigint`, `number`, `string`, `Blob`, `File` or their array types are allowed
|
|
80
|
+
* 4. By the way, union type never be not allowed
|
|
41
81
|
*
|
|
42
82
|
* @template T Expected type of decoded value
|
|
43
|
-
* @param input
|
|
44
|
-
* @
|
|
83
|
+
* @param input FormData instance
|
|
84
|
+
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
85
|
+
* @returns Decoded form FormData
|
|
45
86
|
*
|
|
46
87
|
* @author Jeongho Nam - https://github.com/samchon
|
|
47
88
|
*/
|
|
48
|
-
|
|
89
|
+
function assertFormData<T extends object>(
|
|
90
|
+
input: FormData,
|
|
91
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
92
|
+
): Resolved<T>;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* @internal
|
|
96
|
+
*/
|
|
97
|
+
function assertFormData(): never {
|
|
98
|
+
halt("assertFormData");
|
|
99
|
+
}
|
|
100
|
+
const assertFormDataPure = /** @__PURE__ */ Object.assign<
|
|
101
|
+
typeof assertFormData,
|
|
102
|
+
{},
|
|
103
|
+
{}
|
|
104
|
+
>(
|
|
105
|
+
assertFormData,
|
|
106
|
+
/** @__PURE__ */ Namespace.http.formData(),
|
|
107
|
+
/** @__PURE__ */ Namespace.assert("http.assertFormData"),
|
|
108
|
+
);
|
|
109
|
+
export { assertFormDataPure as assertFormData };
|
|
49
110
|
|
|
111
|
+
/**
|
|
112
|
+
* Form data decoder with type checking.
|
|
113
|
+
*
|
|
114
|
+
* `typia.http.isFormData()` is a function decoding `FormData` instance, with
|
|
115
|
+
* automatic type casting to the expected type. When roperty type be defined
|
|
116
|
+
* as `boolean` or `Blob` type, `typia.http.isFormData()` will cast the value
|
|
117
|
+
* to the expected type when decoding.
|
|
118
|
+
*
|
|
119
|
+
* Also, after decoding, `typia.http.isFormData()` performs type checking to the
|
|
120
|
+
* decoded value by combining with {@link is} function. Therefore, when the
|
|
121
|
+
* decoded value is not following the `T` type, `null` value would be returned.
|
|
122
|
+
*
|
|
123
|
+
* By the way, as `FormData` is not enough to express complex data structures,
|
|
124
|
+
* `typia.http.isFormData()` function has some limitations. If target type `T` is
|
|
125
|
+
* not following those restrictions, compilation errors would be occured.
|
|
126
|
+
*
|
|
127
|
+
* 1. Type `T` must be an object type
|
|
128
|
+
* 2. Do not allow dynamic property
|
|
129
|
+
* 3. Only `boolean`, `bigint`, `number`, `string`, `Blob`, `File` or their array types are allowed
|
|
130
|
+
* 4. By the way, union type never be not allowed
|
|
131
|
+
*
|
|
132
|
+
* @template T Expected type of decoded value
|
|
133
|
+
* @param input FormData instance
|
|
134
|
+
* @returns Decoded form FormData or `null` value
|
|
135
|
+
*
|
|
136
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
137
|
+
*/
|
|
138
|
+
function isFormData<T extends object>(input: FormData): Resolved<T> | null;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* @internal
|
|
142
|
+
*/
|
|
143
|
+
function isFormData(): never {
|
|
144
|
+
halt("isFormData");
|
|
145
|
+
}
|
|
146
|
+
const isFormDataPure = /** @__PURE__ */ Object.assign<
|
|
147
|
+
typeof isFormData,
|
|
148
|
+
{},
|
|
149
|
+
{}
|
|
150
|
+
>(
|
|
151
|
+
isFormData,
|
|
152
|
+
/** @__PURE__ */ Namespace.http.formData(),
|
|
153
|
+
/** @__PURE__ */ Namespace.is(),
|
|
154
|
+
);
|
|
155
|
+
export { isFormDataPure as isFormData };
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Form data decoder with type validation.
|
|
159
|
+
*
|
|
160
|
+
* `typia.http.validateFormData()` is a function decoding `FormData` instance,
|
|
161
|
+
* with automatic type casting to the expected type. When roperty type be defined
|
|
162
|
+
* as `boolean` or `Blob` type, `typia.http.validateFormData()` will cast the
|
|
163
|
+
* value to the expected type when decoding.
|
|
164
|
+
*
|
|
165
|
+
* Also, after decoding, `typia.http.validateFormData()` performs type validation
|
|
166
|
+
* to the decoded value by combining with {@link validate} function. Therefore,
|
|
167
|
+
* when the decoded value is not following the `T` type,
|
|
168
|
+
* {@link IValidation.IFailure} would be returned. Otherwise,
|
|
169
|
+
* x@xxxx IValidation.ISuccess} would be returned.
|
|
170
|
+
*
|
|
171
|
+
* By the way, as `FormData` is not enough to express complex data structures,
|
|
172
|
+
* `typia.http.validateFormData()` function has some limitations. If target type
|
|
173
|
+
* `T` is not following those restrictions, compilation errors would be occured.
|
|
174
|
+
*
|
|
175
|
+
* 1. Type `T` must be an object type
|
|
176
|
+
* 2. Do not allow dynamic property
|
|
177
|
+
* 3. Only `boolean`, `bigint`, `number`, `string`, `Blob`, `File` or their array types are allowed
|
|
178
|
+
* 4. By the way, union type never be not allowed
|
|
179
|
+
*
|
|
180
|
+
* @template T Expected type of decoded value
|
|
181
|
+
* @param input FormData instance
|
|
182
|
+
* @returns Validation result with decoded form FormData
|
|
183
|
+
*
|
|
184
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
185
|
+
*/
|
|
186
|
+
function validateFormData<T extends object>(
|
|
187
|
+
input: FormData,
|
|
188
|
+
): IValidation<Resolved<T>>;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @internal
|
|
192
|
+
*/
|
|
193
|
+
function validateFormData(): never {
|
|
194
|
+
halt("validateFormData");
|
|
195
|
+
}
|
|
196
|
+
const validateFormDataPure = /** @__PURE__ */ Object.assign<
|
|
197
|
+
typeof validateFormData,
|
|
198
|
+
{},
|
|
199
|
+
{}
|
|
200
|
+
>(
|
|
201
|
+
validateFormData,
|
|
202
|
+
/** @__PURE__ */ Namespace.http.formData(),
|
|
203
|
+
/** @__PURE__ */ Namespace.validate(),
|
|
204
|
+
);
|
|
205
|
+
export { validateFormDataPure as validateFormData };
|
|
206
|
+
|
|
207
|
+
/* -----------------------------------------------------------
|
|
208
|
+
QUERY
|
|
209
|
+
----------------------------------------------------------- */
|
|
50
210
|
/**
|
|
51
211
|
* URL query decoder.
|
|
52
212
|
*
|
|
@@ -78,48 +238,19 @@ export function query(): never;
|
|
|
78
238
|
*
|
|
79
239
|
* @author Jeongho Nam - https://github.com/samchon
|
|
80
240
|
*/
|
|
81
|
-
|
|
82
|
-
input: string | URLSearchParams,
|
|
83
|
-
): Resolved<T>;
|
|
241
|
+
function query<T extends object>(input: string | URLSearchParams): Resolved<T>;
|
|
84
242
|
|
|
85
243
|
/**
|
|
86
244
|
* @internal
|
|
87
245
|
*/
|
|
88
|
-
|
|
246
|
+
function query(): never {
|
|
89
247
|
halt("query");
|
|
90
248
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
*
|
|
97
|
-
* `typia.http.assertQuery()` is a function decoding a query string or an
|
|
98
|
-
* `URLSearchParams` instance, with automatic type casting to the expected type.
|
|
99
|
-
* When property type be defined as `boolean` or `number` type,
|
|
100
|
-
* `typia.http.assertQuery()` will cast the value to the expected type when decoding.
|
|
101
|
-
*
|
|
102
|
-
* Also, after decoding, `typia.http.assertQuery()` performs type assertion to the
|
|
103
|
-
* decoded value by combining with {@link assert} function. Therefore, when the
|
|
104
|
-
* decoded value is not following the `T` type, {@link TypeGuardError} would be
|
|
105
|
-
* thrown.
|
|
106
|
-
*
|
|
107
|
-
* By the way, as URL query is not enough to express complex data structures,
|
|
108
|
-
* `typia.http.assertQuery()` function has some limitations. If target type `T` is
|
|
109
|
-
* notfollowing those restrictions, compilation errors would be occured.
|
|
110
|
-
*
|
|
111
|
-
* 1. Type `T` must be an object type
|
|
112
|
-
* 2. Do not allow dynamic property
|
|
113
|
-
* 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
|
|
114
|
-
* 4. By the way, union type never be not allowed
|
|
115
|
-
*
|
|
116
|
-
* @template T Expected type of decoded value
|
|
117
|
-
* @param input Query string or URLSearchParams instance
|
|
118
|
-
* @returns Decoded query object
|
|
119
|
-
*
|
|
120
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
121
|
-
*/
|
|
122
|
-
export function assertQuery(): never;
|
|
249
|
+
const queryPure = /** @__PURE__ */ Object.assign<typeof query, {}>(
|
|
250
|
+
query,
|
|
251
|
+
/** @__PURE__ */ Namespace.http.query(),
|
|
252
|
+
);
|
|
253
|
+
export { queryPure as query };
|
|
123
254
|
|
|
124
255
|
/**
|
|
125
256
|
* URL query decoder with type assertion.
|
|
@@ -131,8 +262,8 @@ export function assertQuery(): never;
|
|
|
131
262
|
*
|
|
132
263
|
* Also, after decoding, `typia.http.assertQuery()` performs type assertion to the
|
|
133
264
|
* decoded value by combining with {@link assert} function. Therefore, when the
|
|
134
|
-
* decoded value is not following the `T` type, {@link TypeGuardError}
|
|
135
|
-
* thrown.
|
|
265
|
+
* decoded value is not following the `T` type, {@link TypeGuardError} or custom
|
|
266
|
+
* error generated by *errorFactory* would be thrown.
|
|
136
267
|
*
|
|
137
268
|
* By the way, as URL query is not enough to express complex data structures,
|
|
138
269
|
* `typia.http.assertQuery()` function has some limitations. If target type `T` is
|
|
@@ -145,24 +276,34 @@ export function assertQuery(): never;
|
|
|
145
276
|
*
|
|
146
277
|
* @template T Expected type of decoded value
|
|
147
278
|
* @param input Query string or URLSearchParams instance
|
|
279
|
+
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
148
280
|
* @returns Decoded query object
|
|
149
281
|
*
|
|
150
282
|
* @author Jeongho Nam - https://github.com/samchon
|
|
151
283
|
*/
|
|
152
|
-
|
|
284
|
+
function assertQuery<T extends object>(
|
|
153
285
|
input: string | URLSearchParams,
|
|
286
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
154
287
|
): Resolved<T>;
|
|
155
288
|
|
|
156
289
|
/**
|
|
157
290
|
* @internal
|
|
158
291
|
*/
|
|
159
|
-
|
|
292
|
+
function assertQuery(): never {
|
|
160
293
|
halt("assertQuery");
|
|
161
294
|
}
|
|
295
|
+
const assertQueryPure = /** @__PURE__ */ Object.assign<
|
|
296
|
+
typeof assertQuery,
|
|
297
|
+
{},
|
|
298
|
+
{}
|
|
299
|
+
>(
|
|
300
|
+
assertQuery,
|
|
301
|
+
/** @__PURE__ */ Namespace.http.query(),
|
|
302
|
+
/** @__PURE__ */ Namespace.assert("http.assertQuery"),
|
|
303
|
+
);
|
|
304
|
+
export { assertQueryPure as assertQuery };
|
|
162
305
|
|
|
163
306
|
/**
|
|
164
|
-
* > You must configure the generic argument `T`.
|
|
165
|
-
*
|
|
166
307
|
* URL query decoder with type checking.
|
|
167
308
|
*
|
|
168
309
|
* `typia.http.isQuery()` is a function decoding a query string or an
|
|
@@ -189,77 +330,23 @@ export function assertQuery(): never {
|
|
|
189
330
|
*
|
|
190
331
|
* @author Jeongho Nam - https://github.com/samchon
|
|
191
332
|
*/
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* URL query decoder with type checking.
|
|
196
|
-
*
|
|
197
|
-
* `typia.http.isQuery()` is a function decoding a query string or an
|
|
198
|
-
* `URLSearchParams` instance, with automatic type casting to the expected type.
|
|
199
|
-
* When property type be defined as `boolean` or `number` type,
|
|
200
|
-
* `typia.http.isQuery()` will cast the value to the expected type when decoding.
|
|
201
|
-
*
|
|
202
|
-
* Also, after decoding, `typia.http.isQuery()` performs type checking to the
|
|
203
|
-
* decoded value by combining with {@link is} function. Therefore, when the
|
|
204
|
-
* decoded value is not following the `T` type, `null` value would be returned.
|
|
205
|
-
*
|
|
206
|
-
* By the way, as URL query is not enough to express complex data structures,
|
|
207
|
-
* `typia.http.isQuery()` function has some limitations. If target type `T` is
|
|
208
|
-
* notfollowing those restrictions, compilation errors would be occured.
|
|
209
|
-
*
|
|
210
|
-
* 1. Type `T` must be an object type
|
|
211
|
-
* 2. Do not allow dynamic property
|
|
212
|
-
* 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
|
|
213
|
-
* 4. By the way, union type never be not allowed
|
|
214
|
-
*
|
|
215
|
-
* @template T Expected type of decoded value
|
|
216
|
-
* @param input Query string or URLSearchParams instance
|
|
217
|
-
* @returns Decoded query object or `null` value
|
|
218
|
-
*
|
|
219
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
220
|
-
*/
|
|
221
|
-
export function isQuery<T extends object>(
|
|
333
|
+
function isQuery<T extends object>(
|
|
222
334
|
input: string | URLSearchParams,
|
|
223
335
|
): Resolved<T> | null;
|
|
224
336
|
|
|
225
337
|
/**
|
|
226
338
|
* @internal
|
|
227
339
|
*/
|
|
228
|
-
|
|
340
|
+
function isQuery(): never {
|
|
229
341
|
halt("isQuery");
|
|
230
342
|
}
|
|
231
343
|
|
|
232
|
-
/**
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
* `URLSearchParams` instance, with automatic type casting to the expected type.
|
|
239
|
-
* When property type be defined as `boolean` or `number` type,
|
|
240
|
-
* `typia.http.validateQuery()` will cast the value to the expected type when decoding.
|
|
241
|
-
*
|
|
242
|
-
* Also, after decoding, `typia.http.validateQuery()` performs type validation to the
|
|
243
|
-
* decoded value by combining with {@link validate} function. Therefore, when the
|
|
244
|
-
* decoded value is not following the `T` type, {@link IValidation.IFailure} would
|
|
245
|
-
* be returned. Otherwise, {@link IValidation.ISuccess} would be returned.
|
|
246
|
-
*
|
|
247
|
-
* By the way, as URL query is not enough to express complex data structures,
|
|
248
|
-
* `typia.http.validateQuery()` function has some limitations. If target type `T` is
|
|
249
|
-
* notfollowing those restrictions, compilation errors would be occured.
|
|
250
|
-
*
|
|
251
|
-
* 1. Type `T` must be an object type
|
|
252
|
-
* 2. Do not allow dynamic property
|
|
253
|
-
* 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
|
|
254
|
-
* 4. By the way, union type never be not allowed
|
|
255
|
-
*
|
|
256
|
-
* @template T Expected type of decoded value
|
|
257
|
-
* @param input Query string or URLSearchParams instance
|
|
258
|
-
* @returns Validation result with decoded query object
|
|
259
|
-
*
|
|
260
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
261
|
-
*/
|
|
262
|
-
export function validateQuery(): never;
|
|
344
|
+
const isQueryPure = /** @__PURE__ */ Object.assign<typeof isQuery, {}, {}>(
|
|
345
|
+
isQuery,
|
|
346
|
+
/** @__PURE__ */ Namespace.http.query(),
|
|
347
|
+
/** @__PURE__ */ Namespace.is(),
|
|
348
|
+
);
|
|
349
|
+
export { isQueryPure as isQuery };
|
|
263
350
|
|
|
264
351
|
/**
|
|
265
352
|
* URL query decoder with type validation.
|
|
@@ -289,76 +376,30 @@ export function validateQuery(): never;
|
|
|
289
376
|
*
|
|
290
377
|
* @author Jeongho Nam - https://github.com/samchon
|
|
291
378
|
*/
|
|
292
|
-
|
|
379
|
+
function validateQuery<T extends object>(
|
|
293
380
|
input: string | URLSearchParams,
|
|
294
381
|
): IValidation<Resolved<T>>;
|
|
295
382
|
|
|
296
383
|
/**
|
|
297
384
|
* @internal
|
|
298
385
|
*/
|
|
299
|
-
|
|
386
|
+
function validateQuery(): never {
|
|
300
387
|
halt("validateQuery");
|
|
301
388
|
}
|
|
389
|
+
const validateQueryPure = /** @__PURE__ */ Object.assign<
|
|
390
|
+
typeof validateQuery,
|
|
391
|
+
{},
|
|
392
|
+
{}
|
|
393
|
+
>(
|
|
394
|
+
validateQuery,
|
|
395
|
+
/** @__PURE__ */ Namespace.http.query(),
|
|
396
|
+
/** @__PURE__ */ Namespace.validate(),
|
|
397
|
+
);
|
|
398
|
+
export { validateQueryPure as validateQuery };
|
|
302
399
|
|
|
303
400
|
/* -----------------------------------------------------------
|
|
304
401
|
HEADERS
|
|
305
402
|
----------------------------------------------------------- */
|
|
306
|
-
/**
|
|
307
|
-
* > You must configure the generic argument `T`.
|
|
308
|
-
*
|
|
309
|
-
* Headers decoder (for express and fastify).
|
|
310
|
-
*
|
|
311
|
-
* `typia.http.headers()` is a function decoding an header instance, with automatic
|
|
312
|
-
* type casting to the expected type. When property type be defined as `boolean` or
|
|
313
|
-
* `number` type, `typia.http.headers()` will cast the value to the expected type.
|
|
314
|
-
*
|
|
315
|
-
* By the way, as HTTP headers are not enough to express complex data structures,
|
|
316
|
-
* `typia.http.headers()` function has some limitations. If target type `T` is not
|
|
317
|
-
* following those restrictions, compilation errors would be occured.
|
|
318
|
-
*
|
|
319
|
-
* 1. Type `T` must be an object type
|
|
320
|
-
* 2. Do not allow dynamic property
|
|
321
|
-
* 3. Property key must be lower case
|
|
322
|
-
* 4. Property value cannot be `null`, but `undefined` is possible
|
|
323
|
-
* 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
|
|
324
|
-
* 6. By the way, union type never be not allowed
|
|
325
|
-
* 7. Property `set-cookie` must be array type
|
|
326
|
-
* 8. Those properties cannot be array type
|
|
327
|
-
* - age
|
|
328
|
-
* - authorization
|
|
329
|
-
* - content-length
|
|
330
|
-
* - content-type
|
|
331
|
-
* - etag
|
|
332
|
-
* - expires
|
|
333
|
-
* - from
|
|
334
|
-
* - host
|
|
335
|
-
* - if-modified-since
|
|
336
|
-
* - if-unmodified-since
|
|
337
|
-
* - last-modified
|
|
338
|
-
* - location
|
|
339
|
-
* - max-forwards
|
|
340
|
-
* - proxy-authorization
|
|
341
|
-
* - referer
|
|
342
|
-
* - retry-after
|
|
343
|
-
* - server
|
|
344
|
-
* - user-agent
|
|
345
|
-
*
|
|
346
|
-
* Also, `typia.http.headers()` function does not perform validation about the decoded
|
|
347
|
-
* value. Therefore, if you can't sure that input data is following the `T` type,
|
|
348
|
-
* it would better to call one of below functions intead.
|
|
349
|
-
*
|
|
350
|
-
* - {@link assertHeaders}
|
|
351
|
-
* - {@link isHeaders}
|
|
352
|
-
* - {@link validateHeaders}
|
|
353
|
-
*
|
|
354
|
-
* @template T Expected type of decoded value
|
|
355
|
-
* @param input Query string or URLSearchParams instance
|
|
356
|
-
* @returns Decoded headers object
|
|
357
|
-
*
|
|
358
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
359
|
-
*/
|
|
360
|
-
export function headers(): never;
|
|
361
|
-
|
|
362
403
|
/**
|
|
363
404
|
* Headers decoder (for express and fastify).
|
|
364
405
|
*
|
|
@@ -411,70 +452,22 @@ export function headers(): never;
|
|
|
411
452
|
*
|
|
412
453
|
* @author Jeongho Nam - https://github.com/samchon
|
|
413
454
|
*/
|
|
414
|
-
|
|
455
|
+
function headers<T extends object>(
|
|
415
456
|
input: Record<string, string | string[] | undefined>,
|
|
416
457
|
): Resolved<T>;
|
|
417
458
|
|
|
418
459
|
/**
|
|
419
460
|
* @internal
|
|
420
461
|
*/
|
|
421
|
-
|
|
462
|
+
function headers(): never {
|
|
422
463
|
halt("headers");
|
|
423
464
|
}
|
|
424
465
|
|
|
425
|
-
/**
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
* `typia.http.assertHeaders()` is a function decoding an header instance, with
|
|
431
|
-
* automatic type casting to the expected type. When property type be defined as
|
|
432
|
-
* `boolean` or `number` type, `typia.http.headers()` will cast the value to the
|
|
433
|
-
* expected type.
|
|
434
|
-
*
|
|
435
|
-
* Also, after decoding, `typia.http.assertHeaders()` performs type assertion to the
|
|
436
|
-
* decoded value by combining with {@link assert} function. Therefore, when the
|
|
437
|
-
* decoded value is not following the `T` type, {@link TypeGuardError} would be
|
|
438
|
-
* thrown.
|
|
439
|
-
*
|
|
440
|
-
* By the way, as HTTP headers are not enough to express complex data structures,
|
|
441
|
-
* `typia.http.headers()` function has some limitations. If target type `T` is not
|
|
442
|
-
* following those restrictions, compilation errors would be occured.
|
|
443
|
-
*
|
|
444
|
-
* 1. Type `T` must be an object type
|
|
445
|
-
* 2. Do not allow dynamic property
|
|
446
|
-
* 3. Property key must be lower case
|
|
447
|
-
* 4. Property value cannot be `null`, but `undefined` is possible
|
|
448
|
-
* 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
|
|
449
|
-
* 6. By the way, union type never be not allowed
|
|
450
|
-
* 7. Property `set-cookie` must be array type
|
|
451
|
-
* 8. Those properties cannot be array type
|
|
452
|
-
* - age
|
|
453
|
-
* - authorization
|
|
454
|
-
* - content-length
|
|
455
|
-
* - content-type
|
|
456
|
-
* - etag
|
|
457
|
-
* - expires
|
|
458
|
-
* - from
|
|
459
|
-
* - host
|
|
460
|
-
* - if-modified-since
|
|
461
|
-
* - if-unmodified-since
|
|
462
|
-
* - last-modified
|
|
463
|
-
* - location
|
|
464
|
-
* - max-forwards
|
|
465
|
-
* - proxy-authorization
|
|
466
|
-
* - referer
|
|
467
|
-
* - retry-after
|
|
468
|
-
* - server
|
|
469
|
-
* - user-agent
|
|
470
|
-
*
|
|
471
|
-
* @template T Expected type of decoded value
|
|
472
|
-
* @param input Query string or URLSearchParams instance
|
|
473
|
-
* @returns Decoded headers object
|
|
474
|
-
*
|
|
475
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
476
|
-
*/
|
|
477
|
-
export function assertHeaders(): never;
|
|
466
|
+
const headersPure = /** @__PURE__ */ Object.assign<typeof headers, {}>(
|
|
467
|
+
headers,
|
|
468
|
+
/** @__PURE__ */ Namespace.http.headers(),
|
|
469
|
+
);
|
|
470
|
+
export { headersPure as headers };
|
|
478
471
|
|
|
479
472
|
/**
|
|
480
473
|
* Headers decoder with type assertion (for express and fastify).
|
|
@@ -486,8 +479,8 @@ export function assertHeaders(): never;
|
|
|
486
479
|
*
|
|
487
480
|
* Also, after decoding, `typia.http.assertHeaders()` performs type assertion to the
|
|
488
481
|
* decoded value by combining with {@link assert} function. Therefore, when the
|
|
489
|
-
* decoded value is not following the `T` type, {@link TypeGuardError}
|
|
490
|
-
* thrown.
|
|
482
|
+
* decoded value is not following the `T` type, {@link TypeGuardError} or custom
|
|
483
|
+
* error generated by *errorFactory* would be thrown.
|
|
491
484
|
*
|
|
492
485
|
* By the way, as HTTP headers are not enough to express complex data structures,
|
|
493
486
|
* `typia.http.headers()` function has some limitations. If target type `T` is not
|
|
@@ -522,73 +515,33 @@ export function assertHeaders(): never;
|
|
|
522
515
|
*
|
|
523
516
|
* @template T Expected type of decoded value
|
|
524
517
|
* @param input Query string or URLSearchParams instance
|
|
518
|
+
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
525
519
|
* @returns Decoded headers object
|
|
526
520
|
*
|
|
527
521
|
* @author Jeongho Nam - https://github.com/samchon
|
|
528
522
|
*/
|
|
529
|
-
|
|
523
|
+
function assertHeaders<T extends object>(
|
|
530
524
|
input: Record<string, string | string[] | undefined>,
|
|
525
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
531
526
|
): Resolved<T>;
|
|
532
527
|
|
|
533
528
|
/**
|
|
534
529
|
* @internal
|
|
535
530
|
*/
|
|
536
|
-
|
|
531
|
+
function assertHeaders(): never {
|
|
537
532
|
halt("assertHeaders");
|
|
538
533
|
}
|
|
539
534
|
|
|
540
|
-
/**
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
* Also, after decoding, `typia.http.isHeaders()` performs type checking to the
|
|
551
|
-
* decoded value by combining with {@link is} function. Therefore, when the
|
|
552
|
-
* decoded value is not following the `T` type, `null` value would be returned.
|
|
553
|
-
*
|
|
554
|
-
* By the way, as HTTP headers are not enough to express complex data structures,
|
|
555
|
-
* `typia.http.headers()` function has some limitations. If target type `T` is not
|
|
556
|
-
* following those restrictions, compilation errors would be occured.
|
|
557
|
-
*
|
|
558
|
-
* 1. Type `T` must be an object type
|
|
559
|
-
* 2. Do not allow dynamic property
|
|
560
|
-
* 3. Property key must be lower case
|
|
561
|
-
* 4. Property value cannot be `null`, but `undefined` is possible
|
|
562
|
-
* 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
|
|
563
|
-
* 6. By the way, union type never be not allowed
|
|
564
|
-
* 7. Property `set-cookie` must be array type
|
|
565
|
-
* 8. Those properties cannot be array type
|
|
566
|
-
* - age
|
|
567
|
-
* - authorization
|
|
568
|
-
* - content-length
|
|
569
|
-
* - content-type
|
|
570
|
-
* - etag
|
|
571
|
-
* - expires
|
|
572
|
-
* - from
|
|
573
|
-
* - host
|
|
574
|
-
* - if-modified-since
|
|
575
|
-
* - if-unmodified-since
|
|
576
|
-
* - last-modified
|
|
577
|
-
* - location
|
|
578
|
-
* - max-forwards
|
|
579
|
-
* - proxy-authorization
|
|
580
|
-
* - referer
|
|
581
|
-
* - retry-after
|
|
582
|
-
* - server
|
|
583
|
-
* - user-agent
|
|
584
|
-
*
|
|
585
|
-
* @template T Expected type of decoded value
|
|
586
|
-
* @param input Query string or URLSearchParams instance
|
|
587
|
-
* @returns Decoded headers object or `null` value
|
|
588
|
-
*
|
|
589
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
590
|
-
*/
|
|
591
|
-
export function isHeaders(): never;
|
|
535
|
+
const assertHeadersPure = /** @__PURE__ */ Object.assign<
|
|
536
|
+
typeof assertHeaders,
|
|
537
|
+
{},
|
|
538
|
+
{}
|
|
539
|
+
>(
|
|
540
|
+
assertHeaders,
|
|
541
|
+
/** @__PURE__ */ Namespace.http.headers(),
|
|
542
|
+
/** @__PURE__ */ Namespace.assert("http.assertHeaders"),
|
|
543
|
+
);
|
|
544
|
+
export { assertHeadersPure as assertHeaders };
|
|
592
545
|
|
|
593
546
|
/**
|
|
594
547
|
* > You must configure the generic argument `T`.
|
|
@@ -641,20 +594,24 @@ export function isHeaders(): never;
|
|
|
641
594
|
*
|
|
642
595
|
* @author Jeongho Nam - https://github.com/samchon
|
|
643
596
|
*/
|
|
644
|
-
|
|
597
|
+
function isHeaders<T extends object>(
|
|
645
598
|
input: Record<string, string | string[] | undefined>,
|
|
646
599
|
): Resolved<T> | null;
|
|
647
600
|
|
|
648
601
|
/**
|
|
649
602
|
* @internal
|
|
650
603
|
*/
|
|
651
|
-
|
|
604
|
+
function isHeaders(): never {
|
|
652
605
|
halt("isHeaders");
|
|
653
606
|
}
|
|
607
|
+
const isHeadersPure = /** @__PURE__ */ Object.assign<typeof isHeaders, {}, {}>(
|
|
608
|
+
isHeaders,
|
|
609
|
+
/** @__PURE__ */ Namespace.http.headers(),
|
|
610
|
+
/** @__PURE__ */ Namespace.is(),
|
|
611
|
+
);
|
|
612
|
+
export { isHeadersPure as isHeaders };
|
|
654
613
|
|
|
655
614
|
/**
|
|
656
|
-
* > You must configure the generic argument `T`.
|
|
657
|
-
*
|
|
658
615
|
* Headers decoder with type validation (for express and fastify).
|
|
659
616
|
*
|
|
660
617
|
* `typia.http.validateHeaders()` is a function decoding an header instance, with
|
|
@@ -704,75 +661,32 @@ export function isHeaders(): never {
|
|
|
704
661
|
*
|
|
705
662
|
* @author Jeongho Nam - https://github.com/samchon
|
|
706
663
|
*/
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
/**
|
|
710
|
-
* Headers decoder with type validation (for express and fastify).
|
|
711
|
-
*
|
|
712
|
-
* `typia.http.validateHeaders()` is a function decoding an header instance, with
|
|
713
|
-
* automatic type casting to the expected type. When property type be defined as
|
|
714
|
-
* `boolean` or `number` type, `typia.http.headers()` will cast the value to the
|
|
715
|
-
* expected type.
|
|
716
|
-
*
|
|
717
|
-
* Also, after decoding, `typia.http.validateHeaders()` performs type assertion to the
|
|
718
|
-
* decoded value by combining with {@link validate} function. Therefore, when the
|
|
719
|
-
* decoded value is not following the `T` type, {@link IValidation.IError} would be
|
|
720
|
-
* returned. Otherwise, {@link IValidation.ISuccess} be returned.
|
|
721
|
-
*
|
|
722
|
-
* By the way, as HTTP headers are not enough to express complex data structures,
|
|
723
|
-
* `typia.http.headers()` function has some limitations. If target type `T` is not
|
|
724
|
-
* following those restrictions, compilation errors would be occured.
|
|
725
|
-
*
|
|
726
|
-
* 1. Type `T` must be an object type
|
|
727
|
-
* 2. Do not allow dynamic property
|
|
728
|
-
* 3. Property key must be lower case
|
|
729
|
-
* 4. Property value cannot be `null`, but `undefined` is possible
|
|
730
|
-
* 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
|
|
731
|
-
* 6. By the way, union type never be not allowed
|
|
732
|
-
* 7. Property `set-cookie` must be array type
|
|
733
|
-
* 8. Those properties cannot be array type
|
|
734
|
-
* - age
|
|
735
|
-
* - authorization
|
|
736
|
-
* - content-length
|
|
737
|
-
* - content-type
|
|
738
|
-
* - etag
|
|
739
|
-
* - expires
|
|
740
|
-
* - from
|
|
741
|
-
* - host
|
|
742
|
-
* - if-modified-since
|
|
743
|
-
* - if-unmodified-since
|
|
744
|
-
* - last-modified
|
|
745
|
-
* - location
|
|
746
|
-
* - max-forwards
|
|
747
|
-
* - proxy-authorization
|
|
748
|
-
* - referer
|
|
749
|
-
* - retry-after
|
|
750
|
-
* - server
|
|
751
|
-
* - user-agent
|
|
752
|
-
*
|
|
753
|
-
* @template T Expected type of decoded value
|
|
754
|
-
* @param input Query string or URLSearchParams instance
|
|
755
|
-
* @returns Decoded headers object
|
|
756
|
-
*
|
|
757
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
758
|
-
*/
|
|
759
|
-
export function validateHeaders<T extends object>(
|
|
664
|
+
function validateHeaders<T extends object>(
|
|
760
665
|
input: Record<string, string | string[] | undefined>,
|
|
761
666
|
): IValidation<Resolved<T>>;
|
|
762
667
|
|
|
763
668
|
/**
|
|
764
669
|
* @internal
|
|
765
670
|
*/
|
|
766
|
-
|
|
671
|
+
function validateHeaders(): never {
|
|
767
672
|
halt("validateHeaders");
|
|
768
673
|
}
|
|
769
674
|
|
|
675
|
+
const validateHeadersPure = /** @__PURE__ */ Object.assign<
|
|
676
|
+
typeof validateHeaders,
|
|
677
|
+
{},
|
|
678
|
+
{}
|
|
679
|
+
>(
|
|
680
|
+
validateHeaders,
|
|
681
|
+
/** @__PURE__ */ Namespace.http.headers(),
|
|
682
|
+
/** @__PURE__ */ Namespace.validate(),
|
|
683
|
+
);
|
|
684
|
+
export { validateHeadersPure as validateHeaders };
|
|
685
|
+
|
|
770
686
|
/* -----------------------------------------------------------
|
|
771
687
|
PARAMETER
|
|
772
688
|
----------------------------------------------------------- */
|
|
773
689
|
/**
|
|
774
|
-
* > You must configure the generic argument `T`.
|
|
775
|
-
*
|
|
776
690
|
* URL path parameter decoder.
|
|
777
691
|
*
|
|
778
692
|
* `typia.http.parameter()` is a function decoding a path parameter, with automatic
|
|
@@ -787,37 +701,186 @@ export function validateHeaders(): never {
|
|
|
787
701
|
* @param input Path parameter string
|
|
788
702
|
* @returns Decoded path parameter value
|
|
789
703
|
*/
|
|
790
|
-
|
|
704
|
+
function parameter<T extends Atomic.Type | null>(input: string): Resolved<T>;
|
|
791
705
|
|
|
792
706
|
/**
|
|
793
|
-
*
|
|
707
|
+
* @internal
|
|
708
|
+
*/
|
|
709
|
+
function parameter(): never {
|
|
710
|
+
halt("parameter");
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
const parameterPure = /** @__PURE__ */ Object.assign<typeof parameter, {}, {}>(
|
|
714
|
+
parameter,
|
|
715
|
+
/** @__PURE__ */ Namespace.http.parameter(),
|
|
716
|
+
/** @__PURE__ */ Namespace.assert("http.parameter"),
|
|
717
|
+
);
|
|
718
|
+
export { parameterPure as parameter };
|
|
719
|
+
|
|
720
|
+
/* -----------------------------------------------------------
|
|
721
|
+
FACTORY FUNCTIONS
|
|
722
|
+
----------------------------------------------------------- */
|
|
723
|
+
/**
|
|
724
|
+
* Creates a reusable {@link formdata} function.
|
|
794
725
|
*
|
|
795
|
-
*
|
|
796
|
-
*
|
|
797
|
-
*
|
|
726
|
+
* @danger You must configure the generic argument `T`
|
|
727
|
+
* @template T The type of the formdata object
|
|
728
|
+
* @throws compile error
|
|
798
729
|
*
|
|
799
|
-
*
|
|
800
|
-
|
|
801
|
-
|
|
730
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
731
|
+
*/
|
|
732
|
+
function createFormData(): never;
|
|
733
|
+
|
|
734
|
+
/**
|
|
735
|
+
* Creates a reusable {@link formdata} function.
|
|
802
736
|
*
|
|
803
|
-
* @template T
|
|
804
|
-
* @
|
|
805
|
-
*
|
|
737
|
+
* @template T The type of the formdata object
|
|
738
|
+
* @returns A reusable `formdata` function
|
|
739
|
+
*
|
|
740
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
806
741
|
*/
|
|
807
|
-
|
|
808
|
-
input: string,
|
|
809
|
-
): Resolved<T>;
|
|
742
|
+
function createFormData<T extends object>(): (input: FormData) => T;
|
|
810
743
|
|
|
811
744
|
/**
|
|
812
745
|
* @internal
|
|
813
746
|
*/
|
|
814
|
-
|
|
815
|
-
halt("
|
|
747
|
+
function createFormData<T>(): (input: FormData) => T {
|
|
748
|
+
halt("createFormData");
|
|
816
749
|
}
|
|
817
750
|
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
751
|
+
const createFormDataPure = /** @__PURE__ */ Object.assign<
|
|
752
|
+
typeof createFormData,
|
|
753
|
+
{}
|
|
754
|
+
>(createFormData, /** @__PURE__ */ Namespace.http.formData());
|
|
755
|
+
export { createFormDataPure as createFormData };
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* Creates a reusable {@link assertFormData} function.
|
|
759
|
+
*
|
|
760
|
+
* @danger You must configure the generic argument `T`
|
|
761
|
+
* @template T The type of the formdata object
|
|
762
|
+
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
763
|
+
* @throws compile error
|
|
764
|
+
*
|
|
765
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
766
|
+
*/
|
|
767
|
+
function createAssertFormData(
|
|
768
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
769
|
+
): never;
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* Creates a reusable {@link assertFormData} function.
|
|
773
|
+
*
|
|
774
|
+
* @template T The type of the formdata object
|
|
775
|
+
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
776
|
+
* @returns A reusable `assertFormData` function
|
|
777
|
+
*
|
|
778
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
779
|
+
*/
|
|
780
|
+
function createAssertFormData<T extends object>(
|
|
781
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
782
|
+
): (input: FormData) => T;
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* @internal
|
|
786
|
+
*/
|
|
787
|
+
function createAssertFormData<T>(): (input: FormData) => T {
|
|
788
|
+
halt("createAssertFormData");
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
const createAssertFormDataPure = /** @__PURE__ */ Object.assign<
|
|
792
|
+
typeof createAssertFormData,
|
|
793
|
+
{},
|
|
794
|
+
{}
|
|
795
|
+
>(
|
|
796
|
+
createAssertFormData,
|
|
797
|
+
/** @__PURE__ */ Namespace.http.formData(),
|
|
798
|
+
/** @__PURE__ */ Namespace.assert("http.createAssertFormData"),
|
|
799
|
+
);
|
|
800
|
+
export { createAssertFormDataPure as createAssertFormData };
|
|
801
|
+
|
|
802
|
+
/**
|
|
803
|
+
* Creates a reusable {@link isFormData} function.
|
|
804
|
+
*
|
|
805
|
+
* @danger You must configure the generic argument `T`
|
|
806
|
+
* @template T The type of the formdata object
|
|
807
|
+
* @throws compile error
|
|
808
|
+
*
|
|
809
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
810
|
+
*/
|
|
811
|
+
function createIsFormData(): never;
|
|
812
|
+
|
|
813
|
+
/**
|
|
814
|
+
* Creates a reusable {@link isFormData} function.
|
|
815
|
+
*
|
|
816
|
+
* @template T The type of the formdata object
|
|
817
|
+
* @returns A reusable `isFormData` function
|
|
818
|
+
*
|
|
819
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
820
|
+
*/
|
|
821
|
+
function createIsFormData<T extends object>(): (input: FormData) => T | null;
|
|
822
|
+
|
|
823
|
+
/**
|
|
824
|
+
* @internal
|
|
825
|
+
*/
|
|
826
|
+
function createIsFormData<T>(): (input: FormData) => T | null {
|
|
827
|
+
halt("createIsFormData");
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
const createIsFormDataPure = /** @__PURE__ */ Object.assign<
|
|
831
|
+
typeof createIsFormData,
|
|
832
|
+
{},
|
|
833
|
+
{}
|
|
834
|
+
>(
|
|
835
|
+
createIsFormData,
|
|
836
|
+
/** @__PURE__ */ Namespace.http.formData(),
|
|
837
|
+
/** @__PURE__ */ Namespace.is(),
|
|
838
|
+
);
|
|
839
|
+
export { createIsFormDataPure as createIsFormData };
|
|
840
|
+
|
|
841
|
+
/**
|
|
842
|
+
* Creates a reusable {@link validateFormData} function.
|
|
843
|
+
*
|
|
844
|
+
* @danger You must configure the generic argument `T`
|
|
845
|
+
* @template T The type of the formdata object
|
|
846
|
+
* @throws compile error
|
|
847
|
+
*
|
|
848
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
849
|
+
*/
|
|
850
|
+
function createValidateFormData(): never;
|
|
851
|
+
|
|
852
|
+
/**
|
|
853
|
+
* Creates a reusable {@link validateFormData} function.
|
|
854
|
+
*
|
|
855
|
+
* @template T The type of the formdata object
|
|
856
|
+
* @returns A reusable `validateFormData` function
|
|
857
|
+
*
|
|
858
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
859
|
+
*/
|
|
860
|
+
function createValidateFormData<T extends object>(): (
|
|
861
|
+
input: FormData,
|
|
862
|
+
) => IValidation<Resolved<T>>;
|
|
863
|
+
|
|
864
|
+
/**
|
|
865
|
+
* @internal
|
|
866
|
+
*/
|
|
867
|
+
function createValidateFormData<T>(): (
|
|
868
|
+
input: FormData,
|
|
869
|
+
) => IValidation<Resolved<T>> {
|
|
870
|
+
halt("createValidateFormData");
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
const createValidateFormDataPure = /** @__PURE__ */ Object.assign<
|
|
874
|
+
typeof createValidateFormData,
|
|
875
|
+
{},
|
|
876
|
+
{}
|
|
877
|
+
>(
|
|
878
|
+
createValidateFormData,
|
|
879
|
+
/** @__PURE__ */ Namespace.http.formData(),
|
|
880
|
+
/** @__PURE__ */ Namespace.validate(),
|
|
881
|
+
);
|
|
882
|
+
export { createValidateFormDataPure as createValidateFormData };
|
|
883
|
+
|
|
821
884
|
/**
|
|
822
885
|
* Creates a reusable {@link query} function.
|
|
823
886
|
*
|
|
@@ -827,7 +890,7 @@ export function parameter(): never {
|
|
|
827
890
|
*
|
|
828
891
|
* @author Jeongho Nam - https://github.com/samchon
|
|
829
892
|
*/
|
|
830
|
-
|
|
893
|
+
function createQuery(): never;
|
|
831
894
|
|
|
832
895
|
/**
|
|
833
896
|
* Creates a reusable {@link query} function.
|
|
@@ -837,47 +900,68 @@ export function createQuery(): never;
|
|
|
837
900
|
*
|
|
838
901
|
* @author Jeongho Nam - https://github.com/samchon
|
|
839
902
|
*/
|
|
840
|
-
|
|
903
|
+
function createQuery<T extends object>(): (
|
|
841
904
|
input: string | URLSearchParams,
|
|
842
905
|
) => T;
|
|
843
906
|
|
|
844
907
|
/**
|
|
845
908
|
* @internal
|
|
846
909
|
*/
|
|
847
|
-
|
|
910
|
+
function createQuery<T>(): (input: string | URLSearchParams) => T {
|
|
848
911
|
halt("createQuery");
|
|
849
912
|
}
|
|
850
913
|
|
|
914
|
+
const createQueryPure = /** @__PURE__ */ Object.assign<typeof createQuery, {}>(
|
|
915
|
+
createQuery,
|
|
916
|
+
/** @__PURE__ */ Namespace.http.query(),
|
|
917
|
+
);
|
|
918
|
+
export { createQueryPure as createQuery };
|
|
919
|
+
|
|
851
920
|
/**
|
|
852
921
|
* Creates a reusable {@link assertQuery} function.
|
|
853
922
|
*
|
|
854
923
|
* @danger You must configure the generic argument `T`
|
|
855
924
|
* @template T The type of the query object
|
|
925
|
+
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
856
926
|
* @throws compile error
|
|
857
927
|
*
|
|
858
928
|
* @author Jeongho Nam - https://github.com/samchon
|
|
859
929
|
*/
|
|
860
|
-
|
|
930
|
+
function createAssertQuery(
|
|
931
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
932
|
+
): never;
|
|
861
933
|
|
|
862
934
|
/**
|
|
863
935
|
* Creates a reusable {@link assertQuery} function.
|
|
864
936
|
*
|
|
865
937
|
* @template T The type of the query object
|
|
938
|
+
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
866
939
|
* @returns A reusable `assertQuery` function
|
|
867
940
|
*
|
|
868
941
|
* @author Jeongho Nam - https://github.com/samchon
|
|
869
942
|
*/
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
) => T;
|
|
943
|
+
function createAssertQuery<T extends object>(
|
|
944
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
945
|
+
): (input: string | URLSearchParams) => T;
|
|
873
946
|
|
|
874
947
|
/**
|
|
875
948
|
* @internal
|
|
876
949
|
*/
|
|
877
|
-
|
|
950
|
+
function createAssertQuery<T>(): (input: string | URLSearchParams) => T {
|
|
878
951
|
halt("createAssertQuery");
|
|
879
952
|
}
|
|
880
953
|
|
|
954
|
+
const createAssertQueryPure = /** @__PURE__ */ Object.assign<
|
|
955
|
+
typeof createAssertQuery,
|
|
956
|
+
{},
|
|
957
|
+
{}
|
|
958
|
+
>(
|
|
959
|
+
createAssertQuery,
|
|
960
|
+
/** @__PURE__ */ Namespace.http.query(),
|
|
961
|
+
/** @__PURE__ */ Namespace.assert("http.createAssertQuery"),
|
|
962
|
+
);
|
|
963
|
+
export { createAssertQueryPure as createAssertQuery };
|
|
964
|
+
|
|
881
965
|
/**
|
|
882
966
|
* Creates a reusable {@link isQuery} function.
|
|
883
967
|
*
|
|
@@ -887,7 +971,7 @@ export function createAssertQuery<T>(): (input: string | URLSearchParams) => T {
|
|
|
887
971
|
*
|
|
888
972
|
* @author Jeongho Nam - https://github.com/samchon
|
|
889
973
|
*/
|
|
890
|
-
|
|
974
|
+
function createIsQuery(): never;
|
|
891
975
|
|
|
892
976
|
/**
|
|
893
977
|
* Creates a reusable {@link isQuery} function.
|
|
@@ -897,19 +981,28 @@ export function createIsQuery(): never;
|
|
|
897
981
|
*
|
|
898
982
|
* @author Jeongho Nam - https://github.com/samchon
|
|
899
983
|
*/
|
|
900
|
-
|
|
984
|
+
function createIsQuery<T extends object>(): (
|
|
901
985
|
input: string | URLSearchParams,
|
|
902
986
|
) => T | null;
|
|
903
987
|
|
|
904
988
|
/**
|
|
905
989
|
* @internal
|
|
906
990
|
*/
|
|
907
|
-
|
|
908
|
-
input: string | URLSearchParams,
|
|
909
|
-
) => T | null {
|
|
991
|
+
function createIsQuery<T>(): (input: string | URLSearchParams) => T | null {
|
|
910
992
|
halt("createIsQuery");
|
|
911
993
|
}
|
|
912
994
|
|
|
995
|
+
const createIsQueryPure = /** @__PURE__ */ Object.assign<
|
|
996
|
+
typeof createIsQuery,
|
|
997
|
+
{},
|
|
998
|
+
{}
|
|
999
|
+
>(
|
|
1000
|
+
createIsQuery,
|
|
1001
|
+
/** @__PURE__ */ Namespace.http.query(),
|
|
1002
|
+
/** @__PURE__ */ Namespace.is(),
|
|
1003
|
+
);
|
|
1004
|
+
export { createIsQueryPure as createIsQuery };
|
|
1005
|
+
|
|
913
1006
|
/**
|
|
914
1007
|
* Creates a reusable {@link validateQuery} function.
|
|
915
1008
|
*
|
|
@@ -919,7 +1012,7 @@ export function createIsQuery<T>(): (
|
|
|
919
1012
|
*
|
|
920
1013
|
* @author Jeongho Nam - https://github.com/samchon
|
|
921
1014
|
*/
|
|
922
|
-
|
|
1015
|
+
function createValidateQuery(): never;
|
|
923
1016
|
|
|
924
1017
|
/**
|
|
925
1018
|
* Creates a reusable {@link validateQuery} function.
|
|
@@ -929,19 +1022,30 @@ export function createValidateQuery(): never;
|
|
|
929
1022
|
*
|
|
930
1023
|
* @author Jeongho Nam - https://github.com/samchon
|
|
931
1024
|
*/
|
|
932
|
-
|
|
1025
|
+
function createValidateQuery<T extends object>(): (
|
|
933
1026
|
input: string | URLSearchParams,
|
|
934
1027
|
) => IValidation<Resolved<T>>;
|
|
935
1028
|
|
|
936
1029
|
/**
|
|
937
1030
|
* @internal
|
|
938
1031
|
*/
|
|
939
|
-
|
|
1032
|
+
function createValidateQuery<T>(): (
|
|
940
1033
|
input: string | URLSearchParams,
|
|
941
1034
|
) => IValidation<Resolved<T>> {
|
|
942
1035
|
halt("createValidateQuery");
|
|
943
1036
|
}
|
|
944
1037
|
|
|
1038
|
+
const createValidateQueryPure = /** @__PURE__ */ Object.assign<
|
|
1039
|
+
typeof createValidateQuery,
|
|
1040
|
+
{},
|
|
1041
|
+
{}
|
|
1042
|
+
>(
|
|
1043
|
+
createValidateQuery,
|
|
1044
|
+
/** @__PURE__ */ Namespace.http.query(),
|
|
1045
|
+
/** @__PURE__ */ Namespace.validate(),
|
|
1046
|
+
);
|
|
1047
|
+
export { createValidateQueryPure as createValidateQuery };
|
|
1048
|
+
|
|
945
1049
|
/**
|
|
946
1050
|
* Creates a reusable {@link headers} function.
|
|
947
1051
|
*
|
|
@@ -951,7 +1055,7 @@ export function createValidateQuery<T>(): (
|
|
|
951
1055
|
*
|
|
952
1056
|
* @author Jeongho Nam - https://github.com/samchon
|
|
953
1057
|
*/
|
|
954
|
-
|
|
1058
|
+
function createHeaders(): never;
|
|
955
1059
|
|
|
956
1060
|
/**
|
|
957
1061
|
* Creates a reusable {@link headers} function.
|
|
@@ -961,51 +1065,72 @@ export function createHeaders(): never;
|
|
|
961
1065
|
*
|
|
962
1066
|
* @author Jeongho Nam - https://github.com/samchon
|
|
963
1067
|
*/
|
|
964
|
-
|
|
1068
|
+
function createHeaders<T extends object>(): (
|
|
965
1069
|
input: Record<string, string | string[] | undefined>,
|
|
966
1070
|
) => T;
|
|
967
1071
|
|
|
968
1072
|
/**
|
|
969
1073
|
* @internal
|
|
970
1074
|
*/
|
|
971
|
-
|
|
1075
|
+
function createHeaders<T>(): (
|
|
972
1076
|
input: Record<string, string | string[] | undefined>,
|
|
973
1077
|
) => T {
|
|
974
1078
|
halt("createHeaders");
|
|
975
1079
|
}
|
|
976
1080
|
|
|
1081
|
+
const createHeadersPure = /** @__PURE__ */ Object.assign<
|
|
1082
|
+
typeof createHeaders,
|
|
1083
|
+
{}
|
|
1084
|
+
>(createHeaders, /** @__PURE__ */ Namespace.http.headers());
|
|
1085
|
+
export { createHeadersPure as createHeaders };
|
|
1086
|
+
|
|
977
1087
|
/**
|
|
978
1088
|
* Creates a reusable {@link assertHeaders} function.
|
|
979
1089
|
*
|
|
980
1090
|
* @danger You must configure the generic argument `T`
|
|
981
1091
|
* @template T The type of the headers object
|
|
1092
|
+
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
982
1093
|
* @throws compile error
|
|
983
1094
|
*
|
|
984
1095
|
* @author Jeongho Nam - https://github.com/samchon
|
|
985
1096
|
*/
|
|
986
|
-
|
|
1097
|
+
function createAssertHeaders(
|
|
1098
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
1099
|
+
): never;
|
|
987
1100
|
|
|
988
1101
|
/**
|
|
989
1102
|
* Creates a reusable {@link assertHeaders} function.
|
|
990
1103
|
*
|
|
991
1104
|
* @template T The type of the headers object
|
|
1105
|
+
* @param errorFactory Custom error factory. Default is `TypeGuardError`
|
|
992
1106
|
* @returns A reusable `assertHeaders` function
|
|
993
1107
|
*
|
|
994
1108
|
* @author Jeongho Nam - https://github.com/samchon
|
|
995
1109
|
*/
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
) => T;
|
|
1110
|
+
function createAssertHeaders<T extends object>(
|
|
1111
|
+
errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
|
|
1112
|
+
): (input: Record<string, string | string[] | undefined>) => T;
|
|
999
1113
|
|
|
1000
1114
|
/**
|
|
1001
1115
|
* @internal
|
|
1002
1116
|
*/
|
|
1003
|
-
|
|
1117
|
+
function createAssertHeaders<T>(): (
|
|
1004
1118
|
input: Record<string, string | string[] | undefined>,
|
|
1005
1119
|
) => T {
|
|
1006
1120
|
halt("createAssertHeaders");
|
|
1007
1121
|
}
|
|
1008
1122
|
|
|
1123
|
+
const createAssertHeadersPure = /** @__PURE__ */ Object.assign<
|
|
1124
|
+
typeof createAssertHeaders,
|
|
1125
|
+
{},
|
|
1126
|
+
{}
|
|
1127
|
+
>(
|
|
1128
|
+
createAssertHeaders,
|
|
1129
|
+
/** @__PURE__ */ Namespace.http.headers(),
|
|
1130
|
+
/** @__PURE__ */ Namespace.assert("http.createAssertHeaders"),
|
|
1131
|
+
);
|
|
1132
|
+
export { createAssertHeadersPure as createAssertHeaders };
|
|
1133
|
+
|
|
1009
1134
|
/**
|
|
1010
1135
|
* Creates a reusable {@link isHeaders} function.
|
|
1011
1136
|
*
|
|
@@ -1015,7 +1140,7 @@ export function createAssertHeaders<T>(): (
|
|
|
1015
1140
|
*
|
|
1016
1141
|
* @author Jeongho Nam - https://github.com/samchon
|
|
1017
1142
|
*/
|
|
1018
|
-
|
|
1143
|
+
function createIsHeaders(): never;
|
|
1019
1144
|
|
|
1020
1145
|
/**
|
|
1021
1146
|
* Creates a reusable {@link isHeaders} function.
|
|
@@ -1025,19 +1150,30 @@ export function createIsHeaders(): never;
|
|
|
1025
1150
|
*
|
|
1026
1151
|
* @author Jeongho Nam - https://github.com/samchon
|
|
1027
1152
|
*/
|
|
1028
|
-
|
|
1153
|
+
function createIsHeaders<T extends object>(): (
|
|
1029
1154
|
input: Record<string, string | string[] | undefined>,
|
|
1030
1155
|
) => T | null;
|
|
1031
1156
|
|
|
1032
1157
|
/**
|
|
1033
1158
|
* @internal
|
|
1034
1159
|
*/
|
|
1035
|
-
|
|
1160
|
+
function createIsHeaders<T>(): (
|
|
1036
1161
|
input: Record<string, string | string[] | undefined>,
|
|
1037
1162
|
) => T | null {
|
|
1038
1163
|
halt("createIsHeaders");
|
|
1039
1164
|
}
|
|
1040
1165
|
|
|
1166
|
+
const createIsHeadersPure = /** @__PURE__ */ Object.assign<
|
|
1167
|
+
typeof createIsHeaders,
|
|
1168
|
+
{},
|
|
1169
|
+
{}
|
|
1170
|
+
>(
|
|
1171
|
+
createIsHeaders,
|
|
1172
|
+
/** @__PURE__ */ Namespace.http.headers(),
|
|
1173
|
+
/** @__PURE__ */ Namespace.is(),
|
|
1174
|
+
);
|
|
1175
|
+
export { createIsHeadersPure as createIsHeaders };
|
|
1176
|
+
|
|
1041
1177
|
/**
|
|
1042
1178
|
* Creates a reusable {@link validateHeaders} function.
|
|
1043
1179
|
*
|
|
@@ -1047,7 +1183,7 @@ export function createIsHeaders<T>(): (
|
|
|
1047
1183
|
*
|
|
1048
1184
|
* @author Jeongho Nam - https://github.com/samchon
|
|
1049
1185
|
*/
|
|
1050
|
-
|
|
1186
|
+
function createValidateHeaders(): never;
|
|
1051
1187
|
|
|
1052
1188
|
/**
|
|
1053
1189
|
* Creates a reusable {@link validateHeaders} function.
|
|
@@ -1057,19 +1193,30 @@ export function createValidateHeaders(): never;
|
|
|
1057
1193
|
*
|
|
1058
1194
|
* @author Jeongho Nam - https://github.com/samchon
|
|
1059
1195
|
*/
|
|
1060
|
-
|
|
1196
|
+
function createValidateHeaders<T extends object>(): (
|
|
1061
1197
|
input: Record<string, string | string[] | undefined>,
|
|
1062
1198
|
) => IValidation<Resolved<T>>;
|
|
1063
1199
|
|
|
1064
1200
|
/**
|
|
1065
1201
|
* @internal
|
|
1066
1202
|
*/
|
|
1067
|
-
|
|
1203
|
+
function createValidateHeaders<T>(): (
|
|
1068
1204
|
input: Record<string, string | string[] | undefined>,
|
|
1069
1205
|
) => IValidation<Resolved<T>> {
|
|
1070
1206
|
halt("createValidateHeaders");
|
|
1071
1207
|
}
|
|
1072
1208
|
|
|
1209
|
+
const createValidateHeadersPure = /** @__PURE__ */ Object.assign<
|
|
1210
|
+
typeof createValidateHeaders,
|
|
1211
|
+
{},
|
|
1212
|
+
{}
|
|
1213
|
+
>(
|
|
1214
|
+
createValidateHeaders,
|
|
1215
|
+
/** @__PURE__ */ Namespace.http.headers(),
|
|
1216
|
+
/** @__PURE__ */ Namespace.validate(),
|
|
1217
|
+
);
|
|
1218
|
+
export { createValidateHeadersPure as createValidateHeaders };
|
|
1219
|
+
|
|
1073
1220
|
/**
|
|
1074
1221
|
* Creates a reusable {@link parameter} function.
|
|
1075
1222
|
*
|
|
@@ -1079,7 +1226,7 @@ export function createValidateHeaders<T>(): (
|
|
|
1079
1226
|
*
|
|
1080
1227
|
* @author Jeongho Nam - https://github.com/samchon
|
|
1081
1228
|
*/
|
|
1082
|
-
|
|
1229
|
+
function createParameter(): never;
|
|
1083
1230
|
|
|
1084
1231
|
/**
|
|
1085
1232
|
* Creates a reusable {@link parameter} function.
|
|
@@ -1089,19 +1236,26 @@ export function createParameter(): never;
|
|
|
1089
1236
|
*
|
|
1090
1237
|
* @author Jeongho Nam - https://github.com/samchon
|
|
1091
1238
|
*/
|
|
1092
|
-
|
|
1093
|
-
input: string,
|
|
1094
|
-
) => T;
|
|
1239
|
+
function createParameter<T extends Atomic.Type | null>(): (input: string) => T;
|
|
1095
1240
|
|
|
1096
1241
|
/**
|
|
1097
1242
|
* @internal
|
|
1098
1243
|
*/
|
|
1099
|
-
|
|
1100
|
-
input: string,
|
|
1101
|
-
) => T {
|
|
1244
|
+
function createParameter<T extends Atomic.Type | null>(): (input: string) => T {
|
|
1102
1245
|
halt("createParameter");
|
|
1103
1246
|
}
|
|
1104
1247
|
|
|
1248
|
+
const createParameterPure = /** @__PURE__ */ Object.assign<
|
|
1249
|
+
typeof createParameter,
|
|
1250
|
+
{},
|
|
1251
|
+
{}
|
|
1252
|
+
>(
|
|
1253
|
+
createParameter,
|
|
1254
|
+
/** @__PURE__ */ Namespace.http.parameter(),
|
|
1255
|
+
/** @__PURE__ */ Namespace.assert("http.createParameter"),
|
|
1256
|
+
);
|
|
1257
|
+
export { createParameterPure as createParameter };
|
|
1258
|
+
|
|
1105
1259
|
/**
|
|
1106
1260
|
* @internal
|
|
1107
1261
|
*/
|