typia 3.3.12 → 3.4.0-dev.20221212
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 +169 -403
- package/lib/IValidation.d.ts +10 -4
- package/lib/Primitive.d.ts +45 -0
- package/lib/Primitive.js +3 -0
- package/lib/Primitive.js.map +1 -0
- package/lib/executable/internal/TypiaSetupWizard.d.ts +4 -0
- package/lib/executable/internal/TypiaSetupWizard.js +200 -0
- package/lib/executable/internal/TypiaSetupWizard.js.map +1 -0
- package/lib/executable/typia.d.ts +1 -0
- package/lib/executable/typia.js +98 -0
- package/lib/executable/typia.js.map +1 -0
- package/lib/factories/CommentFactory.js +1 -1
- package/lib/factories/CommentFactory.js.map +1 -1
- package/lib/factories/ExpressionFactory.d.ts +1 -0
- package/lib/factories/ExpressionFactory.js +4 -0
- package/lib/factories/ExpressionFactory.js.map +1 -1
- package/lib/factories/IdentifierFactory.d.ts +1 -1
- package/lib/factories/IdentifierFactory.js +4 -2
- package/lib/factories/IdentifierFactory.js.map +1 -1
- package/lib/factories/MetadataCollection.d.ts +2 -1
- package/lib/factories/MetadataCollection.js +24 -5
- package/lib/factories/MetadataCollection.js.map +1 -1
- package/lib/factories/MetadataTagFactory.js +1 -1
- package/lib/factories/MetadataTagFactory.js.map +1 -1
- package/lib/factories/StatementFactory.d.ts +1 -3
- package/lib/factories/StatementFactory.js +3 -13
- package/lib/factories/StatementFactory.js.map +1 -1
- package/lib/factories/TemplateFactory.js +4 -0
- package/lib/factories/TemplateFactory.js.map +1 -1
- package/lib/factories/TypeFactory.d.ts +2 -1
- package/lib/factories/TypeFactory.js +14 -7
- package/lib/factories/TypeFactory.js.map +1 -1
- package/lib/factories/internal/explore_metadata.js +1 -1
- package/lib/factories/internal/explore_metadata.js.map +1 -1
- package/lib/factories/internal/iterate_metadata.js +12 -3
- package/lib/factories/internal/iterate_metadata.js.map +1 -1
- package/lib/factories/internal/iterate_metadata_array.js +2 -3
- package/lib/factories/internal/iterate_metadata_array.js.map +1 -1
- package/lib/factories/internal/iterate_metadata_atomic.js +30 -55
- package/lib/factories/internal/iterate_metadata_atomic.js.map +1 -1
- package/lib/factories/internal/iterate_metadata_coalesce.js +2 -3
- package/lib/factories/internal/iterate_metadata_coalesce.js.map +1 -1
- package/lib/factories/internal/iterate_metadata_map.d.ts +5 -0
- package/lib/factories/internal/iterate_metadata_map.js +30 -0
- package/lib/factories/internal/iterate_metadata_map.js.map +1 -0
- package/lib/factories/internal/iterate_metadata_native.d.ts +3 -0
- package/lib/factories/internal/iterate_metadata_native.js +230 -0
- package/lib/factories/internal/iterate_metadata_native.js.map +1 -0
- package/lib/factories/internal/iterate_metadata_set.d.ts +5 -0
- package/lib/factories/internal/iterate_metadata_set.js +26 -0
- package/lib/factories/internal/iterate_metadata_set.js.map +1 -0
- package/lib/factories/internal/iterate_metadata_tuple.d.ts +1 -1
- package/lib/factories/internal/iterate_metadata_tuple.js +25 -3
- package/lib/factories/internal/iterate_metadata_tuple.js.map +1 -1
- 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.d.ts +1 -0
- package/lib/functional/$guard.js +18 -0
- package/lib/functional/$guard.js.map +1 -0
- package/lib/functional/$number.js +4 -4
- package/lib/functional/$number.js.map +1 -1
- package/lib/functional/$report.d.ts +2 -0
- package/lib/functional/$report.js +18 -0
- package/lib/functional/$report.js.map +1 -0
- package/lib/functional/$rest.d.ts +1 -0
- package/lib/functional/$rest.js +8 -0
- package/lib/functional/$rest.js.map +1 -0
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/metadata/IMetadata.d.ts +5 -0
- package/lib/metadata/IMetadataApplication.d.ts +6 -0
- package/lib/metadata/IMetadataApplication.js +3 -0
- package/lib/metadata/IMetadataApplication.js.map +1 -0
- package/lib/metadata/IMetadataConstant.d.ts +1 -1
- package/lib/metadata/IMetadataEntry.d.ts +5 -0
- package/lib/metadata/IMetadataEntry.js +3 -0
- package/lib/metadata/IMetadataEntry.js.map +1 -0
- package/lib/metadata/IMetadataTag.d.ts +1 -1
- package/lib/metadata/Metadata.d.ts +10 -0
- package/lib/metadata/Metadata.js +156 -59
- package/lib/metadata/Metadata.js.map +1 -1
- package/lib/metadata/MetadataObject.d.ts +0 -1
- package/lib/metadata/MetadataObject.js +10 -0
- package/lib/metadata/MetadataObject.js.map +1 -1
- package/lib/module.d.ts +603 -72
- package/lib/module.js +185 -23
- package/lib/module.js.map +1 -1
- package/lib/programmers/ApplicationProgrammer.js +2 -2
- package/lib/programmers/ApplicationProgrammer.js.map +1 -1
- package/lib/programmers/AssertParseProgrammer.d.ts +5 -0
- package/lib/programmers/AssertParseProgrammer.js +23 -0
- package/lib/programmers/AssertParseProgrammer.js.map +1 -0
- package/lib/programmers/AssertProgrammer.d.ts +1 -1
- package/lib/programmers/AssertProgrammer.js +133 -58
- package/lib/programmers/AssertProgrammer.js.map +1 -1
- package/lib/programmers/AssertStringifyProgrammer.d.ts +5 -0
- package/lib/programmers/AssertStringifyProgrammer.js +26 -0
- package/lib/programmers/AssertStringifyProgrammer.js.map +1 -0
- package/lib/programmers/CheckerProgrammer.d.ts +17 -7
- package/lib/programmers/CheckerProgrammer.js +284 -79
- package/lib/programmers/CheckerProgrammer.js.map +1 -1
- package/lib/programmers/FeatureProgrammer.d.ts +14 -9
- package/lib/programmers/FeatureProgrammer.js +76 -116
- package/lib/programmers/FeatureProgrammer.js.map +1 -1
- package/lib/programmers/IsParseProgrammer.d.ts +5 -0
- package/lib/programmers/IsParseProgrammer.js +23 -0
- package/lib/programmers/IsParseProgrammer.js.map +1 -0
- package/lib/programmers/IsProgrammer.d.ts +5 -4
- package/lib/programmers/IsProgrammer.js +69 -44
- package/lib/programmers/IsProgrammer.js.map +1 -1
- package/lib/programmers/IsStringifyProgrammer.d.ts +5 -0
- package/lib/programmers/IsStringifyProgrammer.js +24 -0
- package/lib/programmers/IsStringifyProgrammer.js.map +1 -0
- package/lib/programmers/StringifyProgrammer.js +118 -47
- package/lib/programmers/StringifyProgrammer.js.map +1 -1
- package/lib/programmers/ValidateParseProgrammer.d.ts +5 -0
- package/lib/programmers/ValidateParseProgrammer.js +24 -0
- package/lib/programmers/ValidateParseProgrammer.js.map +1 -0
- package/lib/programmers/ValidateProgrammer.d.ts +1 -1
- package/lib/programmers/ValidateProgrammer.js +124 -68
- package/lib/programmers/ValidateProgrammer.js.map +1 -1
- package/lib/programmers/ValidateStringifyProgrammer.d.ts +5 -0
- package/lib/programmers/ValidateStringifyProgrammer.js +26 -0
- package/lib/programmers/ValidateStringifyProgrammer.js.map +1 -0
- package/lib/programmers/helpers/AtomicPredicator.d.ts +6 -0
- package/lib/programmers/helpers/AtomicPredicator.js +16 -0
- package/lib/programmers/helpers/AtomicPredicator.js.map +1 -0
- package/lib/programmers/helpers/FunctionImporeter.js +1 -1
- package/lib/programmers/helpers/FunctionImporeter.js.map +1 -1
- package/lib/programmers/helpers/OptionPredicator.d.ts +1 -1
- package/lib/programmers/helpers/OptionPredicator.js +7 -7
- package/lib/programmers/helpers/OptionPredicator.js.map +1 -1
- package/lib/programmers/helpers/StringifyJoinder.d.ts +2 -2
- package/lib/programmers/helpers/StringifyJoinder.js +5 -2
- package/lib/programmers/helpers/StringifyJoinder.js.map +1 -1
- package/lib/programmers/helpers/UnionExplorer.d.ts +33 -4
- package/lib/programmers/helpers/UnionExplorer.js +85 -47
- package/lib/programmers/helpers/UnionExplorer.js.map +1 -1
- package/lib/programmers/internal/application_array.js +1 -1
- package/lib/programmers/internal/application_array.js.map +1 -1
- package/lib/programmers/internal/application_default.js +1 -1
- package/lib/programmers/internal/application_default.js.map +1 -1
- package/lib/programmers/internal/application_native.d.ts +4 -0
- package/lib/programmers/internal/application_native.js +35 -0
- package/lib/programmers/internal/application_native.js.map +1 -0
- package/lib/programmers/internal/application_number.js +6 -2
- package/lib/programmers/internal/application_number.js.map +1 -1
- package/lib/programmers/internal/application_object.js +44 -31
- package/lib/programmers/internal/application_object.js.map +1 -1
- package/lib/programmers/internal/application_schema.js +70 -36
- package/lib/programmers/internal/application_schema.js.map +1 -1
- package/lib/programmers/internal/application_string.js +2 -2
- package/lib/programmers/internal/application_string.js.map +1 -1
- package/lib/programmers/internal/check_array.js +4 -10
- package/lib/programmers/internal/check_array.js.map +1 -1
- package/lib/programmers/internal/check_dynamic_properties.js +40 -50
- package/lib/programmers/internal/check_dynamic_properties.js.map +1 -1
- package/lib/programmers/internal/check_everything.js +1 -3
- package/lib/programmers/internal/check_everything.js.map +1 -1
- package/lib/programmers/internal/check_length.js +2 -2
- package/lib/programmers/internal/check_length.js.map +1 -1
- package/lib/programmers/internal/check_native.d.ts +1 -0
- package/lib/programmers/internal/check_native.js +9 -0
- package/lib/programmers/internal/check_native.js.map +1 -0
- package/lib/programmers/internal/check_number.js +1 -1
- package/lib/programmers/internal/check_number.js.map +1 -1
- package/lib/programmers/internal/check_object.d.ts +12 -1
- package/lib/programmers/internal/check_object.js +12 -22
- package/lib/programmers/internal/check_object.js.map +1 -1
- package/lib/programmers/internal/decode_union_object.js +9 -7
- package/lib/programmers/internal/decode_union_object.js.map +1 -1
- package/lib/programmers/internal/feature_object_entries.d.ts +9 -0
- package/lib/programmers/internal/feature_object_entries.js +38 -0
- package/lib/programmers/internal/feature_object_entries.js.map +1 -0
- package/lib/programmers/internal/stringify_dynamic_properties.js +4 -2
- package/lib/programmers/internal/stringify_dynamic_properties.js.map +1 -1
- package/lib/programmers/internal/stringify_native.d.ts +1 -0
- package/lib/programmers/internal/stringify_native.js +12 -0
- package/lib/programmers/internal/stringify_native.js.map +1 -0
- package/lib/schemas/IJsonComponents.d.ts +1 -1
- package/lib/schemas/IJsonSchema.d.ts +10 -8
- package/lib/transformers/CallExpressionTransformer.js +47 -10
- package/lib/transformers/CallExpressionTransformer.js.map +1 -1
- package/lib/transformers/FileTransformer.js +1 -1
- package/lib/transformers/features/{ApplicationTransformer.d.ts → miscellaneous/ApplicationTransformer.d.ts} +1 -1
- package/lib/transformers/features/{ApplicationTransformer.js → miscellaneous/ApplicationTransformer.js} +8 -8
- package/lib/transformers/features/miscellaneous/ApplicationTransformer.js.map +1 -0
- package/lib/transformers/features/{CreateTransformer.d.ts → miscellaneous/CreateInstanceTransformer.d.ts} +2 -2
- package/lib/transformers/features/{CreateTransformer.js → miscellaneous/CreateInstanceTransformer.js} +8 -8
- package/lib/transformers/features/miscellaneous/CreateInstanceTransformer.js.map +1 -0
- package/lib/transformers/features/miscellaneous/MetadataTransformer.d.ts +5 -0
- package/lib/transformers/features/miscellaneous/MetadataTransformer.js +43 -0
- package/lib/transformers/features/miscellaneous/MetadataTransformer.js.map +1 -0
- package/lib/transformers/features/parsers/AssertParseTransformer.d.ts +5 -0
- package/lib/transformers/features/parsers/AssertParseTransformer.js +21 -0
- package/lib/transformers/features/parsers/AssertParseTransformer.js.map +1 -0
- package/lib/transformers/features/parsers/CreateAssertParseTransformer.d.ts +5 -0
- package/lib/transformers/features/parsers/CreateAssertParseTransformer.js +17 -0
- package/lib/transformers/features/parsers/CreateAssertParseTransformer.js.map +1 -0
- package/lib/transformers/features/parsers/CreateIsParseTransformer.d.ts +5 -0
- package/lib/transformers/features/parsers/CreateIsParseTransformer.js +17 -0
- package/lib/transformers/features/parsers/CreateIsParseTransformer.js.map +1 -0
- package/lib/transformers/features/parsers/CreateValidateParseTransformer.d.ts +5 -0
- package/lib/transformers/features/parsers/CreateValidateParseTransformer.js +17 -0
- package/lib/transformers/features/parsers/CreateValidateParseTransformer.js.map +1 -0
- package/lib/transformers/features/parsers/IsParseTransformer.d.ts +5 -0
- package/lib/transformers/features/parsers/IsParseTransformer.js +21 -0
- package/lib/transformers/features/parsers/IsParseTransformer.js.map +1 -0
- package/lib/transformers/features/parsers/ValidateParseTransformer.d.ts +5 -0
- package/lib/transformers/features/parsers/ValidateParseTransformer.js +21 -0
- package/lib/transformers/features/parsers/ValidateParseTransformer.js.map +1 -0
- package/lib/transformers/features/stringifiers/AssertStringifyTransformer.d.ts +5 -0
- package/lib/transformers/features/stringifiers/AssertStringifyTransformer.js +23 -0
- package/lib/transformers/features/stringifiers/AssertStringifyTransformer.js.map +1 -0
- package/lib/transformers/features/stringifiers/CreateAssertStringifyTransformer.d.ts +5 -0
- package/lib/transformers/features/stringifiers/CreateAssertStringifyTransformer.js +17 -0
- package/lib/transformers/features/stringifiers/CreateAssertStringifyTransformer.js.map +1 -0
- package/lib/transformers/features/stringifiers/CreateIsStringifyTransformer.d.ts +5 -0
- package/lib/transformers/features/stringifiers/CreateIsStringifyTransformer.js +17 -0
- package/lib/transformers/features/stringifiers/CreateIsStringifyTransformer.js.map +1 -0
- package/lib/transformers/features/stringifiers/CreateStringifyTransformer.d.ts +5 -0
- package/lib/transformers/features/stringifiers/CreateStringifyTransformer.js +17 -0
- package/lib/transformers/features/stringifiers/CreateStringifyTransformer.js.map +1 -0
- package/lib/transformers/features/stringifiers/CreateValidateStringifyProgrammer.d.ts +5 -0
- package/lib/transformers/features/stringifiers/CreateValidateStringifyProgrammer.js +17 -0
- package/lib/transformers/features/stringifiers/CreateValidateStringifyProgrammer.js.map +1 -0
- package/lib/transformers/features/stringifiers/IsStringifyTransformer.d.ts +5 -0
- package/lib/transformers/features/stringifiers/IsStringifyTransformer.js +23 -0
- package/lib/transformers/features/stringifiers/IsStringifyTransformer.js.map +1 -0
- package/lib/transformers/features/{StringifyTransformer.d.ts → stringifiers/StringifyTransformer.d.ts} +1 -1
- package/lib/transformers/features/{StringifyTransformer.js → stringifiers/StringifyTransformer.js} +3 -3
- package/lib/transformers/features/stringifiers/StringifyTransformer.js.map +1 -0
- package/lib/transformers/features/stringifiers/ValidateStringifyTransformer.d.ts +5 -0
- package/lib/transformers/features/stringifiers/ValidateStringifyTransformer.js +23 -0
- package/lib/transformers/features/stringifiers/ValidateStringifyTransformer.js.map +1 -0
- package/lib/transformers/features/{AssertTransformer.d.ts → validators/AssertTransformer.d.ts} +1 -1
- package/lib/transformers/features/{AssertTransformer.js → validators/AssertTransformer.js} +4 -4
- package/lib/transformers/features/validators/AssertTransformer.js.map +1 -0
- package/lib/transformers/features/validators/CreateAssertTransformer.d.ts +5 -0
- package/lib/transformers/features/validators/CreateAssertTransformer.js +24 -0
- package/lib/transformers/features/validators/CreateAssertTransformer.js.map +1 -0
- package/lib/transformers/features/validators/CreateIsTransformer.d.ts +5 -0
- package/lib/transformers/features/validators/CreateIsTransformer.js +24 -0
- package/lib/transformers/features/validators/CreateIsTransformer.js.map +1 -0
- package/lib/transformers/features/validators/CreateValidateTransformer.d.ts +5 -0
- package/lib/transformers/features/validators/CreateValidateTransformer.js +24 -0
- package/lib/transformers/features/validators/CreateValidateTransformer.js.map +1 -0
- package/lib/transformers/features/{IsTransformer.d.ts → validators/IsTransformer.d.ts} +1 -1
- package/lib/transformers/features/{IsTransformer.js → validators/IsTransformer.js} +3 -3
- package/lib/transformers/features/validators/IsTransformer.js.map +1 -0
- package/lib/transformers/features/{ValidateTransformer.d.ts → validators/ValidateTransformer.d.ts} +1 -1
- package/lib/transformers/features/{ValidateTransformer.js → validators/ValidateTransformer.js} +3 -3
- package/lib/transformers/features/validators/ValidateTransformer.js.map +1 -0
- package/lib/typings/ClassProperties.d.ts +1 -1
- package/lib/typings/OmitNever.d.ts +1 -1
- package/lib/typings/SpecialFields.d.ts +1 -1
- package/lib/typings/Writable.d.ts +1 -1
- package/lib/utils/PatternUtil.js +1 -1
- package/lib/utils/PatternUtil.js.map +1 -1
- package/package.json +114 -78
- package/src/IValidation.ts +21 -0
- package/src/Primitive.ts +82 -0
- package/src/TypeGuardError.ts +36 -0
- package/src/executable/internal/TypiaSetupWizard.ts +130 -0
- package/src/executable/typia.ts +34 -0
- package/src/factories/CommentFactory.ts +10 -0
- package/src/factories/ExpressionFactory.ts +52 -0
- package/src/factories/IdentifierFactory.ts +72 -0
- package/src/factories/LiteralFactory.ts +44 -0
- package/src/factories/MetadataCollection.ts +122 -0
- package/src/factories/MetadataFactory.ts +46 -0
- package/src/factories/MetadataTagFactory.ts +347 -0
- package/src/factories/StatementFactory.ts +60 -0
- package/src/factories/TemplateFactory.ts +56 -0
- package/src/factories/TypeFactory.ts +101 -0
- package/src/factories/ValueFactory.ts +12 -0
- package/src/factories/internal/MetadataHelper.ts +12 -0
- package/src/factories/internal/emplace_metadata_object.ts +140 -0
- package/src/factories/internal/explore_metadata.ts +91 -0
- package/src/factories/internal/iterate_metadata.ts +81 -0
- package/src/factories/internal/iterate_metadata_array.ts +29 -0
- package/src/factories/internal/iterate_metadata_atomic.ts +59 -0
- package/src/factories/internal/iterate_metadata_coalesce.ts +33 -0
- package/src/factories/internal/iterate_metadata_constant.ts +58 -0
- package/src/factories/internal/iterate_metadata_map.ts +41 -0
- package/src/factories/internal/iterate_metadata_native.ts +227 -0
- package/src/factories/internal/iterate_metadata_object.ts +45 -0
- package/src/factories/internal/iterate_metadata_resolve.ts +27 -0
- package/src/factories/internal/iterate_metadata_set.ts +33 -0
- package/src/factories/internal/iterate_metadata_template.ts +38 -0
- package/src/factories/internal/iterate_metadata_tuple.ts +51 -0
- package/src/factories/internal/iterate_metadata_union.ts +59 -0
- package/src/functional/$every.ts +11 -0
- package/src/functional/$guard.ts +35 -0
- package/src/functional/$is_email.ts +5 -0
- package/src/functional/$is_ipv4.ts +5 -0
- package/src/functional/$is_ipv6.ts +5 -0
- package/src/functional/$is_url.ts +5 -0
- package/src/functional/$is_uuid.ts +5 -0
- package/src/functional/$join.ts +50 -0
- package/src/functional/$number.ts +19 -0
- package/src/functional/$report.ts +15 -0
- package/src/functional/$rest.ts +3 -0
- package/src/functional/$string.ts +37 -0
- package/src/functional/$tail.ts +6 -0
- package/src/index.ts +4 -0
- package/src/metadata/IJsDocTagInfo.ts +10 -0
- package/src/metadata/IMetadata.ts +25 -0
- package/src/metadata/IMetadataApplication.ts +7 -0
- package/src/metadata/IMetadataConstant.ts +16 -0
- package/src/metadata/IMetadataEntry.ts +6 -0
- package/src/metadata/IMetadataObject.ts +29 -0
- package/src/metadata/IMetadataProperty.ts +11 -0
- package/src/metadata/IMetadataTag.ts +122 -0
- package/src/metadata/Metadata.ts +477 -0
- package/src/metadata/MetadataConstant.ts +3 -0
- package/src/metadata/MetadataObject.ts +131 -0
- package/src/metadata/MetadataProperty.ts +64 -0
- package/src/module.ts +1535 -0
- package/src/programmers/ApplicationProgrammer.ts +55 -0
- package/src/programmers/AssertParseProgrammer.ts +45 -0
- package/src/programmers/AssertProgrammer.ts +444 -0
- package/src/programmers/AssertStringifyProgrammer.ts +45 -0
- package/src/programmers/CheckerProgrammer.ts +798 -0
- package/src/programmers/FeatureProgrammer.ts +327 -0
- package/src/programmers/IsParseProgrammer.ts +51 -0
- package/src/programmers/IsProgrammer.ts +169 -0
- package/src/programmers/IsStringifyProgrammer.ts +49 -0
- package/src/programmers/StringifyProgrammer.ts +746 -0
- package/src/programmers/ValidateParseProgrammer.ts +49 -0
- package/src/programmers/ValidateProgrammer.ts +236 -0
- package/src/programmers/ValidateStringifyProgrammer.ts +60 -0
- package/src/programmers/helpers/AtomicPredicator.ts +15 -0
- package/src/programmers/helpers/FunctionImporeter.ts +31 -0
- package/src/programmers/helpers/IExpressionEntry.ts +10 -0
- package/src/programmers/helpers/OptionPredicator.ts +18 -0
- package/src/programmers/helpers/StringifyJoinder.ts +111 -0
- package/src/programmers/helpers/StringifyPredicator.ts +18 -0
- package/src/programmers/helpers/UnionExplorer.ts +437 -0
- package/src/programmers/helpers/UnionPredicator.ts +81 -0
- package/src/programmers/internal/application_array.ts +45 -0
- package/src/programmers/internal/application_boolean.ts +17 -0
- package/src/programmers/internal/application_constant.ts +29 -0
- package/src/programmers/internal/application_default.ts +17 -0
- package/src/programmers/internal/application_default_string.ts +32 -0
- package/src/programmers/internal/application_native.ts +29 -0
- package/src/programmers/internal/application_number.ts +76 -0
- package/src/programmers/internal/application_object.ts +103 -0
- package/src/programmers/internal/application_schema.ts +221 -0
- package/src/programmers/internal/application_string.ts +49 -0
- package/src/programmers/internal/application_templates.ts +27 -0
- package/src/programmers/internal/application_tuple.ts +25 -0
- package/src/programmers/internal/check_array.ts +44 -0
- package/src/programmers/internal/check_dynamic_properties.ts +146 -0
- package/src/programmers/internal/check_everything.ts +25 -0
- package/src/programmers/internal/check_length.ts +46 -0
- package/src/programmers/internal/check_native.ts +9 -0
- package/src/programmers/internal/check_number.ts +181 -0
- package/src/programmers/internal/check_object.ts +42 -0
- package/src/programmers/internal/check_string.ts +24 -0
- package/src/programmers/internal/check_string_tags.ts +63 -0
- package/src/programmers/internal/check_template.ts +50 -0
- package/src/programmers/internal/decode_union_object.ts +73 -0
- package/src/programmers/internal/feature_object_entries.ts +49 -0
- package/src/programmers/internal/metadata_to_pattern.ts +31 -0
- package/src/programmers/internal/stringify_dynamic_properties.ts +164 -0
- package/src/programmers/internal/stringify_native.ts +8 -0
- package/src/programmers/internal/stringify_regular_properties.ts +81 -0
- package/src/programmers/internal/template_to_pattern.ts +15 -0
- package/src/schemas/IJsonApplication.ts +9 -0
- package/src/schemas/IJsonComponents.ts +24 -0
- package/src/schemas/IJsonSchema.ts +92 -0
- package/src/transform.ts +20 -0
- package/src/transformers/CallExpressionTransformer.ts +124 -0
- package/src/transformers/ExpressionWithArgumentTransformer.ts +66 -0
- package/src/transformers/FileTransformer.ts +49 -0
- package/src/transformers/IProject.ts +11 -0
- package/src/transformers/ITransformOptions.ts +4 -0
- package/src/transformers/NodeTransformer.ts +19 -0
- package/src/transformers/features/miscellaneous/ApplicationTransformer.ts +114 -0
- package/src/transformers/features/miscellaneous/CreateInstanceTransformer.ts +41 -0
- package/src/transformers/features/miscellaneous/MetadataTransformer.ts +55 -0
- package/src/transformers/features/parsers/AssertParseTransformer.ts +36 -0
- package/src/transformers/features/parsers/CreateAssertParseTransformer.ts +32 -0
- package/src/transformers/features/parsers/CreateIsParseTransformer.ts +32 -0
- package/src/transformers/features/parsers/CreateValidateParseTransformer.ts +32 -0
- package/src/transformers/features/parsers/IsParseTransformer.ts +36 -0
- package/src/transformers/features/parsers/ValidateParseTransformer.ts +36 -0
- package/src/transformers/features/stringifiers/AssertStringifyTransformer.ts +38 -0
- package/src/transformers/features/stringifiers/CreateAssertStringifyTransformer.ts +32 -0
- package/src/transformers/features/stringifiers/CreateIsStringifyTransformer.ts +32 -0
- package/src/transformers/features/stringifiers/CreateStringifyTransformer.ts +31 -0
- package/src/transformers/features/stringifiers/CreateValidateStringifyProgrammer.ts +32 -0
- package/src/transformers/features/stringifiers/IsStringifyTransformer.ts +38 -0
- package/src/transformers/features/stringifiers/StringifyTransformer.ts +36 -0
- package/src/transformers/features/stringifiers/ValidateStringifyTransformer.ts +38 -0
- package/src/transformers/features/validators/AssertTransformer.ts +43 -0
- package/src/transformers/features/validators/CreateAssertTransformer.ts +35 -0
- package/src/transformers/features/validators/CreateIsTransformer.ts +35 -0
- package/src/transformers/features/validators/CreateValidateTransformer.ts +35 -0
- package/src/transformers/features/validators/IsTransformer.ts +43 -0
- package/src/transformers/features/validators/ValidateTransformer.ts +43 -0
- package/src/typings/Atomic.ts +17 -0
- package/src/typings/ClassProperties.ts +5 -0
- package/src/typings/OmitNever.ts +3 -0
- package/src/typings/SpecialFields.ts +3 -0
- package/src/typings/Writable.ts +11 -0
- package/src/utils/ArrayUtil.ts +49 -0
- package/src/utils/Escaper.ts +50 -0
- package/src/utils/MapUtil.ts +14 -0
- package/src/utils/PatternUtil.ts +30 -0
- package/src/utils/Singleton.ts +17 -0
- package/CODE_OF_CONDUCT.md +0 -133
- package/CONTRIBUTING.md +0 -104
- package/lib/transformers/features/ApplicationTransformer.js.map +0 -1
- package/lib/transformers/features/AssertTransformer.js.map +0 -1
- package/lib/transformers/features/CreateTransformer.js.map +0 -1
- package/lib/transformers/features/IsTransformer.js.map +0 -1
- package/lib/transformers/features/StringifyTransformer.js.map +0 -1
- package/lib/transformers/features/ValidateTransformer.js.map +0 -1
package/lib/module.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { IValidation } from "./IValidation";
|
|
|
3
3
|
export * from "./schemas/IJsonApplication";
|
|
4
4
|
export * from "./schemas/IJsonComponents";
|
|
5
5
|
export * from "./schemas/IJsonSchema";
|
|
6
|
+
export * from "./Primitive";
|
|
6
7
|
export * from "./TypeGuardError";
|
|
7
8
|
export * from "./IValidation";
|
|
8
9
|
/**
|
|
@@ -26,7 +27,7 @@ export * from "./IValidation";
|
|
|
26
27
|
*
|
|
27
28
|
* @author Jeongho Nam - https://github.com/samchon
|
|
28
29
|
*/
|
|
29
|
-
export declare function
|
|
30
|
+
export declare function assert<T>(input: T): T;
|
|
30
31
|
/**
|
|
31
32
|
* Asserts a value type.
|
|
32
33
|
*
|
|
@@ -36,7 +37,7 @@ export declare function assertType<T>(input: T): T;
|
|
|
36
37
|
*
|
|
37
38
|
* If what you want is not asserting but just knowing whether the parametric value is
|
|
38
39
|
* following the type `T` or not, you can choose the {@link is} function instead.
|
|
39
|
-
* Otherwise you want to know all the errors, {@link validate} is the way to go.
|
|
40
|
+
* Otherwise, you want to know all the errors, {@link validate} is the way to go.
|
|
40
41
|
*
|
|
41
42
|
* On the other and, if you don't want to allow any superfluous property that is not
|
|
42
43
|
* enrolled to the type `T`, you can use {@link assertEquals} function instead.
|
|
@@ -48,6 +49,34 @@ export declare function assertType<T>(input: T): T;
|
|
|
48
49
|
*
|
|
49
50
|
* @author Jeongho Nam - https://github.com/samchon
|
|
50
51
|
*/
|
|
52
|
+
export declare function assert<T>(input: unknown): T;
|
|
53
|
+
/**
|
|
54
|
+
* Asserts a value type.
|
|
55
|
+
*
|
|
56
|
+
* Duplicated function of {@link assert} for `typescript-is` users.
|
|
57
|
+
*
|
|
58
|
+
* @template T Type of the input value
|
|
59
|
+
* @param input A value to be asserted
|
|
60
|
+
* @returns Parametric input value
|
|
61
|
+
* @throws A {@link TypeGuardError} instance with detailed reason
|
|
62
|
+
*
|
|
63
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
64
|
+
* @deprecated
|
|
65
|
+
*/
|
|
66
|
+
export declare function assertType<T>(input: T): T;
|
|
67
|
+
/**
|
|
68
|
+
* Asserts a value type.
|
|
69
|
+
*
|
|
70
|
+
* Duplicated function of {@link assert} for `typescript-is` users.
|
|
71
|
+
*
|
|
72
|
+
* @template T Type of the input value
|
|
73
|
+
* @param input A value to be asserted
|
|
74
|
+
* @returns Parametric input value
|
|
75
|
+
* @throws A {@link TypeGuardError} instance with detailed reason
|
|
76
|
+
*
|
|
77
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
78
|
+
* @deprecated
|
|
79
|
+
*/
|
|
51
80
|
export declare function assertType<T>(input: unknown): T;
|
|
52
81
|
/**
|
|
53
82
|
* Tests a value type.
|
|
@@ -59,7 +88,7 @@ export declare function assertType<T>(input: unknown): T;
|
|
|
59
88
|
*
|
|
60
89
|
* If what you want is not just knowing whether the parametric value is following the
|
|
61
90
|
* type `T` or not, but throwing an exception with detailed reason, you can choose
|
|
62
|
-
* {@link
|
|
91
|
+
* {@link assert} function instead. Also, if you want to know all the errors with
|
|
63
92
|
* detailed reasons, {@link validate} function would be useful.
|
|
64
93
|
*
|
|
65
94
|
* On the other and, if you don't want to allow any superfluous property that is not
|
|
@@ -82,7 +111,7 @@ export declare function is<T>(input: T): input is T;
|
|
|
82
111
|
*
|
|
83
112
|
* If what you want is not just knowing whether the parametric value is following the
|
|
84
113
|
* type `T` or not, but throwing an exception with detailed reason, you can choose
|
|
85
|
-
* {@link
|
|
114
|
+
* {@link assert} function instead. Also, if you want to know all the errors with
|
|
86
115
|
* detailed reasons, {@link validate} function would be useful.
|
|
87
116
|
*
|
|
88
117
|
* On the other and, if you don't want to allow any superfluous property that is not
|
|
@@ -105,7 +134,7 @@ export declare function is<T>(input: unknown): input is T;
|
|
|
105
134
|
* would have the `true` value.
|
|
106
135
|
*
|
|
107
136
|
* If what you want is not finding all the error, but asserting the parametric value
|
|
108
|
-
* type with exception throwing, you can choose {@link
|
|
137
|
+
* type with exception throwing, you can choose {@link assert} function instead.
|
|
109
138
|
* Otherwise, you just want to know whether the parametric value is matched with the
|
|
110
139
|
* type `T`, {@link is} function is the way to go.
|
|
111
140
|
*
|
|
@@ -115,8 +144,10 @@ export declare function is<T>(input: unknown): input is T;
|
|
|
115
144
|
* @template Type of the input value
|
|
116
145
|
* @param input A value to be validated
|
|
117
146
|
* @returns Validation result
|
|
147
|
+
*
|
|
148
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
118
149
|
*/
|
|
119
|
-
export declare function validate<T>(input: T): IValidation
|
|
150
|
+
export declare function validate<T>(input: T): IValidation<T>;
|
|
120
151
|
/**
|
|
121
152
|
* Validates a value type.
|
|
122
153
|
*
|
|
@@ -127,7 +158,7 @@ export declare function validate<T>(input: T): IValidation;
|
|
|
127
158
|
* would have the `true` value.
|
|
128
159
|
*
|
|
129
160
|
* If what you want is not finding all the error, but asserting the parametric value
|
|
130
|
-
* type with exception throwing, you can choose {@link
|
|
161
|
+
* type with exception throwing, you can choose {@link assert} function instead.
|
|
131
162
|
* Otherwise, you just want to know whether the parametric value is matched with the
|
|
132
163
|
* type `T`, {@link is} function is the way to go.
|
|
133
164
|
*
|
|
@@ -137,8 +168,10 @@ export declare function validate<T>(input: T): IValidation;
|
|
|
137
168
|
* @template Type of the input value
|
|
138
169
|
* @param input A value to be validated
|
|
139
170
|
* @returns Validation result
|
|
171
|
+
*
|
|
172
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
140
173
|
*/
|
|
141
|
-
export declare function validate<T>(input: unknown): IValidation
|
|
174
|
+
export declare function validate<T>(input: unknown): IValidation<T>;
|
|
142
175
|
/**
|
|
143
176
|
* Asserts equality between a value and its type.
|
|
144
177
|
*
|
|
@@ -150,10 +183,10 @@ export declare function validate<T>(input: unknown): IValidation;
|
|
|
150
183
|
*
|
|
151
184
|
* If what you want is not asserting but just knowing whether the parametric value is
|
|
152
185
|
* following the type `T` or not, you can choose the {@link equals} function instead.
|
|
153
|
-
* Otherwise you want to know all the errors, {@link validateEquals} is the way to go.
|
|
186
|
+
* Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
|
|
154
187
|
*
|
|
155
188
|
* On the other hand, if you want to allow superfluous property that is not enrolled
|
|
156
|
-
* to the type `T`, you can use {@link
|
|
189
|
+
* to the type `T`, you can use {@link assert} function instead.
|
|
157
190
|
*
|
|
158
191
|
* @template T Type of the input value
|
|
159
192
|
* @param input A value to be asserted
|
|
@@ -174,10 +207,10 @@ export declare function assertEquals<T>(input: T): T;
|
|
|
174
207
|
*
|
|
175
208
|
* If what you want is not asserting but just knowing whether the parametric value is
|
|
176
209
|
* following the type `T` or not, you can choose the {@link equals} function instead.
|
|
177
|
-
* Otherwise you want to know all the errors, {@link validateEquals} is the way to go.
|
|
210
|
+
* Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
|
|
178
211
|
*
|
|
179
212
|
* On the other hand, if you want to allow superfluous property that is not enrolled
|
|
180
|
-
* to the type `T`, you can use {@link
|
|
213
|
+
* to the type `T`, you can use {@link assert} function instead.
|
|
181
214
|
*
|
|
182
215
|
* @template T Type of the input value
|
|
183
216
|
* @param input A value to be asserted
|
|
@@ -236,7 +269,7 @@ export declare function equals<T>(input: T): input is T;
|
|
|
236
269
|
*/
|
|
237
270
|
export declare function equals<T>(input: unknown): input is T;
|
|
238
271
|
/**
|
|
239
|
-
* Validates
|
|
272
|
+
* Validates equality between a value and its type.
|
|
240
273
|
*
|
|
241
274
|
* Validates a parametric value type and archives all the type errors into an
|
|
242
275
|
* {@link IValidation.errors} array, if the parametric value is not following the
|
|
@@ -246,7 +279,7 @@ export declare function equals<T>(input: unknown): input is T;
|
|
|
246
279
|
* and {@link IValidation.success} would have the `true` value.
|
|
247
280
|
*
|
|
248
281
|
* If what you want is not finding all the error, but asserting the parametric value
|
|
249
|
-
* type with exception throwing, you can choose {@link
|
|
282
|
+
* type with exception throwing, you can choose {@link assert} function instead.
|
|
250
283
|
* Otherwise, you just want to know whether the parametric value is matched with the
|
|
251
284
|
* type `T`, {@link is} function is the way to go.
|
|
252
285
|
*
|
|
@@ -256,10 +289,12 @@ export declare function equals<T>(input: unknown): input is T;
|
|
|
256
289
|
* @template Type of the input value
|
|
257
290
|
* @param input A value to be validated
|
|
258
291
|
* @returns Validation result
|
|
292
|
+
*
|
|
293
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
259
294
|
*/
|
|
260
|
-
export declare function validateEquals<T>(input: T): IValidation
|
|
295
|
+
export declare function validateEquals<T>(input: T): IValidation<T>;
|
|
261
296
|
/**
|
|
262
|
-
* Validates
|
|
297
|
+
* Validates equality between a value and its type.
|
|
263
298
|
*
|
|
264
299
|
* Validates a parametric value type and archives all the type errors into an
|
|
265
300
|
* {@link IValidation.errors} array, if the parametric value is not following the
|
|
@@ -269,7 +304,7 @@ export declare function validateEquals<T>(input: T): IValidation;
|
|
|
269
304
|
* and {@link IValidation.success} would have the `true` value.
|
|
270
305
|
*
|
|
271
306
|
* If what you want is not finding all the error, but asserting the parametric value
|
|
272
|
-
* type with exception throwing, you can choose {@link
|
|
307
|
+
* type with exception throwing, you can choose {@link assert} function instead.
|
|
273
308
|
* Otherwise, you just want to know whether the parametric value is matched with the
|
|
274
309
|
* type `T`, {@link is} function is the way to go.
|
|
275
310
|
*
|
|
@@ -279,59 +314,10 @@ export declare function validateEquals<T>(input: T): IValidation;
|
|
|
279
314
|
* @template Type of the input value
|
|
280
315
|
* @param input A value to be validated
|
|
281
316
|
* @returns Validation result
|
|
282
|
-
*/
|
|
283
|
-
export declare function validateEquals<T>(input: unknown): IValidation;
|
|
284
|
-
/**
|
|
285
|
-
* 5x faster `JSON.stringify()` function.
|
|
286
|
-
*
|
|
287
|
-
* Converts an input value to a JSON (JavaSript Object Noation) string, about 5x faster
|
|
288
|
-
* than the native `JSON.stringify()` function. The 5x faster principle is because
|
|
289
|
-
* it writes an optmized JSON conversion plan, only for the type `T`.
|
|
290
|
-
*
|
|
291
|
-
* If you want to create a stringify function which is reusable, just assign this function
|
|
292
|
-
* to a (constant) variable like below, with the generic argument `T`. Then the variable
|
|
293
|
-
* would be a stringify fuction reusable.
|
|
294
|
-
*
|
|
295
|
-
* ```typescript
|
|
296
|
-
* const stringify = TSON.stringify<MyType>;
|
|
297
|
-
* stringify(x);
|
|
298
|
-
* stringify(y);
|
|
299
|
-
* stringify(z);
|
|
300
|
-
* ```
|
|
301
|
-
*
|
|
302
|
-
* For reference, this `TSON.stringify()` does not validate the input value type. It
|
|
303
|
-
* just believes that the input value is following the type `T`. Therefore, if you
|
|
304
|
-
* can't ensure the input value type, it would better to call {@link assertType} or
|
|
305
|
-
* {@link is} function before.
|
|
306
|
-
*
|
|
307
|
-
* @template T Type of the input value
|
|
308
|
-
* @param input A value to be converted
|
|
309
|
-
* @return JSON string value
|
|
310
317
|
*
|
|
311
318
|
* @author Jeongho Nam - https://github.com/samchon
|
|
312
319
|
*/
|
|
313
|
-
export declare function
|
|
314
|
-
/**
|
|
315
|
-
* 2x faster constant object creator.
|
|
316
|
-
*
|
|
317
|
-
* You know what? `JSON.parse()` is faster than literal object construction, when the
|
|
318
|
-
* object would be constructed only one time.
|
|
319
|
-
*
|
|
320
|
-
* - [Faster apps with JSON.parse (Chrome Dev Summit 2019)](https://www.youtube.com/watch?v=ff4fgQxPaO0)
|
|
321
|
-
* - [The cost of parsing JSON](https://v8.dev/blog/cost-of-javascript-2019#json)
|
|
322
|
-
*
|
|
323
|
-
* `TSON.create()` is a transformer function which converts a literal object construction
|
|
324
|
-
* to a `JSON.parse()` function call expression with JSON string argument. Therefore, if
|
|
325
|
-
* you construct a literal object via this `TSON.create()`, you can get benefit from both
|
|
326
|
-
* type safe and performance tuning at the same time.
|
|
327
|
-
*
|
|
328
|
-
* @template T Type of the input value
|
|
329
|
-
* @param input A value to be converted
|
|
330
|
-
* @return Same with the parametric value
|
|
331
|
-
*
|
|
332
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
333
|
-
*/
|
|
334
|
-
export declare function create<T>(input: T): T;
|
|
320
|
+
export declare function validateEquals<T>(input: unknown): IValidation<T>;
|
|
335
321
|
/**
|
|
336
322
|
* > You must configure the generic argument `T`.
|
|
337
323
|
*
|
|
@@ -341,16 +327,16 @@ export declare function create<T>(input: T): T;
|
|
|
341
327
|
* Note that, all of the object types are stored in the {@link IJsonApplication.components}
|
|
342
328
|
* property for the `$ref` referencing.
|
|
343
329
|
*
|
|
344
|
-
* Also, `
|
|
330
|
+
* Also, `typia.application()` has additional generic arguments, *Purpose*.
|
|
345
331
|
* As JSON schema definitions used by `swagger` and `ajv` are different a little bit,
|
|
346
|
-
* you should configure the *Purpose*
|
|
332
|
+
* you should configure the *Purpose* appropriately.
|
|
347
333
|
*
|
|
348
334
|
* For an example, `ajv` has an extra property "$recursiveRef" that are not exists
|
|
349
335
|
* in the standard JSON schema definition spec. Otherwise, `swagger` can't identify
|
|
350
336
|
* the tuple definition.
|
|
351
337
|
*
|
|
352
338
|
* @template Types Tuple of target types
|
|
353
|
-
* @template Purpose Purpose of the JSON schema
|
|
339
|
+
* @template Purpose Purpose of the JSON schema`
|
|
354
340
|
* @template Prefix Prefix of the JSON components referenced by `$ref` tag
|
|
355
341
|
* @return JSON schema application
|
|
356
342
|
*
|
|
@@ -364,9 +350,9 @@ export declare function application(): never;
|
|
|
364
350
|
* Note that, all of the object types are stored in the {@link IJsonApplication.components}
|
|
365
351
|
* property for the `$ref` referencing.
|
|
366
352
|
*
|
|
367
|
-
* Also, `
|
|
353
|
+
* Also, `typia.application()` has additional generic arguments, *Purpose*.
|
|
368
354
|
* As JSON schema definitions used by `swagger` and `ajv` are different a little bit,
|
|
369
|
-
* you should configure the *Purpose*
|
|
355
|
+
* you should configure the *Purpose* appropriately.
|
|
370
356
|
*
|
|
371
357
|
* For an example, `ajv` has an extra property "$recursiveRef" that are not exists
|
|
372
358
|
* in the standard JSON schema definition spec. Otherwise, `swagger` can't identify
|
|
@@ -380,3 +366,548 @@ export declare function application(): never;
|
|
|
380
366
|
* @author Jeongho Nam - https://github.com/samchon
|
|
381
367
|
*/
|
|
382
368
|
export declare function application<Types extends unknown[], Purpose extends "swagger" | "ajv" = "swagger", Prefix extends string = Purpose extends "swagger" ? "#/components/schemas" : "components#/schemas">(): IJsonApplication;
|
|
369
|
+
/**
|
|
370
|
+
* > You must configure the generic argument `T`.
|
|
371
|
+
*
|
|
372
|
+
* Safe `JSON.parse()` function with type assertion.
|
|
373
|
+
*
|
|
374
|
+
* `typia.assertParse()` is a combination function of `JSON.parse()` and {@link assert}.
|
|
375
|
+
* Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
|
|
376
|
+
* instance with type assertion.
|
|
377
|
+
*
|
|
378
|
+
* In such reason, when parsed JSON string value is not matched with the type `T`, it
|
|
379
|
+
* throws {@link TypeGuardError}. Otherwise, there's no problem on the parsed value,
|
|
380
|
+
* the parsed value would be returned.
|
|
381
|
+
*
|
|
382
|
+
* @template T Expected type of parsed value
|
|
383
|
+
* @param input JSON string
|
|
384
|
+
* @returns Parsed value
|
|
385
|
+
*
|
|
386
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
387
|
+
*/
|
|
388
|
+
export declare function assertParse(input: string): never;
|
|
389
|
+
/**
|
|
390
|
+
* Safe `JSON.parse()` function with type assertion.
|
|
391
|
+
*
|
|
392
|
+
* `typia.assertParse()` is a combination function of `JSON.parse()` and {@link assert}.
|
|
393
|
+
* Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
|
|
394
|
+
* instance with type assertion.
|
|
395
|
+
*
|
|
396
|
+
* In such reason, when parsed JSON string value is not matched with the type `T`, it
|
|
397
|
+
* throws {@link TypeGuardError}. Otherwise, there's no problem on the parsed value,
|
|
398
|
+
* the parsed value would be returned.
|
|
399
|
+
*
|
|
400
|
+
* @template T Expected type of parsed value
|
|
401
|
+
* @param input JSON string
|
|
402
|
+
* @returns Parsed value
|
|
403
|
+
*
|
|
404
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
405
|
+
*/
|
|
406
|
+
export declare function assertParse<T>(input: string): T;
|
|
407
|
+
/**
|
|
408
|
+
* > You must configure the generic argument `T`.
|
|
409
|
+
*
|
|
410
|
+
* Safe `JSON.parse()` function with type checking.
|
|
411
|
+
*
|
|
412
|
+
* `typia.isParse()` is a combination function of `JSON.parse()` and {@link is}.
|
|
413
|
+
* Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
|
|
414
|
+
* instance with type checking.
|
|
415
|
+
*
|
|
416
|
+
* In such reason, when parsed JSON string value is not matched with the type `T`, it
|
|
417
|
+
* returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
|
|
418
|
+
* value would be returned.
|
|
419
|
+
*
|
|
420
|
+
* @template T Expected type of parsed value
|
|
421
|
+
* @param input JSON string
|
|
422
|
+
* @returns Parsed value when exact type, otherwise `null`
|
|
423
|
+
*
|
|
424
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
425
|
+
*/
|
|
426
|
+
export declare function isParse(input: string): never;
|
|
427
|
+
/**
|
|
428
|
+
* Safe `JSON.parse()` function with type checking.
|
|
429
|
+
*
|
|
430
|
+
* `typia.isParse()` is a combination function of `JSON.parse()` and {@link is}.
|
|
431
|
+
* Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
|
|
432
|
+
* instance with type checking.
|
|
433
|
+
*
|
|
434
|
+
* In such reason, when parsed JSON string value is not matched with the type `T`, it
|
|
435
|
+
* returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
|
|
436
|
+
* value would be returned.
|
|
437
|
+
*
|
|
438
|
+
* @template T Expected type of parsed value
|
|
439
|
+
* @param input JSON string
|
|
440
|
+
* @returns Parsed value when exact type, otherwise `null`
|
|
441
|
+
*
|
|
442
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
443
|
+
*/
|
|
444
|
+
export declare function isParse<T>(input: string): T | null;
|
|
445
|
+
/**
|
|
446
|
+
* > You must configure the generic argument `T`.
|
|
447
|
+
*
|
|
448
|
+
* Safe `JSON.parse()` function with detailed type validation.
|
|
449
|
+
*
|
|
450
|
+
* `typia.validateParse()` is a combination function of `JSON.parse()` and
|
|
451
|
+
* {@link validate}. Therefore, it convers a JSON (JavaScript Object Notation) string
|
|
452
|
+
* to a `T` typed instance with detailed type validation.
|
|
453
|
+
*
|
|
454
|
+
* In such reason, when parsed JSON string value is not matched with the type `T`, it
|
|
455
|
+
* returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
|
|
456
|
+
* there's no problem on the parsed value, the parsed value would be stored in `data`
|
|
457
|
+
* property of the output {@link IValidation.ISuccess} instance.
|
|
458
|
+
*
|
|
459
|
+
* @template T Expected type of parsed value
|
|
460
|
+
* @param input JSON string
|
|
461
|
+
* @returns Validation result with JSON parsed value
|
|
462
|
+
*
|
|
463
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
464
|
+
*/
|
|
465
|
+
export declare function validateParse(input: string): never;
|
|
466
|
+
/**
|
|
467
|
+
* Safe `JSON.parse()` function with detailed type validation.
|
|
468
|
+
*
|
|
469
|
+
* `typia.validateParse()` is a combination function of `JSON.parse()` and
|
|
470
|
+
* {@link validate}. Therefore, it convers a JSON (JavaScript Object Notation) string
|
|
471
|
+
* to a `T` typed instance with detailed type validation.
|
|
472
|
+
*
|
|
473
|
+
* In such reason, when parsed JSON string value is not matched with the type `T`, it
|
|
474
|
+
* returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
|
|
475
|
+
* there's no problem on the parsed value, the parsed value would be stored in `data`
|
|
476
|
+
* property of the output {@link IValidation.ISuccess} instance.
|
|
477
|
+
*
|
|
478
|
+
* @template T Expected type of parsed value
|
|
479
|
+
* @param input JSON string
|
|
480
|
+
* @returns Validation result with JSON parsed value
|
|
481
|
+
*
|
|
482
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
483
|
+
*/
|
|
484
|
+
export declare function validateParse<T>(input: string): IValidation<T>;
|
|
485
|
+
/**
|
|
486
|
+
* 8x faster `JSON.stringify()` function.
|
|
487
|
+
*
|
|
488
|
+
* Converts an input value to a JSON (JavaScript Object Notation) string, about 8x faster
|
|
489
|
+
* than the native `JSON.stringify()` function. The 5x faster principle is because
|
|
490
|
+
* it writes an optimized JSON conversion plan, only for the type `T`.
|
|
491
|
+
*
|
|
492
|
+
* For reference, this `typia.stringify()` does not validate the input value type. It
|
|
493
|
+
* just believes that the input value is following the type `T`. Therefore, if you
|
|
494
|
+
* can't ensure the input value type, it would be better to call one of below functions
|
|
495
|
+
* instead.
|
|
496
|
+
*
|
|
497
|
+
* - {@link assertStringify}
|
|
498
|
+
* - {@link isStringify}
|
|
499
|
+
* - {@link validateStringify}
|
|
500
|
+
*
|
|
501
|
+
* @template T Type of the input value
|
|
502
|
+
* @param input A value to be converted
|
|
503
|
+
* @return JSON string value
|
|
504
|
+
*
|
|
505
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
506
|
+
*/
|
|
507
|
+
export declare function stringify<T>(input: T): string;
|
|
508
|
+
/**
|
|
509
|
+
* 5x faster `JSON.stringify()` function with type assertion.
|
|
510
|
+
*
|
|
511
|
+
* `typia.assertStringify()` is a combination function of {@link assert} and
|
|
512
|
+
* {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
|
|
513
|
+
* Notation) string, with type assertion.
|
|
514
|
+
*
|
|
515
|
+
* In such reason, when `input` value is not matched with the type `T`, it throws an
|
|
516
|
+
* {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, JSON
|
|
517
|
+
* string would be returned.
|
|
518
|
+
*
|
|
519
|
+
* For reference, with type assertion, it is even 5x times faster than the native
|
|
520
|
+
* `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
|
|
521
|
+
* with confidence.
|
|
522
|
+
*
|
|
523
|
+
* @template T Type of the input value
|
|
524
|
+
* @param input A value to be asserted and converted
|
|
525
|
+
* @return JSON string value
|
|
526
|
+
*
|
|
527
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
528
|
+
*/
|
|
529
|
+
export declare function assertStringify<T>(input: T): string;
|
|
530
|
+
/**
|
|
531
|
+
* 5x faster `JSON.stringify()` function with type assertion.
|
|
532
|
+
*
|
|
533
|
+
* `typia.assertStringify()` is a combination function of {@link assert} and
|
|
534
|
+
* {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
|
|
535
|
+
* Notation) string, with type assertion.
|
|
536
|
+
*
|
|
537
|
+
* In such reason, when `input` value is not matched with the type `T`, it throws an
|
|
538
|
+
* {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, JSON
|
|
539
|
+
* string would be returned.
|
|
540
|
+
*
|
|
541
|
+
* For reference, with type assertion, it is even 5x times faster than the native
|
|
542
|
+
* `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
|
|
543
|
+
* with confidence.
|
|
544
|
+
*
|
|
545
|
+
* @template T Type of the input value
|
|
546
|
+
* @param input A value to be asserted and converted
|
|
547
|
+
* @return JSON string value
|
|
548
|
+
*
|
|
549
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
550
|
+
*/
|
|
551
|
+
export declare function assertStringify<T>(input: T): unknown;
|
|
552
|
+
/**
|
|
553
|
+
* 7x faster `JSON.stringify()` function with type checking.
|
|
554
|
+
*
|
|
555
|
+
* `typia.stringify()` is a combination function of {@link is} and
|
|
556
|
+
* {@link stringify}. Therefore, it converts an input value to JSON
|
|
557
|
+
* (JavaScript Object Notation) string, with type checking.
|
|
558
|
+
*
|
|
559
|
+
* In such reason, when `input` value is not matched with the type `T`, it returns
|
|
560
|
+
* `null` value. Otherwise, there's no problem on the `input` value, JSON string would
|
|
561
|
+
* be returned.
|
|
562
|
+
*
|
|
563
|
+
* For reference, with type checking, it is even 7x times faster than the native
|
|
564
|
+
* `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
|
|
565
|
+
* with confidence.
|
|
566
|
+
*
|
|
567
|
+
* @template T Type of the input value
|
|
568
|
+
* @param input A value to be checked and converted
|
|
569
|
+
* @return JSON string value when exact type, otherwise null
|
|
570
|
+
*
|
|
571
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
572
|
+
*/
|
|
573
|
+
export declare function isStringify<T>(input: T): string | null;
|
|
574
|
+
/**
|
|
575
|
+
* 7x faster `JSON.stringify()` function with type checking.
|
|
576
|
+
*
|
|
577
|
+
* `typia.isStringify()` is a combination function of {@link is} and
|
|
578
|
+
* {@link stringify}. Therefore, it converts an input value to JSON
|
|
579
|
+
* (JavaScript Object Notation) string, with type checking.
|
|
580
|
+
*
|
|
581
|
+
* In such reason, when `input` value is not matched with the type `T`, it returns
|
|
582
|
+
* `null` value. Otherwise, there's no problem on the `input` value, JSON string would
|
|
583
|
+
* be returned.
|
|
584
|
+
*
|
|
585
|
+
* For reference, with type checking, it is even 7x times faster than the native
|
|
586
|
+
* `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
|
|
587
|
+
* with confidence.
|
|
588
|
+
*
|
|
589
|
+
* @template T Type of the input value
|
|
590
|
+
* @param input A value to be checked and converted
|
|
591
|
+
* @return JSON string value when exact type, otherwise null
|
|
592
|
+
*
|
|
593
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
594
|
+
*/
|
|
595
|
+
export declare function isStringify<T>(input: unknown): string | null;
|
|
596
|
+
/**
|
|
597
|
+
* 5x faster `JSON.stringify()` function with detailed type validation.
|
|
598
|
+
*
|
|
599
|
+
* `typia.validateStringify()` is a combination function of {@link validate} and
|
|
600
|
+
* {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
|
|
601
|
+
* Notation) string, with detailed type validation.
|
|
602
|
+
*
|
|
603
|
+
* In such reason, when `input` value is not matched with the type `T`, it returns
|
|
604
|
+
* {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's no
|
|
605
|
+
* problem on the `input` value, JSON string would be stored in `data` property of
|
|
606
|
+
* the output {@link IValidation.ISuccess} instance.
|
|
607
|
+
*
|
|
608
|
+
* For reference, with detailed type validation, it is even 5x times faster than the
|
|
609
|
+
* native `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
|
|
610
|
+
* with confidence.
|
|
611
|
+
*
|
|
612
|
+
* @template T Type of the input value
|
|
613
|
+
* @param input A value to be checked and converted
|
|
614
|
+
* @returns Validation result with JSON string value
|
|
615
|
+
*
|
|
616
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
617
|
+
*/
|
|
618
|
+
export declare function validateStringify<T>(input: T): IValidation<string>;
|
|
619
|
+
/**
|
|
620
|
+
* 5x faster `JSON.stringify()` function with detailed type validation.
|
|
621
|
+
*
|
|
622
|
+
* `typia.validateStringify()` is a combination function of {@link validate} and
|
|
623
|
+
* {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
|
|
624
|
+
* Notation) string, with detailed type validation.
|
|
625
|
+
*
|
|
626
|
+
* In such reason, when `input` value is not matched with the type `T`, it returns
|
|
627
|
+
* {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's no
|
|
628
|
+
* problem on the `input` value, JSON string would be stored in `data` property of
|
|
629
|
+
* the output {@link IValidation.ISuccess} instance.
|
|
630
|
+
*
|
|
631
|
+
* For reference, with detailed type validation, it is even 5x times faster than the
|
|
632
|
+
* native `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
|
|
633
|
+
* with confidence.
|
|
634
|
+
*
|
|
635
|
+
* @template T Type of the input value
|
|
636
|
+
* @param input A value to be checked and converted
|
|
637
|
+
* @returns Validation result with JSON string value
|
|
638
|
+
*
|
|
639
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
640
|
+
*/
|
|
641
|
+
export declare function validateStringify<T>(input: unknown): IValidation<string>;
|
|
642
|
+
/**
|
|
643
|
+
* Creates a reusable {@link assert} function.
|
|
644
|
+
*
|
|
645
|
+
* @danger You have to specify the generic argument `T`
|
|
646
|
+
* @return Nothing until specifying the generic argument `T`
|
|
647
|
+
* @throws compile error
|
|
648
|
+
*
|
|
649
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
650
|
+
*/
|
|
651
|
+
export declare function createAssert(): never;
|
|
652
|
+
/**
|
|
653
|
+
* Creates a reusable {@link assert} function.
|
|
654
|
+
*
|
|
655
|
+
* @template T Type of the input value
|
|
656
|
+
* @returns A reusable `assert` function
|
|
657
|
+
*
|
|
658
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
659
|
+
*/
|
|
660
|
+
export declare function createAssert<T>(): (input: unknown) => T;
|
|
661
|
+
/**
|
|
662
|
+
* Creates a reusable {@link assertType} function.
|
|
663
|
+
*
|
|
664
|
+
* Duplicated function of {@link createAssert} for `typescript-is` users.
|
|
665
|
+
*
|
|
666
|
+
* @danger You have to specify the generic argument `T`
|
|
667
|
+
* @return Nothing until specifying the generic argument `T`
|
|
668
|
+
* @throws compile error
|
|
669
|
+
*
|
|
670
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
671
|
+
* @deprecated
|
|
672
|
+
*/
|
|
673
|
+
export declare function createAssertType(): never;
|
|
674
|
+
/**
|
|
675
|
+
* Creates a reusable {@link assertType} function.
|
|
676
|
+
*
|
|
677
|
+
* Duplicated function of {@link createAssert} for `typescript-is` users.
|
|
678
|
+
*
|
|
679
|
+
* @template T Type of the input value
|
|
680
|
+
* @returns A reusable `assert` function
|
|
681
|
+
*
|
|
682
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
683
|
+
* @deprecated
|
|
684
|
+
*/
|
|
685
|
+
export declare function createAssertType<T>(): (input: unknown) => T;
|
|
686
|
+
/**
|
|
687
|
+
* Creates a reusable {@link is} function.
|
|
688
|
+
*
|
|
689
|
+
* @danger You have to specify the generic argument `T`
|
|
690
|
+
* @return Nothing until specifying the generic argument `T`
|
|
691
|
+
* @throws compile error
|
|
692
|
+
*
|
|
693
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
694
|
+
*/
|
|
695
|
+
export declare function createIs(): never;
|
|
696
|
+
/**
|
|
697
|
+
* Creates a reusable {@link is} function.
|
|
698
|
+
*
|
|
699
|
+
* @template T Type of the input value
|
|
700
|
+
* @returns A reusable `is` function
|
|
701
|
+
*
|
|
702
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
703
|
+
*/
|
|
704
|
+
export declare function createIs<T>(): (input: unknown) => input is T;
|
|
705
|
+
/**
|
|
706
|
+
* Creates a reusable {@link validate} function.
|
|
707
|
+
*
|
|
708
|
+
* @danger You have to specify the generic argument `T`
|
|
709
|
+
* @return Nothing until specifying the generic argument `T`
|
|
710
|
+
* @throws compile error
|
|
711
|
+
*
|
|
712
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
713
|
+
*/
|
|
714
|
+
export declare function createValidate(): never;
|
|
715
|
+
/**
|
|
716
|
+
* Creates a reusable {@link validate} function.
|
|
717
|
+
*
|
|
718
|
+
* @template T Type of the input value
|
|
719
|
+
* @returns A reusable `validate` function
|
|
720
|
+
*
|
|
721
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
722
|
+
*/
|
|
723
|
+
export declare function createValidate<T>(): (input: unknown) => IValidation<T>;
|
|
724
|
+
/**
|
|
725
|
+
* Creates a reusable {@link assertEquals} function.
|
|
726
|
+
*
|
|
727
|
+
* @danger You have to specify the generic argument `T`
|
|
728
|
+
* @return Nothing until specifying the generic argument `T`
|
|
729
|
+
* @throws compile error
|
|
730
|
+
*
|
|
731
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
732
|
+
*/
|
|
733
|
+
export declare function createAssertEquals(): never;
|
|
734
|
+
/**
|
|
735
|
+
* Creates a reusable {@link assertEquals} function.
|
|
736
|
+
*
|
|
737
|
+
* @template T Type of the input value
|
|
738
|
+
* @returns A reusable `assertEquals` function
|
|
739
|
+
*
|
|
740
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
741
|
+
*/
|
|
742
|
+
export declare function createAssertEquals<T>(): (input: unknown) => T;
|
|
743
|
+
/**
|
|
744
|
+
* Creates a reusable {@link equals} function.
|
|
745
|
+
*
|
|
746
|
+
* @danger You have to specify the generic argument `T`
|
|
747
|
+
* @return Nothing until specifying the generic argument `T`
|
|
748
|
+
* @throws compile error
|
|
749
|
+
*
|
|
750
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
751
|
+
*/
|
|
752
|
+
export declare function createEquals(): never;
|
|
753
|
+
/**
|
|
754
|
+
* Creates a reusable {@link equals} function.
|
|
755
|
+
*
|
|
756
|
+
* @template T Type of the input value
|
|
757
|
+
* @returns A reusable `equals` function
|
|
758
|
+
*
|
|
759
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
760
|
+
*/
|
|
761
|
+
export declare function createEquals<T>(): (input: unknown) => input is T;
|
|
762
|
+
/**
|
|
763
|
+
* Creates a reusable {@link validateEquals} function.
|
|
764
|
+
*
|
|
765
|
+
* @danger You have to specify the generic argument `T`
|
|
766
|
+
* @return Nothing until specifying the generic argument `T`
|
|
767
|
+
* @throws compile error
|
|
768
|
+
*
|
|
769
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
770
|
+
*/
|
|
771
|
+
export declare function createValidateEquals(): never;
|
|
772
|
+
/**
|
|
773
|
+
* Creates a reusable {@link validateEquals} function.
|
|
774
|
+
*
|
|
775
|
+
* @template T Type of the input value
|
|
776
|
+
* @returns A reusable `validateEquals` function
|
|
777
|
+
*
|
|
778
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
779
|
+
*/
|
|
780
|
+
export declare function createValidateEquals<T>(): (input: unknown) => IValidation;
|
|
781
|
+
/**
|
|
782
|
+
* Creates a reusable {@link isParse} function.
|
|
783
|
+
*
|
|
784
|
+
* @danger You have to specify the generic argument `T`
|
|
785
|
+
* @return Nothing until specifying the generic argument `T`
|
|
786
|
+
* @throws compile error
|
|
787
|
+
*
|
|
788
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
789
|
+
*/
|
|
790
|
+
export declare function createIsParse(): never;
|
|
791
|
+
/**
|
|
792
|
+
* Creates a reusable {@link isParse} function.
|
|
793
|
+
*
|
|
794
|
+
* @template T Expected type of parsed value
|
|
795
|
+
* @returns A reusable `isParse` function
|
|
796
|
+
*
|
|
797
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
798
|
+
*/
|
|
799
|
+
export declare function createIsParse<T>(): (input: string) => T | null;
|
|
800
|
+
/**
|
|
801
|
+
* Creates a reusable {@link assertParse} function.
|
|
802
|
+
*
|
|
803
|
+
* @danger You have to specify the generic argument `T`
|
|
804
|
+
* @return Nothing until specifying the generic argument `T`
|
|
805
|
+
* @throws compile error
|
|
806
|
+
*
|
|
807
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
808
|
+
*/
|
|
809
|
+
export declare function createAssertParse(): never;
|
|
810
|
+
/**
|
|
811
|
+
* Creates a reusable {@link assertParse} function.
|
|
812
|
+
*
|
|
813
|
+
* @template T Expected type of parsed value
|
|
814
|
+
* @returns A reusable `assertParse` function
|
|
815
|
+
*
|
|
816
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
817
|
+
*/
|
|
818
|
+
export declare function createAssertParse<T>(): (input: string) => T;
|
|
819
|
+
/**
|
|
820
|
+
* Creates a reusable {@link validateParse} function.
|
|
821
|
+
*
|
|
822
|
+
* @danger You have to specify the generic argument `T`
|
|
823
|
+
* @return Nothing until specifying the generic argument `T`
|
|
824
|
+
* @throws compile error
|
|
825
|
+
*
|
|
826
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
827
|
+
*/
|
|
828
|
+
export declare function createValidateParse(): never;
|
|
829
|
+
/**
|
|
830
|
+
* Creates a reusable {@link validateParse} function.
|
|
831
|
+
*
|
|
832
|
+
* @template T Expected type of parsed value
|
|
833
|
+
* @returns A reusable `validateParse` function
|
|
834
|
+
*
|
|
835
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
836
|
+
*/
|
|
837
|
+
export declare function createValidateParse<T>(): (input: string) => IValidation<T>;
|
|
838
|
+
/**
|
|
839
|
+
* Creates a reusable {@link stringify} function.
|
|
840
|
+
*
|
|
841
|
+
* @danger You have to specify the generic argument `T`
|
|
842
|
+
* @return Nothing until specifying the generic argument `T`
|
|
843
|
+
* @throws compile error
|
|
844
|
+
*
|
|
845
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
846
|
+
*/
|
|
847
|
+
export declare function createStringify(): never;
|
|
848
|
+
/**
|
|
849
|
+
* Creates a reusable {@link stringify} function.
|
|
850
|
+
*
|
|
851
|
+
* @template T Type of the input value
|
|
852
|
+
* @returns A reusable `stringify` function
|
|
853
|
+
*
|
|
854
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
855
|
+
*/
|
|
856
|
+
export declare function createStringify<T>(): (input: T) => string;
|
|
857
|
+
/**
|
|
858
|
+
* Creates a reusable {@link assertStringify} function.
|
|
859
|
+
*
|
|
860
|
+
* @danger You have to specify the generic argument `T`
|
|
861
|
+
* @return Nothing until specifying the generic argument `T`
|
|
862
|
+
* @throws compile error
|
|
863
|
+
*
|
|
864
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
865
|
+
*/
|
|
866
|
+
export declare function createAssertStringify(): never;
|
|
867
|
+
/**
|
|
868
|
+
* Creates a reusable {@link assertStringify} function.
|
|
869
|
+
*
|
|
870
|
+
* @template T Type of the input value
|
|
871
|
+
* @returns A reusable `assertStringify` function
|
|
872
|
+
*
|
|
873
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
874
|
+
*/
|
|
875
|
+
export declare function createAssertStringify<T>(): (input: unknown) => string;
|
|
876
|
+
/**
|
|
877
|
+
* Creates a reusable {@link isStringify} function.
|
|
878
|
+
*
|
|
879
|
+
* @danger You have to specify the generic argument `T`
|
|
880
|
+
* @return Nothing until specifying the generic argument `T`
|
|
881
|
+
* @throws compile error
|
|
882
|
+
*
|
|
883
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
884
|
+
*/
|
|
885
|
+
export declare function createIsStringify(): never;
|
|
886
|
+
/**
|
|
887
|
+
* Creates a reusable {@link isStringify} function.
|
|
888
|
+
*
|
|
889
|
+
* @template T Type of the input value
|
|
890
|
+
* @returns A reusable `isStringify` function
|
|
891
|
+
*
|
|
892
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
893
|
+
*/
|
|
894
|
+
export declare function createIsStringify<T>(): (input: unknown) => string | null;
|
|
895
|
+
/**
|
|
896
|
+
* Creates a reusable {@link validateStringify} function.
|
|
897
|
+
*
|
|
898
|
+
* @danger You have to specify the generic argument `T`
|
|
899
|
+
* @return Nothing until specifying the generic argument `T`
|
|
900
|
+
* @throws compile error
|
|
901
|
+
*
|
|
902
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
903
|
+
*/
|
|
904
|
+
export declare function createValidateStringify(): never;
|
|
905
|
+
/**
|
|
906
|
+
* Creates a reusable {@link validateStringify} function.
|
|
907
|
+
*
|
|
908
|
+
* @template T Type of the input value
|
|
909
|
+
* @returns A reusable `validateStringify` function
|
|
910
|
+
*
|
|
911
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
912
|
+
*/
|
|
913
|
+
export declare function createValidateStringify<T>(): (input: unknown) => IValidation<string>;
|