typia 5.0.0-dev.20230711 → 5.0.0-dev.20230715
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 +22 -17
- package/lib/factories/MetadataCollection.js +1 -0
- package/lib/factories/MetadataCollection.js.map +1 -1
- package/lib/factories/internal/metadata/{emplace_metadata_definition.d.ts → emplace_metadata_alias.d.ts} +1 -1
- package/lib/factories/internal/metadata/{emplace_metadata_definition.js → emplace_metadata_alias.js} +17 -5
- package/lib/factories/internal/metadata/emplace_metadata_alias.js.map +1 -0
- package/lib/factories/internal/metadata/iterate_metadata_alias.js +2 -2
- package/lib/factories/internal/metadata/iterate_metadata_alias.js.map +1 -1
- package/lib/factories/internal/metadata/iterate_metadata_collection.js +4 -4
- package/lib/factories/internal/metadata/iterate_metadata_collection.js.map +1 -1
- package/lib/functional/$number.js +2 -2
- package/lib/functional/$number.js.map +1 -1
- package/lib/json.d.ts +455 -0
- package/lib/json.js +85 -0
- package/lib/json.js.map +1 -0
- package/lib/metadata/IMetadataAlias.d.ts +3 -1
- package/lib/metadata/MetadataAlias.d.ts +2 -0
- package/lib/metadata/MetadataAlias.js +4 -1
- package/lib/metadata/MetadataAlias.js.map +1 -1
- package/lib/misc.d.ts +442 -0
- package/lib/misc.js +98 -0
- package/lib/misc.js.map +1 -0
- package/lib/module.d.ts +132 -1024
- package/lib/module.js +32 -189
- package/lib/module.js.map +1 -1
- package/lib/programmers/IsPruneProgrammer.js +2 -2
- package/lib/programmers/IsPruneProgrammer.js.map +1 -1
- package/lib/programmers/internal/application_alias.d.ts +2 -2
- package/lib/programmers/internal/application_alias.js +19 -3
- package/lib/programmers/internal/application_alias.js.map +1 -1
- package/lib/programmers/internal/application_array.js.map +1 -1
- package/lib/programmers/internal/application_native.js.map +1 -1
- package/lib/programmers/internal/application_object.js +1 -1
- package/lib/programmers/internal/application_object.js.map +1 -1
- package/lib/programmers/internal/application_resolved.d.ts +2 -2
- package/lib/programmers/internal/application_resolved.js.map +1 -1
- package/lib/programmers/internal/application_schema.js.map +1 -1
- package/lib/programmers/internal/application_tuple.js.map +1 -1
- package/lib/programmers/json/JsonApplicationProgrammer.d.ts +8 -0
- package/lib/programmers/{ApplicationProgrammer.js → json/JsonApplicationProgrammer.js} +8 -8
- package/lib/programmers/json/JsonApplicationProgrammer.js.map +1 -0
- package/lib/programmers/{AssertStringifyProgrammer.d.ts → json/JsonAssertParseProgrammer.d.ts} +2 -2
- package/lib/programmers/{AssertParseProgrammer.js → json/JsonAssertParseProgrammer.js} +10 -10
- package/lib/programmers/json/JsonAssertParseProgrammer.js.map +1 -0
- package/lib/programmers/json/JsonAssertStringifyProgrammer.d.ts +5 -0
- package/lib/programmers/{AssertStringifyProgrammer.js → json/JsonAssertStringifyProgrammer.js} +12 -12
- package/lib/programmers/json/JsonAssertStringifyProgrammer.js.map +1 -0
- package/lib/programmers/{IsCloneProgrammer.d.ts → json/JsonIsParseProgrammer.d.ts} +2 -2
- package/lib/programmers/{IsParseProgrammer.js → json/JsonIsParseProgrammer.js} +10 -10
- package/lib/programmers/json/JsonIsParseProgrammer.js.map +1 -0
- package/lib/programmers/{IsStringifyProgrammer.d.ts → json/JsonIsStringifyProgrammer.d.ts} +1 -1
- package/lib/programmers/{IsStringifyProgrammer.js → json/JsonIsStringifyProgrammer.js} +7 -7
- package/lib/programmers/json/JsonIsStringifyProgrammer.js.map +1 -0
- package/lib/programmers/{StringifyProgrammer.d.ts → json/JsonStringifyProgrammer.d.ts} +2 -2
- package/lib/programmers/{StringifyProgrammer.js → json/JsonStringifyProgrammer.js} +30 -30
- package/lib/programmers/json/JsonStringifyProgrammer.js.map +1 -0
- package/lib/programmers/json/JsonValidateParseProgrammer.d.ts +5 -0
- package/lib/programmers/{ValidateParseProgrammer.js → json/JsonValidateParseProgrammer.js} +10 -10
- package/lib/programmers/json/JsonValidateParseProgrammer.js.map +1 -0
- package/lib/programmers/json/JsonValidateStringifyProgrammer.d.ts +5 -0
- package/lib/programmers/{ValidateStringifyProgrammer.js → json/JsonValidateStringifyProgrammer.js} +12 -12
- package/lib/programmers/json/JsonValidateStringifyProgrammer.js.map +1 -0
- package/lib/programmers/{AssertParseProgrammer.d.ts → misc/MiscAssertCloneProgrammer.d.ts} +2 -2
- package/lib/programmers/{AssertCloneProgrammer.js → misc/MiscAssertCloneProgrammer.js} +12 -12
- package/lib/programmers/misc/MiscAssertCloneProgrammer.js.map +1 -0
- package/lib/programmers/{AssertPruneProgrammer.d.ts → misc/MiscAssertPruneProgrammer.d.ts} +2 -2
- package/lib/programmers/{AssertPruneProgrammer.js → misc/MiscAssertPruneProgrammer.js} +12 -12
- package/lib/programmers/misc/MiscAssertPruneProgrammer.js.map +1 -0
- package/lib/programmers/{CloneProgrammer.d.ts → misc/MiscCloneProgrammer.d.ts} +2 -2
- package/lib/programmers/{CloneProgrammer.js → misc/MiscCloneProgrammer.js} +20 -20
- package/lib/programmers/misc/MiscCloneProgrammer.js.map +1 -0
- package/lib/programmers/{AssertCloneProgrammer.d.ts → misc/MiscIsCloneProgrammer.d.ts} +2 -2
- package/lib/programmers/{IsCloneProgrammer.js → misc/MiscIsCloneProgrammer.js} +12 -12
- package/lib/programmers/misc/MiscIsCloneProgrammer.js.map +1 -0
- package/lib/programmers/{LiteralsProgrammer.d.ts → misc/MiscLiteralsProgrammer.d.ts} +2 -2
- package/lib/programmers/{LiteralsProgrammer.js → misc/MiscLiteralsProgrammer.js} +12 -11
- package/lib/programmers/misc/MiscLiteralsProgrammer.js.map +1 -0
- package/lib/programmers/{PruneProgrammer.d.ts → misc/MiscPruneProgrammer.d.ts} +2 -2
- package/lib/programmers/{PruneProgrammer.js → misc/MiscPruneProgrammer.js} +20 -20
- package/lib/programmers/misc/MiscPruneProgrammer.js.map +1 -0
- package/lib/programmers/misc/MiscValidateCloneProgrammer.d.ts +5 -0
- package/lib/programmers/{ValidateCloneProgrammer.js → misc/MiscValidateCloneProgrammer.js} +12 -12
- package/lib/programmers/misc/MiscValidateCloneProgrammer.js.map +1 -0
- package/lib/programmers/misc/MiscValidatePruneProgrammer.d.ts +5 -0
- package/lib/programmers/{ValidatePruneProgrammer.js → misc/MiscValidatePruneProgrammer.js} +12 -12
- package/lib/programmers/misc/MiscValidatePruneProgrammer.js.map +1 -0
- package/lib/programmers/{MessageProgrammer.d.ts → protobuf/ProtobufMessageProgrammer.d.ts} +2 -2
- package/lib/programmers/{MessageProgrammer.js → protobuf/ProtobufMessageProgrammer.js} +11 -11
- package/lib/programmers/protobuf/ProtobufMessageProgrammer.js.map +1 -0
- package/lib/protobuf.d.ts +16 -0
- package/lib/protobuf.js +43 -0
- package/lib/protobuf.js.map +1 -0
- package/lib/transformers/CallExpressionTransformer.js +122 -103
- package/lib/transformers/CallExpressionTransformer.js.map +1 -1
- package/lib/transformers/features/AssertTransformer.d.ts +3 -0
- package/lib/transformers/features/{validators/AssertTransformer.js → AssertTransformer.js} +2 -2
- package/lib/transformers/features/AssertTransformer.js.map +1 -0
- package/lib/transformers/features/CreateAssertTransformer.d.ts +3 -0
- package/lib/transformers/features/{validators/CreateAssertTransformer.js → CreateAssertTransformer.js} +2 -2
- package/lib/transformers/features/CreateAssertTransformer.js.map +1 -0
- package/lib/transformers/features/CreateIsTransformer.d.ts +3 -0
- package/lib/transformers/features/{validators/CreateIsTransformer.js → CreateIsTransformer.js} +2 -2
- package/lib/transformers/features/CreateIsTransformer.js.map +1 -0
- package/lib/transformers/features/{miscellaneous/CreateRandomTransformer.d.ts → CreateRandomTransformer.d.ts} +1 -1
- package/lib/transformers/features/{miscellaneous/CreateRandomTransformer.js → CreateRandomTransformer.js} +1 -1
- package/lib/transformers/features/CreateRandomTransformer.js.map +1 -0
- package/lib/transformers/features/CreateValidateTransformer.d.ts +3 -0
- package/lib/transformers/features/{validators/CreateValidateTransformer.js → CreateValidateTransformer.js} +2 -2
- package/lib/transformers/features/CreateValidateTransformer.js.map +1 -0
- package/lib/transformers/features/IsTransformer.d.ts +3 -0
- package/lib/transformers/features/{validators/IsTransformer.js → IsTransformer.js} +2 -2
- package/lib/transformers/features/IsTransformer.js.map +1 -0
- package/lib/transformers/features/{miscellaneous/RandomTransformer.d.ts → RandomTransformer.d.ts} +1 -1
- package/lib/transformers/features/{miscellaneous/RandomTransformer.js → RandomTransformer.js} +1 -1
- package/lib/transformers/features/RandomTransformer.js.map +1 -0
- package/lib/transformers/features/ValidateTransformer.d.ts +3 -0
- package/lib/transformers/features/{validators/ValidateTransformer.js → ValidateTransformer.js} +2 -2
- package/lib/transformers/features/ValidateTransformer.js.map +1 -0
- package/lib/transformers/features/{parsers → json}/AssertParseTransformer.js +4 -2
- package/lib/transformers/features/json/AssertParseTransformer.js.map +1 -0
- package/lib/transformers/features/{stringifiers → json}/AssertStringifyTransformer.js +2 -2
- package/lib/transformers/features/json/AssertStringifyTransformer.js.map +1 -0
- package/lib/transformers/features/{parsers → json}/CreateAssertParseTransformer.js +4 -2
- package/lib/transformers/features/json/CreateAssertParseTransformer.js.map +1 -0
- package/lib/transformers/features/{stringifiers → json}/CreateAssertStringifyTransformer.js +2 -2
- package/lib/transformers/features/json/CreateAssertStringifyTransformer.js.map +1 -0
- package/lib/transformers/features/{parsers → json}/CreateIsParseTransformer.js +2 -2
- package/lib/transformers/features/json/CreateIsParseTransformer.js.map +1 -0
- package/lib/transformers/features/{stringifiers → json}/CreateIsStringifyTransformer.js +2 -2
- package/lib/transformers/features/json/CreateIsStringifyTransformer.js.map +1 -0
- package/lib/transformers/features/{stringifiers → json}/CreateStringifyTransformer.js +2 -2
- package/lib/transformers/features/json/CreateStringifyTransformer.js.map +1 -0
- package/lib/transformers/features/{parsers → json}/CreateValidateParseTransformer.js +4 -2
- package/lib/transformers/features/json/CreateValidateParseTransformer.js.map +1 -0
- package/lib/transformers/features/{stringifiers → json}/CreateValidateStringifyProgrammer.js +2 -2
- package/lib/transformers/features/json/CreateValidateStringifyProgrammer.js.map +1 -0
- package/lib/transformers/features/{parsers → json}/IsParseTransformer.js +2 -2
- package/lib/transformers/features/json/IsParseTransformer.js.map +1 -0
- package/lib/transformers/features/{stringifiers → json}/IsStringifyTransformer.js +2 -2
- package/lib/transformers/features/json/IsStringifyTransformer.js.map +1 -0
- package/lib/transformers/features/{stringifiers → json}/StringifyTransformer.js +2 -2
- package/lib/transformers/features/json/StringifyTransformer.js.map +1 -0
- package/lib/transformers/features/{parsers → json}/ValidateParseTransformer.js +4 -2
- package/lib/transformers/features/json/ValidateParseTransformer.js.map +1 -0
- package/lib/transformers/features/{stringifiers → json}/ValidateStringifyTransformer.js +2 -2
- package/lib/transformers/features/json/ValidateStringifyTransformer.js.map +1 -0
- package/lib/transformers/features/{miscellaneous → misc}/ApplicationTransformer.js +2 -2
- package/lib/transformers/features/misc/ApplicationTransformer.js.map +1 -0
- package/lib/transformers/features/{miscellaneous → misc}/AssertCloneTransformer.js +4 -2
- package/lib/transformers/features/misc/AssertCloneTransformer.js.map +1 -0
- package/lib/transformers/features/{miscellaneous → misc}/AssertPruneTransformer.js +4 -2
- package/lib/transformers/features/misc/AssertPruneTransformer.js.map +1 -0
- package/lib/transformers/features/{miscellaneous → misc}/CloneTransformer.js +2 -2
- package/lib/transformers/features/misc/CloneTransformer.js.map +1 -0
- package/lib/transformers/features/{miscellaneous → misc}/CreateAssertCloneTransformer.js +4 -2
- package/lib/transformers/features/misc/CreateAssertCloneTransformer.js.map +1 -0
- package/lib/transformers/features/{miscellaneous → misc}/CreateAssertPruneTransformer.js +4 -2
- package/lib/transformers/features/misc/CreateAssertPruneTransformer.js.map +1 -0
- package/lib/transformers/features/{miscellaneous → misc}/CreateCloneTransformer.js +2 -2
- package/lib/transformers/features/misc/CreateCloneTransformer.js.map +1 -0
- package/lib/transformers/features/{miscellaneous → misc}/CreateIsCloneTransformer.js +2 -2
- package/lib/transformers/features/misc/CreateIsCloneTransformer.js.map +1 -0
- package/lib/transformers/features/misc/CreateIsPruneTransformer.js.map +1 -0
- package/lib/transformers/features/{miscellaneous → misc}/CreatePruneTransformer.js +2 -2
- package/lib/transformers/features/misc/CreatePruneTransformer.js.map +1 -0
- package/lib/transformers/features/{miscellaneous → misc}/CreateValidateCloneTransformer.js +4 -2
- package/lib/transformers/features/misc/CreateValidateCloneTransformer.js.map +1 -0
- package/lib/transformers/features/{miscellaneous → misc}/CreateValidatePruneTransformer.js +4 -2
- package/lib/transformers/features/misc/CreateValidatePruneTransformer.js.map +1 -0
- package/lib/transformers/features/{miscellaneous → misc}/IsCloneTransformer.js +2 -2
- package/lib/transformers/features/misc/IsCloneTransformer.js.map +1 -0
- package/lib/transformers/features/misc/IsPruneTransformer.js.map +1 -0
- package/lib/transformers/features/{miscellaneous → misc}/LiteralsTransformer.js +2 -2
- package/lib/transformers/features/misc/LiteralsTransformer.js.map +1 -0
- package/lib/transformers/features/misc/MetadataTransformer.js.map +1 -0
- package/lib/transformers/features/{miscellaneous → misc}/PruneTransformer.js +2 -2
- package/lib/transformers/features/misc/PruneTransformer.js.map +1 -0
- package/lib/transformers/features/{miscellaneous → misc}/ValidateCloneTransformer.js +4 -2
- package/lib/transformers/features/misc/ValidateCloneTransformer.js.map +1 -0
- package/lib/transformers/features/{miscellaneous → misc}/ValidatePruneTransformer.js +4 -2
- package/lib/transformers/features/misc/ValidatePruneTransformer.js.map +1 -0
- package/lib/transformers/features/{protocols → protobuf}/MessageTransformer.js +2 -2
- package/lib/transformers/features/protobuf/MessageTransformer.js.map +1 -0
- package/package.json +1 -1
- package/src/factories/MetadataCollection.ts +1 -0
- package/src/factories/MetadataTagFactory.ts +362 -362
- package/src/factories/ProtocolFactory.ts +80 -80
- package/src/factories/internal/metadata/{emplace_metadata_definition.ts → emplace_metadata_alias.ts} +7 -2
- package/src/factories/internal/metadata/iterate_metadata_alias.ts +4 -4
- package/src/factories/internal/metadata/iterate_metadata_collection.ts +4 -4
- package/src/factories/internal/protocols/ProtocolMetadataUtil.ts +180 -180
- package/src/factories/internal/protocols/emplace_protocol_object.ts +25 -25
- package/src/factories/internal/protocols/emplace_protocol_property.ts +12 -12
- package/src/factories/internal/protocols/iterate_protocol_atomic.ts +34 -34
- package/src/factories/internal/protocols/iterate_protocol_constant.ts +27 -27
- package/src/factories/internal/protocols/iterate_protocol_main.ts +19 -19
- package/src/factories/internal/protocols/iterate_protocol_map.ts +58 -58
- package/src/factories/internal/protocols/iterate_protocol_metadata.ts +96 -96
- package/src/factories/internal/protocols/iterate_protocol_native.ts +34 -34
- package/src/factories/internal/protocols/iterate_protocol_never.ts +1 -1
- package/src/factories/internal/protocols/iterate_protocol_object.ts +110 -110
- package/src/factories/internal/protocols/iterate_protocol_repeated.ts +34 -34
- package/src/factories/internal/protocols/iterate_protocol_tuple.ts +29 -29
- package/src/functional/$number.ts +3 -2
- package/src/functional/$proto_bytes.ts +25 -25
- package/src/functional/$proto_field.ts +30 -30
- package/src/functional/$proto_float.ts +37 -37
- package/src/functional/$proto_i32.ts +29 -29
- package/src/functional/$proto_i64.ts +37 -37
- package/src/functional/$proto_size.ts +82 -82
- package/src/functional/$proto_string.ts +24 -24
- package/src/functional/$varint.ts +130 -130
- package/src/functional/$zigzag.ts +39 -39
- package/src/json.ts +648 -0
- package/src/messages/IProtocolMap.ts +5 -5
- package/src/messages/IProtocolMessage.ts +6 -6
- package/src/messages/IProtocolProperty.ts +13 -13
- package/src/metadata/IMetadataAlias.ts +3 -1
- package/src/metadata/IMetadataTag.ts +113 -113
- package/src/metadata/Metadata.ts +606 -606
- package/src/metadata/MetadataAlias.ts +6 -1
- package/src/misc.ts +651 -0
- package/src/module.ts +781 -2049
- package/src/programmers/IsPruneProgrammer.ts +2 -2
- package/src/programmers/internal/application_alias.ts +22 -3
- package/src/programmers/internal/application_array.ts +2 -2
- package/src/programmers/internal/application_native.ts +2 -2
- package/src/programmers/internal/application_number.ts +77 -77
- package/src/programmers/internal/application_object.ts +4 -4
- package/src/programmers/internal/application_resolved.ts +2 -2
- package/src/programmers/internal/application_schema.ts +2 -2
- package/src/programmers/internal/application_tuple.ts +2 -2
- package/src/programmers/{ApplicationProgrammer.ts → json/JsonApplicationProgrammer.ts} +6 -6
- package/src/programmers/{AssertParseProgrammer.ts → json/JsonAssertParseProgrammer.ts} +6 -6
- package/src/programmers/{AssertStringifyProgrammer.ts → json/JsonAssertStringifyProgrammer.ts} +8 -8
- package/src/programmers/{IsParseProgrammer.ts → json/JsonIsParseProgrammer.ts} +6 -6
- package/src/programmers/{IsStringifyProgrammer.ts → json/JsonIsStringifyProgrammer.ts} +7 -7
- package/src/programmers/{StringifyProgrammer.ts → json/JsonStringifyProgrammer.ts} +40 -39
- package/src/programmers/{ValidateParseProgrammer.ts → json/JsonValidateParseProgrammer.ts} +6 -6
- package/src/programmers/{ValidateStringifyProgrammer.ts → json/JsonValidateStringifyProgrammer.ts} +8 -8
- package/src/programmers/{AssertCloneProgrammer.ts → misc/MiscAssertCloneProgrammer.ts} +8 -8
- package/src/programmers/{AssertPruneProgrammer.ts → misc/MiscAssertPruneProgrammer.ts} +8 -8
- package/src/programmers/{CloneProgrammer.ts → misc/MiscCloneProgrammer.ts} +24 -24
- package/src/programmers/{IsCloneProgrammer.ts → misc/MiscIsCloneProgrammer.ts} +8 -8
- package/src/programmers/{LiteralsProgrammer.ts → misc/MiscLiteralsProgrammer.ts} +63 -62
- package/src/programmers/{PruneProgrammer.ts → misc/MiscPruneProgrammer.ts} +24 -24
- package/src/programmers/{ValidateCloneProgrammer.ts → misc/MiscValidateCloneProgrammer.ts} +8 -8
- package/src/programmers/{ValidatePruneProgrammer.ts → misc/MiscValidatePruneProgrammer.ts} +8 -8
- package/src/programmers/{MessageProgrammer.ts → protobuf/ProtobufMessageProgrammer.ts} +126 -126
- package/src/protobuf.ts +121 -0
- package/src/transformers/CallExpressionTransformer.ts +196 -186
- package/src/transformers/features/{validators/AssertTransformer.ts → AssertTransformer.ts} +2 -2
- package/src/transformers/features/{validators/CreateAssertTransformer.ts → CreateAssertTransformer.ts} +2 -2
- package/src/transformers/features/{validators/CreateIsTransformer.ts → CreateIsTransformer.ts} +2 -2
- package/src/transformers/features/{miscellaneous/CreateRandomTransformer.ts → CreateRandomTransformer.ts} +2 -2
- package/src/transformers/features/{validators/CreateValidateTransformer.ts → CreateValidateTransformer.ts} +2 -2
- package/src/transformers/features/{validators/IsTransformer.ts → IsTransformer.ts} +2 -2
- package/src/transformers/features/{miscellaneous/RandomTransformer.ts → RandomTransformer.ts} +2 -2
- package/src/transformers/features/{validators/ValidateTransformer.ts → ValidateTransformer.ts} +2 -2
- package/src/transformers/features/{parsers → json}/AssertParseTransformer.ts +3 -2
- package/src/transformers/features/{stringifiers → json}/AssertStringifyTransformer.ts +2 -2
- package/src/transformers/features/{parsers → json}/CreateAssertParseTransformer.ts +3 -2
- package/src/transformers/features/{stringifiers → json}/CreateAssertStringifyTransformer.ts +2 -2
- package/src/transformers/features/{parsers → json}/CreateIsParseTransformer.ts +2 -2
- package/src/transformers/features/{stringifiers → json}/CreateIsStringifyTransformer.ts +1 -1
- package/src/transformers/features/{stringifiers → json}/CreateStringifyTransformer.ts +2 -2
- package/src/transformers/features/{parsers → json}/CreateValidateParseTransformer.ts +3 -2
- package/src/transformers/features/{stringifiers → json}/CreateValidateStringifyProgrammer.ts +2 -2
- package/src/transformers/features/{parsers → json}/IsParseTransformer.ts +2 -2
- package/src/transformers/features/{stringifiers → json}/IsStringifyTransformer.ts +1 -1
- package/src/transformers/features/{stringifiers → json}/StringifyTransformer.ts +2 -2
- package/src/transformers/features/{parsers → json}/ValidateParseTransformer.ts +3 -2
- package/src/transformers/features/{stringifiers → json}/ValidateStringifyTransformer.ts +2 -2
- package/src/transformers/features/{miscellaneous → misc}/ApplicationTransformer.ts +102 -102
- package/src/transformers/features/{miscellaneous → misc}/AssertCloneTransformer.ts +3 -2
- package/src/transformers/features/{miscellaneous → misc}/AssertPruneTransformer.ts +3 -2
- package/src/transformers/features/{miscellaneous → misc}/CloneTransformer.ts +2 -2
- package/src/transformers/features/{miscellaneous → misc}/CreateAssertCloneTransformer.ts +3 -2
- package/src/transformers/features/{miscellaneous → misc}/CreateAssertPruneTransformer.ts +3 -2
- package/src/transformers/features/{miscellaneous → misc}/CreateCloneTransformer.ts +2 -2
- package/src/transformers/features/{miscellaneous → misc}/CreateIsCloneTransformer.ts +2 -2
- package/src/transformers/features/{miscellaneous → misc}/CreatePruneTransformer.ts +2 -2
- package/src/transformers/features/{miscellaneous → misc}/CreateValidateCloneTransformer.ts +3 -2
- package/src/transformers/features/{miscellaneous → misc}/CreateValidatePruneTransformer.ts +3 -2
- package/src/transformers/features/{miscellaneous → misc}/IsCloneTransformer.ts +2 -2
- package/src/transformers/features/{miscellaneous → misc}/LiteralsTransformer.ts +2 -2
- package/src/transformers/features/{miscellaneous → misc}/PruneTransformer.ts +2 -2
- package/src/transformers/features/{miscellaneous → misc}/ValidateCloneTransformer.ts +3 -2
- package/src/transformers/features/{miscellaneous → misc}/ValidatePruneTransformer.ts +3 -2
- package/src/transformers/features/{protocols → protobuf}/MessageTransformer.ts +31 -31
- package/src/utils/Escaper.ts +46 -46
- package/src/utils/NameEncoder.ts +32 -32
- package/lib/factories/internal/metadata/emplace_metadata_definition.js.map +0 -1
- package/lib/programmers/ApplicationProgrammer.d.ts +0 -8
- package/lib/programmers/ApplicationProgrammer.js.map +0 -1
- package/lib/programmers/AssertCloneProgrammer.js.map +0 -1
- package/lib/programmers/AssertParseProgrammer.js.map +0 -1
- package/lib/programmers/AssertPruneProgrammer.js.map +0 -1
- package/lib/programmers/AssertStringifyProgrammer.js.map +0 -1
- package/lib/programmers/CloneProgrammer.js.map +0 -1
- package/lib/programmers/IsCloneProgrammer.js.map +0 -1
- package/lib/programmers/IsParseProgrammer.d.ts +0 -5
- package/lib/programmers/IsParseProgrammer.js.map +0 -1
- package/lib/programmers/IsStringifyProgrammer.js.map +0 -1
- package/lib/programmers/LiteralsProgrammer.js.map +0 -1
- package/lib/programmers/MessageProgrammer.js.map +0 -1
- package/lib/programmers/PruneProgrammer.js.map +0 -1
- package/lib/programmers/StringifyProgrammer.js.map +0 -1
- package/lib/programmers/ValidateCloneProgrammer.d.ts +0 -5
- package/lib/programmers/ValidateCloneProgrammer.js.map +0 -1
- package/lib/programmers/ValidateParseProgrammer.d.ts +0 -5
- package/lib/programmers/ValidateParseProgrammer.js.map +0 -1
- package/lib/programmers/ValidatePruneProgrammer.d.ts +0 -5
- package/lib/programmers/ValidatePruneProgrammer.js.map +0 -1
- package/lib/programmers/ValidateStringifyProgrammer.d.ts +0 -5
- package/lib/programmers/ValidateStringifyProgrammer.js.map +0 -1
- package/lib/transformers/features/miscellaneous/ApplicationTransformer.js.map +0 -1
- package/lib/transformers/features/miscellaneous/AssertCloneTransformer.js.map +0 -1
- package/lib/transformers/features/miscellaneous/AssertPruneTransformer.js.map +0 -1
- package/lib/transformers/features/miscellaneous/CloneTransformer.js.map +0 -1
- package/lib/transformers/features/miscellaneous/CreateAssertCloneTransformer.js.map +0 -1
- package/lib/transformers/features/miscellaneous/CreateAssertPruneTransformer.js.map +0 -1
- package/lib/transformers/features/miscellaneous/CreateCloneTransformer.js.map +0 -1
- package/lib/transformers/features/miscellaneous/CreateIsCloneTransformer.js.map +0 -1
- package/lib/transformers/features/miscellaneous/CreateIsPruneTransformer.js.map +0 -1
- package/lib/transformers/features/miscellaneous/CreatePruneTransformer.js.map +0 -1
- package/lib/transformers/features/miscellaneous/CreateRandomTransformer.js.map +0 -1
- package/lib/transformers/features/miscellaneous/CreateValidateCloneTransformer.js.map +0 -1
- package/lib/transformers/features/miscellaneous/CreateValidatePruneTransformer.js.map +0 -1
- package/lib/transformers/features/miscellaneous/IsCloneTransformer.js.map +0 -1
- package/lib/transformers/features/miscellaneous/IsPruneTransformer.js.map +0 -1
- package/lib/transformers/features/miscellaneous/LiteralsTransformer.js.map +0 -1
- package/lib/transformers/features/miscellaneous/MetadataTransformer.js.map +0 -1
- package/lib/transformers/features/miscellaneous/PruneTransformer.js.map +0 -1
- package/lib/transformers/features/miscellaneous/RandomTransformer.js.map +0 -1
- package/lib/transformers/features/miscellaneous/ValidateCloneTransformer.js.map +0 -1
- package/lib/transformers/features/miscellaneous/ValidatePruneTransformer.js.map +0 -1
- package/lib/transformers/features/parsers/AssertParseTransformer.js.map +0 -1
- package/lib/transformers/features/parsers/CreateAssertParseTransformer.js.map +0 -1
- package/lib/transformers/features/parsers/CreateIsParseTransformer.js.map +0 -1
- package/lib/transformers/features/parsers/CreateValidateParseTransformer.js.map +0 -1
- package/lib/transformers/features/parsers/IsParseTransformer.js.map +0 -1
- package/lib/transformers/features/parsers/ValidateParseTransformer.js.map +0 -1
- package/lib/transformers/features/protocols/MessageTransformer.js.map +0 -1
- package/lib/transformers/features/stringifiers/AssertStringifyTransformer.js.map +0 -1
- package/lib/transformers/features/stringifiers/CreateAssertStringifyTransformer.js.map +0 -1
- package/lib/transformers/features/stringifiers/CreateIsStringifyTransformer.js.map +0 -1
- package/lib/transformers/features/stringifiers/CreateStringifyTransformer.js.map +0 -1
- package/lib/transformers/features/stringifiers/CreateValidateStringifyProgrammer.js.map +0 -1
- package/lib/transformers/features/stringifiers/IsStringifyTransformer.js.map +0 -1
- package/lib/transformers/features/stringifiers/StringifyTransformer.js.map +0 -1
- package/lib/transformers/features/stringifiers/ValidateStringifyTransformer.js.map +0 -1
- package/lib/transformers/features/validators/AssertTransformer.d.ts +0 -3
- package/lib/transformers/features/validators/AssertTransformer.js.map +0 -1
- package/lib/transformers/features/validators/CreateAssertTransformer.d.ts +0 -3
- package/lib/transformers/features/validators/CreateAssertTransformer.js.map +0 -1
- package/lib/transformers/features/validators/CreateIsTransformer.d.ts +0 -3
- package/lib/transformers/features/validators/CreateIsTransformer.js.map +0 -1
- package/lib/transformers/features/validators/CreateValidateTransformer.d.ts +0 -3
- package/lib/transformers/features/validators/CreateValidateTransformer.js.map +0 -1
- package/lib/transformers/features/validators/IsTransformer.d.ts +0 -3
- package/lib/transformers/features/validators/IsTransformer.js.map +0 -1
- package/lib/transformers/features/validators/ValidateTransformer.d.ts +0 -3
- package/lib/transformers/features/validators/ValidateTransformer.js.map +0 -1
- /package/lib/transformers/features/{parsers → json}/AssertParseTransformer.d.ts +0 -0
- /package/lib/transformers/features/{stringifiers → json}/AssertStringifyTransformer.d.ts +0 -0
- /package/lib/transformers/features/{parsers → json}/CreateAssertParseTransformer.d.ts +0 -0
- /package/lib/transformers/features/{stringifiers → json}/CreateAssertStringifyTransformer.d.ts +0 -0
- /package/lib/transformers/features/{parsers → json}/CreateIsParseTransformer.d.ts +0 -0
- /package/lib/transformers/features/{stringifiers → json}/CreateIsStringifyTransformer.d.ts +0 -0
- /package/lib/transformers/features/{stringifiers → json}/CreateStringifyTransformer.d.ts +0 -0
- /package/lib/transformers/features/{parsers → json}/CreateValidateParseTransformer.d.ts +0 -0
- /package/lib/transformers/features/{stringifiers → json}/CreateValidateStringifyProgrammer.d.ts +0 -0
- /package/lib/transformers/features/{parsers → json}/IsParseTransformer.d.ts +0 -0
- /package/lib/transformers/features/{stringifiers → json}/IsStringifyTransformer.d.ts +0 -0
- /package/lib/transformers/features/{stringifiers → json}/StringifyTransformer.d.ts +0 -0
- /package/lib/transformers/features/{parsers → json}/ValidateParseTransformer.d.ts +0 -0
- /package/lib/transformers/features/{stringifiers → json}/ValidateStringifyTransformer.d.ts +0 -0
- /package/lib/transformers/features/{miscellaneous → misc}/ApplicationTransformer.d.ts +0 -0
- /package/lib/transformers/features/{miscellaneous → misc}/AssertCloneTransformer.d.ts +0 -0
- /package/lib/transformers/features/{miscellaneous → misc}/AssertPruneTransformer.d.ts +0 -0
- /package/lib/transformers/features/{miscellaneous → misc}/CloneTransformer.d.ts +0 -0
- /package/lib/transformers/features/{miscellaneous → misc}/CreateAssertCloneTransformer.d.ts +0 -0
- /package/lib/transformers/features/{miscellaneous → misc}/CreateAssertPruneTransformer.d.ts +0 -0
- /package/lib/transformers/features/{miscellaneous → misc}/CreateCloneTransformer.d.ts +0 -0
- /package/lib/transformers/features/{miscellaneous → misc}/CreateIsCloneTransformer.d.ts +0 -0
- /package/lib/transformers/features/{miscellaneous → misc}/CreateIsPruneTransformer.d.ts +0 -0
- /package/lib/transformers/features/{miscellaneous → misc}/CreateIsPruneTransformer.js +0 -0
- /package/lib/transformers/features/{miscellaneous → misc}/CreatePruneTransformer.d.ts +0 -0
- /package/lib/transformers/features/{miscellaneous → misc}/CreateValidateCloneTransformer.d.ts +0 -0
- /package/lib/transformers/features/{miscellaneous → misc}/CreateValidatePruneTransformer.d.ts +0 -0
- /package/lib/transformers/features/{miscellaneous → misc}/IsCloneTransformer.d.ts +0 -0
- /package/lib/transformers/features/{miscellaneous → misc}/IsPruneTransformer.d.ts +0 -0
- /package/lib/transformers/features/{miscellaneous → misc}/IsPruneTransformer.js +0 -0
- /package/lib/transformers/features/{miscellaneous → misc}/LiteralsTransformer.d.ts +0 -0
- /package/lib/transformers/features/{miscellaneous → misc}/MetadataTransformer.d.ts +0 -0
- /package/lib/transformers/features/{miscellaneous → misc}/MetadataTransformer.js +0 -0
- /package/lib/transformers/features/{miscellaneous → misc}/PruneTransformer.d.ts +0 -0
- /package/lib/transformers/features/{miscellaneous → misc}/ValidateCloneTransformer.d.ts +0 -0
- /package/lib/transformers/features/{miscellaneous → misc}/ValidatePruneTransformer.d.ts +0 -0
- /package/lib/transformers/features/{protocols → protobuf}/MessageTransformer.d.ts +0 -0
- /package/src/transformers/features/{miscellaneous → misc}/CreateIsPruneTransformer.ts +0 -0
- /package/src/transformers/features/{miscellaneous → misc}/IsPruneTransformer.ts +0 -0
- /package/src/transformers/features/{miscellaneous → misc}/MetadataTransformer.ts +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
|
|
3
|
-
import { IdentifierFactory } from "
|
|
4
|
-
import { StatementFactory } from "
|
|
5
|
-
import { TypeFactory } from "
|
|
3
|
+
import { IdentifierFactory } from "../../factories/IdentifierFactory";
|
|
4
|
+
import { StatementFactory } from "../../factories/StatementFactory";
|
|
5
|
+
import { TypeFactory } from "../../factories/TypeFactory";
|
|
6
6
|
|
|
7
|
-
import { IProject } from "
|
|
7
|
+
import { IProject } from "../../transformers/IProject";
|
|
8
8
|
|
|
9
|
-
import { AssertProgrammer } from "
|
|
10
|
-
import {
|
|
9
|
+
import { AssertProgrammer } from "../AssertProgrammer";
|
|
10
|
+
import { MiscCloneProgrammer } from "./MiscCloneProgrammer";
|
|
11
11
|
|
|
12
|
-
export namespace
|
|
12
|
+
export namespace MiscAssertCloneProgrammer {
|
|
13
13
|
export const write =
|
|
14
14
|
(project: IProject) =>
|
|
15
15
|
(modulo: ts.LeftHandSideExpression) =>
|
|
@@ -39,7 +39,7 @@ export namespace AssertCloneProgrammer {
|
|
|
39
39
|
),
|
|
40
40
|
StatementFactory.constant(
|
|
41
41
|
"clone",
|
|
42
|
-
|
|
42
|
+
MiscCloneProgrammer.write({
|
|
43
43
|
...project,
|
|
44
44
|
options: {
|
|
45
45
|
...project.options,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
|
|
3
|
-
import { IdentifierFactory } from "
|
|
4
|
-
import { StatementFactory } from "
|
|
5
|
-
import { TypeFactory } from "
|
|
3
|
+
import { IdentifierFactory } from "../../factories/IdentifierFactory";
|
|
4
|
+
import { StatementFactory } from "../../factories/StatementFactory";
|
|
5
|
+
import { TypeFactory } from "../../factories/TypeFactory";
|
|
6
6
|
|
|
7
|
-
import { IProject } from "
|
|
7
|
+
import { IProject } from "../../transformers/IProject";
|
|
8
8
|
|
|
9
|
-
import { AssertProgrammer } from "
|
|
10
|
-
import {
|
|
9
|
+
import { AssertProgrammer } from "../AssertProgrammer";
|
|
10
|
+
import { MiscPruneProgrammer } from "./MiscPruneProgrammer";
|
|
11
11
|
|
|
12
|
-
export namespace
|
|
12
|
+
export namespace MiscAssertPruneProgrammer {
|
|
13
13
|
export const write =
|
|
14
14
|
(project: IProject) =>
|
|
15
15
|
(modulo: ts.LeftHandSideExpression) =>
|
|
@@ -37,7 +37,7 @@ export namespace AssertPruneProgrammer {
|
|
|
37
37
|
),
|
|
38
38
|
StatementFactory.constant(
|
|
39
39
|
"prune",
|
|
40
|
-
|
|
40
|
+
MiscPruneProgrammer.write({
|
|
41
41
|
...project,
|
|
42
42
|
options: {
|
|
43
43
|
...project.options,
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
|
|
3
|
-
import { ExpressionFactory } from "
|
|
4
|
-
import { IdentifierFactory } from "
|
|
5
|
-
import { MetadataCollection } from "
|
|
6
|
-
import { MetadataFactory } from "
|
|
7
|
-
import { StatementFactory } from "
|
|
8
|
-
import { TypeFactory } from "
|
|
9
|
-
|
|
10
|
-
import { IJsDocTagInfo } from "
|
|
11
|
-
import { IMetadataTag } from "
|
|
12
|
-
import { Metadata } from "
|
|
13
|
-
import { MetadataArray } from "
|
|
14
|
-
import { MetadataTuple } from "
|
|
15
|
-
|
|
16
|
-
import { IProject } from "
|
|
17
|
-
|
|
18
|
-
import { FeatureProgrammer } from "
|
|
19
|
-
import { IsProgrammer } from "
|
|
20
|
-
import { CloneJoiner } from "
|
|
21
|
-
import { FunctionImporter } from "
|
|
22
|
-
import { UnionExplorer } from "
|
|
23
|
-
import { decode_union_object } from "
|
|
24
|
-
import { wrap_metadata_rest_tuple } from "
|
|
25
|
-
|
|
26
|
-
export namespace
|
|
3
|
+
import { ExpressionFactory } from "../../factories/ExpressionFactory";
|
|
4
|
+
import { IdentifierFactory } from "../../factories/IdentifierFactory";
|
|
5
|
+
import { MetadataCollection } from "../../factories/MetadataCollection";
|
|
6
|
+
import { MetadataFactory } from "../../factories/MetadataFactory";
|
|
7
|
+
import { StatementFactory } from "../../factories/StatementFactory";
|
|
8
|
+
import { TypeFactory } from "../../factories/TypeFactory";
|
|
9
|
+
|
|
10
|
+
import { IJsDocTagInfo } from "../../metadata/IJsDocTagInfo";
|
|
11
|
+
import { IMetadataTag } from "../../metadata/IMetadataTag";
|
|
12
|
+
import { Metadata } from "../../metadata/Metadata";
|
|
13
|
+
import { MetadataArray } from "../../metadata/MetadataArray";
|
|
14
|
+
import { MetadataTuple } from "../../metadata/MetadataTuple";
|
|
15
|
+
|
|
16
|
+
import { IProject } from "../../transformers/IProject";
|
|
17
|
+
|
|
18
|
+
import { FeatureProgrammer } from "../FeatureProgrammer";
|
|
19
|
+
import { IsProgrammer } from "../IsProgrammer";
|
|
20
|
+
import { CloneJoiner } from "../helpers/CloneJoiner";
|
|
21
|
+
import { FunctionImporter } from "../helpers/FunctionImporeter";
|
|
22
|
+
import { UnionExplorer } from "../helpers/UnionExplorer";
|
|
23
|
+
import { decode_union_object } from "../internal/decode_union_object";
|
|
24
|
+
import { wrap_metadata_rest_tuple } from "../internal/wrap_metadata_rest_tuple";
|
|
25
|
+
|
|
26
|
+
export namespace MiscCloneProgrammer {
|
|
27
27
|
export const write =
|
|
28
28
|
(project: IProject) => (modulo: ts.LeftHandSideExpression) => {
|
|
29
29
|
const importer: FunctionImporter = new FunctionImporter();
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
|
|
3
|
-
import { IdentifierFactory } from "
|
|
4
|
-
import { StatementFactory } from "
|
|
5
|
-
import { TypeFactory } from "
|
|
3
|
+
import { IdentifierFactory } from "../../factories/IdentifierFactory";
|
|
4
|
+
import { StatementFactory } from "../../factories/StatementFactory";
|
|
5
|
+
import { TypeFactory } from "../../factories/TypeFactory";
|
|
6
6
|
|
|
7
|
-
import { IProject } from "
|
|
7
|
+
import { IProject } from "../../transformers/IProject";
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { IsProgrammer } from "../IsProgrammer";
|
|
10
|
+
import { MiscCloneProgrammer } from "./MiscCloneProgrammer";
|
|
11
11
|
|
|
12
|
-
export namespace
|
|
12
|
+
export namespace MiscIsCloneProgrammer {
|
|
13
13
|
export const write =
|
|
14
14
|
(project: IProject) =>
|
|
15
15
|
(modulo: ts.LeftHandSideExpression) =>
|
|
@@ -40,7 +40,7 @@ export namespace IsCloneProgrammer {
|
|
|
40
40
|
),
|
|
41
41
|
StatementFactory.constant(
|
|
42
42
|
"clone",
|
|
43
|
-
|
|
43
|
+
MiscCloneProgrammer.write({
|
|
44
44
|
...project,
|
|
45
45
|
options: {
|
|
46
46
|
...project.options,
|
|
@@ -1,62 +1,63 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
|
|
3
|
-
import { MetadataCollection } from "
|
|
4
|
-
import { MetadataFactory } from "
|
|
5
|
-
|
|
6
|
-
import { Metadata } from "
|
|
7
|
-
|
|
8
|
-
import { IProject } from "
|
|
9
|
-
|
|
10
|
-
import { Atomic } from "
|
|
11
|
-
|
|
12
|
-
import { ArrayUtil } from "
|
|
13
|
-
|
|
14
|
-
export namespace
|
|
15
|
-
export const write = (project: IProject) => (type: ts.Type) => {
|
|
16
|
-
const meta: Metadata = MetadataFactory.analyze(project.checker)({
|
|
17
|
-
resolve: true,
|
|
18
|
-
constant: true,
|
|
19
|
-
absorb: true,
|
|
20
|
-
validate: (meta) => {
|
|
21
|
-
const length: number =
|
|
22
|
-
meta.constants
|
|
23
|
-
.map((c) => c.values.length)
|
|
24
|
-
.reduce((a, b) => a + b, 0) +
|
|
25
|
-
meta.atomics.filter((type) => type === "boolean").length;
|
|
26
|
-
if (0 === length) throw new Error(ErrorMessages.NO);
|
|
27
|
-
else if (meta.size() !== length)
|
|
28
|
-
throw new Error(ErrorMessages.ONLY);
|
|
29
|
-
},
|
|
30
|
-
})(new MetadataCollection())(type);
|
|
31
|
-
const values: Set<Atomic.Type | null> = new Set([
|
|
32
|
-
...ArrayUtil.flat<Atomic.Type>(meta.constants.map((c) => c.values)),
|
|
33
|
-
...(meta.atomics.filter((type) => type === "boolean").length
|
|
34
|
-
? [true, false]
|
|
35
|
-
: []),
|
|
36
|
-
...meta.nullable ? [null] : []
|
|
37
|
-
]);
|
|
38
|
-
return ts.factory.createAsExpression(
|
|
39
|
-
ts.factory.createArrayLiteralExpression(
|
|
40
|
-
[...values].map((v) =>
|
|
41
|
-
v === null
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
|
|
3
|
+
import { MetadataCollection } from "../../factories/MetadataCollection";
|
|
4
|
+
import { MetadataFactory } from "../../factories/MetadataFactory";
|
|
5
|
+
|
|
6
|
+
import { Metadata } from "../../metadata/Metadata";
|
|
7
|
+
|
|
8
|
+
import { IProject } from "../../transformers/IProject";
|
|
9
|
+
|
|
10
|
+
import { Atomic } from "../../typings/Atomic";
|
|
11
|
+
|
|
12
|
+
import { ArrayUtil } from "../../utils/ArrayUtil";
|
|
13
|
+
|
|
14
|
+
export namespace MiscLiteralsProgrammer {
|
|
15
|
+
export const write = (project: IProject) => (type: ts.Type) => {
|
|
16
|
+
const meta: Metadata = MetadataFactory.analyze(project.checker)({
|
|
17
|
+
resolve: true,
|
|
18
|
+
constant: true,
|
|
19
|
+
absorb: true,
|
|
20
|
+
validate: (meta) => {
|
|
21
|
+
const length: number =
|
|
22
|
+
meta.constants
|
|
23
|
+
.map((c) => c.values.length)
|
|
24
|
+
.reduce((a, b) => a + b, 0) +
|
|
25
|
+
meta.atomics.filter((type) => type === "boolean").length;
|
|
26
|
+
if (0 === length) throw new Error(ErrorMessages.NO);
|
|
27
|
+
else if (meta.size() !== length)
|
|
28
|
+
throw new Error(ErrorMessages.ONLY);
|
|
29
|
+
},
|
|
30
|
+
})(new MetadataCollection())(type);
|
|
31
|
+
const values: Set<Atomic.Type | null> = new Set([
|
|
32
|
+
...ArrayUtil.flat<Atomic.Type>(meta.constants.map((c) => c.values)),
|
|
33
|
+
...(meta.atomics.filter((type) => type === "boolean").length
|
|
34
|
+
? [true, false]
|
|
35
|
+
: []),
|
|
36
|
+
...(meta.nullable ? [null] : []),
|
|
37
|
+
]);
|
|
38
|
+
return ts.factory.createAsExpression(
|
|
39
|
+
ts.factory.createArrayLiteralExpression(
|
|
40
|
+
[...values].map((v) =>
|
|
41
|
+
v === null
|
|
42
|
+
? ts.factory.createNull()
|
|
43
|
+
: typeof v === "boolean"
|
|
44
|
+
? v
|
|
45
|
+
? ts.factory.createTrue()
|
|
46
|
+
: ts.factory.createFalse()
|
|
47
|
+
: typeof v === "number"
|
|
48
|
+
? ts.factory.createNumericLiteral(v)
|
|
49
|
+
: typeof v === "bigint"
|
|
50
|
+
? ts.factory.createBigIntLiteral(v.toString())
|
|
51
|
+
: ts.factory.createStringLiteral(v),
|
|
52
|
+
),
|
|
53
|
+
true,
|
|
54
|
+
),
|
|
55
|
+
ts.factory.createTypeReferenceNode("const"),
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
enum ErrorMessages {
|
|
61
|
+
NO = "Error on typia.literals(): no literal type found.",
|
|
62
|
+
ONLY = "Error on typia.literals(): only literal type allowed.",
|
|
63
|
+
}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
|
|
3
|
-
import { ExpressionFactory } from "
|
|
4
|
-
import { IdentifierFactory } from "
|
|
5
|
-
import { MetadataCollection } from "
|
|
6
|
-
import { MetadataFactory } from "
|
|
7
|
-
import { StatementFactory } from "
|
|
8
|
-
import { TypeFactory } from "
|
|
9
|
-
|
|
10
|
-
import { IJsDocTagInfo } from "
|
|
11
|
-
import { IMetadataTag } from "
|
|
12
|
-
import { Metadata } from "
|
|
13
|
-
import { MetadataArray } from "
|
|
14
|
-
import { MetadataTuple } from "
|
|
15
|
-
|
|
16
|
-
import { IProject } from "
|
|
17
|
-
|
|
18
|
-
import { FeatureProgrammer } from "
|
|
19
|
-
import { IsProgrammer } from "
|
|
20
|
-
import { FunctionImporter } from "
|
|
21
|
-
import { PruneJoiner } from "
|
|
22
|
-
import { UnionExplorer } from "
|
|
23
|
-
import { decode_union_object } from "
|
|
24
|
-
import { wrap_metadata_rest_tuple } from "
|
|
25
|
-
|
|
26
|
-
export namespace
|
|
3
|
+
import { ExpressionFactory } from "../../factories/ExpressionFactory";
|
|
4
|
+
import { IdentifierFactory } from "../../factories/IdentifierFactory";
|
|
5
|
+
import { MetadataCollection } from "../../factories/MetadataCollection";
|
|
6
|
+
import { MetadataFactory } from "../../factories/MetadataFactory";
|
|
7
|
+
import { StatementFactory } from "../../factories/StatementFactory";
|
|
8
|
+
import { TypeFactory } from "../../factories/TypeFactory";
|
|
9
|
+
|
|
10
|
+
import { IJsDocTagInfo } from "../../metadata/IJsDocTagInfo";
|
|
11
|
+
import { IMetadataTag } from "../../metadata/IMetadataTag";
|
|
12
|
+
import { Metadata } from "../../metadata/Metadata";
|
|
13
|
+
import { MetadataArray } from "../../metadata/MetadataArray";
|
|
14
|
+
import { MetadataTuple } from "../../metadata/MetadataTuple";
|
|
15
|
+
|
|
16
|
+
import { IProject } from "../../transformers/IProject";
|
|
17
|
+
|
|
18
|
+
import { FeatureProgrammer } from "../FeatureProgrammer";
|
|
19
|
+
import { IsProgrammer } from "../IsProgrammer";
|
|
20
|
+
import { FunctionImporter } from "../helpers/FunctionImporeter";
|
|
21
|
+
import { PruneJoiner } from "../helpers/PruneJoiner";
|
|
22
|
+
import { UnionExplorer } from "../helpers/UnionExplorer";
|
|
23
|
+
import { decode_union_object } from "../internal/decode_union_object";
|
|
24
|
+
import { wrap_metadata_rest_tuple } from "../internal/wrap_metadata_rest_tuple";
|
|
25
|
+
|
|
26
|
+
export namespace MiscPruneProgrammer {
|
|
27
27
|
export const write =
|
|
28
28
|
(project: IProject) => (modulo: ts.LeftHandSideExpression) => {
|
|
29
29
|
const importer: FunctionImporter = new FunctionImporter();
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
|
|
3
|
-
import { IdentifierFactory } from "
|
|
4
|
-
import { StatementFactory } from "
|
|
5
|
-
import { TypeFactory } from "
|
|
3
|
+
import { IdentifierFactory } from "../../factories/IdentifierFactory";
|
|
4
|
+
import { StatementFactory } from "../../factories/StatementFactory";
|
|
5
|
+
import { TypeFactory } from "../../factories/TypeFactory";
|
|
6
6
|
|
|
7
|
-
import { IProject } from "
|
|
7
|
+
import { IProject } from "../../transformers/IProject";
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { ValidateProgrammer } from "../ValidateProgrammer";
|
|
10
|
+
import { MiscCloneProgrammer } from "./MiscCloneProgrammer";
|
|
11
11
|
|
|
12
|
-
export namespace
|
|
12
|
+
export namespace MiscValidateCloneProgrammer {
|
|
13
13
|
export const write =
|
|
14
14
|
(project: IProject) =>
|
|
15
15
|
(modulo: ts.LeftHandSideExpression) =>
|
|
@@ -43,7 +43,7 @@ export namespace ValidateCloneProgrammer {
|
|
|
43
43
|
),
|
|
44
44
|
StatementFactory.constant(
|
|
45
45
|
"clone",
|
|
46
|
-
|
|
46
|
+
MiscCloneProgrammer.write({
|
|
47
47
|
...project,
|
|
48
48
|
options: {
|
|
49
49
|
...project.options,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
|
|
3
|
-
import { IdentifierFactory } from "
|
|
4
|
-
import { StatementFactory } from "
|
|
5
|
-
import { TypeFactory } from "
|
|
3
|
+
import { IdentifierFactory } from "../../factories/IdentifierFactory";
|
|
4
|
+
import { StatementFactory } from "../../factories/StatementFactory";
|
|
5
|
+
import { TypeFactory } from "../../factories/TypeFactory";
|
|
6
6
|
|
|
7
|
-
import { IProject } from "
|
|
7
|
+
import { IProject } from "../../transformers/IProject";
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { ValidateProgrammer } from "../ValidateProgrammer";
|
|
10
|
+
import { MiscPruneProgrammer } from "./MiscPruneProgrammer";
|
|
11
11
|
|
|
12
|
-
export namespace
|
|
12
|
+
export namespace MiscValidatePruneProgrammer {
|
|
13
13
|
export const write =
|
|
14
14
|
(project: IProject) =>
|
|
15
15
|
(modulo: ts.LeftHandSideExpression) =>
|
|
@@ -43,7 +43,7 @@ export namespace ValidatePruneProgrammer {
|
|
|
43
43
|
),
|
|
44
44
|
StatementFactory.constant(
|
|
45
45
|
"prune",
|
|
46
|
-
|
|
46
|
+
MiscPruneProgrammer.write({
|
|
47
47
|
...project,
|
|
48
48
|
options: {
|
|
49
49
|
...project.options,
|