typia 4.1.6 → 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.
Files changed (466) hide show
  1. package/README.md +9 -1
  2. package/lib/factories/MetadataTagFactory.js +11 -4
  3. package/lib/factories/MetadataTagFactory.js.map +1 -1
  4. package/lib/factories/ProtocolFactory.d.ts +8 -0
  5. package/lib/factories/ProtocolFactory.js +113 -0
  6. package/lib/factories/ProtocolFactory.js.map +1 -0
  7. package/lib/factories/internal/protocols/ProtocolMetadataUtil.d.ts +16 -0
  8. package/lib/factories/internal/protocols/ProtocolMetadataUtil.js +173 -0
  9. package/lib/factories/internal/protocols/ProtocolMetadataUtil.js.map +1 -0
  10. package/lib/factories/internal/protocols/emplace_protocol_object.d.ts +3 -0
  11. package/lib/factories/internal/protocols/emplace_protocol_object.js +47 -0
  12. package/lib/factories/internal/protocols/emplace_protocol_object.js.map +1 -0
  13. package/lib/factories/internal/protocols/emplace_protocol_property.d.ts +4 -0
  14. package/lib/factories/internal/protocols/emplace_protocol_property.js +20 -0
  15. package/lib/factories/internal/protocols/emplace_protocol_property.js.map +1 -0
  16. package/lib/factories/internal/protocols/iterate_protocol_atomic.d.ts +3 -0
  17. package/lib/factories/internal/protocols/iterate_protocol_atomic.js +69 -0
  18. package/lib/factories/internal/protocols/iterate_protocol_atomic.js.map +1 -0
  19. package/lib/factories/internal/protocols/iterate_protocol_constant.d.ts +2 -0
  20. package/lib/factories/internal/protocols/iterate_protocol_constant.js +30 -0
  21. package/lib/factories/internal/protocols/iterate_protocol_constant.js.map +1 -0
  22. package/lib/factories/internal/protocols/iterate_protocol_main.d.ts +3 -0
  23. package/lib/factories/internal/protocols/iterate_protocol_main.js +17 -0
  24. package/lib/factories/internal/protocols/iterate_protocol_main.js.map +1 -0
  25. package/lib/factories/internal/protocols/iterate_protocol_map.d.ts +4 -0
  26. package/lib/factories/internal/protocols/iterate_protocol_map.js +75 -0
  27. package/lib/factories/internal/protocols/iterate_protocol_map.js.map +1 -0
  28. package/lib/factories/internal/protocols/iterate_protocol_metadata.d.ts +5 -0
  29. package/lib/factories/internal/protocols/iterate_protocol_metadata.js +190 -0
  30. package/lib/factories/internal/protocols/iterate_protocol_metadata.js.map +1 -0
  31. package/lib/factories/internal/protocols/iterate_protocol_native.d.ts +2 -0
  32. package/lib/factories/internal/protocols/iterate_protocol_native.js +33 -0
  33. package/lib/factories/internal/protocols/iterate_protocol_native.js.map +1 -0
  34. package/lib/factories/internal/protocols/iterate_protocol_never.d.ts +1 -0
  35. package/lib/factories/internal/protocols/iterate_protocol_never.js +6 -0
  36. package/lib/factories/internal/protocols/iterate_protocol_never.js.map +1 -0
  37. package/lib/factories/internal/protocols/iterate_protocol_object.d.ts +4 -0
  38. package/lib/factories/internal/protocols/iterate_protocol_object.js +157 -0
  39. package/lib/factories/internal/protocols/iterate_protocol_object.js.map +1 -0
  40. package/lib/factories/internal/protocols/iterate_protocol_repeated.d.ts +5 -0
  41. package/lib/factories/internal/protocols/iterate_protocol_repeated.js +25 -0
  42. package/lib/factories/internal/protocols/iterate_protocol_repeated.js.map +1 -0
  43. package/lib/factories/internal/protocols/iterate_protocol_tuple.d.ts +3 -0
  44. package/lib/factories/internal/protocols/iterate_protocol_tuple.js +46 -0
  45. package/lib/factories/internal/protocols/iterate_protocol_tuple.js.map +1 -0
  46. package/lib/functional/$number.js +2 -2
  47. package/lib/functional/$number.js.map +1 -1
  48. package/lib/functional/$proto_bytes.d.ts +2 -0
  49. package/lib/functional/$proto_bytes.js +37 -0
  50. package/lib/functional/$proto_bytes.js.map +1 -0
  51. package/lib/functional/$proto_field.d.ts +10 -0
  52. package/lib/functional/$proto_field.js +42 -0
  53. package/lib/functional/$proto_field.js.map +1 -0
  54. package/lib/functional/$proto_float.d.ts +4 -0
  55. package/lib/functional/$proto_float.js +28 -0
  56. package/lib/functional/$proto_float.js.map +1 -0
  57. package/lib/functional/$proto_i32.d.ts +2 -0
  58. package/lib/functional/$proto_i32.js +23 -0
  59. package/lib/functional/$proto_i32.js.map +1 -0
  60. package/lib/functional/$proto_i64.d.ts +2 -0
  61. package/lib/functional/$proto_i64.js +31 -0
  62. package/lib/functional/$proto_i64.js.map +1 -0
  63. package/lib/functional/$proto_size.d.ts +6 -0
  64. package/lib/functional/$proto_size.js +76 -0
  65. package/lib/functional/$proto_size.js.map +1 -0
  66. package/lib/functional/$proto_string.d.ts +2 -0
  67. package/lib/functional/$proto_string.js +34 -0
  68. package/lib/functional/$proto_string.js.map +1 -0
  69. package/lib/functional/$varint.d.ts +6 -0
  70. package/lib/functional/$varint.js +99 -0
  71. package/lib/functional/$varint.js.map +1 -0
  72. package/lib/functional/$zigzag.d.ts +4 -0
  73. package/lib/functional/$zigzag.js +34 -0
  74. package/lib/functional/$zigzag.js.map +1 -0
  75. package/lib/json.d.ts +455 -0
  76. package/lib/json.js +85 -0
  77. package/lib/json.js.map +1 -0
  78. package/lib/messages/IProtocolMap.d.ts +5 -0
  79. package/lib/messages/IProtocolMap.js +3 -0
  80. package/lib/messages/IProtocolMap.js.map +1 -0
  81. package/lib/messages/IProtocolMessage.d.ts +5 -0
  82. package/lib/messages/IProtocolMessage.js +3 -0
  83. package/lib/messages/IProtocolMessage.js.map +1 -0
  84. package/lib/messages/IProtocolProperty.d.ts +12 -0
  85. package/lib/messages/IProtocolProperty.js +3 -0
  86. package/lib/messages/IProtocolProperty.js.map +1 -0
  87. package/lib/metadata/IMetadataTag.d.ts +3 -3
  88. package/lib/metadata/Metadata.js.map +1 -1
  89. package/lib/misc.d.ts +442 -0
  90. package/lib/misc.js +98 -0
  91. package/lib/misc.js.map +1 -0
  92. package/lib/module.d.ts +132 -1022
  93. package/lib/module.js +32 -184
  94. package/lib/module.js.map +1 -1
  95. package/lib/programmers/IsPruneProgrammer.js +2 -2
  96. package/lib/programmers/IsPruneProgrammer.js.map +1 -1
  97. package/lib/programmers/internal/application_alias.d.ts +2 -2
  98. package/lib/programmers/internal/application_alias.js.map +1 -1
  99. package/lib/programmers/internal/application_array.js.map +1 -1
  100. package/lib/programmers/internal/application_native.js.map +1 -1
  101. package/lib/programmers/internal/application_number.js +8 -5
  102. package/lib/programmers/internal/application_number.js.map +1 -1
  103. package/lib/programmers/internal/application_object.js.map +1 -1
  104. package/lib/programmers/internal/application_resolved.d.ts +2 -2
  105. package/lib/programmers/internal/application_resolved.js.map +1 -1
  106. package/lib/programmers/internal/application_schema.js.map +1 -1
  107. package/lib/programmers/internal/application_tuple.js.map +1 -1
  108. package/lib/programmers/json/JsonApplicationProgrammer.d.ts +8 -0
  109. package/lib/programmers/{ApplicationProgrammer.js → json/JsonApplicationProgrammer.js} +8 -8
  110. package/lib/programmers/json/JsonApplicationProgrammer.js.map +1 -0
  111. package/lib/programmers/{AssertStringifyProgrammer.d.ts → json/JsonAssertParseProgrammer.d.ts} +2 -2
  112. package/lib/programmers/{AssertParseProgrammer.js → json/JsonAssertParseProgrammer.js} +10 -10
  113. package/lib/programmers/json/JsonAssertParseProgrammer.js.map +1 -0
  114. package/lib/programmers/json/JsonAssertStringifyProgrammer.d.ts +5 -0
  115. package/lib/programmers/{AssertStringifyProgrammer.js → json/JsonAssertStringifyProgrammer.js} +12 -12
  116. package/lib/programmers/json/JsonAssertStringifyProgrammer.js.map +1 -0
  117. package/lib/programmers/{IsCloneProgrammer.d.ts → json/JsonIsParseProgrammer.d.ts} +2 -2
  118. package/lib/programmers/{IsParseProgrammer.js → json/JsonIsParseProgrammer.js} +10 -10
  119. package/lib/programmers/json/JsonIsParseProgrammer.js.map +1 -0
  120. package/lib/programmers/{IsStringifyProgrammer.d.ts → json/JsonIsStringifyProgrammer.d.ts} +1 -1
  121. package/lib/programmers/{IsStringifyProgrammer.js → json/JsonIsStringifyProgrammer.js} +7 -7
  122. package/lib/programmers/json/JsonIsStringifyProgrammer.js.map +1 -0
  123. package/lib/programmers/{StringifyProgrammer.d.ts → json/JsonStringifyProgrammer.d.ts} +2 -2
  124. package/lib/programmers/{StringifyProgrammer.js → json/JsonStringifyProgrammer.js} +30 -30
  125. package/lib/programmers/json/JsonStringifyProgrammer.js.map +1 -0
  126. package/lib/programmers/json/JsonValidateParseProgrammer.d.ts +5 -0
  127. package/lib/programmers/{ValidateParseProgrammer.js → json/JsonValidateParseProgrammer.js} +10 -10
  128. package/lib/programmers/json/JsonValidateParseProgrammer.js.map +1 -0
  129. package/lib/programmers/json/JsonValidateStringifyProgrammer.d.ts +5 -0
  130. package/lib/programmers/{ValidateStringifyProgrammer.js → json/JsonValidateStringifyProgrammer.js} +12 -12
  131. package/lib/programmers/json/JsonValidateStringifyProgrammer.js.map +1 -0
  132. package/lib/programmers/{AssertPruneProgrammer.d.ts → misc/MiscAssertCloneProgrammer.d.ts} +2 -2
  133. package/lib/programmers/{AssertCloneProgrammer.js → misc/MiscAssertCloneProgrammer.js} +12 -12
  134. package/lib/programmers/misc/MiscAssertCloneProgrammer.js.map +1 -0
  135. package/lib/programmers/{AssertCloneProgrammer.d.ts → misc/MiscAssertPruneProgrammer.d.ts} +2 -2
  136. package/lib/programmers/{AssertPruneProgrammer.js → misc/MiscAssertPruneProgrammer.js} +12 -12
  137. package/lib/programmers/misc/MiscAssertPruneProgrammer.js.map +1 -0
  138. package/lib/programmers/{CloneProgrammer.d.ts → misc/MiscCloneProgrammer.d.ts} +2 -2
  139. package/lib/programmers/{CloneProgrammer.js → misc/MiscCloneProgrammer.js} +20 -20
  140. package/lib/programmers/misc/MiscCloneProgrammer.js.map +1 -0
  141. package/lib/programmers/{AssertParseProgrammer.d.ts → misc/MiscIsCloneProgrammer.d.ts} +2 -2
  142. package/lib/programmers/{IsCloneProgrammer.js → misc/MiscIsCloneProgrammer.js} +12 -12
  143. package/lib/programmers/misc/MiscIsCloneProgrammer.js.map +1 -0
  144. package/lib/programmers/{LiteralsProgrammer.d.ts → misc/MiscLiteralsProgrammer.d.ts} +2 -2
  145. package/lib/programmers/{LiteralsProgrammer.js → misc/MiscLiteralsProgrammer.js} +12 -11
  146. package/lib/programmers/misc/MiscLiteralsProgrammer.js.map +1 -0
  147. package/lib/programmers/{PruneProgrammer.d.ts → misc/MiscPruneProgrammer.d.ts} +2 -2
  148. package/lib/programmers/{PruneProgrammer.js → misc/MiscPruneProgrammer.js} +20 -20
  149. package/lib/programmers/misc/MiscPruneProgrammer.js.map +1 -0
  150. package/lib/programmers/misc/MiscValidateCloneProgrammer.d.ts +5 -0
  151. package/lib/programmers/{ValidateCloneProgrammer.js → misc/MiscValidateCloneProgrammer.js} +12 -12
  152. package/lib/programmers/misc/MiscValidateCloneProgrammer.js.map +1 -0
  153. package/lib/programmers/misc/MiscValidatePruneProgrammer.d.ts +5 -0
  154. package/lib/programmers/{ValidatePruneProgrammer.js → misc/MiscValidatePruneProgrammer.js} +12 -12
  155. package/lib/programmers/misc/MiscValidatePruneProgrammer.js.map +1 -0
  156. package/lib/programmers/protobuf/ProtobufMessageProgrammer.d.ts +5 -0
  157. package/lib/programmers/protobuf/ProtobufMessageProgrammer.js +141 -0
  158. package/lib/programmers/protobuf/ProtobufMessageProgrammer.js.map +1 -0
  159. package/lib/protobuf.d.ts +2 -0
  160. package/lib/protobuf.js +11 -0
  161. package/lib/protobuf.js.map +1 -0
  162. package/lib/transformers/CallExpressionTransformer.js +122 -101
  163. package/lib/transformers/CallExpressionTransformer.js.map +1 -1
  164. package/lib/transformers/features/AssertTransformer.d.ts +3 -0
  165. package/lib/transformers/features/{validators/AssertTransformer.js → AssertTransformer.js} +2 -2
  166. package/lib/transformers/features/AssertTransformer.js.map +1 -0
  167. package/lib/transformers/features/CreateAssertTransformer.d.ts +3 -0
  168. package/lib/transformers/features/{validators/CreateAssertTransformer.js → CreateAssertTransformer.js} +2 -2
  169. package/lib/transformers/features/CreateAssertTransformer.js.map +1 -0
  170. package/lib/transformers/features/CreateIsTransformer.d.ts +3 -0
  171. package/lib/transformers/features/{validators/CreateIsTransformer.js → CreateIsTransformer.js} +2 -2
  172. package/lib/transformers/features/CreateIsTransformer.js.map +1 -0
  173. package/lib/transformers/features/{miscellaneous/CreateRandomTransformer.d.ts → CreateRandomTransformer.d.ts} +1 -1
  174. package/lib/transformers/features/{miscellaneous/CreateRandomTransformer.js → CreateRandomTransformer.js} +1 -1
  175. package/lib/transformers/features/CreateRandomTransformer.js.map +1 -0
  176. package/lib/transformers/features/CreateValidateTransformer.d.ts +3 -0
  177. package/lib/transformers/features/{validators/CreateValidateTransformer.js → CreateValidateTransformer.js} +2 -2
  178. package/lib/transformers/features/CreateValidateTransformer.js.map +1 -0
  179. package/lib/transformers/features/IsTransformer.d.ts +3 -0
  180. package/lib/transformers/features/{validators/IsTransformer.js → IsTransformer.js} +2 -2
  181. package/lib/transformers/features/IsTransformer.js.map +1 -0
  182. package/lib/transformers/features/{miscellaneous/RandomTransformer.d.ts → RandomTransformer.d.ts} +1 -1
  183. package/lib/transformers/features/{miscellaneous/RandomTransformer.js → RandomTransformer.js} +1 -1
  184. package/lib/transformers/features/RandomTransformer.js.map +1 -0
  185. package/lib/transformers/features/ValidateTransformer.d.ts +3 -0
  186. package/lib/transformers/features/{validators/ValidateTransformer.js → ValidateTransformer.js} +2 -2
  187. package/lib/transformers/features/ValidateTransformer.js.map +1 -0
  188. package/lib/transformers/features/{parsers → json}/AssertParseTransformer.js +4 -2
  189. package/lib/transformers/features/json/AssertParseTransformer.js.map +1 -0
  190. package/lib/transformers/features/{stringifiers → json}/AssertStringifyTransformer.js +2 -2
  191. package/lib/transformers/features/json/AssertStringifyTransformer.js.map +1 -0
  192. package/lib/transformers/features/{parsers → json}/CreateAssertParseTransformer.js +4 -2
  193. package/lib/transformers/features/json/CreateAssertParseTransformer.js.map +1 -0
  194. package/lib/transformers/features/{stringifiers → json}/CreateAssertStringifyTransformer.js +2 -2
  195. package/lib/transformers/features/json/CreateAssertStringifyTransformer.js.map +1 -0
  196. package/lib/transformers/features/{parsers → json}/CreateIsParseTransformer.js +2 -2
  197. package/lib/transformers/features/json/CreateIsParseTransformer.js.map +1 -0
  198. package/lib/transformers/features/{stringifiers → json}/CreateIsStringifyTransformer.js +2 -2
  199. package/lib/transformers/features/json/CreateIsStringifyTransformer.js.map +1 -0
  200. package/lib/transformers/features/{stringifiers → json}/CreateStringifyTransformer.js +2 -2
  201. package/lib/transformers/features/json/CreateStringifyTransformer.js.map +1 -0
  202. package/lib/transformers/features/{parsers → json}/CreateValidateParseTransformer.js +4 -2
  203. package/lib/transformers/features/json/CreateValidateParseTransformer.js.map +1 -0
  204. package/lib/transformers/features/{stringifiers → json}/CreateValidateStringifyProgrammer.js +2 -2
  205. package/lib/transformers/features/json/CreateValidateStringifyProgrammer.js.map +1 -0
  206. package/lib/transformers/features/{parsers → json}/IsParseTransformer.js +2 -2
  207. package/lib/transformers/features/json/IsParseTransformer.js.map +1 -0
  208. package/lib/transformers/features/{stringifiers → json}/IsStringifyTransformer.js +2 -2
  209. package/lib/transformers/features/json/IsStringifyTransformer.js.map +1 -0
  210. package/lib/transformers/features/{stringifiers → json}/StringifyTransformer.js +2 -2
  211. package/lib/transformers/features/json/StringifyTransformer.js.map +1 -0
  212. package/lib/transformers/features/{parsers → json}/ValidateParseTransformer.js +4 -2
  213. package/lib/transformers/features/json/ValidateParseTransformer.js.map +1 -0
  214. package/lib/transformers/features/{stringifiers → json}/ValidateStringifyTransformer.js +2 -2
  215. package/lib/transformers/features/json/ValidateStringifyTransformer.js.map +1 -0
  216. package/lib/transformers/features/{miscellaneous → misc}/ApplicationTransformer.js +3 -5
  217. package/lib/transformers/features/misc/ApplicationTransformer.js.map +1 -0
  218. package/lib/transformers/features/{miscellaneous → misc}/AssertCloneTransformer.js +4 -2
  219. package/lib/transformers/features/misc/AssertCloneTransformer.js.map +1 -0
  220. package/lib/transformers/features/{miscellaneous → misc}/AssertPruneTransformer.js +4 -2
  221. package/lib/transformers/features/misc/AssertPruneTransformer.js.map +1 -0
  222. package/lib/transformers/features/{miscellaneous → misc}/CloneTransformer.js +2 -2
  223. package/lib/transformers/features/misc/CloneTransformer.js.map +1 -0
  224. package/lib/transformers/features/{miscellaneous → misc}/CreateAssertCloneTransformer.js +4 -2
  225. package/lib/transformers/features/misc/CreateAssertCloneTransformer.js.map +1 -0
  226. package/lib/transformers/features/{miscellaneous → misc}/CreateAssertPruneTransformer.js +4 -2
  227. package/lib/transformers/features/misc/CreateAssertPruneTransformer.js.map +1 -0
  228. package/lib/transformers/features/{miscellaneous → misc}/CreateCloneTransformer.js +2 -2
  229. package/lib/transformers/features/misc/CreateCloneTransformer.js.map +1 -0
  230. package/lib/transformers/features/{miscellaneous → misc}/CreateIsCloneTransformer.js +2 -2
  231. package/lib/transformers/features/misc/CreateIsCloneTransformer.js.map +1 -0
  232. package/lib/transformers/features/misc/CreateIsPruneTransformer.js.map +1 -0
  233. package/lib/transformers/features/{miscellaneous → misc}/CreatePruneTransformer.js +2 -2
  234. package/lib/transformers/features/misc/CreatePruneTransformer.js.map +1 -0
  235. package/lib/transformers/features/{miscellaneous → misc}/CreateValidateCloneTransformer.js +4 -2
  236. package/lib/transformers/features/misc/CreateValidateCloneTransformer.js.map +1 -0
  237. package/lib/transformers/features/{miscellaneous → misc}/CreateValidatePruneTransformer.js +4 -2
  238. package/lib/transformers/features/misc/CreateValidatePruneTransformer.js.map +1 -0
  239. package/lib/transformers/features/{miscellaneous → misc}/IsCloneTransformer.js +2 -2
  240. package/lib/transformers/features/misc/IsCloneTransformer.js.map +1 -0
  241. package/lib/transformers/features/misc/IsPruneTransformer.js.map +1 -0
  242. package/lib/transformers/features/{miscellaneous → misc}/LiteralsTransformer.js +2 -2
  243. package/lib/transformers/features/misc/LiteralsTransformer.js.map +1 -0
  244. package/lib/transformers/features/misc/MetadataTransformer.js.map +1 -0
  245. package/lib/transformers/features/{miscellaneous → misc}/PruneTransformer.js +2 -2
  246. package/lib/transformers/features/misc/PruneTransformer.js.map +1 -0
  247. package/lib/transformers/features/{miscellaneous → misc}/ValidateCloneTransformer.js +4 -2
  248. package/lib/transformers/features/misc/ValidateCloneTransformer.js.map +1 -0
  249. package/lib/transformers/features/{miscellaneous → misc}/ValidatePruneTransformer.js +4 -2
  250. package/lib/transformers/features/misc/ValidatePruneTransformer.js.map +1 -0
  251. package/lib/transformers/features/protobuf/MessageTransformer.d.ts +5 -0
  252. package/lib/transformers/features/protobuf/MessageTransformer.js +20 -0
  253. package/lib/transformers/features/protobuf/MessageTransformer.js.map +1 -0
  254. package/lib/utils/NameEncoder.d.ts +4 -0
  255. package/lib/utils/NameEncoder.js +89 -0
  256. package/lib/utils/NameEncoder.js.map +1 -0
  257. package/package.json +1 -1
  258. package/src/factories/MetadataTagFactory.ts +362 -355
  259. package/src/factories/ProtocolFactory.ts +80 -0
  260. package/src/factories/internal/protocols/ProtocolMetadataUtil.ts +180 -0
  261. package/src/factories/internal/protocols/emplace_protocol_object.ts +25 -0
  262. package/src/factories/internal/protocols/emplace_protocol_property.ts +12 -0
  263. package/src/factories/internal/protocols/iterate_protocol_atomic.ts +34 -0
  264. package/src/factories/internal/protocols/iterate_protocol_constant.ts +27 -0
  265. package/src/factories/internal/protocols/iterate_protocol_main.ts +19 -0
  266. package/src/factories/internal/protocols/iterate_protocol_map.ts +58 -0
  267. package/src/factories/internal/protocols/iterate_protocol_metadata.ts +96 -0
  268. package/src/factories/internal/protocols/iterate_protocol_native.ts +34 -0
  269. package/src/factories/internal/protocols/iterate_protocol_never.ts +1 -0
  270. package/src/factories/internal/protocols/iterate_protocol_object.ts +110 -0
  271. package/src/factories/internal/protocols/iterate_protocol_repeated.ts +34 -0
  272. package/src/factories/internal/protocols/iterate_protocol_tuple.ts +29 -0
  273. package/src/functional/$number.ts +3 -2
  274. package/src/functional/$proto_bytes.ts +25 -0
  275. package/src/functional/$proto_field.ts +30 -0
  276. package/src/functional/$proto_float.ts +37 -0
  277. package/src/functional/$proto_i32.ts +29 -0
  278. package/src/functional/$proto_i64.ts +37 -0
  279. package/src/functional/$proto_size.ts +82 -0
  280. package/src/functional/$proto_string.ts +24 -0
  281. package/src/functional/$varint.ts +130 -0
  282. package/src/functional/$zigzag.ts +39 -0
  283. package/src/json.ts +648 -0
  284. package/src/messages/IProtocolMap.ts +5 -0
  285. package/src/messages/IProtocolMessage.ts +6 -0
  286. package/src/messages/IProtocolProperty.ts +13 -0
  287. package/src/metadata/IMetadataTag.ts +113 -105
  288. package/src/metadata/Metadata.ts +606 -603
  289. package/src/misc.ts +651 -0
  290. package/src/module.ts +781 -2038
  291. package/src/programmers/IsPruneProgrammer.ts +2 -2
  292. package/src/programmers/internal/application_alias.ts +2 -2
  293. package/src/programmers/internal/application_array.ts +2 -2
  294. package/src/programmers/internal/application_native.ts +2 -2
  295. package/src/programmers/internal/application_number.ts +77 -74
  296. package/src/programmers/internal/application_object.ts +3 -3
  297. package/src/programmers/internal/application_resolved.ts +2 -2
  298. package/src/programmers/internal/application_schema.ts +2 -2
  299. package/src/programmers/internal/application_tuple.ts +2 -2
  300. package/src/programmers/{ApplicationProgrammer.ts → json/JsonApplicationProgrammer.ts} +6 -6
  301. package/src/programmers/{AssertParseProgrammer.ts → json/JsonAssertParseProgrammer.ts} +6 -6
  302. package/src/programmers/{AssertStringifyProgrammer.ts → json/JsonAssertStringifyProgrammer.ts} +8 -8
  303. package/src/programmers/{IsParseProgrammer.ts → json/JsonIsParseProgrammer.ts} +6 -6
  304. package/src/programmers/{IsStringifyProgrammer.ts → json/JsonIsStringifyProgrammer.ts} +7 -7
  305. package/src/programmers/{StringifyProgrammer.ts → json/JsonStringifyProgrammer.ts} +40 -39
  306. package/src/programmers/{ValidateParseProgrammer.ts → json/JsonValidateParseProgrammer.ts} +6 -6
  307. package/src/programmers/{ValidateStringifyProgrammer.ts → json/JsonValidateStringifyProgrammer.ts} +8 -8
  308. package/src/programmers/{AssertCloneProgrammer.ts → misc/MiscAssertCloneProgrammer.ts} +8 -8
  309. package/src/programmers/{AssertPruneProgrammer.ts → misc/MiscAssertPruneProgrammer.ts} +8 -8
  310. package/src/programmers/{CloneProgrammer.ts → misc/MiscCloneProgrammer.ts} +24 -24
  311. package/src/programmers/{IsCloneProgrammer.ts → misc/MiscIsCloneProgrammer.ts} +8 -8
  312. package/src/programmers/{LiteralsProgrammer.ts → misc/MiscLiteralsProgrammer.ts} +63 -62
  313. package/src/programmers/{PruneProgrammer.ts → misc/MiscPruneProgrammer.ts} +24 -24
  314. package/src/programmers/{ValidateCloneProgrammer.ts → misc/MiscValidateCloneProgrammer.ts} +8 -8
  315. package/src/programmers/{ValidatePruneProgrammer.ts → misc/MiscValidatePruneProgrammer.ts} +8 -8
  316. package/src/programmers/protobuf/ProtobufMessageProgrammer.ts +126 -0
  317. package/src/protobuf.ts +18 -0
  318. package/src/transformers/CallExpressionTransformer.ts +196 -179
  319. package/src/transformers/features/{validators/AssertTransformer.ts → AssertTransformer.ts} +2 -2
  320. package/src/transformers/features/{validators/CreateAssertTransformer.ts → CreateAssertTransformer.ts} +2 -2
  321. package/src/transformers/features/{validators/CreateIsTransformer.ts → CreateIsTransformer.ts} +2 -2
  322. package/src/transformers/features/{miscellaneous/CreateRandomTransformer.ts → CreateRandomTransformer.ts} +2 -2
  323. package/src/transformers/features/{validators/CreateValidateTransformer.ts → CreateValidateTransformer.ts} +2 -2
  324. package/src/transformers/features/{validators/IsTransformer.ts → IsTransformer.ts} +2 -2
  325. package/src/transformers/features/{miscellaneous/RandomTransformer.ts → RandomTransformer.ts} +2 -2
  326. package/src/transformers/features/{validators/ValidateTransformer.ts → ValidateTransformer.ts} +2 -2
  327. package/src/transformers/features/{parsers → json}/AssertParseTransformer.ts +3 -2
  328. package/src/transformers/features/{stringifiers → json}/AssertStringifyTransformer.ts +2 -2
  329. package/src/transformers/features/{parsers → json}/CreateAssertParseTransformer.ts +3 -2
  330. package/src/transformers/features/{stringifiers → json}/CreateAssertStringifyTransformer.ts +2 -2
  331. package/src/transformers/features/{parsers → json}/CreateIsParseTransformer.ts +2 -2
  332. package/src/transformers/features/{stringifiers → json}/CreateIsStringifyTransformer.ts +1 -1
  333. package/src/transformers/features/{stringifiers → json}/CreateStringifyTransformer.ts +2 -2
  334. package/src/transformers/features/{parsers → json}/CreateValidateParseTransformer.ts +3 -2
  335. package/src/transformers/features/{stringifiers → json}/CreateValidateStringifyProgrammer.ts +2 -2
  336. package/src/transformers/features/{parsers → json}/IsParseTransformer.ts +2 -2
  337. package/src/transformers/features/{stringifiers → json}/IsStringifyTransformer.ts +1 -1
  338. package/src/transformers/features/{stringifiers → json}/StringifyTransformer.ts +2 -2
  339. package/src/transformers/features/{parsers → json}/ValidateParseTransformer.ts +3 -2
  340. package/src/transformers/features/{stringifiers → json}/ValidateStringifyTransformer.ts +2 -2
  341. package/src/transformers/features/{miscellaneous → misc}/ApplicationTransformer.ts +102 -104
  342. package/src/transformers/features/{miscellaneous → misc}/AssertCloneTransformer.ts +3 -2
  343. package/src/transformers/features/{miscellaneous → misc}/AssertPruneTransformer.ts +3 -2
  344. package/src/transformers/features/{miscellaneous → misc}/CloneTransformer.ts +2 -2
  345. package/src/transformers/features/{miscellaneous → misc}/CreateAssertCloneTransformer.ts +3 -2
  346. package/src/transformers/features/{miscellaneous → misc}/CreateAssertPruneTransformer.ts +3 -2
  347. package/src/transformers/features/{miscellaneous → misc}/CreateCloneTransformer.ts +2 -2
  348. package/src/transformers/features/{miscellaneous → misc}/CreateIsCloneTransformer.ts +2 -2
  349. package/src/transformers/features/{miscellaneous → misc}/CreatePruneTransformer.ts +2 -2
  350. package/src/transformers/features/{miscellaneous → misc}/CreateValidateCloneTransformer.ts +3 -2
  351. package/src/transformers/features/{miscellaneous → misc}/CreateValidatePruneTransformer.ts +3 -2
  352. package/src/transformers/features/{miscellaneous → misc}/IsCloneTransformer.ts +2 -2
  353. package/src/transformers/features/{miscellaneous → misc}/LiteralsTransformer.ts +2 -2
  354. package/src/transformers/features/{miscellaneous → misc}/PruneTransformer.ts +2 -2
  355. package/src/transformers/features/{miscellaneous → misc}/ValidateCloneTransformer.ts +3 -2
  356. package/src/transformers/features/{miscellaneous → misc}/ValidatePruneTransformer.ts +3 -2
  357. package/src/transformers/features/protobuf/MessageTransformer.ts +31 -0
  358. package/src/utils/NameEncoder.ts +32 -0
  359. package/lib/programmers/ApplicationProgrammer.d.ts +0 -8
  360. package/lib/programmers/ApplicationProgrammer.js.map +0 -1
  361. package/lib/programmers/AssertCloneProgrammer.js.map +0 -1
  362. package/lib/programmers/AssertParseProgrammer.js.map +0 -1
  363. package/lib/programmers/AssertPruneProgrammer.js.map +0 -1
  364. package/lib/programmers/AssertStringifyProgrammer.js.map +0 -1
  365. package/lib/programmers/CloneProgrammer.js.map +0 -1
  366. package/lib/programmers/IsCloneProgrammer.js.map +0 -1
  367. package/lib/programmers/IsParseProgrammer.d.ts +0 -5
  368. package/lib/programmers/IsParseProgrammer.js.map +0 -1
  369. package/lib/programmers/IsStringifyProgrammer.js.map +0 -1
  370. package/lib/programmers/LiteralsProgrammer.js.map +0 -1
  371. package/lib/programmers/PruneProgrammer.js.map +0 -1
  372. package/lib/programmers/StringifyProgrammer.js.map +0 -1
  373. package/lib/programmers/ValidateCloneProgrammer.d.ts +0 -5
  374. package/lib/programmers/ValidateCloneProgrammer.js.map +0 -1
  375. package/lib/programmers/ValidateParseProgrammer.d.ts +0 -5
  376. package/lib/programmers/ValidateParseProgrammer.js.map +0 -1
  377. package/lib/programmers/ValidatePruneProgrammer.d.ts +0 -5
  378. package/lib/programmers/ValidatePruneProgrammer.js.map +0 -1
  379. package/lib/programmers/ValidateStringifyProgrammer.d.ts +0 -5
  380. package/lib/programmers/ValidateStringifyProgrammer.js.map +0 -1
  381. package/lib/transformers/features/miscellaneous/ApplicationTransformer.js.map +0 -1
  382. package/lib/transformers/features/miscellaneous/AssertCloneTransformer.js.map +0 -1
  383. package/lib/transformers/features/miscellaneous/AssertPruneTransformer.js.map +0 -1
  384. package/lib/transformers/features/miscellaneous/CloneTransformer.js.map +0 -1
  385. package/lib/transformers/features/miscellaneous/CreateAssertCloneTransformer.js.map +0 -1
  386. package/lib/transformers/features/miscellaneous/CreateAssertPruneTransformer.js.map +0 -1
  387. package/lib/transformers/features/miscellaneous/CreateCloneTransformer.js.map +0 -1
  388. package/lib/transformers/features/miscellaneous/CreateIsCloneTransformer.js.map +0 -1
  389. package/lib/transformers/features/miscellaneous/CreateIsPruneTransformer.js.map +0 -1
  390. package/lib/transformers/features/miscellaneous/CreatePruneTransformer.js.map +0 -1
  391. package/lib/transformers/features/miscellaneous/CreateRandomTransformer.js.map +0 -1
  392. package/lib/transformers/features/miscellaneous/CreateValidateCloneTransformer.js.map +0 -1
  393. package/lib/transformers/features/miscellaneous/CreateValidatePruneTransformer.js.map +0 -1
  394. package/lib/transformers/features/miscellaneous/IsCloneTransformer.js.map +0 -1
  395. package/lib/transformers/features/miscellaneous/IsPruneTransformer.js.map +0 -1
  396. package/lib/transformers/features/miscellaneous/LiteralsTransformer.js.map +0 -1
  397. package/lib/transformers/features/miscellaneous/MetadataTransformer.js.map +0 -1
  398. package/lib/transformers/features/miscellaneous/PruneTransformer.js.map +0 -1
  399. package/lib/transformers/features/miscellaneous/RandomTransformer.js.map +0 -1
  400. package/lib/transformers/features/miscellaneous/ValidateCloneTransformer.js.map +0 -1
  401. package/lib/transformers/features/miscellaneous/ValidatePruneTransformer.js.map +0 -1
  402. package/lib/transformers/features/parsers/AssertParseTransformer.js.map +0 -1
  403. package/lib/transformers/features/parsers/CreateAssertParseTransformer.js.map +0 -1
  404. package/lib/transformers/features/parsers/CreateIsParseTransformer.js.map +0 -1
  405. package/lib/transformers/features/parsers/CreateValidateParseTransformer.js.map +0 -1
  406. package/lib/transformers/features/parsers/IsParseTransformer.js.map +0 -1
  407. package/lib/transformers/features/parsers/ValidateParseTransformer.js.map +0 -1
  408. package/lib/transformers/features/stringifiers/AssertStringifyTransformer.js.map +0 -1
  409. package/lib/transformers/features/stringifiers/CreateAssertStringifyTransformer.js.map +0 -1
  410. package/lib/transformers/features/stringifiers/CreateIsStringifyTransformer.js.map +0 -1
  411. package/lib/transformers/features/stringifiers/CreateStringifyTransformer.js.map +0 -1
  412. package/lib/transformers/features/stringifiers/CreateValidateStringifyProgrammer.js.map +0 -1
  413. package/lib/transformers/features/stringifiers/IsStringifyTransformer.js.map +0 -1
  414. package/lib/transformers/features/stringifiers/StringifyTransformer.js.map +0 -1
  415. package/lib/transformers/features/stringifiers/ValidateStringifyTransformer.js.map +0 -1
  416. package/lib/transformers/features/validators/AssertTransformer.d.ts +0 -3
  417. package/lib/transformers/features/validators/AssertTransformer.js.map +0 -1
  418. package/lib/transformers/features/validators/CreateAssertTransformer.d.ts +0 -3
  419. package/lib/transformers/features/validators/CreateAssertTransformer.js.map +0 -1
  420. package/lib/transformers/features/validators/CreateIsTransformer.d.ts +0 -3
  421. package/lib/transformers/features/validators/CreateIsTransformer.js.map +0 -1
  422. package/lib/transformers/features/validators/CreateValidateTransformer.d.ts +0 -3
  423. package/lib/transformers/features/validators/CreateValidateTransformer.js.map +0 -1
  424. package/lib/transformers/features/validators/IsTransformer.d.ts +0 -3
  425. package/lib/transformers/features/validators/IsTransformer.js.map +0 -1
  426. package/lib/transformers/features/validators/ValidateTransformer.d.ts +0 -3
  427. package/lib/transformers/features/validators/ValidateTransformer.js.map +0 -1
  428. /package/lib/transformers/features/{parsers → json}/AssertParseTransformer.d.ts +0 -0
  429. /package/lib/transformers/features/{stringifiers → json}/AssertStringifyTransformer.d.ts +0 -0
  430. /package/lib/transformers/features/{parsers → json}/CreateAssertParseTransformer.d.ts +0 -0
  431. /package/lib/transformers/features/{stringifiers → json}/CreateAssertStringifyTransformer.d.ts +0 -0
  432. /package/lib/transformers/features/{parsers → json}/CreateIsParseTransformer.d.ts +0 -0
  433. /package/lib/transformers/features/{stringifiers → json}/CreateIsStringifyTransformer.d.ts +0 -0
  434. /package/lib/transformers/features/{stringifiers → json}/CreateStringifyTransformer.d.ts +0 -0
  435. /package/lib/transformers/features/{parsers → json}/CreateValidateParseTransformer.d.ts +0 -0
  436. /package/lib/transformers/features/{stringifiers → json}/CreateValidateStringifyProgrammer.d.ts +0 -0
  437. /package/lib/transformers/features/{parsers → json}/IsParseTransformer.d.ts +0 -0
  438. /package/lib/transformers/features/{stringifiers → json}/IsStringifyTransformer.d.ts +0 -0
  439. /package/lib/transformers/features/{stringifiers → json}/StringifyTransformer.d.ts +0 -0
  440. /package/lib/transformers/features/{parsers → json}/ValidateParseTransformer.d.ts +0 -0
  441. /package/lib/transformers/features/{stringifiers → json}/ValidateStringifyTransformer.d.ts +0 -0
  442. /package/lib/transformers/features/{miscellaneous → misc}/ApplicationTransformer.d.ts +0 -0
  443. /package/lib/transformers/features/{miscellaneous → misc}/AssertCloneTransformer.d.ts +0 -0
  444. /package/lib/transformers/features/{miscellaneous → misc}/AssertPruneTransformer.d.ts +0 -0
  445. /package/lib/transformers/features/{miscellaneous → misc}/CloneTransformer.d.ts +0 -0
  446. /package/lib/transformers/features/{miscellaneous → misc}/CreateAssertCloneTransformer.d.ts +0 -0
  447. /package/lib/transformers/features/{miscellaneous → misc}/CreateAssertPruneTransformer.d.ts +0 -0
  448. /package/lib/transformers/features/{miscellaneous → misc}/CreateCloneTransformer.d.ts +0 -0
  449. /package/lib/transformers/features/{miscellaneous → misc}/CreateIsCloneTransformer.d.ts +0 -0
  450. /package/lib/transformers/features/{miscellaneous → misc}/CreateIsPruneTransformer.d.ts +0 -0
  451. /package/lib/transformers/features/{miscellaneous → misc}/CreateIsPruneTransformer.js +0 -0
  452. /package/lib/transformers/features/{miscellaneous → misc}/CreatePruneTransformer.d.ts +0 -0
  453. /package/lib/transformers/features/{miscellaneous → misc}/CreateValidateCloneTransformer.d.ts +0 -0
  454. /package/lib/transformers/features/{miscellaneous → misc}/CreateValidatePruneTransformer.d.ts +0 -0
  455. /package/lib/transformers/features/{miscellaneous → misc}/IsCloneTransformer.d.ts +0 -0
  456. /package/lib/transformers/features/{miscellaneous → misc}/IsPruneTransformer.d.ts +0 -0
  457. /package/lib/transformers/features/{miscellaneous → misc}/IsPruneTransformer.js +0 -0
  458. /package/lib/transformers/features/{miscellaneous → misc}/LiteralsTransformer.d.ts +0 -0
  459. /package/lib/transformers/features/{miscellaneous → misc}/MetadataTransformer.d.ts +0 -0
  460. /package/lib/transformers/features/{miscellaneous → misc}/MetadataTransformer.js +0 -0
  461. /package/lib/transformers/features/{miscellaneous → misc}/PruneTransformer.d.ts +0 -0
  462. /package/lib/transformers/features/{miscellaneous → misc}/ValidateCloneTransformer.d.ts +0 -0
  463. /package/lib/transformers/features/{miscellaneous → misc}/ValidatePruneTransformer.d.ts +0 -0
  464. /package/src/transformers/features/{miscellaneous → misc}/CreateIsPruneTransformer.ts +0 -0
  465. /package/src/transformers/features/{miscellaneous → misc}/IsPruneTransformer.ts +0 -0
  466. /package/src/transformers/features/{miscellaneous → misc}/MetadataTransformer.ts +0 -0
