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.
Files changed (404) hide show
  1. package/README.md +22 -17
  2. package/lib/factories/MetadataCollection.js +1 -0
  3. package/lib/factories/MetadataCollection.js.map +1 -1
  4. package/lib/factories/internal/metadata/{emplace_metadata_definition.d.ts → emplace_metadata_alias.d.ts} +1 -1
  5. package/lib/factories/internal/metadata/{emplace_metadata_definition.js → emplace_metadata_alias.js} +17 -5
  6. package/lib/factories/internal/metadata/emplace_metadata_alias.js.map +1 -0
  7. package/lib/factories/internal/metadata/iterate_metadata_alias.js +2 -2
  8. package/lib/factories/internal/metadata/iterate_metadata_alias.js.map +1 -1
  9. package/lib/factories/internal/metadata/iterate_metadata_collection.js +4 -4
  10. package/lib/factories/internal/metadata/iterate_metadata_collection.js.map +1 -1
  11. package/lib/functional/$number.js +2 -2
  12. package/lib/functional/$number.js.map +1 -1
  13. package/lib/json.d.ts +455 -0
  14. package/lib/json.js +85 -0
  15. package/lib/json.js.map +1 -0
  16. package/lib/metadata/IMetadataAlias.d.ts +3 -1
  17. package/lib/metadata/MetadataAlias.d.ts +2 -0
  18. package/lib/metadata/MetadataAlias.js +4 -1
  19. package/lib/metadata/MetadataAlias.js.map +1 -1
  20. package/lib/misc.d.ts +442 -0
  21. package/lib/misc.js +98 -0
  22. package/lib/misc.js.map +1 -0
  23. package/lib/module.d.ts +132 -1024
  24. package/lib/module.js +32 -189
  25. package/lib/module.js.map +1 -1
  26. package/lib/programmers/IsPruneProgrammer.js +2 -2
  27. package/lib/programmers/IsPruneProgrammer.js.map +1 -1
  28. package/lib/programmers/internal/application_alias.d.ts +2 -2
  29. package/lib/programmers/internal/application_alias.js +19 -3
  30. package/lib/programmers/internal/application_alias.js.map +1 -1
  31. package/lib/programmers/internal/application_array.js.map +1 -1
  32. package/lib/programmers/internal/application_native.js.map +1 -1
  33. package/lib/programmers/internal/application_object.js +1 -1
  34. package/lib/programmers/internal/application_object.js.map +1 -1
  35. package/lib/programmers/internal/application_resolved.d.ts +2 -2
  36. package/lib/programmers/internal/application_resolved.js.map +1 -1
  37. package/lib/programmers/internal/application_schema.js.map +1 -1
  38. package/lib/programmers/internal/application_tuple.js.map +1 -1
  39. package/lib/programmers/json/JsonApplicationProgrammer.d.ts +8 -0
  40. package/lib/programmers/{ApplicationProgrammer.js → json/JsonApplicationProgrammer.js} +8 -8
  41. package/lib/programmers/json/JsonApplicationProgrammer.js.map +1 -0
  42. package/lib/programmers/{AssertStringifyProgrammer.d.ts → json/JsonAssertParseProgrammer.d.ts} +2 -2
  43. package/lib/programmers/{AssertParseProgrammer.js → json/JsonAssertParseProgrammer.js} +10 -10
  44. package/lib/programmers/json/JsonAssertParseProgrammer.js.map +1 -0
  45. package/lib/programmers/json/JsonAssertStringifyProgrammer.d.ts +5 -0
  46. package/lib/programmers/{AssertStringifyProgrammer.js → json/JsonAssertStringifyProgrammer.js} +12 -12
  47. package/lib/programmers/json/JsonAssertStringifyProgrammer.js.map +1 -0
  48. package/lib/programmers/{IsCloneProgrammer.d.ts → json/JsonIsParseProgrammer.d.ts} +2 -2
  49. package/lib/programmers/{IsParseProgrammer.js → json/JsonIsParseProgrammer.js} +10 -10
  50. package/lib/programmers/json/JsonIsParseProgrammer.js.map +1 -0
  51. package/lib/programmers/{IsStringifyProgrammer.d.ts → json/JsonIsStringifyProgrammer.d.ts} +1 -1
  52. package/lib/programmers/{IsStringifyProgrammer.js → json/JsonIsStringifyProgrammer.js} +7 -7
  53. package/lib/programmers/json/JsonIsStringifyProgrammer.js.map +1 -0
  54. package/lib/programmers/{StringifyProgrammer.d.ts → json/JsonStringifyProgrammer.d.ts} +2 -2
  55. package/lib/programmers/{StringifyProgrammer.js → json/JsonStringifyProgrammer.js} +30 -30
  56. package/lib/programmers/json/JsonStringifyProgrammer.js.map +1 -0
  57. package/lib/programmers/json/JsonValidateParseProgrammer.d.ts +5 -0
  58. package/lib/programmers/{ValidateParseProgrammer.js → json/JsonValidateParseProgrammer.js} +10 -10
  59. package/lib/programmers/json/JsonValidateParseProgrammer.js.map +1 -0
  60. package/lib/programmers/json/JsonValidateStringifyProgrammer.d.ts +5 -0
  61. package/lib/programmers/{ValidateStringifyProgrammer.js → json/JsonValidateStringifyProgrammer.js} +12 -12
  62. package/lib/programmers/json/JsonValidateStringifyProgrammer.js.map +1 -0
  63. package/lib/programmers/{AssertParseProgrammer.d.ts → misc/MiscAssertCloneProgrammer.d.ts} +2 -2
  64. package/lib/programmers/{AssertCloneProgrammer.js → misc/MiscAssertCloneProgrammer.js} +12 -12
  65. package/lib/programmers/misc/MiscAssertCloneProgrammer.js.map +1 -0
  66. package/lib/programmers/{AssertPruneProgrammer.d.ts → misc/MiscAssertPruneProgrammer.d.ts} +2 -2
  67. package/lib/programmers/{AssertPruneProgrammer.js → misc/MiscAssertPruneProgrammer.js} +12 -12
  68. package/lib/programmers/misc/MiscAssertPruneProgrammer.js.map +1 -0
  69. package/lib/programmers/{CloneProgrammer.d.ts → misc/MiscCloneProgrammer.d.ts} +2 -2
  70. package/lib/programmers/{CloneProgrammer.js → misc/MiscCloneProgrammer.js} +20 -20
  71. package/lib/programmers/misc/MiscCloneProgrammer.js.map +1 -0
  72. package/lib/programmers/{AssertCloneProgrammer.d.ts → misc/MiscIsCloneProgrammer.d.ts} +2 -2
  73. package/lib/programmers/{IsCloneProgrammer.js → misc/MiscIsCloneProgrammer.js} +12 -12
  74. package/lib/programmers/misc/MiscIsCloneProgrammer.js.map +1 -0
  75. package/lib/programmers/{LiteralsProgrammer.d.ts → misc/MiscLiteralsProgrammer.d.ts} +2 -2
  76. package/lib/programmers/{LiteralsProgrammer.js → misc/MiscLiteralsProgrammer.js} +12 -11
  77. package/lib/programmers/misc/MiscLiteralsProgrammer.js.map +1 -0
  78. package/lib/programmers/{PruneProgrammer.d.ts → misc/MiscPruneProgrammer.d.ts} +2 -2
  79. package/lib/programmers/{PruneProgrammer.js → misc/MiscPruneProgrammer.js} +20 -20
  80. package/lib/programmers/misc/MiscPruneProgrammer.js.map +1 -0
  81. package/lib/programmers/misc/MiscValidateCloneProgrammer.d.ts +5 -0
  82. package/lib/programmers/{ValidateCloneProgrammer.js → misc/MiscValidateCloneProgrammer.js} +12 -12
  83. package/lib/programmers/misc/MiscValidateCloneProgrammer.js.map +1 -0
  84. package/lib/programmers/misc/MiscValidatePruneProgrammer.d.ts +5 -0
  85. package/lib/programmers/{ValidatePruneProgrammer.js → misc/MiscValidatePruneProgrammer.js} +12 -12
  86. package/lib/programmers/misc/MiscValidatePruneProgrammer.js.map +1 -0
  87. package/lib/programmers/{MessageProgrammer.d.ts → protobuf/ProtobufMessageProgrammer.d.ts} +2 -2
  88. package/lib/programmers/{MessageProgrammer.js → protobuf/ProtobufMessageProgrammer.js} +11 -11
  89. package/lib/programmers/protobuf/ProtobufMessageProgrammer.js.map +1 -0
  90. package/lib/protobuf.d.ts +16 -0
  91. package/lib/protobuf.js +43 -0
  92. package/lib/protobuf.js.map +1 -0
  93. package/lib/transformers/CallExpressionTransformer.js +122 -103
  94. package/lib/transformers/CallExpressionTransformer.js.map +1 -1
  95. package/lib/transformers/features/AssertTransformer.d.ts +3 -0
  96. package/lib/transformers/features/{validators/AssertTransformer.js → AssertTransformer.js} +2 -2
  97. package/lib/transformers/features/AssertTransformer.js.map +1 -0
  98. package/lib/transformers/features/CreateAssertTransformer.d.ts +3 -0
  99. package/lib/transformers/features/{validators/CreateAssertTransformer.js → CreateAssertTransformer.js} +2 -2
  100. package/lib/transformers/features/CreateAssertTransformer.js.map +1 -0
  101. package/lib/transformers/features/CreateIsTransformer.d.ts +3 -0
  102. package/lib/transformers/features/{validators/CreateIsTransformer.js → CreateIsTransformer.js} +2 -2
  103. package/lib/transformers/features/CreateIsTransformer.js.map +1 -0
  104. package/lib/transformers/features/{miscellaneous/CreateRandomTransformer.d.ts → CreateRandomTransformer.d.ts} +1 -1
  105. package/lib/transformers/features/{miscellaneous/CreateRandomTransformer.js → CreateRandomTransformer.js} +1 -1
  106. package/lib/transformers/features/CreateRandomTransformer.js.map +1 -0
  107. package/lib/transformers/features/CreateValidateTransformer.d.ts +3 -0
  108. package/lib/transformers/features/{validators/CreateValidateTransformer.js → CreateValidateTransformer.js} +2 -2
  109. package/lib/transformers/features/CreateValidateTransformer.js.map +1 -0
  110. package/lib/transformers/features/IsTransformer.d.ts +3 -0
  111. package/lib/transformers/features/{validators/IsTransformer.js → IsTransformer.js} +2 -2
  112. package/lib/transformers/features/IsTransformer.js.map +1 -0
  113. package/lib/transformers/features/{miscellaneous/RandomTransformer.d.ts → RandomTransformer.d.ts} +1 -1
  114. package/lib/transformers/features/{miscellaneous/RandomTransformer.js → RandomTransformer.js} +1 -1
  115. package/lib/transformers/features/RandomTransformer.js.map +1 -0
  116. package/lib/transformers/features/ValidateTransformer.d.ts +3 -0
  117. package/lib/transformers/features/{validators/ValidateTransformer.js → ValidateTransformer.js} +2 -2
  118. package/lib/transformers/features/ValidateTransformer.js.map +1 -0
  119. package/lib/transformers/features/{parsers → json}/AssertParseTransformer.js +4 -2
  120. package/lib/transformers/features/json/AssertParseTransformer.js.map +1 -0
  121. package/lib/transformers/features/{stringifiers → json}/AssertStringifyTransformer.js +2 -2
  122. package/lib/transformers/features/json/AssertStringifyTransformer.js.map +1 -0
  123. package/lib/transformers/features/{parsers → json}/CreateAssertParseTransformer.js +4 -2
  124. package/lib/transformers/features/json/CreateAssertParseTransformer.js.map +1 -0
  125. package/lib/transformers/features/{stringifiers → json}/CreateAssertStringifyTransformer.js +2 -2
  126. package/lib/transformers/features/json/CreateAssertStringifyTransformer.js.map +1 -0
  127. package/lib/transformers/features/{parsers → json}/CreateIsParseTransformer.js +2 -2
  128. package/lib/transformers/features/json/CreateIsParseTransformer.js.map +1 -0
  129. package/lib/transformers/features/{stringifiers → json}/CreateIsStringifyTransformer.js +2 -2
  130. package/lib/transformers/features/json/CreateIsStringifyTransformer.js.map +1 -0
  131. package/lib/transformers/features/{stringifiers → json}/CreateStringifyTransformer.js +2 -2
  132. package/lib/transformers/features/json/CreateStringifyTransformer.js.map +1 -0
  133. package/lib/transformers/features/{parsers → json}/CreateValidateParseTransformer.js +4 -2
  134. package/lib/transformers/features/json/CreateValidateParseTransformer.js.map +1 -0
  135. package/lib/transformers/features/{stringifiers → json}/CreateValidateStringifyProgrammer.js +2 -2
  136. package/lib/transformers/features/json/CreateValidateStringifyProgrammer.js.map +1 -0
  137. package/lib/transformers/features/{parsers → json}/IsParseTransformer.js +2 -2
  138. package/lib/transformers/features/json/IsParseTransformer.js.map +1 -0
  139. package/lib/transformers/features/{stringifiers → json}/IsStringifyTransformer.js +2 -2
  140. package/lib/transformers/features/json/IsStringifyTransformer.js.map +1 -0
  141. package/lib/transformers/features/{stringifiers → json}/StringifyTransformer.js +2 -2
  142. package/lib/transformers/features/json/StringifyTransformer.js.map +1 -0
  143. package/lib/transformers/features/{parsers → json}/ValidateParseTransformer.js +4 -2
  144. package/lib/transformers/features/json/ValidateParseTransformer.js.map +1 -0
  145. package/lib/transformers/features/{stringifiers → json}/ValidateStringifyTransformer.js +2 -2
  146. package/lib/transformers/features/json/ValidateStringifyTransformer.js.map +1 -0
  147. package/lib/transformers/features/{miscellaneous → misc}/ApplicationTransformer.js +2 -2
  148. package/lib/transformers/features/misc/ApplicationTransformer.js.map +1 -0
  149. package/lib/transformers/features/{miscellaneous → misc}/AssertCloneTransformer.js +4 -2
  150. package/lib/transformers/features/misc/AssertCloneTransformer.js.map +1 -0
  151. package/lib/transformers/features/{miscellaneous → misc}/AssertPruneTransformer.js +4 -2
  152. package/lib/transformers/features/misc/AssertPruneTransformer.js.map +1 -0
  153. package/lib/transformers/features/{miscellaneous → misc}/CloneTransformer.js +2 -2
  154. package/lib/transformers/features/misc/CloneTransformer.js.map +1 -0
  155. package/lib/transformers/features/{miscellaneous → misc}/CreateAssertCloneTransformer.js +4 -2
  156. package/lib/transformers/features/misc/CreateAssertCloneTransformer.js.map +1 -0
  157. package/lib/transformers/features/{miscellaneous → misc}/CreateAssertPruneTransformer.js +4 -2
  158. package/lib/transformers/features/misc/CreateAssertPruneTransformer.js.map +1 -0
  159. package/lib/transformers/features/{miscellaneous → misc}/CreateCloneTransformer.js +2 -2
  160. package/lib/transformers/features/misc/CreateCloneTransformer.js.map +1 -0
  161. package/lib/transformers/features/{miscellaneous → misc}/CreateIsCloneTransformer.js +2 -2
  162. package/lib/transformers/features/misc/CreateIsCloneTransformer.js.map +1 -0
  163. package/lib/transformers/features/misc/CreateIsPruneTransformer.js.map +1 -0
  164. package/lib/transformers/features/{miscellaneous → misc}/CreatePruneTransformer.js +2 -2
  165. package/lib/transformers/features/misc/CreatePruneTransformer.js.map +1 -0
  166. package/lib/transformers/features/{miscellaneous → misc}/CreateValidateCloneTransformer.js +4 -2
  167. package/lib/transformers/features/misc/CreateValidateCloneTransformer.js.map +1 -0
  168. package/lib/transformers/features/{miscellaneous → misc}/CreateValidatePruneTransformer.js +4 -2
  169. package/lib/transformers/features/misc/CreateValidatePruneTransformer.js.map +1 -0
  170. package/lib/transformers/features/{miscellaneous → misc}/IsCloneTransformer.js +2 -2
  171. package/lib/transformers/features/misc/IsCloneTransformer.js.map +1 -0
  172. package/lib/transformers/features/misc/IsPruneTransformer.js.map +1 -0
  173. package/lib/transformers/features/{miscellaneous → misc}/LiteralsTransformer.js +2 -2
  174. package/lib/transformers/features/misc/LiteralsTransformer.js.map +1 -0
  175. package/lib/transformers/features/misc/MetadataTransformer.js.map +1 -0
  176. package/lib/transformers/features/{miscellaneous → misc}/PruneTransformer.js +2 -2
  177. package/lib/transformers/features/misc/PruneTransformer.js.map +1 -0
  178. package/lib/transformers/features/{miscellaneous → misc}/ValidateCloneTransformer.js +4 -2
  179. package/lib/transformers/features/misc/ValidateCloneTransformer.js.map +1 -0
  180. package/lib/transformers/features/{miscellaneous → misc}/ValidatePruneTransformer.js +4 -2
  181. package/lib/transformers/features/misc/ValidatePruneTransformer.js.map +1 -0
  182. package/lib/transformers/features/{protocols → protobuf}/MessageTransformer.js +2 -2
  183. package/lib/transformers/features/protobuf/MessageTransformer.js.map +1 -0
  184. package/package.json +1 -1
  185. package/src/factories/MetadataCollection.ts +1 -0
  186. package/src/factories/MetadataTagFactory.ts +362 -362
  187. package/src/factories/ProtocolFactory.ts +80 -80
  188. package/src/factories/internal/metadata/{emplace_metadata_definition.ts → emplace_metadata_alias.ts} +7 -2
  189. package/src/factories/internal/metadata/iterate_metadata_alias.ts +4 -4
  190. package/src/factories/internal/metadata/iterate_metadata_collection.ts +4 -4
  191. package/src/factories/internal/protocols/ProtocolMetadataUtil.ts +180 -180
  192. package/src/factories/internal/protocols/emplace_protocol_object.ts +25 -25
  193. package/src/factories/internal/protocols/emplace_protocol_property.ts +12 -12
  194. package/src/factories/internal/protocols/iterate_protocol_atomic.ts +34 -34
  195. package/src/factories/internal/protocols/iterate_protocol_constant.ts +27 -27
  196. package/src/factories/internal/protocols/iterate_protocol_main.ts +19 -19
  197. package/src/factories/internal/protocols/iterate_protocol_map.ts +58 -58
  198. package/src/factories/internal/protocols/iterate_protocol_metadata.ts +96 -96
  199. package/src/factories/internal/protocols/iterate_protocol_native.ts +34 -34
  200. package/src/factories/internal/protocols/iterate_protocol_never.ts +1 -1
  201. package/src/factories/internal/protocols/iterate_protocol_object.ts +110 -110
  202. package/src/factories/internal/protocols/iterate_protocol_repeated.ts +34 -34
  203. package/src/factories/internal/protocols/iterate_protocol_tuple.ts +29 -29
  204. package/src/functional/$number.ts +3 -2
  205. package/src/functional/$proto_bytes.ts +25 -25
  206. package/src/functional/$proto_field.ts +30 -30
  207. package/src/functional/$proto_float.ts +37 -37
  208. package/src/functional/$proto_i32.ts +29 -29
  209. package/src/functional/$proto_i64.ts +37 -37
  210. package/src/functional/$proto_size.ts +82 -82
  211. package/src/functional/$proto_string.ts +24 -24
  212. package/src/functional/$varint.ts +130 -130
  213. package/src/functional/$zigzag.ts +39 -39
  214. package/src/json.ts +648 -0
  215. package/src/messages/IProtocolMap.ts +5 -5
  216. package/src/messages/IProtocolMessage.ts +6 -6
  217. package/src/messages/IProtocolProperty.ts +13 -13
  218. package/src/metadata/IMetadataAlias.ts +3 -1
  219. package/src/metadata/IMetadataTag.ts +113 -113
  220. package/src/metadata/Metadata.ts +606 -606
  221. package/src/metadata/MetadataAlias.ts +6 -1
  222. package/src/misc.ts +651 -0
  223. package/src/module.ts +781 -2049
  224. package/src/programmers/IsPruneProgrammer.ts +2 -2
  225. package/src/programmers/internal/application_alias.ts +22 -3
  226. package/src/programmers/internal/application_array.ts +2 -2
  227. package/src/programmers/internal/application_native.ts +2 -2
  228. package/src/programmers/internal/application_number.ts +77 -77
  229. package/src/programmers/internal/application_object.ts +4 -4
  230. package/src/programmers/internal/application_resolved.ts +2 -2
  231. package/src/programmers/internal/application_schema.ts +2 -2
  232. package/src/programmers/internal/application_tuple.ts +2 -2
  233. package/src/programmers/{ApplicationProgrammer.ts → json/JsonApplicationProgrammer.ts} +6 -6
  234. package/src/programmers/{AssertParseProgrammer.ts → json/JsonAssertParseProgrammer.ts} +6 -6
  235. package/src/programmers/{AssertStringifyProgrammer.ts → json/JsonAssertStringifyProgrammer.ts} +8 -8
  236. package/src/programmers/{IsParseProgrammer.ts → json/JsonIsParseProgrammer.ts} +6 -6
  237. package/src/programmers/{IsStringifyProgrammer.ts → json/JsonIsStringifyProgrammer.ts} +7 -7
  238. package/src/programmers/{StringifyProgrammer.ts → json/JsonStringifyProgrammer.ts} +40 -39
  239. package/src/programmers/{ValidateParseProgrammer.ts → json/JsonValidateParseProgrammer.ts} +6 -6
  240. package/src/programmers/{ValidateStringifyProgrammer.ts → json/JsonValidateStringifyProgrammer.ts} +8 -8
  241. package/src/programmers/{AssertCloneProgrammer.ts → misc/MiscAssertCloneProgrammer.ts} +8 -8
  242. package/src/programmers/{AssertPruneProgrammer.ts → misc/MiscAssertPruneProgrammer.ts} +8 -8
  243. package/src/programmers/{CloneProgrammer.ts → misc/MiscCloneProgrammer.ts} +24 -24
  244. package/src/programmers/{IsCloneProgrammer.ts → misc/MiscIsCloneProgrammer.ts} +8 -8
  245. package/src/programmers/{LiteralsProgrammer.ts → misc/MiscLiteralsProgrammer.ts} +63 -62
  246. package/src/programmers/{PruneProgrammer.ts → misc/MiscPruneProgrammer.ts} +24 -24
  247. package/src/programmers/{ValidateCloneProgrammer.ts → misc/MiscValidateCloneProgrammer.ts} +8 -8
  248. package/src/programmers/{ValidatePruneProgrammer.ts → misc/MiscValidatePruneProgrammer.ts} +8 -8
  249. package/src/programmers/{MessageProgrammer.ts → protobuf/ProtobufMessageProgrammer.ts} +126 -126
  250. package/src/protobuf.ts +121 -0
  251. package/src/transformers/CallExpressionTransformer.ts +196 -186
  252. package/src/transformers/features/{validators/AssertTransformer.ts → AssertTransformer.ts} +2 -2
  253. package/src/transformers/features/{validators/CreateAssertTransformer.ts → CreateAssertTransformer.ts} +2 -2
  254. package/src/transformers/features/{validators/CreateIsTransformer.ts → CreateIsTransformer.ts} +2 -2
  255. package/src/transformers/features/{miscellaneous/CreateRandomTransformer.ts → CreateRandomTransformer.ts} +2 -2
  256. package/src/transformers/features/{validators/CreateValidateTransformer.ts → CreateValidateTransformer.ts} +2 -2
  257. package/src/transformers/features/{validators/IsTransformer.ts → IsTransformer.ts} +2 -2
  258. package/src/transformers/features/{miscellaneous/RandomTransformer.ts → RandomTransformer.ts} +2 -2
  259. package/src/transformers/features/{validators/ValidateTransformer.ts → ValidateTransformer.ts} +2 -2
  260. package/src/transformers/features/{parsers → json}/AssertParseTransformer.ts +3 -2
  261. package/src/transformers/features/{stringifiers → json}/AssertStringifyTransformer.ts +2 -2
  262. package/src/transformers/features/{parsers → json}/CreateAssertParseTransformer.ts +3 -2
  263. package/src/transformers/features/{stringifiers → json}/CreateAssertStringifyTransformer.ts +2 -2
  264. package/src/transformers/features/{parsers → json}/CreateIsParseTransformer.ts +2 -2
  265. package/src/transformers/features/{stringifiers → json}/CreateIsStringifyTransformer.ts +1 -1
  266. package/src/transformers/features/{stringifiers → json}/CreateStringifyTransformer.ts +2 -2
  267. package/src/transformers/features/{parsers → json}/CreateValidateParseTransformer.ts +3 -2
  268. package/src/transformers/features/{stringifiers → json}/CreateValidateStringifyProgrammer.ts +2 -2
  269. package/src/transformers/features/{parsers → json}/IsParseTransformer.ts +2 -2
  270. package/src/transformers/features/{stringifiers → json}/IsStringifyTransformer.ts +1 -1
  271. package/src/transformers/features/{stringifiers → json}/StringifyTransformer.ts +2 -2
  272. package/src/transformers/features/{parsers → json}/ValidateParseTransformer.ts +3 -2
  273. package/src/transformers/features/{stringifiers → json}/ValidateStringifyTransformer.ts +2 -2
  274. package/src/transformers/features/{miscellaneous → misc}/ApplicationTransformer.ts +102 -102
  275. package/src/transformers/features/{miscellaneous → misc}/AssertCloneTransformer.ts +3 -2
  276. package/src/transformers/features/{miscellaneous → misc}/AssertPruneTransformer.ts +3 -2
  277. package/src/transformers/features/{miscellaneous → misc}/CloneTransformer.ts +2 -2
  278. package/src/transformers/features/{miscellaneous → misc}/CreateAssertCloneTransformer.ts +3 -2
  279. package/src/transformers/features/{miscellaneous → misc}/CreateAssertPruneTransformer.ts +3 -2
  280. package/src/transformers/features/{miscellaneous → misc}/CreateCloneTransformer.ts +2 -2
  281. package/src/transformers/features/{miscellaneous → misc}/CreateIsCloneTransformer.ts +2 -2
  282. package/src/transformers/features/{miscellaneous → misc}/CreatePruneTransformer.ts +2 -2
  283. package/src/transformers/features/{miscellaneous → misc}/CreateValidateCloneTransformer.ts +3 -2
  284. package/src/transformers/features/{miscellaneous → misc}/CreateValidatePruneTransformer.ts +3 -2
  285. package/src/transformers/features/{miscellaneous → misc}/IsCloneTransformer.ts +2 -2
  286. package/src/transformers/features/{miscellaneous → misc}/LiteralsTransformer.ts +2 -2
  287. package/src/transformers/features/{miscellaneous → misc}/PruneTransformer.ts +2 -2
  288. package/src/transformers/features/{miscellaneous → misc}/ValidateCloneTransformer.ts +3 -2
  289. package/src/transformers/features/{miscellaneous → misc}/ValidatePruneTransformer.ts +3 -2
  290. package/src/transformers/features/{protocols → protobuf}/MessageTransformer.ts +31 -31
  291. package/src/utils/Escaper.ts +46 -46
  292. package/src/utils/NameEncoder.ts +32 -32
  293. package/lib/factories/internal/metadata/emplace_metadata_definition.js.map +0 -1
  294. package/lib/programmers/ApplicationProgrammer.d.ts +0 -8
  295. package/lib/programmers/ApplicationProgrammer.js.map +0 -1
  296. package/lib/programmers/AssertCloneProgrammer.js.map +0 -1
  297. package/lib/programmers/AssertParseProgrammer.js.map +0 -1
  298. package/lib/programmers/AssertPruneProgrammer.js.map +0 -1
  299. package/lib/programmers/AssertStringifyProgrammer.js.map +0 -1
  300. package/lib/programmers/CloneProgrammer.js.map +0 -1
  301. package/lib/programmers/IsCloneProgrammer.js.map +0 -1
  302. package/lib/programmers/IsParseProgrammer.d.ts +0 -5
  303. package/lib/programmers/IsParseProgrammer.js.map +0 -1
  304. package/lib/programmers/IsStringifyProgrammer.js.map +0 -1
  305. package/lib/programmers/LiteralsProgrammer.js.map +0 -1
  306. package/lib/programmers/MessageProgrammer.js.map +0 -1
  307. package/lib/programmers/PruneProgrammer.js.map +0 -1
  308. package/lib/programmers/StringifyProgrammer.js.map +0 -1
  309. package/lib/programmers/ValidateCloneProgrammer.d.ts +0 -5
  310. package/lib/programmers/ValidateCloneProgrammer.js.map +0 -1
  311. package/lib/programmers/ValidateParseProgrammer.d.ts +0 -5
  312. package/lib/programmers/ValidateParseProgrammer.js.map +0 -1
  313. package/lib/programmers/ValidatePruneProgrammer.d.ts +0 -5
  314. package/lib/programmers/ValidatePruneProgrammer.js.map +0 -1
  315. package/lib/programmers/ValidateStringifyProgrammer.d.ts +0 -5
  316. package/lib/programmers/ValidateStringifyProgrammer.js.map +0 -1
  317. package/lib/transformers/features/miscellaneous/ApplicationTransformer.js.map +0 -1
  318. package/lib/transformers/features/miscellaneous/AssertCloneTransformer.js.map +0 -1
  319. package/lib/transformers/features/miscellaneous/AssertPruneTransformer.js.map +0 -1
  320. package/lib/transformers/features/miscellaneous/CloneTransformer.js.map +0 -1
  321. package/lib/transformers/features/miscellaneous/CreateAssertCloneTransformer.js.map +0 -1
  322. package/lib/transformers/features/miscellaneous/CreateAssertPruneTransformer.js.map +0 -1
  323. package/lib/transformers/features/miscellaneous/CreateCloneTransformer.js.map +0 -1
  324. package/lib/transformers/features/miscellaneous/CreateIsCloneTransformer.js.map +0 -1
  325. package/lib/transformers/features/miscellaneous/CreateIsPruneTransformer.js.map +0 -1
  326. package/lib/transformers/features/miscellaneous/CreatePruneTransformer.js.map +0 -1
  327. package/lib/transformers/features/miscellaneous/CreateRandomTransformer.js.map +0 -1
  328. package/lib/transformers/features/miscellaneous/CreateValidateCloneTransformer.js.map +0 -1
  329. package/lib/transformers/features/miscellaneous/CreateValidatePruneTransformer.js.map +0 -1
  330. package/lib/transformers/features/miscellaneous/IsCloneTransformer.js.map +0 -1
  331. package/lib/transformers/features/miscellaneous/IsPruneTransformer.js.map +0 -1
  332. package/lib/transformers/features/miscellaneous/LiteralsTransformer.js.map +0 -1
  333. package/lib/transformers/features/miscellaneous/MetadataTransformer.js.map +0 -1
  334. package/lib/transformers/features/miscellaneous/PruneTransformer.js.map +0 -1
  335. package/lib/transformers/features/miscellaneous/RandomTransformer.js.map +0 -1
  336. package/lib/transformers/features/miscellaneous/ValidateCloneTransformer.js.map +0 -1
  337. package/lib/transformers/features/miscellaneous/ValidatePruneTransformer.js.map +0 -1
  338. package/lib/transformers/features/parsers/AssertParseTransformer.js.map +0 -1
  339. package/lib/transformers/features/parsers/CreateAssertParseTransformer.js.map +0 -1
  340. package/lib/transformers/features/parsers/CreateIsParseTransformer.js.map +0 -1
  341. package/lib/transformers/features/parsers/CreateValidateParseTransformer.js.map +0 -1
  342. package/lib/transformers/features/parsers/IsParseTransformer.js.map +0 -1
  343. package/lib/transformers/features/parsers/ValidateParseTransformer.js.map +0 -1
  344. package/lib/transformers/features/protocols/MessageTransformer.js.map +0 -1
  345. package/lib/transformers/features/stringifiers/AssertStringifyTransformer.js.map +0 -1
  346. package/lib/transformers/features/stringifiers/CreateAssertStringifyTransformer.js.map +0 -1
  347. package/lib/transformers/features/stringifiers/CreateIsStringifyTransformer.js.map +0 -1
  348. package/lib/transformers/features/stringifiers/CreateStringifyTransformer.js.map +0 -1
  349. package/lib/transformers/features/stringifiers/CreateValidateStringifyProgrammer.js.map +0 -1
  350. package/lib/transformers/features/stringifiers/IsStringifyTransformer.js.map +0 -1
  351. package/lib/transformers/features/stringifiers/StringifyTransformer.js.map +0 -1
  352. package/lib/transformers/features/stringifiers/ValidateStringifyTransformer.js.map +0 -1
  353. package/lib/transformers/features/validators/AssertTransformer.d.ts +0 -3
  354. package/lib/transformers/features/validators/AssertTransformer.js.map +0 -1
  355. package/lib/transformers/features/validators/CreateAssertTransformer.d.ts +0 -3
  356. package/lib/transformers/features/validators/CreateAssertTransformer.js.map +0 -1
  357. package/lib/transformers/features/validators/CreateIsTransformer.d.ts +0 -3
  358. package/lib/transformers/features/validators/CreateIsTransformer.js.map +0 -1
  359. package/lib/transformers/features/validators/CreateValidateTransformer.d.ts +0 -3
  360. package/lib/transformers/features/validators/CreateValidateTransformer.js.map +0 -1
  361. package/lib/transformers/features/validators/IsTransformer.d.ts +0 -3
  362. package/lib/transformers/features/validators/IsTransformer.js.map +0 -1
  363. package/lib/transformers/features/validators/ValidateTransformer.d.ts +0 -3
  364. package/lib/transformers/features/validators/ValidateTransformer.js.map +0 -1
  365. /package/lib/transformers/features/{parsers → json}/AssertParseTransformer.d.ts +0 -0
  366. /package/lib/transformers/features/{stringifiers → json}/AssertStringifyTransformer.d.ts +0 -0
  367. /package/lib/transformers/features/{parsers → json}/CreateAssertParseTransformer.d.ts +0 -0
  368. /package/lib/transformers/features/{stringifiers → json}/CreateAssertStringifyTransformer.d.ts +0 -0
  369. /package/lib/transformers/features/{parsers → json}/CreateIsParseTransformer.d.ts +0 -0
  370. /package/lib/transformers/features/{stringifiers → json}/CreateIsStringifyTransformer.d.ts +0 -0
  371. /package/lib/transformers/features/{stringifiers → json}/CreateStringifyTransformer.d.ts +0 -0
  372. /package/lib/transformers/features/{parsers → json}/CreateValidateParseTransformer.d.ts +0 -0
  373. /package/lib/transformers/features/{stringifiers → json}/CreateValidateStringifyProgrammer.d.ts +0 -0
  374. /package/lib/transformers/features/{parsers → json}/IsParseTransformer.d.ts +0 -0
  375. /package/lib/transformers/features/{stringifiers → json}/IsStringifyTransformer.d.ts +0 -0
  376. /package/lib/transformers/features/{stringifiers → json}/StringifyTransformer.d.ts +0 -0
  377. /package/lib/transformers/features/{parsers → json}/ValidateParseTransformer.d.ts +0 -0
  378. /package/lib/transformers/features/{stringifiers → json}/ValidateStringifyTransformer.d.ts +0 -0
  379. /package/lib/transformers/features/{miscellaneous → misc}/ApplicationTransformer.d.ts +0 -0
  380. /package/lib/transformers/features/{miscellaneous → misc}/AssertCloneTransformer.d.ts +0 -0
  381. /package/lib/transformers/features/{miscellaneous → misc}/AssertPruneTransformer.d.ts +0 -0
  382. /package/lib/transformers/features/{miscellaneous → misc}/CloneTransformer.d.ts +0 -0
  383. /package/lib/transformers/features/{miscellaneous → misc}/CreateAssertCloneTransformer.d.ts +0 -0
  384. /package/lib/transformers/features/{miscellaneous → misc}/CreateAssertPruneTransformer.d.ts +0 -0
  385. /package/lib/transformers/features/{miscellaneous → misc}/CreateCloneTransformer.d.ts +0 -0
  386. /package/lib/transformers/features/{miscellaneous → misc}/CreateIsCloneTransformer.d.ts +0 -0
  387. /package/lib/transformers/features/{miscellaneous → misc}/CreateIsPruneTransformer.d.ts +0 -0
  388. /package/lib/transformers/features/{miscellaneous → misc}/CreateIsPruneTransformer.js +0 -0
  389. /package/lib/transformers/features/{miscellaneous → misc}/CreatePruneTransformer.d.ts +0 -0
  390. /package/lib/transformers/features/{miscellaneous → misc}/CreateValidateCloneTransformer.d.ts +0 -0
  391. /package/lib/transformers/features/{miscellaneous → misc}/CreateValidatePruneTransformer.d.ts +0 -0
  392. /package/lib/transformers/features/{miscellaneous → misc}/IsCloneTransformer.d.ts +0 -0
  393. /package/lib/transformers/features/{miscellaneous → misc}/IsPruneTransformer.d.ts +0 -0
  394. /package/lib/transformers/features/{miscellaneous → misc}/IsPruneTransformer.js +0 -0
  395. /package/lib/transformers/features/{miscellaneous → misc}/LiteralsTransformer.d.ts +0 -0
  396. /package/lib/transformers/features/{miscellaneous → misc}/MetadataTransformer.d.ts +0 -0
  397. /package/lib/transformers/features/{miscellaneous → misc}/MetadataTransformer.js +0 -0
  398. /package/lib/transformers/features/{miscellaneous → misc}/PruneTransformer.d.ts +0 -0
  399. /package/lib/transformers/features/{miscellaneous → misc}/ValidateCloneTransformer.d.ts +0 -0
  400. /package/lib/transformers/features/{miscellaneous → misc}/ValidatePruneTransformer.d.ts +0 -0
  401. /package/lib/transformers/features/{protocols → protobuf}/MessageTransformer.d.ts +0 -0
  402. /package/src/transformers/features/{miscellaneous → misc}/CreateIsPruneTransformer.ts +0 -0
  403. /package/src/transformers/features/{miscellaneous → misc}/IsPruneTransformer.ts +0 -0
  404. /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 "../factories/IdentifierFactory";
