typia 5.0.0-dev.20230711 → 5.0.0-dev.20230713
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/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/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.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.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/{AssertPruneProgrammer.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/{AssertCloneProgrammer.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/{AssertParseProgrammer.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 +2 -0
- package/lib/protobuf.js +11 -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/MetadataTagFactory.ts +362 -362
- package/src/factories/ProtocolFactory.ts +80 -80
- 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/IMetadataTag.ts +113 -113
- package/src/metadata/Metadata.ts +606 -606
- 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 +2 -2
- 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 +3 -3
- 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 +18 -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/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,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JsonStringifyProgrammer } from "../../../programmers/json/JsonStringifyProgrammer";
|
|
2
2
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
5
|
export namespace StringifyTransformer {
|
|
6
6
|
export const transform = GenericTransformer.scalar("stringify")(
|
|
7
|
-
(project) => (modulo) =>
|
|
7
|
+
(project) => (modulo) => JsonStringifyProgrammer.write(project)(modulo),
|
|
8
8
|
);
|
|
9
9
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JsonValidateParseProgrammer } from "../../../programmers/json/JsonValidateParseProgrammer";
|
|
2
2
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
5
|
export namespace ValidateParseTransformer {
|
|
6
6
|
export const transform = GenericTransformer.scalar("validatParse")(
|
|
7
|
-
(project) => (modulo) =>
|
|
7
|
+
(project) => (modulo) =>
|
|
8
|
+
JsonValidateParseProgrammer.write(project)(modulo),
|
|
8
9
|
);
|
|
9
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JsonValidateStringifyProgrammer } from "../../../programmers/json/JsonValidateStringifyProgrammer";
|
|
2
2
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
5
|
export namespace ValidateStringifyTransformer {
|
|
6
6
|
export const transform = GenericTransformer.scalar("validatStringify")(
|
|
7
7
|
(project) => (modulo) =>
|
|
8
|
-
|
|
8
|
+
JsonValidateStringifyProgrammer.write(project)(modulo),
|
|
9
9
|
);
|
|
10
10
|
}
|
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
|
|
3
|
-
import { LiteralFactory } from "../../../factories/LiteralFactory";
|
|
4
|
-
import { MetadataCollection } from "../../../factories/MetadataCollection";
|
|
5
|
-
import { MetadataFactory } from "../../../factories/MetadataFactory";
|
|
6
|
-
|
|
7
|
-
import { Metadata } from "../../../metadata/Metadata";
|
|
8
|
-
import { IJsonApplication } from "../../../schemas/IJsonApplication";
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
import { IProject } from "../../IProject";
|
|
13
|
-
|
|
14
|
-
export namespace ApplicationTransformer {
|
|
15
|
-
export const transform =
|
|
16
|
-
({ checker }: IProject) =>
|
|
17
|
-
(expression: ts.CallExpression): ts.Expression => {
|
|
18
|
-
if (!expression.typeArguments?.length)
|
|
19
|
-
throw new Error(NO_GENERIC_ARGUMENT);
|
|
20
|
-
|
|
21
|
-
//----
|
|
22
|
-
// GET ARGUMENTS
|
|
23
|
-
//----
|
|
24
|
-
// VALIDATE TUPLE ARGUMENTS
|
|
25
|
-
const top: ts.Node = expression.typeArguments[0]!;
|
|
26
|
-
if (!ts.isTupleTypeNode(top)) return expression;
|
|
27
|
-
else if (top.elements.some((child) => !ts.isTypeNode(child)))
|
|
28
|
-
return expression;
|
|
29
|
-
|
|
30
|
-
// GET TYPES
|
|
31
|
-
const types: ts.Type[] = top.elements.map((child) =>
|
|
32
|
-
checker.getTypeFromTypeNode(child as ts.TypeNode),
|
|
33
|
-
);
|
|
34
|
-
if (types.some((t) => t.isTypeParameter()))
|
|
35
|
-
throw new Error(GENERIC_ARGUMENT);
|
|
36
|
-
|
|
37
|
-
// ADDITIONAL PARAMETERS
|
|
38
|
-
const purpose: "swagger" | "ajv" = get_parameter(
|
|
39
|
-
checker,
|
|
40
|
-
"Purpose",
|
|
41
|
-
expression.typeArguments[1],
|
|
42
|
-
(str) => str === "swagger" || str === "ajv",
|
|
43
|
-
() => "swagger",
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
//----
|
|
47
|
-
// GENERATORS
|
|
48
|
-
//----
|
|
49
|
-
// METADATA
|
|
50
|
-
const collection: MetadataCollection = new MetadataCollection();
|
|
51
|
-
const metadatas: Array<Metadata> = types.map((type) =>
|
|
52
|
-
MetadataFactory.analyze(checker)({
|
|
53
|
-
resolve: true,
|
|
54
|
-
constant: true,
|
|
55
|
-
absorb: false,
|
|
56
|
-
validate: (meta) => {
|
|
57
|
-
if (meta.atomics.find((str) => str === "bigint"))
|
|
58
|
-
throw new Error(NO_BIGIT);
|
|
59
|
-
},
|
|
60
|
-
})(collection)(type),
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
// APPLICATION
|
|
64
|
-
const app: IJsonApplication =
|
|
65
|
-
purpose,
|
|
66
|
-
})(metadatas);
|
|
67
|
-
|
|
68
|
-
// RETURNS WITH LITERAL EXPRESSION
|
|
69
|
-
return LiteralFactory.generate(app);
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
const get_parameter = <T extends string>(
|
|
73
|
-
checker: ts.TypeChecker,
|
|
74
|
-
name: string,
|
|
75
|
-
node: ts.TypeNode | undefined,
|
|
76
|
-
predicator: (value: string) => boolean,
|
|
77
|
-
defaulter: () => T,
|
|
78
|
-
): T => {
|
|
79
|
-
if (!node) return defaulter();
|
|
80
|
-
|
|
81
|
-
// CHECK LITERAL TYPE
|
|
82
|
-
const type: ts.Type = checker.getTypeFromTypeNode(node);
|
|
83
|
-
if (!type.isLiteral())
|
|
84
|
-
throw new Error(
|
|
85
|
-
`Error on typia.application(): generic argument "${name}" must be constant.`,
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
// GET VALUE AND VALIDATE IT
|
|
89
|
-
const value = type.value;
|
|
90
|
-
if (typeof value !== "string" || predicator(value) === false)
|
|
91
|
-
throw new Error(
|
|
92
|
-
`Error on typia.application(): invalid value on generic argument "${name}".`,
|
|
93
|
-
);
|
|
94
|
-
return value as T;
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const NO_GENERIC_ARGUMENT =
|
|
99
|
-
"Error on typia.application(): no generic argument.";
|
|
100
|
-
const GENERIC_ARGUMENT =
|
|
101
|
-
"Error on typia.application(): non-specified generic argument(s).";
|
|
102
|
-
const NO_BIGIT = "Error on typia.application(): does not allow bigint type.";
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
|
|
3
|
+
import { LiteralFactory } from "../../../factories/LiteralFactory";
|
|
4
|
+
import { MetadataCollection } from "../../../factories/MetadataCollection";
|
|
5
|
+
import { MetadataFactory } from "../../../factories/MetadataFactory";
|
|
6
|
+
|
|
7
|
+
import { Metadata } from "../../../metadata/Metadata";
|
|
8
|
+
import { IJsonApplication } from "../../../schemas/IJsonApplication";
|
|
9
|
+
|
|
10
|
+
import { JsonApplicationProgrammer } from "../../../programmers/json/JsonApplicationProgrammer";
|
|
11
|
+
|
|
12
|
+
import { IProject } from "../../IProject";
|
|
13
|
+
|
|
14
|
+
export namespace ApplicationTransformer {
|
|
15
|
+
export const transform =
|
|
16
|
+
({ checker }: IProject) =>
|
|
17
|
+
(expression: ts.CallExpression): ts.Expression => {
|
|
18
|
+
if (!expression.typeArguments?.length)
|
|
19
|
+
throw new Error(NO_GENERIC_ARGUMENT);
|
|
20
|
+
|
|
21
|
+
//----
|
|
22
|
+
// GET ARGUMENTS
|
|
23
|
+
//----
|
|
24
|
+
// VALIDATE TUPLE ARGUMENTS
|
|
25
|
+
const top: ts.Node = expression.typeArguments[0]!;
|
|
26
|
+
if (!ts.isTupleTypeNode(top)) return expression;
|
|
27
|
+
else if (top.elements.some((child) => !ts.isTypeNode(child)))
|
|
28
|
+
return expression;
|
|
29
|
+
|
|
30
|
+
// GET TYPES
|
|
31
|
+
const types: ts.Type[] = top.elements.map((child) =>
|
|
32
|
+
checker.getTypeFromTypeNode(child as ts.TypeNode),
|
|
33
|
+
);
|
|
34
|
+
if (types.some((t) => t.isTypeParameter()))
|
|
35
|
+
throw new Error(GENERIC_ARGUMENT);
|
|
36
|
+
|
|
37
|
+
// ADDITIONAL PARAMETERS
|
|
38
|
+
const purpose: "swagger" | "ajv" = get_parameter(
|
|
39
|
+
checker,
|
|
40
|
+
"Purpose",
|
|
41
|
+
expression.typeArguments[1],
|
|
42
|
+
(str) => str === "swagger" || str === "ajv",
|
|
43
|
+
() => "swagger",
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
//----
|
|
47
|
+
// GENERATORS
|
|
48
|
+
//----
|
|
49
|
+
// METADATA
|
|
50
|
+
const collection: MetadataCollection = new MetadataCollection();
|
|
51
|
+
const metadatas: Array<Metadata> = types.map((type) =>
|
|
52
|
+
MetadataFactory.analyze(checker)({
|
|
53
|
+
resolve: true,
|
|
54
|
+
constant: true,
|
|
55
|
+
absorb: false,
|
|
56
|
+
validate: (meta) => {
|
|
57
|
+
if (meta.atomics.find((str) => str === "bigint"))
|
|
58
|
+
throw new Error(NO_BIGIT);
|
|
59
|
+
},
|
|
60
|
+
})(collection)(type),
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
// APPLICATION
|
|
64
|
+
const app: IJsonApplication = JsonApplicationProgrammer.write({
|
|
65
|
+
purpose,
|
|
66
|
+
})(metadatas);
|
|
67
|
+
|
|
68
|
+
// RETURNS WITH LITERAL EXPRESSION
|
|
69
|
+
return LiteralFactory.generate(app);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const get_parameter = <T extends string>(
|
|
73
|
+
checker: ts.TypeChecker,
|
|
74
|
+
name: string,
|
|
75
|
+
node: ts.TypeNode | undefined,
|
|
76
|
+
predicator: (value: string) => boolean,
|
|
77
|
+
defaulter: () => T,
|
|
78
|
+
): T => {
|
|
79
|
+
if (!node) return defaulter();
|
|
80
|
+
|
|
81
|
+
// CHECK LITERAL TYPE
|
|
82
|
+
const type: ts.Type = checker.getTypeFromTypeNode(node);
|
|
83
|
+
if (!type.isLiteral())
|
|
84
|
+
throw new Error(
|
|
85
|
+
`Error on typia.application(): generic argument "${name}" must be constant.`,
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
// GET VALUE AND VALIDATE IT
|
|
89
|
+
const value = type.value;
|
|
90
|
+
if (typeof value !== "string" || predicator(value) === false)
|
|
91
|
+
throw new Error(
|
|
92
|
+
`Error on typia.application(): invalid value on generic argument "${name}".`,
|
|
93
|
+
);
|
|
94
|
+
return value as T;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const NO_GENERIC_ARGUMENT =
|
|
99
|
+
"Error on typia.application(): no generic argument.";
|
|
100
|
+
const GENERIC_ARGUMENT =
|
|
101
|
+
"Error on typia.application(): non-specified generic argument(s).";
|
|
102
|
+
const NO_BIGIT = "Error on typia.application(): does not allow bigint type.";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MiscAssertCloneProgrammer } from "../../../programmers/misc/MiscAssertCloneProgrammer";
|
|
2
2
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
5
|
export namespace AssertCloneTransformer {
|
|
6
6
|
export const transform = GenericTransformer.scalar("assertClone")(
|
|
7
|
-
(project) => (modulo) =>
|
|
7
|
+
(project) => (modulo) =>
|
|
8
|
+
MiscAssertCloneProgrammer.write(project)(modulo),
|
|
8
9
|
);
|
|
9
10
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MiscAssertPruneProgrammer } from "../../../programmers/misc/MiscAssertPruneProgrammer";
|
|
2
2
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
5
|
export namespace AssertPruneTransformer {
|
|
6
6
|
export const transform = GenericTransformer.scalar("assertPrune")(
|
|
7
|
-
(project) => (modulo) =>
|
|
7
|
+
(project) => (modulo) =>
|
|
8
|
+
MiscAssertPruneProgrammer.write(project)(modulo),
|
|
8
9
|
);
|
|
9
10
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MiscCloneProgrammer } from "../../../programmers/misc/MiscCloneProgrammer";
|
|
2
2
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
5
|
export namespace CloneTransformer {
|
|
6
6
|
export const transform = GenericTransformer.scalar("clone")(
|
|
7
|
-
(project) => (modulo) =>
|
|
7
|
+
(project) => (modulo) => MiscCloneProgrammer.write(project)(modulo),
|
|
8
8
|
);
|
|
9
9
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MiscAssertCloneProgrammer } from "../../../programmers/misc/MiscAssertCloneProgrammer";
|
|
2
2
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
5
|
export namespace CreateAssertCloneTransformer {
|
|
6
6
|
export const transform = GenericTransformer.factory("createAssertClone")(
|
|
7
|
-
(project) => (modulo) =>
|
|
7
|
+
(project) => (modulo) =>
|
|
8
|
+
MiscAssertCloneProgrammer.write(project)(modulo),
|
|
8
9
|
);
|
|
9
10
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MiscAssertPruneProgrammer } from "../../../programmers/misc/MiscAssertPruneProgrammer";
|
|
2
2
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
5
|
export namespace CreateAssertPruneTransformer {
|
|
6
6
|
export const transform = GenericTransformer.factory("createAssertPrune")(
|
|
7
|
-
(project) => (modulo) =>
|
|
7
|
+
(project) => (modulo) =>
|
|
8
|
+
MiscAssertPruneProgrammer.write(project)(modulo),
|
|
8
9
|
);
|
|
9
10
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MiscCloneProgrammer } from "../../../programmers/misc/MiscCloneProgrammer";
|
|
2
2
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
5
|
export namespace CreateCloneTransformer {
|
|
6
6
|
export const transform = GenericTransformer.factory("createClone")(
|
|
7
|
-
(project) => (modulo) =>
|
|
7
|
+
(project) => (modulo) => MiscCloneProgrammer.write(project)(modulo),
|
|
8
8
|
);
|
|
9
9
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MiscIsCloneProgrammer } from "../../../programmers/misc/MiscIsCloneProgrammer";
|
|
2
2
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
5
|
export namespace CreateIsCloneTransformer {
|
|
6
6
|
export const transform = GenericTransformer.factory("createIsClone")(
|
|
7
|
-
(project) => (modulo) =>
|
|
7
|
+
(project) => (modulo) => MiscIsCloneProgrammer.write(project)(modulo),
|
|
8
8
|
);
|
|
9
9
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MiscPruneProgrammer } from "../../../programmers/misc/MiscPruneProgrammer";
|
|
2
2
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
5
|
export namespace CreatePruneTransformer {
|
|
6
6
|
export const transform = GenericTransformer.factory("createPrune")(
|
|
7
|
-
(project) => (modulo) =>
|
|
7
|
+
(project) => (modulo) => MiscPruneProgrammer.write(project)(modulo),
|
|
8
8
|
);
|
|
9
9
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MiscValidateCloneProgrammer } from "../../../programmers/misc/MiscValidateCloneProgrammer";
|
|
2
2
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
5
|
export namespace CreateValidateCloneTransformer {
|
|
6
6
|
export const transform = GenericTransformer.factory("createValidateClone")(
|
|
7
|
-
(project) => (modulo) =>
|
|
7
|
+
(project) => (modulo) =>
|
|
8
|
+
MiscValidateCloneProgrammer.write(project)(modulo),
|
|
8
9
|
);
|
|
9
10
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MiscValidatePruneProgrammer } from "../../../programmers/misc/MiscValidatePruneProgrammer";
|
|
2
2
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
5
|
export namespace CreateValidatePruneTransformer {
|
|
6
6
|
export const transform = GenericTransformer.factory("createValidatePrune")(
|
|
7
|
-
(project) => (modulo) =>
|
|
7
|
+
(project) => (modulo) =>
|
|
8
|
+
MiscValidatePruneProgrammer.write(project)(modulo),
|
|
8
9
|
);
|
|
9
10
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MiscIsCloneProgrammer } from "../../../programmers/misc/MiscIsCloneProgrammer";
|
|
2
2
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
5
|
export namespace IsCloneTransformer {
|
|
6
6
|
export const transform = GenericTransformer.scalar("isClone")(
|
|
7
|
-
(project) => (modulo) =>
|
|
7
|
+
(project) => (modulo) => MiscIsCloneProgrammer.write(project)(modulo),
|
|
8
8
|
);
|
|
9
9
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { MiscLiteralsProgrammer } from "../../../programmers/misc/MiscLiteralsProgrammer";
|
|
4
4
|
|
|
5
5
|
import { IProject } from "../../IProject";
|
|
6
6
|
|
|
@@ -18,7 +18,7 @@ export namespace LiteralsTransformer {
|
|
|
18
18
|
if (type.isTypeParameter()) throw new Error(NO_GENERIC_ARGUMENT);
|
|
19
19
|
|
|
20
20
|
// DO TRANSFORM
|
|
21
|
-
return
|
|
21
|
+
return MiscLiteralsProgrammer.write(project)(type);
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MiscPruneProgrammer } from "../../../programmers/misc/MiscPruneProgrammer";
|
|
2
2
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
5
|
export namespace PruneTransformer {
|
|
6
6
|
export const transform = GenericTransformer.scalar("prune")(
|
|
7
|
-
(project) => (modulo) =>
|
|
7
|
+
(project) => (modulo) => MiscPruneProgrammer.write(project)(modulo),
|
|
8
8
|
);
|
|
9
9
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MiscValidateCloneProgrammer } from "../../../programmers/misc/MiscValidateCloneProgrammer";
|
|
2
2
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
5
|
export namespace ValidateCloneTransformer {
|
|
6
6
|
export const transform = GenericTransformer.scalar("validatClone")(
|
|
7
|
-
(project) => (modulo) =>
|
|
7
|
+
(project) => (modulo) =>
|
|
8
|
+
MiscValidateCloneProgrammer.write(project)(modulo),
|
|
8
9
|
);
|
|
9
10
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MiscValidatePruneProgrammer } from "../../../programmers/misc/MiscValidatePruneProgrammer";
|
|
2
2
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
5
|
export namespace ValidatePruneTransformer {
|
|
6
6
|
export const transform = GenericTransformer.scalar("validatPrune")(
|
|
7
|
-
(project) => (modulo) =>
|
|
7
|
+
(project) => (modulo) =>
|
|
8
|
+
MiscValidatePruneProgrammer.write(project)(modulo),
|
|
8
9
|
);
|
|
9
10
|
}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { IProject } from "../../IProject";
|
|
6
|
-
|
|
7
|
-
export namespace MessageTransformer {
|
|
8
|
-
export const transform =
|
|
9
|
-
(project: IProject) =>
|
|
10
|
-
(_modulo: ts.LeftHandSideExpression) =>
|
|
11
|
-
(expression: ts.CallExpression): ts.Expression => {
|
|
12
|
-
// CHECK GENERIC ARGUMENT EXISTENCE
|
|
13
|
-
if (!expression.typeArguments || !expression.typeArguments[0])
|
|
14
|
-
throw new Error(ErrorMessages.NOT_SPECIFIED);
|
|
15
|
-
|
|
16
|
-
// GET TYPE INFO
|
|
17
|
-
const type: ts.Type = project.checker.getTypeFromTypeNode(
|
|
18
|
-
expression.typeArguments[0],
|
|
19
|
-
);
|
|
20
|
-
if (type.isTypeParameter())
|
|
21
|
-
throw new Error(ErrorMessages.GENERIC_ARGUMENT);
|
|
22
|
-
|
|
23
|
-
// DO TRANSFORM
|
|
24
|
-
return
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const enum ErrorMessages {
|
|
29
|
-
NOT_SPECIFIED = "Error on typia.message(): generic argument is not specified.",
|
|
30
|
-
GENERIC_ARGUMENT = "Error on typia.message(): non-specified generic argument.",
|
|
31
|
-
}
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
|
|
3
|
+
import { ProtobufMessageProgrammer } from "../../../programmers/protobuf/ProtobufMessageProgrammer";
|
|
4
|
+
|
|
5
|
+
import { IProject } from "../../IProject";
|
|
6
|
+
|
|
7
|
+
export namespace MessageTransformer {
|
|
8
|
+
export const transform =
|
|
9
|
+
(project: IProject) =>
|
|
10
|
+
(_modulo: ts.LeftHandSideExpression) =>
|
|
11
|
+
(expression: ts.CallExpression): ts.Expression => {
|
|
12
|
+
// CHECK GENERIC ARGUMENT EXISTENCE
|
|
13
|
+
if (!expression.typeArguments || !expression.typeArguments[0])
|
|
14
|
+
throw new Error(ErrorMessages.NOT_SPECIFIED);
|
|
15
|
+
|
|
16
|
+
// GET TYPE INFO
|
|
17
|
+
const type: ts.Type = project.checker.getTypeFromTypeNode(
|
|
18
|
+
expression.typeArguments[0],
|
|
19
|
+
);
|
|
20
|
+
if (type.isTypeParameter())
|
|
21
|
+
throw new Error(ErrorMessages.GENERIC_ARGUMENT);
|
|
22
|
+
|
|
23
|
+
// DO TRANSFORM
|
|
24
|
+
return ProtobufMessageProgrammer.generate(project)(type);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const enum ErrorMessages {
|
|
29
|
+
NOT_SPECIFIED = "Error on typia.message(): generic argument is not specified.",
|
|
30
|
+
GENERIC_ARGUMENT = "Error on typia.message(): non-specified generic argument.",
|
|
31
|
+
}
|
package/src/utils/Escaper.ts
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
export namespace Escaper {
|
|
2
|
-
export const variable = (str: string): boolean =>
|
|
3
|
-
reserved(str) === false && /^[a-zA-Z_$][a-zA-Z_$0-9]*$/g.test(str);
|
|
4
|
-
|
|
5
|
-
export const reserved = (str: string): boolean => RESERVED.has(str);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const RESERVED: Set<string> = new Set([
|
|
9
|
-
"break",
|
|
10
|
-
"case",
|
|
11
|
-
"catch",
|
|
12
|
-
"class",
|
|
13
|
-
"const",
|
|
14
|
-
"continue",
|
|
15
|
-
"debugger",
|
|
16
|
-
"default",
|
|
17
|
-
"delete",
|
|
18
|
-
"do",
|
|
19
|
-
"else",
|
|
20
|
-
"enum",
|
|
21
|
-
"export",
|
|
22
|
-
"extends",
|
|
23
|
-
"false",
|
|
24
|
-
"finally",
|
|
25
|
-
"for",
|
|
26
|
-
"function",
|
|
27
|
-
"if",
|
|
28
|
-
"import",
|
|
29
|
-
"in",
|
|
30
|
-
"instanceof",
|
|
31
|
-
"new",
|
|
32
|
-
"null",
|
|
33
|
-
"package",
|
|
34
|
-
"return",
|
|
35
|
-
"super",
|
|
36
|
-
"switch",
|
|
37
|
-
"this",
|
|
38
|
-
"throw",
|
|
39
|
-
"true",
|
|
40
|
-
"try",
|
|
41
|
-
"typeof",
|
|
42
|
-
"var",
|
|
43
|
-
"void",
|
|
44
|
-
"while",
|
|
45
|
-
"with",
|
|
46
|
-
]);
|
|
1
|
+
export namespace Escaper {
|
|
2
|
+
export const variable = (str: string): boolean =>
|
|
3
|
+
reserved(str) === false && /^[a-zA-Z_$][a-zA-Z_$0-9]*$/g.test(str);
|
|
4
|
+
|
|
5
|
+
export const reserved = (str: string): boolean => RESERVED.has(str);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const RESERVED: Set<string> = new Set([
|
|
9
|
+
"break",
|
|
10
|
+
"case",
|
|
11
|
+
"catch",
|
|
12
|
+
"class",
|
|
13
|
+
"const",
|
|
14
|
+
"continue",
|
|
15
|
+
"debugger",
|
|
16
|
+
"default",
|
|
17
|
+
"delete",
|
|
18
|
+
"do",
|
|
19
|
+
"else",
|
|
20
|
+
"enum",
|
|
21
|
+
"export",
|
|
22
|
+
"extends",
|
|
23
|
+
"false",
|
|
24
|
+
"finally",
|
|
25
|
+
"for",
|
|
26
|
+
"function",
|
|
27
|
+
"if",
|
|
28
|
+
"import",
|
|
29
|
+
"in",
|
|
30
|
+
"instanceof",
|
|
31
|
+
"new",
|
|
32
|
+
"null",
|
|
33
|
+
"package",
|
|
34
|
+
"return",
|
|
35
|
+
"super",
|
|
36
|
+
"switch",
|
|
37
|
+
"this",
|
|
38
|
+
"throw",
|
|
39
|
+
"true",
|
|
40
|
+
"try",
|
|
41
|
+
"typeof",
|
|
42
|
+
"var",
|
|
43
|
+
"void",
|
|
44
|
+
"while",
|
|
45
|
+
"with",
|
|
46
|
+
]);
|