package/lib/module.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- import { IJsonApplication } from "./schemas/IJsonApplication";
2
- import { Atomic } from "./typings/Atomic";
3
1
  import { CustomValidatorMap } from "./CustomValidatorMap";
4
2
  import { IRandomGenerator } from "./IRandomGenerator";
5
3
  import { IValidation } from "./IValidation";
6
4
  import { Primitive } from "./Primitive";
5
+ export * as json from "./json";
6
+ export * as protobuf from "./protobuf";
7
+ export * as misc from "./misc";
7
8
  export * from "./schemas/IJsonApplication";
8
9
  export * from "./schemas/IJsonComponents";
9
10
  export * from "./schemas/IJsonSchema";
@@ -11,6 +12,43 @@ export * from "./IRandomGenerator";
11
12
  export * from "./IValidation";
12
13
  export * from "./Primitive";
13
14
  export * from "./TypeGuardError";
15
+ /**
16
+ * Custom validators.
17
+ *
18
+ * If you want to add a custom validation logic utilizing comment tags,
19
+ * add a closure function with its tag and type name. Below example code
20
+ * would helpful to understand how to use this instance.
21
+ *
22
+ * ```ts
23
+ * typia.customValidators.insert("powerOf")("number")(
24
+ * (text: string) => {
25
+ * const denominator: number = Math.log(Number(text));
26
+ * return (value: number) => {
27
+ * value = Math.log(value) / denominator;
28
+ * return value === Math.floor(value);
29
+ * };
30
+ * }
31
+ * );
32
+ * typia.customValidators.insert("dollar")("string")(
33
+ * () => (value: string) => value.startsWith("$"),
34
+ * );
35
+ *
36
+ * interface TagCustom {
37
+ * /**
38
+ * * @powerOf 10
39
+ * *\/
40
+ * powerOf: number;
41
+ *
42
+ * /**
43
+ * * @dollar
44
+ * *\/
45
+ * dollar: string;
46
+ * }
47
+ * ```
48
+ *
49
+ * @author Jeongho Nam - https://github.com/samchon
50
+ */
51
+ export declare const customValidators: CustomValidatorMap;
14
52
  /**
15
53
  * Asserts a value type.
16
54
  *
@@ -323,1127 +361,199 @@ export declare function validateEquals<T>(input: T): IValidation<T>;
323
361
  * @author Jeongho Nam - https://github.com/samchon
324
362
  */