4
- import { StatementFactory } from "../factories/StatementFactory";
5
- import { TypeFactory } from "../factories/TypeFactory";
3
+ import { IdentifierFactory } from "../../factories/IdentifierFactory";
4
+ import { StatementFactory } from "../../factories/StatementFactory";
5
+ import { TypeFactory } from "../../factories/TypeFactory";
6
6
 
7
- import { IProject } from "../transformers/IProject";
7
+ import { IProject } from "../../transformers/IProject";
8
8
 
9
- import { AssertProgrammer } from "./AssertProgrammer";
10
- import { CloneProgrammer } from "./CloneProgrammer";
9
+ import { AssertProgrammer } from "../AssertProgrammer";
10
+ import { MiscCloneProgrammer } from "./MiscCloneProgrammer";
11
11
 
12
- export namespace AssertCloneProgrammer {
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
- CloneProgrammer.write({
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 "../factories/IdentifierFactory";
4
- import { StatementFactory } from "../factories/StatementFactory";
5
- import { TypeFactory } from "../factories/TypeFactory";
3
+ import { IdentifierFactory } from "../../factories/IdentifierFactory";
4
+ import { StatementFactory } from "../../factories/StatementFactory";
5
+ import { TypeFactory } from "../../factories/TypeFactory";
6
6
 
7
- import { IProject } from "../transformers/IProject";
7
+ import { IProject } from "../../transformers/IProject";
8
8
 
9
- import { AssertProgrammer } from "./AssertProgrammer";
10
- import { PruneProgrammer } from "./PruneProgrammer";
9
+ import { AssertProgrammer } from "../AssertProgrammer";
10
+ import { MiscPruneProgrammer } from "./MiscPruneProgrammer";
11
11
 
12
- export namespace AssertPruneProgrammer {
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
- PruneProgrammer.write({
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 "../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 CloneProgrammer {
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 "../factories/IdentifierFactory";
4
- import { StatementFactory } from "../factories/StatementFactory";
5
- import { TypeFactory } from "../factories/TypeFactory";
3
+ import { IdentifierFactory } from "../../factories/IdentifierFactory";
4
+ import { StatementFactory } from "../../factories/StatementFactory";
5
+ import { TypeFactory } from "../../factories/TypeFactory";
6
6
 
7
- import { IProject } from "../transformers/IProject";
7
+ import { IProject } from "../../transformers/IProject";
8
8
 
9
- import { CloneProgrammer } from "./CloneProgrammer";
10
- import { IsProgrammer } from "./IsProgrammer";
9
+ import { IsProgrammer } from "../IsProgrammer";
10
+ import { MiscCloneProgrammer } from "./MiscCloneProgrammer";
11
11
 
12
- export namespace IsCloneProgrammer {
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
- CloneProgrammer.write({
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 "../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 LiteralsProgrammer {
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 ? ts.factory.createNull()
42
- : typeof v === "boolean"
43
- ? v
44
- ? ts.factory.createTrue()
45
- : ts.factory.createFalse()
46
- : typeof v === "number"
47
- ? ts.factory.createNumericLiteral(v)
48
- : typeof v === "bigint"
49
- ? ts.factory.createBigIntLiteral(v.toString())
50
- : ts.factory.createStringLiteral(v),
51
- ),
52
- true,
53
- ),
54
- ts.factory.createTypeReferenceNode("const"),
55
- );
56
- };
57
- }
58
-
59
- enum ErrorMessages {
60
- NO = "Error on typia.literals(): no literal type found.",
61
- ONLY = "Error on typia.literals(): only literal type allowed.",
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 "../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 PruneProgrammer {
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 "../factories/IdentifierFactory";
4
- import { StatementFactory } from "../factories/StatementFactory";
5
- import { TypeFactory } from "../factories/TypeFactory";
3
+ import { IdentifierFactory } from "../../factories/IdentifierFactory";
4
+ import { StatementFactory } from "../../factories/StatementFactory";
5
+ import { TypeFactory } from "../../factories/TypeFactory";
6
6
 
7
- import { IProject } from "../transformers/IProject";
7
+ import { IProject } from "../../transformers/IProject";
8
8
 
9
- import { CloneProgrammer } from "./CloneProgrammer";
10
- import { ValidateProgrammer } from "./ValidateProgrammer";
9
+ import { ValidateProgrammer } from "../ValidateProgrammer";
10
+ import { MiscCloneProgrammer } from "./MiscCloneProgrammer";
11
11
 
12
- export namespace ValidateCloneProgrammer {
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
- CloneProgrammer.write({
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 "../factories/IdentifierFactory";
4
- import { StatementFactory } from "../factories/StatementFactory";
5
- import { TypeFactory } from "../factories/TypeFactory";
3
+ import { IdentifierFactory } from "../../factories/IdentifierFactory";
4
+ import { StatementFactory } from "../../factories/StatementFactory";
5
+ import { TypeFactory } from "../../factories/TypeFactory";
6
6
 
7
- import { IProject } from "../transformers/IProject";
7
+ import { IProject } from "../../transformers/IProject";
8
8
 
9
- import { PruneProgrammer } from "./PruneProgrammer";
10
- import { ValidateProgrammer } from "./ValidateProgrammer";
9
+ import { ValidateProgrammer } from "../ValidateProgrammer";
10
+ import { MiscPruneProgrammer } from "./MiscPruneProgrammer";
11
11
 
12
- export namespace ValidatePruneProgrammer {
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
- PruneProgrammer.write({
46
+ MiscPruneProgrammer.write({
47
47
  ...project,
48
48
  options: {
49
49
  ...project.options,