325
363
  export declare function validateEquals<T>(input: unknown): IValidation<T>;
326
- /**
327
- * Custom validators.
328
- *
329
- * If you want to add a custom validation logic utilizing comment tags,
330
- * add a closure function with its tag and type name. Below example code
331
- * would helpful to understand how to use this instance.
332
- *
333
- * ```ts
334
- * typia.customValidators.insert("powerOf")("number")(
335
- * (text: string) => {
336
- * const denominator: number = Math.log(Number(text));
337
- * return (value: number) => {
338
- * value = Math.log(value) / denominator;
339
- * return value === Math.floor(value);
340
- * };
341
- * }
342
- * );
343
- * typia.customValidators.insert("dollar")("string")(
344
- * () => (value: string) => value.startsWith("$"),
345
- * );
346
- *
347
- * interface TagCustom {
348
- * /**
349
- * * @powerOf 10
350
- * *\/
351
- * powerOf: number;
352
- *
353
- * /**
354
- * * @dollar
355
- * *\/
356
- * dollar: string;
357
- * }
358
- * ```
359
- *
360
- * @author Jeongho Nam - https://github.com/samchon
361
- */
362
- export declare const customValidators: CustomValidatorMap;
363
364
  /**
364
365
  * > You must configure the generic argument `T`.
365
366
  *
366
- * JSON Schema Application.
367
- *
368
- * Creates a JSON schema application which contains both main JSON schemas and components.
369
- * Note that, all of the object types are stored in the {@link IJsonApplication.components}
370
- * property for the `$ref` referencing.
371
- *
372
- * Also, `typia.application()` has additional generic arguments, *Purpose*.
373
- * As JSON schema definitions used by `swagger` and `ajv` are different a little bit,
374
- * you should configure the *Purpose* appropriately.
375
- *
376
- * For an example, `ajv` has an extra property "$recursiveRef" that are not exists
377
- * in the standard JSON schema definition spec. Otherwise, `swagger` can't identify
378
- * the tuple definition.
379
- *
380
- * @template Types Tuple of target types
381
- * @template Purpose Purpose of the JSON schema`
382
- * @return JSON schema application
383
- *
384
- * @author Jeongho Nam - https://github.com/samchon
385
- */
386
- export declare function application(): never;
387
- /**
388
- * JSON Schema Application.
389
- *
390
- * Creates a JSON schema application which contains both main JSON schemas and components.
391
- * Note that, all of the object types are stored in the {@link IJsonApplication.components}
392
- * property for the `$ref` referencing.
367
+ * Generate random data.
393
368
  *
394
- * Also, `typia.application()` has additional generic arguments, *Purpose*.
395
- * As JSON schema definitions used by `swagger` and `ajv` are different a little bit,
396
- * you should configure the *Purpose* appropriately.
369
+ * Generates a random data following type the `T`.
397
370
  *
398
- * For an example, `ajv` has an extra property "$recursiveRef" that are not exists
399
- * in the standard JSON schema definition spec. Otherwise, `swagger` can't identify
400
- * the tuple definition.
371
+ * For reference, this `typia.random()` function generates only primitive type.
372
+ * If there're some methods in the type `T` or its nested instances, those would
373
+ * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
374
+ * would be generated instead.
401
375
  *
402
- * @template Types Tuple of target types
403
- * @template Purpose Purpose of the JSON schema
404
- * @return JSON schema application
376
+ * @template T Type of data to generate
377
+ * @param generator Random data generator
378
+ * @return Randomly generated data
405
379
  *
406
380
  * @author Jeongho Nam - https://github.com/samchon
407
381
  */
408
- export declare function application<Types extends unknown[], Purpose extends "ajv" | "swagger" = "swagger">(): IJsonApplication;
382
+ export declare function random(generator?: Partial<IRandomGenerator>): never;
409
383
  /**
410
- * > You must configure the generic argument `T`.
411
- *
412
- * Safe `JSON.parse()` function with type assertion.
384
+ * Generate random data.
413
385
  *
414
- * `typia.assertParse()` is a combination function of `JSON.parse()` and {@link assert}.
415
- * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
416
- * instance with type assertion.
386
+ * Generates a random data following type the `T`.
417
387
  *
418
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
419
- * throws {@link TypeGuardError}. Otherwise, there's no problem on the parsed value,
420
- * the parsed value would be returned.
388
+ * For reference, this `typia.random()` function generates only primitive type.
389
+ * If there're some methods in the type `T` or its nested instances, those would
390
+ * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
391
+ * would be generated instead.
421
392
  *
422
- * @template T Expected type of parsed value
423
- * @param input JSON string
424
- * @returns Parsed value
393
+ * @template T Type of data to generate
394
+ * @param generator Random data generator
395
+ * @return Randomly generated data
425
396
  *
426
397
  * @author Jeongho Nam - https://github.com/samchon
427
398
  */
428
- export declare function assertParse(input: string): never;
399
+ export declare function random<T>(generator?: Partial<IRandomGenerator>): Primitive<T>;
429
400
  /**
430
- * Safe `JSON.parse()` function with type assertion.
431
- *
432
- * `typia.assertParse()` is a combination function of `JSON.parse()` and {@link assert}.
433
- * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
434
- * instance with type assertion.
435
- *
436
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
437
- * throws {@link TypeGuardError}. Otherwise, there's no problem on the parsed value,
438
- * the parsed value would be returned.
401
+ * Creates a reusable {@link assert} function.
439
402
  *
440
- * @template T Expected type of parsed value
441
- * @param input JSON string
442
- * @returns Parsed value
403
+ * @danger You have to specify the generic argument `T`
404
+ * @return Nothing until specifying the generic argument `T`
405
+ * @throws compile error
443
406
  *
444
407
  * @author Jeongho Nam - https://github.com/samchon
445
408
  */
446
- export declare function assertParse<T>(input: string): Primitive<T>;
409
+ export declare function createAssert(): never;
447
410
  /**
448
- * > You must configure the generic argument `T`.
449
- *
450
- * Safe `JSON.parse()` function with type checking.
451
- *
452
- * `typia.isParse()` is a combination function of `JSON.parse()` and {@link is}.
453
- * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
454
- * instance with type checking.
455
- *
456
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
457
- * returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
458
- * value would be returned.
411
+ * Creates a reusable {@link assert} function.
459
412
  *
460
- * @template T Expected type of parsed value
461
- * @param input JSON string
462
- * @returns Parsed value when exact type, otherwise `null`
413
+ * @template T Type of the input value
414
+ * @returns A reusable `assert` function
463
415
  *
464
416
  * @author Jeongho Nam - https://github.com/samchon
465
417
  */
466
- export declare function isParse(input: string): never;
418
+ export declare function createAssert<T>(): (input: unknown) => T;
467
419
  /**
468
- * Safe `JSON.parse()` function with type checking.
469
- *
470
- * `typia.isParse()` is a combination function of `JSON.parse()` and {@link is}.
471
- * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
472
- * instance with type checking.
420
+ * Creates a reusable {@link assertType} function.
473
421
  *
474
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
475
- * returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
476
- * value would be returned.
422
+ * Duplicated function of {@link createAssert} for `typescript-is` users.
477
423
  *
478
- * @template T Expected type of parsed value
479
- * @param input JSON string
480
- * @returns Parsed value when exact type, otherwise `null`
424
+ * @danger You have to specify the generic argument `T`
425
+ * @return Nothing until specifying the generic argument `T`
426
+ * @throws compile error
481
427
  *
482
428
  * @author Jeongho Nam - https://github.com/samchon
429
+ * @deprecated
483
430
  */
484
- export declare function isParse<T>(input: string): Primitive<T> | null;
431
+ export declare function createAssertType(): never;
485
432
  /**
486
- * > You must configure the generic argument `T`.
487
- *
488
- * Safe `JSON.parse()` function with detailed type validation.
489
- *
490
- * `typia.validateParse()` is a combination function of `JSON.parse()` and
491
- * {@link validate}. Therefore, it convers a JSON (JavaScript Object Notation) string
492
- * to a `T` typed instance with detailed type validation.
433
+ * Creates a reusable {@link assertType} function.
493
434
  *
494
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
495
- * returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
496
- * there's no problem on the parsed value, the parsed value would be stored in `data`
497
- * property of the output {@link IValidation.ISuccess} instance.
435
+ * Duplicated function of {@link createAssert} for `typescript-is` users.
498
436
  *
499
- * @template T Expected type of parsed value
500
- * @param input JSON string
501
- * @returns Validation result with JSON parsed value
437
+ * @template T Type of the input value
438
+ * @returns A reusable `assert` function
502
439
  *
503
440
  * @author Jeongho Nam - https://github.com/samchon
441
+ * @deprecated
504
442
  */
505
- export declare function validateParse(input: string): never;
443
+ export declare function createAssertType<T>(): (input: unknown) => T;
506
444
  /**
507
- * Safe `JSON.parse()` function with detailed type validation.
508
- *
509
- * `typia.validateParse()` is a combination function of `JSON.parse()` and
510
- * {@link validate}. Therefore, it convers a JSON (JavaScript Object Notation) string
511
- * to a `T` typed instance with detailed type validation.
512
- *
513
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
514
- * returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
515
- * there's no problem on the parsed value, the parsed value would be stored in `data`
516
- * property of the output {@link IValidation.ISuccess} instance.
445
+ * Creates a reusable {@link is} function.
517
446
  *
518
- * @template T Expected type of parsed value
519
- * @param input JSON string
520
- * @returns Validation result with JSON parsed value
447
+ * @danger You have to specify the generic argument `T`
448
+ * @return Nothing until specifying the generic argument `T`
449
+ * @throws compile error
521
450
  *
522
451
  * @author Jeongho Nam - https://github.com/samchon
523
452
  */
524
- export declare function validateParse<T>(input: string): IValidation<Primitive<T>>;
453
+ export declare function createIs(): never;
525
454
  /**
526
- * 8x faster `JSON.stringify()` function.
527
- *
528
- * Converts an input value to a JSON (JavaScript Object Notation) string, about 8x faster
529
- * than the native `JSON.stringify()` function. The 5x faster principle is because
530
- * it writes an optimized JSON conversion plan, only for the type `T`.
531
- *
532
- * For reference, this `typia.stringify()` does not validate the input value type.
533
- * It just believes that the input value is following the type `T`. Therefore, if you
534
- * can't ensure the input value type, it would be better to call one of below functions
535
- * instead.
536
- *
537
- * - {@link assertStringify}
538
- * - {@link isStringify}
539
- * - {@link validateStringify}
455
+ * Creates a reusable {@link is} function.
540
456
  *
541
457
  * @template T Type of the input value
542
- * @param input A value to be converted
543
- * @return JSON string value
458
+ * @returns A reusable `is` function
544
459
  *
545
460
  * @author Jeongho Nam - https://github.com/samchon
546
461
  */
547
- export declare function stringify<T>(input: T): string;
462
+ export declare function createIs<T>(): (input: unknown) => input is T;
548
463
  /**
549
- * 5x faster `JSON.stringify()` function with type assertion.
550
- *
551
- * `typia.assertStringify()` is a combination function of {@link assert} and
552
- * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
553
- * Notation) string, with type assertion.
554
- *
555
- * In such reason, when `input` value is not matched with the type `T`, it throws an
556
- * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, JSON
557
- * string would be returned.
558
- *
559
- * For reference, with type assertion, it is even 5x times faster than the native
560
- * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
561
- * with confidence.
464
+ * Creates a reusable {@link validate} function.
562
465
  *
563
- * @template T Type of the input value
564
- * @param input A value to be asserted and converted
565
- * @return JSON string value
466
+ * @danger You have to specify the generic argument `T`
467
+ * @return Nothing until specifying the generic argument `T`
468
+ * @throws compile error
566
469
  *
567
470
  * @author Jeongho Nam - https://github.com/samchon
568
471
  */
569
- export declare function assertStringify<T>(input: T): string;
472
+ export declare function createValidate(): never;
570
473
  /**
571
- * 5x faster `JSON.stringify()` function with type assertion.
572
- *
573
- * `typia.assertStringify()` is a combination function of {@link assert} and
574
- * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
575
- * Notation) string, with type assertion.
576
- *
577
- * In such reason, when `input` value is not matched with the type `T`, it throws an
578
- * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, JSON
579
- * string would be returned.
580
- *
581
- * For reference, with type assertion, it is even 5x times faster than the native
582
- * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
583
- * with confidence.
474
+ * Creates a reusable {@link validate} function.
584
475
  *
585
476
  * @template T Type of the input value
586
- * @param input A value to be asserted and converted
587
- * @return JSON string value
477
+ * @returns A reusable `validate` function
588
478
  *
589
479
  * @author Jeongho Nam - https://github.com/samchon
590
480
  */
591
- export declare function assertStringify<T>(input: T): unknown;
481
+ export declare function createValidate<T>(): (input: unknown) => IValidation<T>;
592
482
  /**
593
- * 7x faster `JSON.stringify()` function with type checking.
594
- *
595
- * `typia.stringify()` is a combination function of {@link is} and
596
- * {@link stringify}. Therefore, it converts an input value to JSON
597
- * (JavaScript Object Notation) string, with type checking.
598
- *
599
- * In such reason, when `input` value is not matched with the type `T`, it returns
600
- * `null` value. Otherwise, there's no problem on the `input` value, JSON string would
601
- * be returned.
602
- *
603
- * For reference, with type checking, it is even 7x times faster than the native
604
- * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
605
- * with confidence.
483
+ * Creates a reusable {@link assertEquals} function.
606
484
  *
607
- * @template T Type of the input value
608
- * @param input A value to be checked and converted
609
- * @return JSON string value when exact type, otherwise null
485
+ * @danger You have to specify the generic argument `T`
486
+ * @return Nothing until specifying the generic argument `T`
487
+ * @throws compile error
610
488
  *
611
489
  * @author Jeongho Nam - https://github.com/samchon
612
490
  */
613
- export declare function isStringify<T>(input: T): string | null;
491
+ export declare function createAssertEquals(): never;
614
492
  /**
615
- * 7x faster `JSON.stringify()` function with type checking.
616
- *
617
- * `typia.isStringify()` is a combination function of {@link is} and
618
- * {@link stringify}. Therefore, it converts an input value to JSON
619
- * (JavaScript Object Notation) string, with type checking.
620
- *f
621
- * In such reason, when `input` value is not matched with the type `T`, it returns
622
- * `null` value. Otherwise, there's no problem on the `input` value, JSON string would
623
- * be returned.
624
- *
625
- * For reference, with type checking, it is even 7x times faster than the native
626
- * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
627
- * with confidence.
493
+ * Creates a reusable {@link assertEquals} function.
628
494
  *
629
495
  * @template T Type of the input value
630
- * @param input A value to be checked and converted
631
- * @return JSON string value when exact type, otherwise null
496
+ * @returns A reusable `assertEquals` function
632
497
  *
633
498
  * @author Jeongho Nam - https://github.com/samchon
634
499
  */
635
- export declare function isStringify<T>(input: unknown): string | null;
500
+ export declare function createAssertEquals<T>(): (input: unknown) => T;
636
501
  /**
637
- * 5x faster `JSON.stringify()` function with detailed type validation.
638
- *
639
- * `typia.validateStringify()` is a combination function of {@link validate} and
640
- * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
641
- * Notation) string, with detailed type validation.
642
- *
643
- * In such reason, when `input` value is not matched with the type `T`, it returns
644
- * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's no
645
- * problem on the `input` value, JSON string would be stored in `data` property of
646
- * the output {@link IValidation.ISuccess} instance.
647
- *
648
- * For reference, with detailed type validation, it is even 5x times faster than the
649
- * native `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
650
- * with confidence.
502
+ * Creates a reusable {@link equals} function.
651
503
  *
652
- * @template T Type of the input value
653
- * @param input A value to be checked and converted
654
- * @returns Validation result with JSON string value
504
+ * @danger You have to specify the generic argument `T`
505
+ * @return Nothing until specifying the generic argument `T`
506
+ * @throws compile error
655
507
  *
656
508
  * @author Jeongho Nam - https://github.com/samchon
657
509
  */
658
- export declare function validateStringify<T>(input: T): IValidation<string>;
510
+ export declare function createEquals(): never;
659
511
  /**
660
- * 5x faster `JSON.stringify()` function with detailed type validation.
661
- *
662
- * `typia.validateStringify()` is a combination function of {@link validate} and
663
- * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
664
- * Notation) string, with detailed type validation.
665
- *
666
- * In such reason, when `input` value is not matched with the type `T`, it returns
667
- * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's no
668
- * problem on the `input` value, JSON string would be stored in `data` property of
669
- * the output {@link IValidation.ISuccess} instance.
670
- *
671
- * For reference, with detailed type validation, it is even 5x times faster than the
672
- * native `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
673
- * with confidence.
512
+ * Creates a reusable {@link equals} function.
674
513
  *
675
514
  * @template T Type of the input value
676
- * @param input A value to be checked and converted
677
- * @returns Validation result with JSON string value
678
- *
679
- * @author Jeongho Nam - https://github.com/samchon
680
- */
681
- export declare function validateStringify<T>(input: unknown): IValidation<string>;
682
- /**
683
- * > You must configure the generic argument `T`.
684
- *
685
- * Generate random data.
686
- *
687
- * Generates a random data following type the `T`.
688
- *
689
- * For reference, this `typia.random()` function generates only primitive type.
690
- * If there're some methods in the type `T` or its nested instances, those would
691
- * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
692
- * would be generated instead.
693
- *
694
- * @template T Type of data to generate
695
- * @param generator Random data generator
696
- * @return Randomly generated data
515
+ * @returns A reusable `equals` function
697
516
  *
698
517
  * @author Jeongho Nam - https://github.com/samchon
699
518
  */
700
- export declare function random(generator?: Partial<IRandomGenerator>): never;
519
+ export declare function createEquals<T>(): (input: unknown) => input is T;
701
520
  /**
702
- * Generate random data.
703
- *
704
- * Generates a random data following type the `T`.
705
- *
706
- * For reference, this `typia.random()` function generates only primitive type.
707
- * If there're some methods in the type `T` or its nested instances, those would
708
- * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
709
- * would be generated instead.
521
+ * Creates a reusable {@link validateEquals} function.
710
522
  *
711
- * @template T Type of data to generate
712
- * @param generator Random data generator
713
- * @return Randomly generated data
523
+ * @danger You have to specify the generic argument `T`
524
+ * @return Nothing until specifying the generic argument `T`
525
+ * @throws compile error
714
526
  *
715
527
  * @author Jeongho Nam - https://github.com/samchon
716
528
  */
717
- export declare function random<T>(generator?: Partial<IRandomGenerator>): Primitive<T>;
529
+ export declare function createValidateEquals(): never;
718
530
  /**
719
- * > You must configure the generic argument `T`.
720
- *
721
- * Union literal type to array.
722
- *
723
- * Converts a union literal type to an array of its members.
724
- *
725
- * ```typescript
726
- * literals<"A" | "B" | 1>; // ["A", "B", 1]
727
- * ```
531
+ * Creates a reusable {@link validateEquals} function.
728
532
  *
729
- * @template T Union literal type
730
- * @return Array of union literal type's members
533
+ * @template T Type of the input value
534
+ * @returns A reusable `validateEquals` function
731
535
  *
732
536
  * @author Jeongho Nam - https://github.com/samchon
733
537
  */
734
- export declare function literals(): never;
538
+ export declare function createValidateEquals<T>(): (input: unknown) => IValidation<T>;
735
539
  /**
736
- * Union literal type to array.
737
- *
738
- * Converts a union literal type to an array of its members.
739
- *
740
- * ```typescript
741
- * literals<"A" | "B" | 1>; // ["A", "B", 1]
742
- * ```
540
+ * Creates a reusable {@link random} function.
743
541
  *
744
- * @template T Union literal type
745
- * @return Array of union literal type's members
542
+ * @danger You have to specify the generic argument `T`
543
+ * @param generator Random data generator
544
+ * @return Nothing until specifying the generic argument `T`
545
+ * @throws compile error
746
546
  *
747
547
  * @author Jeongho Nam - https://github.com/samchon
748
548
  */
749
- export declare function literals<T extends Atomic.Type | null>(): T[];
549
+ export declare function createRandom(generator?: Partial<IRandomGenerator>): never;
750
550
  /**
751
- * Clone a data.
752
- *
753
- * Clones an instance following type `T`. If the target *input* value or its member
754
- * variable contains a class instance that is having a `toJSON()` method, its return
755
- * value would be cloned.
756
- *
757
- * For reference, this `typia.clone()` function does not validate the input value type.
758
- * It just believes that the input value is following the type `T`. Therefore, if you
759
- * can't ensure the input value type, it would be better to call {@link assertClone}
760
- * function instead.
551
+ * Creates a resuable {@link random} function.
761
552
  *
762
553
  * @template T Type of the input value
763
- * @param input A value to be cloned
764
- * @return Cloned data
765
- *
766
- * @author Jeongho Nam - https://github.com/samchon
767
- */
768
- export declare function clone<T>(input: T): Primitive<T>;
769
- /**
770
- * Clone a data with type assertion.
771
- *
772
- * Clones an instance following type `T`, with type assertion. If the target `input`
773
- * value or its member variable contains a class instance that is having a `toJSON()`
774
- * method, its return value would be cloned.
775
- *
776
- * In such reason, when `input` value is not matched with the type `T`, it throws an
777
- * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, cloned
778
- * data would be returned.
779
- *
780
- * @template T Type of the input value
781
- * @param input A value to be cloned
782
- * @return Cloned data
783
- *
784
- * @author Jeongho Nam - https://github.com/samchon
785
- */
786
- export declare function assertClone<T>(input: T): Primitive<T>;
787
- /**
788
- * Clone a data with type assertion.
789
- *
790
- * Clones an instance following type `T`, with type assertion. If the target `input`
791
- * value or its member variable contains a class instance that is having a `toJSON()`
792
- * method, its return value would be cloned.
793
- *
794
- * In such reason, when `input` value is not matched with the type `T`, it throws an
795
- * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, cloned
796
- * data would be returned.
797
- *
798
- * @template T Type of the input value
799
- * @param input A value to be cloned
800
- * @return Cloned data
801
- *
802
- * @author Jeongho Nam - https://github.com/samchon
803
- */
804
- export declare function assertClone<T>(input: unknown): Primitive<T>;
805
- /**
806
- * Clone a data with type checking.
807
- *
808
- * Clones an instance following type `T`, with type checking. If the target `input`
809
- * value or its member variable contains a class instance that is having a `toJSON()`
810
- * method, its return value would be cloned.
811
- *
812
- * In such reason, when `input` value is not matched with the type `T`, it returns
813
- * `null` value instead. Otherwise, there's no problem on the `input` value, cloned
814
- * data would be returned.
815
- *
816
- * @template T Type of the input value
817
- * @param input A value to be cloned
818
- * @return Cloned data when exact type, otherwise null
819
- *
820
- * @author Jeongho Nam - https://github.com/samchon
821
- */
822
- export declare function isClone<T>(input: T): Primitive<T> | null;
823
- /**
824
- * Clone a data with type checking.
825
- *
826
- * Clones an instance following type `T`, with type checking. If the target `input`
827
- * value or its member variable contains a class instance that is having a `toJSON()`
828
- * method, its return value would be cloned.
829
- *
830
- * In such reason, when `input` value is not matched with the type `T`, it returns
831
- * `null` value instead. Otherwise, there's no problem on the `input` value, cloned
832
- * data would be returned.
833
- *
834
- * @template T Type of the input value
835
- * @param input A value to be cloned
836
- * @return Cloned data when exact type, otherwise null
837
- *
838
- * @author Jeongho Nam - https://github.com/samchon
839
- */
840
- export declare function isClone<T>(input: unknown): Primitive<T> | null;
841
- /**
842
- * Clone a data with detailed type validation.
843
- *
844
- * Clones an instance following type `T`, with detailed type validation. If the target
845
- * `input` value or its member variable contains a class instance that is having a
846
- * `toJSON()` method, its return value would be cloned.
847
- *
848
- * In such reason, when `input` value is not matched with the type `T`, it returns
849
- * {@link IValidation.Failure} value. Otherwise, there's no problem on the `input`
850
- * value, cloned data would be stored in `data` property of the output
851
- * {@link IValidation.Success} instance.
852
- *
853
- * @template T Type of the input value
854
- * @param input A value to be cloned
855
- * @returns Validation result with cloned value
856
- */
857
- export declare function validateClone<T>(input: T): IValidation<Primitive<T>>;
858
- /**
859
- * Clone a data with detailed type validation.
860
- *
861
- * Clones an instance following type `T`, with detailed type validation. If the target
862
- * `input` value or its member variable contains a class instance that is having a
863
- * `toJSON()` method, its return value would be cloned.
864
- *
865
- * In such reason, when `input` value is not matched with the type `T`, it returns
866
- * {@link IValidation.Failure} value. Otherwise, there's no problem on the `input`
867
- * value, cloned data would be stored in `data` property of the output
868
- * {@link IValidation.Success} instance.
869
- *
870
- * @template T Type of the input value
871
- * @param input A value to be cloned
872
- * @returns Validation result with cloned value
873
- */
874
- export declare function validateClone<T>(input: unknown): IValidation<Primitive<T>>;
875
- /**
876
- * Prune, erase superfluous properties.
877
- *
878
- * Remove every superfluous properties from the `input` object, even including nested
879
- * objects. Note that, as every superfluous properties would be deleted, you never can
880
- * read those superfluous properties after calling this `prune()` function.
881
- *
882
- * For reference, this `typia.prune()` function does not validate the input value type.
883
- * It just believes that the input value is following the type `T`. Therefore, if you
884
- * can't ensure the input value type, it would better to call one of below functions
885
- * instead.
886
- *
887
- * - {@link assertPrune}
888
- * - {@link isPrune}
889
- * - {@link validatePrune}
890
- *
891
- * @template T Type of the input value
892
- * @param input Target instance to prune
893
- *
894
- * @author Jeongho Nam - https://github.com/samchon
895
- */
896
- export declare function prune<T extends object>(input: T): void;
897
- /**
898
- * Prune, erase superfluous properties, with type assertion.
899
- *
900
- * `typia.assertPrune()` is a combination function of {@link assert} and {@link prune}.
901
- * Therefore, it removes every superfluous properties from the `input` object including
902
- * nested objects, with type assertion.
903
- *
904
- * In such reason, when `input` value is not matched with the type `T`, it throws an
905
- * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, its
906
- * every superfluous properties would be removed, including nested objects.
907
- *
908
- * @template T Type of the input value
909
- * @param input Target instance to assert and prune
910
- *
911
- * @author Jeongho Nam - https://github.com/samchon
912
- */
913
- export declare function assertPrune<T>(input: T): T;
914
- /**
915
- * Prune, erase superfluous properties, with type assertion.
916
- *
917
- * `typia.assertPrune()` is a combination function of {@link assert} and {@link prune}.
918
- * Therefore, it removes every superfluous properties from the `input` object including
919
- * nested objects, with type assertion.
920
- *
921
- * In such reason, when `input` value is not matched with the type `T`, it throws an
922
- * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, its
923
- * every superfluous properties would be removed, including nested objects.
924
- *
925
- * @template T Type of the input value
926
- * @param input Target instance to assert and prune
927
- *
928
- * @author Jeongho Nam - https://github.com/samchon
929
- */
930
- export declare function assertPrune<T>(input: unknown): T;
931
- /**
932
- * Prune, erase superfluous properties, with type checking.
933
- *
934
- * `typia.assertPrune()` is a combination function of {@link is} and {@link prune}.
935
- * Therefore, it removes every superfluous properties from the `input` object including
936
- * nested objects, with type checking.
937
- *
938
- * In such reason, when `input` value is not matched with the type `T`, it returns
939
- * `false` value. Otherwise, there's no problem on the `input` value, it returns
940
- * `true` after removing every superfluous properties, including nested objects.
941
- *
942
- * @template T Type of the input value
943
- * @param input Target instance to check and prune
944
- * @returns Whether the parametric value is following the type `T` or not
945
- *
946
- * @author Jeongho Nam - https://github.com/samchon
947
- */
948
- export declare function isPrune<T>(input: T): input is T;
949
- /**
950
- * Prune, erase superfluous properties, with type checking.
951
- *
952
- * `typia.assertPrune()` is a combination function of {@link is} and {@link prune}.
953
- * Therefore, it removes every superfluous properties from the `input` object including
954
- * nested objects, with type checking.
955
- *
956
- * In such reason, when `input` value is not matched with the type `T`, it returns
957
- * `false` value. Otherwise, there's no problem on the `input` value, it returns
958
- * `true` after removing every superfluous properties, including nested objects.
959
- *
960
- * @template T Type of the input value
961
- * @param input Target instance to check and prune
962
- * @returns Whether the parametric value is following the type `T` or not
963
- *
964
- * @author Jeongho Nam - https://github.com/samchon
965
- */
966
- export declare function isPrune<T>(input: unknown): input is T;
967
- /**
968
- * Prune, erase superfluous properties, with type validation.
969
- *
970
- * `typia.validatePrune()` is a combination function of {@link validate} and {@link prune}.
971
- * Therefore, it removes every superfluous properties from the `input` object including
972
- * nested objects, with type validation.
973
- *
974
- * In such reason, when `input` value is not matched with the type `T`, it returns
975
- * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's
976
- * no problem on the `input` value, it returns {@link IValidation.ISucess} value after
977
- * removing every superfluous properties, including nested objects.
978
- *
979
- * @template T Type of the input value
980
- * @param input Target instance to validate and prune
981
- * @returns Validation result
982
- *
983
- * @author Jeongho Nam - https://github.com/samchon
984
- */
985
- export declare function validatePrune<T>(input: T): IValidation<T>;
986
- /**
987
- * Prune, erase superfluous properties, with type validation.
988
- *
989
- * `typia.validatePrune()` is a combination function of {@link validate} and {@link prune}.
990
- * Therefore, it removes every superfluous properties from the `input` object including
991
- * nested objects, with type validation.
992
- *
993
- * In such reason, when `input` value is not matched with the type `T`, it returns
994
- * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's
995
- * no problem on the `input` value, it returns {@link IValidation.ISucess} value after
996
- * removing every superfluous properties, including nested objects.
997
- *
998
- * @template T Type of the input value
999
- * @param input Target instance to validate and prune
1000
- * @returns Validation result
1001
- *
1002
- * @author Jeongho Nam - https://github.com/samchon
1003
- */
1004
- export declare function validatePrune<T>(input: unknown): IValidation<T>;
1005
- /**
1006
- * Creates a reusable {@link assert} function.
1007
- *
1008
- * @danger You have to specify the generic argument `T`
1009
- * @return Nothing until specifying the generic argument `T`
1010
- * @throws compile error
1011
- *
1012
- * @author Jeongho Nam - https://github.com/samchon
1013
- */
1014
- export declare function createAssert(): never;
1015
- /**
1016
- * Creates a reusable {@link assert} function.
1017
- *
1018
- * @template T Type of the input value
1019
- * @returns A reusable `assert` function
1020
- *
1021
- * @author Jeongho Nam - https://github.com/samchon
1022
- */
1023
- export declare function createAssert<T>(): (input: unknown) => T;
1024
- /**
1025
- * Creates a reusable {@link assertType} function.
1026
- *
1027
- * Duplicated function of {@link createAssert} for `typescript-is` users.
1028
- *
1029
- * @danger You have to specify the generic argument `T`
1030
- * @return Nothing until specifying the generic argument `T`
1031
- * @throws compile error
1032
- *
1033
- * @author Jeongho Nam - https://github.com/samchon
1034
- * @deprecated
1035
- */
1036
- export declare function createAssertType(): never;
1037
- /**
1038
- * Creates a reusable {@link assertType} function.
1039
- *
1040
- * Duplicated function of {@link createAssert} for `typescript-is` users.
1041
- *
1042
- * @template T Type of the input value
1043
- * @returns A reusable `assert` function
1044
- *
1045
- * @author Jeongho Nam - https://github.com/samchon
1046
- * @deprecated
1047
- */
1048
- export declare function createAssertType<T>(): (input: unknown) => T;
1049
- /**
1050
- * Creates a reusable {@link is} function.
1051
- *
1052
- * @danger You have to specify the generic argument `T`
1053
- * @return Nothing until specifying the generic argument `T`
1054
- * @throws compile error
1055
- *
1056
- * @author Jeongho Nam - https://github.com/samchon
1057
- */
1058
- export declare function createIs(): never;
1059
- /**
1060
- * Creates a reusable {@link is} function.
1061
- *
1062
- * @template T Type of the input value
1063
- * @returns A reusable `is` function
1064
- *
1065
- * @author Jeongho Nam - https://github.com/samchon
1066
- */
1067
- export declare function createIs<T>(): (input: unknown) => input is T;
1068
- /**
1069
- * Creates a reusable {@link validate} function.
1070
- *
1071
- * @danger You have to specify the generic argument `T`
1072
- * @return Nothing until specifying the generic argument `T`
1073
- * @throws compile error
1074
- *
1075
- * @author Jeongho Nam - https://github.com/samchon
1076
- */
1077
- export declare function createValidate(): never;
1078
- /**
1079
- * Creates a reusable {@link validate} function.
1080
- *
1081
- * @template T Type of the input value
1082
- * @returns A reusable `validate` function
1083
- *
1084
- * @author Jeongho Nam - https://github.com/samchon
1085
- */
1086
- export declare function createValidate<T>(): (input: unknown) => IValidation<T>;
1087
- /**
1088
- * Creates a reusable {@link assertEquals} function.
1089
- *
1090
- * @danger You have to specify the generic argument `T`
1091
- * @return Nothing until specifying the generic argument `T`
1092
- * @throws compile error
1093
- *
1094
- * @author Jeongho Nam - https://github.com/samchon
1095
- */
1096
- export declare function createAssertEquals(): never;
1097
- /**
1098
- * Creates a reusable {@link assertEquals} function.
1099
- *
1100
- * @template T Type of the input value
1101
- * @returns A reusable `assertEquals` function
1102
- *
1103
- * @author Jeongho Nam - https://github.com/samchon
1104
- */
1105
- export declare function createAssertEquals<T>(): (input: unknown) => T;
1106
- /**
1107
- * Creates a reusable {@link equals} function.
1108
- *
1109
- * @danger You have to specify the generic argument `T`
1110
- * @return Nothing until specifying the generic argument `T`
1111
- * @throws compile error
1112
- *
1113
- * @author Jeongho Nam - https://github.com/samchon
1114
- */
1115
- export declare function createEquals(): never;
1116
- /**
1117
- * Creates a reusable {@link equals} function.
1118
- *
1119
- * @template T Type of the input value
1120
- * @returns A reusable `equals` function
1121
- *
1122
- * @author Jeongho Nam - https://github.com/samchon
1123
- */
1124
- export declare function createEquals<T>(): (input: unknown) => input is T;
1125
- /**
1126
- * Creates a reusable {@link validateEquals} function.
1127
- *
1128
- * @danger You have to specify the generic argument `T`
1129
- * @return Nothing until specifying the generic argument `T`
1130
- * @throws compile error
1131
- *
1132
- * @author Jeongho Nam - https://github.com/samchon
1133
- */
1134
- export declare function createValidateEquals(): never;
1135
- /**
1136
- * Creates a reusable {@link validateEquals} function.
1137
- *
1138
- * @template T Type of the input value
1139
- * @returns A reusable `validateEquals` function
1140
- *
1141
- * @author Jeongho Nam - https://github.com/samchon
1142
- */
1143
- export declare function createValidateEquals<T>(): (input: unknown) => IValidation<T>;
1144
- /**
1145
- * Creates a reusable {@link isParse} function.
1146
- *
1147
- * @danger You have to specify the generic argument `T`
1148
- * @return Nothing until specifying the generic argument `T`
1149
- * @throws compile error
1150
- *
1151
- * @author Jeongho Nam - https://github.com/samchon
1152
- */
1153
- export declare function createIsParse(): never;
1154
- /**
1155
- * Creates a reusable {@link isParse} function.
1156
- *
1157
- * @template T Expected type of parsed value
1158
- * @returns A reusable `isParse` function
1159
- *
1160
- * @author Jeongho Nam - https://github.com/samchon
1161
- */
1162
- export declare function createIsParse<T>(): (input: string) => Primitive<T> | null;
1163
- /**
1164
- * Creates a reusable {@link assertParse} function.
1165
- *
1166
- * @danger You have to specify the generic argument `T`
1167
- * @return Nothing until specifying the generic argument `T`
1168
- * @throws compile error
1169
- *
1170
- * @author Jeongho Nam - https://github.com/samchon
1171
- */
1172
- export declare function createAssertParse(): never;
1173
- /**
1174
- * Creates a reusable {@link assertParse} function.
1175
- *
1176
- * @template T Expected type of parsed value
1177
- * @returns A reusable `assertParse` function
1178
- *
1179
- * @author Jeongho Nam - https://github.com/samchon
1180
- */
1181
- export declare function createAssertParse<T>(): (input: string) => Primitive<T>;
1182
- /**
1183
- * Creates a reusable {@link validateParse} function.
1184
- *
1185
- * @danger You have to specify the generic argument `T`
1186
- * @return Nothing until specifying the generic argument `T`
1187
- * @throws compile error
1188
- *
1189
- * @author Jeongho Nam - https://github.com/samchon
1190
- */
1191
- export declare function createValidateParse(): never;
1192
- /**
1193
- * Creates a reusable {@link validateParse} function.
1194
- *
1195
- * @template T Expected type of parsed value
1196
- * @returns A reusable `validateParse` function
1197
- *
1198
- * @author Jeongho Nam - https://github.com/samchon
1199
- */
1200
- export declare function createValidateParse<T>(): (input: string) => IValidation<Primitive<T>>;
1201
- /**
1202
- * Creates a reusable {@link stringify} function.
1203
- *
1204
- * @danger You have to specify the generic argument `T`
1205
- * @return Nothing until specifying the generic argument `T`
1206
- * @throws compile error
1207
- *
1208
- * @author Jeongho Nam - https://github.com/samchon
1209
- */
1210
- export declare function createStringify(): never;
1211
- /**
1212
- * Creates a reusable {@link stringify} function.
1213
- *
1214
- * @template T Type of the input value
1215
- * @returns A reusable `stringify` function
1216
- *
1217
- * @author Jeongho Nam - https://github.com/samchon
1218
- */
1219
- export declare function createStringify<T>(): (input: T) => string;
1220
- /**
1221
- * Creates a reusable {@link assertStringify} function.
1222
- *
1223
- * @danger You have to specify the generic argument `T`
1224
- * @return Nothing until specifying the generic argument `T`
1225
- * @throws compile error
1226
- *
1227
- * @author Jeongho Nam - https://github.com/samchon
1228
- */
1229
- export declare function createAssertStringify(): never;
1230
- /**
1231
- * Creates a reusable {@link assertStringify} function.
1232
- *
1233
- * @template T Type of the input value
1234
- * @returns A reusable `assertStringify` function
1235
- *
1236
- * @author Jeongho Nam - https://github.com/samchon
1237
- */
1238
- export declare function createAssertStringify<T>(): (input: unknown) => string;
1239
- /**
1240
- * Creates a reusable {@link isStringify} function.
1241
- *
1242
- * @danger You have to specify the generic argument `T`
1243
- * @return Nothing until specifying the generic argument `T`
1244
- * @throws compile error
1245
- *
1246
- * @author Jeongho Nam - https://github.com/samchon
1247
- */
1248
- export declare function createIsStringify(): never;
1249
- /**
1250
- * Creates a reusable {@link isStringify} function.
1251
- *
1252
- * @template T Type of the input value
1253
- * @returns A reusable `isStringify` function
1254
- *
1255
- * @author Jeongho Nam - https://github.com/samchon
1256
- */
1257
- export declare function createIsStringify<T>(): (input: unknown) => string | null;
1258
- /**
1259
- * Creates a reusable {@link validateStringify} function.
1260
- *
1261
- * @danger You have to specify the generic argument `T`
1262
- * @return Nothing until specifying the generic argument `T`
1263
- * @throws compile error
1264
- *
1265
- * @author Jeongho Nam - https://github.com/samchon
1266
- */
1267
- export declare function createValidateStringify(): never;
1268
- /**
1269
- * Creates a reusable {@link validateStringify} function.
1270
- *
1271
- * @template T Type of the input value
1272
- * @returns A reusable `validateStringify` function
1273
-
1274
- * @author Jeongho Nam - https://github.com/samchon
1275
- */
1276
- export declare function createValidateStringify<T>(): (input: unknown) => IValidation<string>;
1277
- /**
1278
- * Creates a reusable {@link random} function.
1279
- *
1280
- * @danger You have to specify the generic argument `T`
1281
- * @param generator Random data generator
1282
- * @return Nothing until specifying the generic argument `T`
1283
- * @throws compile error
1284
- *
1285
- * @author Jeongho Nam - https://github.com/samchon
1286
- */
1287
- export declare function createRandom(generator?: Partial<IRandomGenerator>): never;
1288
- /**
1289
- * Creates a resuable {@link random} function.
1290
- *
1291
- * @template T Type of the input value
1292
- * @param generator Random data generator
1293
- * @returns A reusable `random` function
554
+ * @param generator Random data generator
555
+ * @returns A reusable `random` function
1294
556
  *
1295
557
  * @author Jeongho Nam - https://github.com/samchon
1296
558
  */
1297
559
  export declare function createRandom<T>(generator?: Partial<IRandomGenerator>): () => Primitive<T>;
1298
- /**
1299
- * Creates a reusable {@link clone} function.
1300
- *
1301
- * @danger You have to specify the generic argument `T`
1302
- * @return Nothing until specifying the generic argument `T`
1303
- * @throws compile error
1304
- *
1305
- * @author Jeongho Nam - https://github.com/samchon
1306
- */
1307
- export declare function createClone(): never;
1308
- /**
1309
- * Creates a resuable {@link clone} function.
1310
- *
1311
- * @template T Type of the input value
1312
- * @returns A reusable `clone` function
1313
- *
1314
- * @author Jeongho Nam - https://github.com/samchon
1315
- */
1316
- export declare function createClone<T>(): (input: T) => Primitive<T>;
1317
- /**
1318
- * Creates a reusable {@link assertClone} function.
1319
- *
1320
- * @danger You have to specify the generic argument `T`
1321
- * @return Nothing until specifying the generic argument `T`
1322
- * @throws compile error
1323
- *
1324
- * @author Jeongho Nam - https://github.com/samchon
1325
- */
1326
- export declare function createAssertClone(): never;
1327
- /**
1328
- * Creates a resuable {@link assertClone} function.
1329
- *
1330
- * @template T Type of the input value
1331
- * @returns A reusable `clone` function
1332
- *
1333
- * @author Jeongho Nam - https://github.com/samchon
1334
- */
1335
- export declare function createAssertClone<T>(): (input: unknown) => Primitive<T>;
1336
- /**
1337
- * Creates a reusable {@link isClone} function.
1338
- *
1339
- * @danger You have to specify the generic argument `T`
1340
- * @return Nothing until specifying the generic argument `T`
1341
- * @throws compile error
1342
- *
1343
- * @author Jeongho Nam - https://github.com/samchon
1344
- */
1345
- export declare function createIsClone(): never;
1346
- /**
1347
- * Creates a resuable {@link isClone} function.
1348
- *
1349
- * @template T Type of the input value
1350
- * @returns A reusable `clone` function
1351
- *
1352
- * @author Jeongho Nam - https://github.com/samchon
1353
- */
1354
- export declare function createIsClone<T>(): (input: unknown) => Primitive<T> | null;
1355
- /**
1356
- * Creates a reusable {@link validateClone} function.
1357
- *
1358
- * @danger You have to specify the generic argument `T`
1359
- * @return Nothing until specifying the generic argument `T`
1360
- * @throws compile error
1361
- *
1362
- * @author Jeongho Nam - https://github.com/samchon
1363
- */
1364
- export declare function createValidateClone(): never;
1365
- /**
1366
- * Creates a resuable {@link validateClone} function.
1367
- *
1368
- * @template T Type of the input value
1369
- * @returns A reusable `clone` function
1370
- *
1371
- * @author Jeongho Nam - https://github.com/samchon
1372
- */
1373
- export declare function createValidateClone<T>(): (input: unknown) => IValidation<Primitive<T>>;
1374
- /**
1375
- * Creates a reusable {@link prune} function.
1376
- *
1377
- * @danger You have to specify the generic argument `T`
1378
- * @return Nothing until specifying the generic argument `T`
1379
- * @throws compile error
1380
- *
1381
- * @author Jeongho Nam - https://github.com/samchon
1382
- */
1383
- export declare function createPrune(): never;
1384
- /**
1385
- * Creates a resuable {@link prune} function.
1386
- *
1387
- * @template T Type of the input value
1388
- * @returns A reusable `prune` function
1389
- *
1390
- * @author Jeongho Nam - https://github.com/samchon
1391
- */
1392
- export declare function createPrune<T extends object>(): (input: T) => void;
1393
- /**
1394
- * Creates a reusable {@link assertPrune} function.
1395
- *
1396
- * @danger You have to specify the generic argument `T`
1397
- * @return Nothing until specifying the generic argument `T`
1398
- * @throws compile error
1399
- *
1400
- * @author Jeongho Nam - https://github.com/samchon
1401
- */
1402
- export declare function createAssertPrune(): never;
1403
- /**
1404
- * Creates a resuable {@link assertPrune} function.
1405
- *
1406
- * @template T Type of the input value
1407
- * @returns A reusable `isPrune` function
1408
- *
1409
- * @author Jeongho Nam - https://github.com/samchon
1410
- */
1411
- export declare function createAssertPrune<T extends object>(): (input: T) => T;
1412
- /**
1413
- * Creates a reusable {@link isPrune} function.
1414
- *
1415
- * @danger You have to specify the generic argument `T`
1416
- * @return Nothing until specifying the generic argument `T`
1417
- * @throws compile error
1418
- *
1419
- * @author Jeongho Nam - https://github.com/samchon
1420
- */
1421
- export declare function createIsPrune(): never;
1422
- /**
1423
- * Creates a resuable {@link isPrune} function.
1424
- *
1425
- * @template T Type of the input value
1426
- * @returns A reusable `isPrune` function
1427
- *
1428
- * @author Jeongho Nam - https://github.com/samchon
1429
- */
1430
- export declare function createIsPrune<T extends object>(): (input: T) => input is T;
1431
- /**
1432
- * Creates a reusable {@link validatePrune} function.
1433
- *
1434
- * @danger You have to specify the generic argument `T`
1435
- * @return Nothing until specifying the generic argument `T`
1436
- * @throws compile error
1437
- *
1438
- * @author Jeongho Nam - https://github.com/samchon
1439
- */
1440
- export declare function createValidatePrune(): never;
1441
- /**
1442
- * Creates a resuable {@link validatePrune} function.
1443
- *
1444
- * @template T Type of the input value
1445
- * @returns A reusable `validatePrune` function
1446
- *
1447
- * @author Jeongho Nam - https://github.com/samchon
1448
- */
1449
- export declare function createValidatePrune<T extends object>(): (input: T) => IValidation<T>;