typia 5.0.0-dev.20230715 → 5.0.0-dev.20230726

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 (698) hide show
  1. package/lib/factories/MetadataCollection.d.ts +6 -6
  2. package/lib/factories/MetadataCollection.js +4 -4
  3. package/lib/factories/MetadataCollection.js.map +1 -1
  4. package/lib/factories/MetadataFactory.d.ts +1 -1
  5. package/lib/factories/MetadataTagFactory.d.ts +2 -2
  6. package/lib/factories/ProtocolFactory.d.ts +3 -3
  7. package/lib/factories/ProtocolFactory.js +1 -1
  8. package/lib/factories/ProtocolFactory.js.map +1 -1
  9. package/lib/factories/internal/metadata/MetadataHelper.d.ts +1 -1
  10. package/lib/factories/internal/metadata/MetadataHelper.js +1 -1
  11. package/lib/factories/internal/metadata/MetadataHelper.js.map +1 -1
  12. package/lib/factories/internal/metadata/emend_metadata_atomics.d.ts +1 -1
  13. package/lib/factories/internal/metadata/emplace_metadata_alias.d.ts +1 -1
  14. package/lib/factories/internal/metadata/emplace_metadata_array.d.ts +1 -1
  15. package/lib/factories/internal/metadata/emplace_metadata_object.d.ts +1 -1
  16. package/lib/factories/internal/metadata/emplace_metadata_object.js +1 -1
  17. package/lib/factories/internal/metadata/emplace_metadata_object.js.map +1 -1
  18. package/lib/factories/internal/metadata/emplace_metadata_tuple.d.ts +1 -1
  19. package/lib/factories/internal/metadata/emplace_metadata_tuple.js +1 -1
  20. package/lib/factories/internal/metadata/emplace_metadata_tuple.js.map +1 -1
  21. package/lib/factories/internal/metadata/explore_metadata.d.ts +1 -1
  22. package/lib/factories/internal/metadata/explore_metadata.js +1 -1
  23. package/lib/factories/internal/metadata/explore_metadata.js.map +1 -1
  24. package/lib/factories/internal/metadata/iterate_metadata.d.ts +1 -1
  25. package/lib/factories/internal/metadata/iterate_metadata_alias.d.ts +1 -1
  26. package/lib/factories/internal/metadata/iterate_metadata_array.d.ts +1 -1
  27. package/lib/factories/internal/metadata/iterate_metadata_atomic.d.ts +1 -1
  28. package/lib/factories/internal/metadata/iterate_metadata_coalesce.d.ts +1 -1
  29. package/lib/factories/internal/metadata/iterate_metadata_constant.d.ts +1 -1
  30. package/lib/factories/internal/metadata/iterate_metadata_intersection.d.ts +1 -1
  31. package/lib/factories/internal/metadata/iterate_metadata_intersection.js +1 -1
  32. package/lib/factories/internal/metadata/iterate_metadata_intersection.js.map +1 -1
  33. package/lib/factories/internal/metadata/iterate_metadata_map.d.ts +1 -1
  34. package/lib/factories/internal/metadata/iterate_metadata_native.d.ts +1 -1
  35. package/lib/factories/internal/metadata/iterate_metadata_object.d.ts +1 -1
  36. package/lib/factories/internal/metadata/iterate_metadata_resolve.d.ts +1 -1
  37. package/lib/factories/internal/metadata/iterate_metadata_resolve.js +2 -2
  38. package/lib/factories/internal/metadata/iterate_metadata_resolve.js.map +1 -1
  39. package/lib/factories/internal/metadata/iterate_metadata_set.d.ts +1 -1
  40. package/lib/factories/internal/metadata/iterate_metadata_sort.d.ts +1 -1
  41. package/lib/factories/internal/metadata/iterate_metadata_sort.js +2 -2
  42. package/lib/factories/internal/metadata/iterate_metadata_sort.js.map +1 -1
  43. package/lib/factories/internal/metadata/iterate_metadata_tag.d.ts +1 -1
  44. package/lib/factories/internal/metadata/iterate_metadata_template.d.ts +1 -1
  45. package/lib/factories/internal/metadata/iterate_metadata_tuple.d.ts +1 -1
  46. package/lib/factories/internal/metadata/iterate_metadata_union.d.ts +1 -1
  47. package/lib/factories/internal/protocols/ProtocolMetadataUtil.d.ts +4 -4
  48. package/lib/factories/internal/protocols/ProtocolMetadataUtil.js +4 -4
  49. package/lib/factories/internal/protocols/ProtocolMetadataUtil.js.map +1 -1
  50. package/lib/factories/internal/protocols/emplace_protocol_object.d.ts +2 -2
  51. package/lib/factories/internal/protocols/emplace_protocol_property.d.ts +3 -3
  52. package/lib/factories/internal/protocols/iterate_protocol_atomic.d.ts +1 -1
  53. package/lib/factories/internal/protocols/iterate_protocol_constant.d.ts +1 -1
  54. package/lib/factories/internal/protocols/iterate_protocol_main.d.ts +2 -2
  55. package/lib/factories/internal/protocols/iterate_protocol_map.d.ts +3 -3
  56. package/lib/factories/internal/protocols/iterate_protocol_metadata.d.ts +4 -4
  57. package/lib/factories/internal/protocols/iterate_protocol_native.d.ts +1 -1
  58. package/lib/factories/internal/protocols/iterate_protocol_native.js +1 -1
  59. package/lib/factories/internal/protocols/iterate_protocol_native.js.map +1 -1
  60. package/lib/factories/internal/protocols/iterate_protocol_object.d.ts +3 -3
  61. package/lib/factories/internal/protocols/iterate_protocol_object.js +1 -1
  62. package/lib/factories/internal/protocols/iterate_protocol_object.js.map +1 -1
  63. package/lib/factories/internal/protocols/iterate_protocol_repeated.d.ts +4 -4
  64. package/lib/factories/internal/protocols/iterate_protocol_tuple.d.ts +2 -2
  65. package/lib/json.d.ts +1 -1
  66. package/lib/module.d.ts +3 -3
  67. package/lib/module.js +3 -3
  68. package/lib/module.js.map +1 -1
  69. package/lib/programmers/CheckerProgrammer.d.ts +2 -2
  70. package/lib/programmers/CheckerProgrammer.js +1 -1
  71. package/lib/programmers/CheckerProgrammer.js.map +1 -1
  72. package/lib/programmers/FeatureProgrammer.d.ts +5 -5
  73. package/lib/programmers/IsProgrammer.d.ts +2 -2
  74. package/lib/programmers/helpers/AtomicPredicator.d.ts +1 -1
  75. package/lib/programmers/helpers/IExpressionEntry.d.ts +1 -1
  76. package/lib/programmers/helpers/PruneJoiner.d.ts +1 -1
  77. package/lib/programmers/helpers/RandomJoiner.d.ts +4 -4
  78. package/lib/programmers/helpers/RandomRanger.d.ts +1 -1
  79. package/lib/programmers/helpers/StringifyPredicator.d.ts +1 -1
  80. package/lib/programmers/helpers/UnionExplorer.d.ts +5 -5
  81. package/lib/programmers/helpers/UnionExplorer.js +3 -3
  82. package/lib/programmers/helpers/UnionExplorer.js.map +1 -1
  83. package/lib/programmers/helpers/UnionPredicator.d.ts +2 -2
  84. package/lib/programmers/helpers/UnionPredicator.js +1 -1
  85. package/lib/programmers/helpers/UnionPredicator.js.map +1 -1
  86. package/lib/programmers/internal/application_alias.d.ts +2 -2
  87. package/lib/programmers/internal/application_object.js +1 -1
  88. package/lib/programmers/internal/application_object.js.map +1 -1
  89. package/lib/programmers/internal/application_resolved.d.ts +1 -1
  90. package/lib/programmers/internal/application_tuple.js +1 -1
  91. package/lib/programmers/internal/application_tuple.js.map +1 -1
  92. package/lib/programmers/internal/check_union_array_like.js +2 -2
  93. package/lib/programmers/internal/check_union_array_like.js.map +1 -1
  94. package/lib/programmers/internal/wrap_metadata_rest_tuple.d.ts +1 -1
  95. package/lib/programmers/internal/wrap_metadata_rest_tuple.js +2 -2
  96. package/lib/programmers/internal/wrap_metadata_rest_tuple.js.map +1 -1
  97. package/lib/programmers/json/JsonApplicationProgrammer.d.ts +2 -2
  98. package/lib/programmers/json/JsonIsStringifyProgrammer.d.ts +1 -1
  99. package/lib/programmers/json/JsonIsStringifyProgrammer.js +5 -5
  100. package/lib/programmers/json/JsonIsStringifyProgrammer.js.map +1 -1
  101. package/lib/programmers/json/JsonStringifyProgrammer.js +1 -1
  102. package/lib/programmers/json/JsonStringifyProgrammer.js.map +1 -1
  103. package/lib/programmers/misc/MiscCloneProgrammer.js +1 -1
  104. package/lib/programmers/misc/MiscCloneProgrammer.js.map +1 -1
  105. package/lib/programmers/misc/MiscPruneProgrammer.js +1 -1
  106. package/lib/programmers/misc/MiscPruneProgrammer.js.map +1 -1
  107. package/lib/programmers/protobuf/ProtobufAssertDecodeProgrammer.d.ts +5 -0
  108. package/lib/programmers/protobuf/ProtobufAssertDecodeProgrammer.js +42 -0
  109. package/lib/programmers/protobuf/ProtobufAssertDecodeProgrammer.js.map +1 -0
  110. package/lib/programmers/protobuf/ProtobufAssertEncodeProgrammer.d.ts +5 -0
  111. package/lib/programmers/protobuf/ProtobufAssertEncodeProgrammer.js +42 -0
  112. package/lib/programmers/protobuf/ProtobufAssertEncodeProgrammer.js.map +1 -0
  113. package/lib/programmers/protobuf/ProtobufDecodeProgrammer.d.ts +5 -0
  114. package/lib/programmers/protobuf/ProtobufDecodeProgrammer.js +26 -0
  115. package/lib/programmers/protobuf/ProtobufDecodeProgrammer.js.map +1 -0
  116. package/lib/programmers/protobuf/ProtobufEncodeProgrammer.d.ts +5 -0
  117. package/lib/programmers/protobuf/ProtobufEncodeProgrammer.js +26 -0
  118. package/lib/programmers/protobuf/ProtobufEncodeProgrammer.js.map +1 -0
  119. package/lib/programmers/protobuf/ProtobufIsDecodeProgrammer.d.ts +5 -0
  120. package/lib/programmers/protobuf/ProtobufIsDecodeProgrammer.js +45 -0
  121. package/lib/programmers/protobuf/ProtobufIsDecodeProgrammer.js.map +1 -0
  122. package/lib/programmers/protobuf/ProtobufIsEncodeProgrammer.d.ts +5 -0
  123. package/lib/programmers/protobuf/ProtobufIsEncodeProgrammer.js +43 -0
  124. package/lib/programmers/protobuf/ProtobufIsEncodeProgrammer.js.map +1 -0
  125. package/lib/programmers/protobuf/ProtobufMessageProgrammer.js +1 -1
  126. package/lib/programmers/protobuf/ProtobufMessageProgrammer.js.map +1 -1
  127. package/lib/programmers/protobuf/ProtobufValidateDecodeProgrammer.d.ts +5 -0
  128. package/lib/programmers/protobuf/ProtobufValidateDecodeProgrammer.js +42 -0
  129. package/lib/programmers/protobuf/ProtobufValidateDecodeProgrammer.js.map +1 -0
  130. package/lib/programmers/protobuf/ProtobufValidateEncodeProgrammer.d.ts +5 -0
  131. package/lib/programmers/protobuf/ProtobufValidateEncodeProgrammer.js +42 -0
  132. package/lib/programmers/protobuf/ProtobufValidateEncodeProgrammer.js.map +1 -0
  133. package/lib/protobuf.d.ts +16 -0
  134. package/lib/protobuf.js +33 -1
  135. package/lib/protobuf.js.map +1 -1
  136. package/lib/schemas/json/IJsonApplication.js.map +1 -0
  137. package/lib/schemas/json/IJsonComponents.js.map +1 -0
  138. package/lib/schemas/{IJsonSchema.d.ts → json/IJsonSchema.d.ts} +1 -1
  139. package/lib/schemas/json/IJsonSchema.js.map +1 -0
  140. package/lib/schemas/metadata/ICommentTag.js.map +1 -0
  141. package/lib/schemas/metadata/IJsDocTagInfo.js.map +1 -0
  142. package/lib/{metadata → schemas/metadata}/IMetadata.d.ts +1 -1
  143. package/lib/schemas/metadata/IMetadata.js.map +1 -0
  144. package/lib/schemas/metadata/IMetadataAlias.js.map +1 -0
  145. package/lib/schemas/metadata/IMetadataApplication.js.map +1 -0
  146. package/lib/schemas/metadata/IMetadataArray.js.map +1 -0
  147. package/lib/schemas/metadata/IMetadataCollection.js.map +1 -0
  148. package/lib/{metadata → schemas/metadata}/IMetadataConstant.d.ts +1 -1
  149. package/lib/schemas/metadata/IMetadataConstant.js.map +1 -0
  150. package/lib/schemas/metadata/IMetadataDictionary.js.map +1 -0
  151. package/lib/schemas/metadata/IMetadataEntry.js.map +1 -0
  152. package/lib/schemas/metadata/IMetadataObject.js.map +1 -0
  153. package/lib/schemas/metadata/IMetadataProperty.js.map +1 -0
  154. package/lib/schemas/metadata/IMetadataResolved.js.map +1 -0
  155. package/lib/schemas/metadata/IMetadataTag.js.map +1 -0
  156. package/lib/schemas/metadata/IMetadataTuple.js.map +1 -0
  157. package/lib/{metadata → schemas/metadata}/Metadata.d.ts +1 -1
  158. package/lib/{metadata → schemas/metadata}/Metadata.js +6 -4
  159. package/lib/schemas/metadata/Metadata.js.map +1 -0
  160. package/lib/schemas/metadata/MetadataAlias.js.map +1 -0
  161. package/lib/schemas/metadata/MetadataArray.js.map +1 -0
  162. package/lib/schemas/metadata/MetadataConstant.js.map +1 -0
  163. package/lib/schemas/metadata/MetadataObject.js.map +1 -0
  164. package/lib/schemas/metadata/MetadataProperty.js.map +1 -0
  165. package/lib/schemas/metadata/MetadataResolved.js.map +1 -0
  166. package/lib/{metadata → schemas/metadata}/MetadataTuple.d.ts +1 -1
  167. package/lib/schemas/metadata/MetadataTuple.js.map +1 -0
  168. package/lib/schemas/protobuf/IProtocolMap.js.map +1 -0
  169. package/lib/schemas/protobuf/IProtocolMessage.js.map +1 -0
  170. package/lib/schemas/protobuf/IProtocolProperty.js.map +1 -0
  171. package/lib/transformers/CallExpressionTransformer.js +108 -66
  172. package/lib/transformers/CallExpressionTransformer.js.map +1 -1
  173. package/lib/transformers/features/{misc/ApplicationTransformer.d.ts → json/JsonApplicationTransformer.d.ts} +1 -1
  174. package/lib/transformers/features/{misc/ApplicationTransformer.js → json/JsonApplicationTransformer.js} +6 -6
  175. package/lib/transformers/features/json/JsonApplicationTransformer.js.map +1 -0
  176. package/lib/transformers/features/json/{AssertStringifyTransformer.d.ts → JsonAssertParseTransformer.d.ts} +1 -1
  177. package/lib/transformers/features/json/JsonAssertParseTransformer.js +12 -0
  178. package/lib/transformers/features/json/JsonAssertParseTransformer.js.map +1 -0
  179. package/lib/transformers/features/json/JsonAssertStringifyTransformer.d.ts +3 -0
  180. package/lib/transformers/features/json/JsonAssertStringifyTransformer.js +12 -0
  181. package/lib/transformers/features/json/JsonAssertStringifyTransformer.js.map +1 -0
  182. package/lib/transformers/features/json/{CreateAssertStringifyTransformer.d.ts → JsonCreateAssertParseTransformer.d.ts} +1 -1
  183. package/lib/transformers/features/json/JsonCreateAssertParseTransformer.js +12 -0
  184. package/lib/transformers/features/json/JsonCreateAssertParseTransformer.js.map +1 -0
  185. package/lib/transformers/features/json/JsonCreateAssertStringifyTransformer.d.ts +3 -0
  186. package/lib/transformers/features/json/JsonCreateAssertStringifyTransformer.js +12 -0
  187. package/lib/transformers/features/json/JsonCreateAssertStringifyTransformer.js.map +1 -0
  188. package/lib/transformers/features/json/{CreateIsStringifyTransformer.d.ts → JsonCreateIsParseTransformer.d.ts} +1 -1
  189. package/lib/transformers/features/json/JsonCreateIsParseTransformer.js +10 -0
  190. package/lib/transformers/features/json/JsonCreateIsParseTransformer.js.map +1 -0
  191. package/lib/transformers/features/json/JsonCreateIsStringifyTransformer.d.ts +3 -0
  192. package/lib/transformers/features/json/JsonCreateIsStringifyTransformer.js +12 -0
  193. package/lib/transformers/features/json/JsonCreateIsStringifyTransformer.js.map +1 -0
  194. package/lib/transformers/features/json/JsonCreateStringifyTransformer.d.ts +3 -0
  195. package/lib/transformers/features/json/JsonCreateStringifyTransformer.js +10 -0
  196. package/lib/transformers/features/json/JsonCreateStringifyTransformer.js.map +1 -0
  197. package/lib/transformers/features/json/JsonCreateValidateParseTransformer.d.ts +3 -0
  198. package/lib/transformers/features/json/JsonCreateValidateParseTransformer.js +12 -0
  199. package/lib/transformers/features/json/JsonCreateValidateParseTransformer.js.map +1 -0
  200. package/lib/transformers/features/json/JsonCreateValidateStringifyProgrammer.d.ts +3 -0
  201. package/lib/transformers/features/json/JsonCreateValidateStringifyProgrammer.js +12 -0
  202. package/lib/transformers/features/json/JsonCreateValidateStringifyProgrammer.js.map +1 -0
  203. package/lib/transformers/features/json/{AssertParseTransformer.d.ts → JsonIsParseTransformer.d.ts} +1 -1
  204. package/lib/transformers/features/json/JsonIsParseTransformer.js +10 -0
  205. package/lib/transformers/features/json/JsonIsParseTransformer.js.map +1 -0
  206. package/lib/transformers/features/json/JsonIsStringifyTransformer.d.ts +3 -0
  207. package/lib/transformers/features/json/JsonIsStringifyTransformer.js +12 -0
  208. package/lib/transformers/features/json/JsonIsStringifyTransformer.js.map +1 -0
  209. package/lib/transformers/features/json/JsonStringifyTransformer.d.ts +3 -0
  210. package/lib/transformers/features/json/JsonStringifyTransformer.js +10 -0
  211. package/lib/transformers/features/json/JsonStringifyTransformer.js.map +1 -0
  212. package/lib/transformers/features/json/JsonValidateParseTransformer.d.ts +3 -0
  213. package/lib/transformers/features/json/JsonValidateParseTransformer.js +12 -0
  214. package/lib/transformers/features/json/JsonValidateParseTransformer.js.map +1 -0
  215. package/lib/transformers/features/json/JsonValidateStringifyTransformer.d.ts +3 -0
  216. package/lib/transformers/features/json/JsonValidateStringifyTransformer.js +12 -0
  217. package/lib/transformers/features/json/JsonValidateStringifyTransformer.js.map +1 -0
  218. package/lib/transformers/features/misc/MiscAssertCloneTransformer.d.ts +3 -0
  219. package/lib/transformers/features/misc/MiscAssertCloneTransformer.js +12 -0
  220. package/lib/transformers/features/misc/MiscAssertCloneTransformer.js.map +1 -0
  221. package/lib/transformers/features/misc/MiscAssertPruneTransformer.d.ts +3 -0
  222. package/lib/transformers/features/misc/MiscAssertPruneTransformer.js +12 -0
  223. package/lib/transformers/features/misc/MiscAssertPruneTransformer.js.map +1 -0
  224. package/lib/transformers/features/misc/{CloneTransformer.d.ts → MiscCloneTransformer.d.ts} +1 -1
  225. package/lib/transformers/features/misc/MiscCloneTransformer.js +10 -0
  226. package/lib/transformers/features/misc/MiscCloneTransformer.js.map +1 -0
  227. package/lib/transformers/features/misc/MiscCreateAssertCloneTransformer.d.ts +3 -0
  228. package/lib/transformers/features/misc/MiscCreateAssertCloneTransformer.js +12 -0
  229. package/lib/transformers/features/misc/MiscCreateAssertCloneTransformer.js.map +1 -0
  230. package/lib/transformers/features/misc/MiscCreateAssertPruneTransformer.d.ts +3 -0
  231. package/lib/transformers/features/misc/MiscCreateAssertPruneTransformer.js +12 -0
  232. package/lib/transformers/features/misc/MiscCreateAssertPruneTransformer.js.map +1 -0
  233. package/lib/transformers/features/misc/{CreateCloneTransformer.d.ts → MiscCreateCloneTransformer.d.ts} +1 -1
  234. package/lib/transformers/features/misc/MiscCreateCloneTransformer.js +10 -0
  235. package/lib/transformers/features/misc/MiscCreateCloneTransformer.js.map +1 -0
  236. package/lib/transformers/features/{json/CreateAssertParseTransformer.d.ts → misc/MiscCreateIsCloneTransformer.d.ts} +1 -1
  237. package/lib/transformers/features/misc/MiscCreateIsCloneTransformer.js +10 -0
  238. package/lib/transformers/features/misc/MiscCreateIsCloneTransformer.js.map +1 -0
  239. package/lib/transformers/features/{json/CreateStringifyTransformer.d.ts → misc/MiscCreateIsPruneTransformer.d.ts} +1 -1
  240. package/lib/transformers/features/misc/MiscCreateIsPruneTransformer.js +10 -0
  241. package/lib/transformers/features/misc/MiscCreateIsPruneTransformer.js.map +1 -0
  242. package/lib/transformers/features/{json/CreateIsParseTransformer.d.ts → misc/MiscCreatePruneTransformer.d.ts} +1 -1
  243. package/lib/transformers/features/misc/MiscCreatePruneTransformer.js +10 -0
  244. package/lib/transformers/features/misc/MiscCreatePruneTransformer.js.map +1 -0
  245. package/lib/transformers/features/misc/MiscCreateValidateCloneTransformer.d.ts +3 -0
  246. package/lib/transformers/features/misc/MiscCreateValidateCloneTransformer.js +12 -0
  247. package/lib/transformers/features/misc/MiscCreateValidateCloneTransformer.js.map +1 -0
  248. package/lib/transformers/features/misc/MiscCreateValidatePruneTransformer.d.ts +3 -0
  249. package/lib/transformers/features/misc/MiscCreateValidatePruneTransformer.js +12 -0
  250. package/lib/transformers/features/misc/MiscCreateValidatePruneTransformer.js.map +1 -0
  251. package/lib/transformers/features/{json/IsParseTransformer.d.ts → misc/MiscIsCloneTransformer.d.ts} +1 -1
  252. package/lib/transformers/features/misc/MiscIsCloneTransformer.js +10 -0
  253. package/lib/transformers/features/misc/MiscIsCloneTransformer.js.map +1 -0
  254. package/lib/transformers/features/{json/IsStringifyTransformer.d.ts → misc/MiscIsPruneTransformer.d.ts} +1 -1
  255. package/lib/transformers/features/misc/MiscIsPruneTransformer.js +10 -0
  256. package/lib/transformers/features/misc/MiscIsPruneTransformer.js.map +1 -0
  257. package/lib/transformers/features/misc/{LiteralsTransformer.d.ts → MiscLiteralsTransformer.d.ts} +1 -1
  258. package/lib/transformers/features/misc/{LiteralsTransformer.js → MiscLiteralsTransformer.js} +6 -6
  259. package/lib/transformers/features/misc/MiscLiteralsTransformer.js.map +1 -0
  260. package/lib/transformers/features/{json/StringifyTransformer.d.ts → misc/MiscPruneTransformer.d.ts} +1 -1
  261. package/lib/transformers/features/misc/MiscPruneTransformer.js +10 -0
  262. package/lib/transformers/features/misc/MiscPruneTransformer.js.map +1 -0
  263. package/lib/transformers/features/misc/MiscValidateCloneTransformer.d.ts +3 -0
  264. package/lib/transformers/features/misc/MiscValidateCloneTransformer.js +12 -0
  265. package/lib/transformers/features/misc/MiscValidateCloneTransformer.js.map +1 -0
  266. package/lib/transformers/features/misc/MiscValidatePruneTransformer.d.ts +3 -0
  267. package/lib/transformers/features/misc/MiscValidatePruneTransformer.js +12 -0
  268. package/lib/transformers/features/misc/MiscValidatePruneTransformer.js.map +1 -0
  269. package/lib/transformers/features/protobuf/CreateProtobufAssertDecodeTransformer.d.ts +3 -0
  270. package/lib/transformers/features/protobuf/CreateProtobufAssertDecodeTransformer.js +12 -0
  271. package/lib/transformers/features/protobuf/CreateProtobufAssertDecodeTransformer.js.map +1 -0
  272. package/lib/transformers/features/protobuf/CreateProtobufAssertEncodeTransformer.d.ts +3 -0
  273. package/lib/transformers/features/protobuf/CreateProtobufAssertEncodeTransformer.js +12 -0
  274. package/lib/transformers/features/protobuf/CreateProtobufAssertEncodeTransformer.js.map +1 -0
  275. package/lib/transformers/features/protobuf/CreateProtobufDecodeTransformer.d.ts +3 -0
  276. package/lib/transformers/features/protobuf/CreateProtobufDecodeTransformer.js +12 -0
  277. package/lib/transformers/features/protobuf/CreateProtobufDecodeTransformer.js.map +1 -0
  278. package/lib/transformers/features/protobuf/CreateProtobufEncodeTransformer.d.ts +3 -0
  279. package/lib/transformers/features/protobuf/CreateProtobufEncodeTransformer.js +12 -0
  280. package/lib/transformers/features/protobuf/CreateProtobufEncodeTransformer.js.map +1 -0
  281. package/lib/transformers/features/protobuf/CreateProtobufIsDecodeTransformer.d.ts +3 -0
  282. package/lib/transformers/features/protobuf/CreateProtobufIsDecodeTransformer.js +12 -0
  283. package/lib/transformers/features/protobuf/CreateProtobufIsDecodeTransformer.js.map +1 -0
  284. package/lib/transformers/features/protobuf/CreateProtobufIsEncodeTransformer.d.ts +3 -0
  285. package/lib/transformers/features/protobuf/CreateProtobufIsEncodeTransformer.js +12 -0
  286. package/lib/transformers/features/protobuf/CreateProtobufIsEncodeTransformer.js.map +1 -0
  287. package/lib/transformers/features/protobuf/CreateProtobufValidateDecodeTransformer.d.ts +3 -0
  288. package/lib/transformers/features/protobuf/CreateProtobufValidateDecodeTransformer.js +12 -0
  289. package/lib/transformers/features/protobuf/CreateProtobufValidateDecodeTransformer.js.map +1 -0
  290. package/lib/transformers/features/protobuf/CreateProtobufValidateEncodeTransformer.d.ts +3 -0
  291. package/lib/transformers/features/protobuf/CreateProtobufValidateEncodeTransformer.js +12 -0
  292. package/lib/transformers/features/protobuf/CreateProtobufValidateEncodeTransformer.js.map +1 -0
  293. package/lib/transformers/features/protobuf/ProtobufAssertDecodeTransformer.d.ts +3 -0
  294. package/lib/transformers/features/protobuf/ProtobufAssertDecodeTransformer.js +12 -0
  295. package/lib/transformers/features/protobuf/ProtobufAssertDecodeTransformer.js.map +1 -0
  296. package/lib/transformers/features/protobuf/ProtobufAssertEncodeTransformer.d.ts +3 -0
  297. package/lib/transformers/features/protobuf/ProtobufAssertEncodeTransformer.js +12 -0
  298. package/lib/transformers/features/protobuf/ProtobufAssertEncodeTransformer.js.map +1 -0
  299. package/lib/transformers/features/protobuf/ProtobufDecodeTransformer.d.ts +3 -0
  300. package/lib/transformers/features/protobuf/ProtobufDecodeTransformer.js +12 -0
  301. package/lib/transformers/features/protobuf/ProtobufDecodeTransformer.js.map +1 -0
  302. package/lib/transformers/features/protobuf/ProtobufEncodeTransformer.d.ts +3 -0
  303. package/lib/transformers/features/protobuf/ProtobufEncodeTransformer.js +12 -0
  304. package/lib/transformers/features/protobuf/ProtobufEncodeTransformer.js.map +1 -0
  305. package/lib/transformers/features/protobuf/ProtobufIsDecodeTransformer.d.ts +3 -0
  306. package/lib/transformers/features/protobuf/ProtobufIsDecodeTransformer.js +12 -0
  307. package/lib/transformers/features/protobuf/ProtobufIsDecodeTransformer.js.map +1 -0
  308. package/lib/transformers/features/protobuf/ProtobufIsEncodeTransformer.d.ts +3 -0
  309. package/lib/transformers/features/protobuf/ProtobufIsEncodeTransformer.js +12 -0
  310. package/lib/transformers/features/protobuf/ProtobufIsEncodeTransformer.js.map +1 -0
  311. package/lib/transformers/features/protobuf/{MessageTransformer.js → ProtobufMessageTransformer.js} +1 -1
  312. package/lib/transformers/features/protobuf/ProtobufMessageTransformer.js.map +1 -0
  313. package/lib/transformers/features/protobuf/ProtobufValidateDecodeTransformer.d.ts +3 -0
  314. package/lib/transformers/features/protobuf/ProtobufValidateDecodeTransformer.js +12 -0
  315. package/lib/transformers/features/protobuf/ProtobufValidateDecodeTransformer.js.map +1 -0
  316. package/lib/transformers/features/protobuf/ProtobufValidateEncodeTransformer.d.ts +3 -0
  317. package/lib/transformers/features/protobuf/ProtobufValidateEncodeTransformer.js +12 -0
  318. package/lib/transformers/features/protobuf/ProtobufValidateEncodeTransformer.js.map +1 -0
  319. package/package.json +2 -2
  320. package/src/factories/MetadataCollection.ts +255 -255
  321. package/src/factories/MetadataFactory.ts +30 -30
  322. package/src/factories/MetadataTagFactory.ts +362 -362
  323. package/src/factories/ProtocolFactory.ts +80 -80
  324. package/src/factories/internal/metadata/MetadataHelper.ts +12 -12
  325. package/src/factories/internal/metadata/emend_metadata_atomics.ts +33 -33
  326. package/src/factories/internal/metadata/emplace_metadata_alias.ts +40 -40
  327. package/src/factories/internal/metadata/emplace_metadata_array.ts +34 -34
  328. package/src/factories/internal/metadata/emplace_metadata_object.ts +136 -136
  329. package/src/factories/internal/metadata/emplace_metadata_tuple.ts +50 -50
  330. package/src/factories/internal/metadata/explore_metadata.ts +40 -40
  331. package/src/factories/internal/metadata/iterate_metadata.ts +81 -81
  332. package/src/factories/internal/metadata/iterate_metadata_alias.ts +30 -30
  333. package/src/factories/internal/metadata/iterate_metadata_array.ts +24 -24
  334. package/src/factories/internal/metadata/iterate_metadata_atomic.ts +59 -59
  335. package/src/factories/internal/metadata/iterate_metadata_coalesce.ts +33 -33
  336. package/src/factories/internal/metadata/iterate_metadata_collection.ts +133 -133
  337. package/src/factories/internal/metadata/iterate_metadata_constant.ts +58 -58
  338. package/src/factories/internal/metadata/iterate_metadata_intersection.ts +83 -83
  339. package/src/factories/internal/metadata/iterate_metadata_map.ts +41 -41
  340. package/src/factories/internal/metadata/iterate_metadata_native.ts +219 -219
  341. package/src/factories/internal/metadata/iterate_metadata_object.ts +43 -43
  342. package/src/factories/internal/metadata/iterate_metadata_resolve.ts +49 -49
  343. package/src/factories/internal/metadata/iterate_metadata_set.ts +33 -33
  344. package/src/factories/internal/metadata/iterate_metadata_sort.ts +69 -69
  345. package/src/factories/internal/metadata/iterate_metadata_tag.ts +31 -31
  346. package/src/factories/internal/metadata/iterate_metadata_template.ts +38 -38
  347. package/src/factories/internal/metadata/iterate_metadata_tuple.ts +24 -24
  348. package/src/factories/internal/metadata/iterate_metadata_union.ts +24 -24
  349. package/src/factories/internal/protocols/ProtocolMetadataUtil.ts +180 -180
  350. package/src/factories/internal/protocols/emplace_protocol_object.ts +25 -25
  351. package/src/factories/internal/protocols/emplace_protocol_property.ts +12 -12
  352. package/src/factories/internal/protocols/iterate_protocol_atomic.ts +34 -34
  353. package/src/factories/internal/protocols/iterate_protocol_constant.ts +27 -27
  354. package/src/factories/internal/protocols/iterate_protocol_main.ts +19 -19
  355. package/src/factories/internal/protocols/iterate_protocol_map.ts +58 -58
  356. package/src/factories/internal/protocols/iterate_protocol_metadata.ts +96 -96
  357. package/src/factories/internal/protocols/iterate_protocol_native.ts +34 -34
  358. package/src/factories/internal/protocols/iterate_protocol_never.ts +1 -1
  359. package/src/factories/internal/protocols/iterate_protocol_object.ts +110 -110
  360. package/src/factories/internal/protocols/iterate_protocol_repeated.ts +34 -34
  361. package/src/factories/internal/protocols/iterate_protocol_tuple.ts +29 -29
  362. package/src/functional/$number.ts +13 -13
  363. package/src/functional/$proto_bytes.ts +25 -25
  364. package/src/functional/$proto_field.ts +30 -30
  365. package/src/functional/$proto_float.ts +37 -37
  366. package/src/functional/$proto_i32.ts +29 -29
  367. package/src/functional/$proto_i64.ts +37 -37
  368. package/src/functional/$proto_size.ts +82 -82
  369. package/src/functional/$proto_string.ts +24 -24
  370. package/src/functional/$varint.ts +130 -130
  371. package/src/functional/$zigzag.ts +39 -39
  372. package/src/json.ts +648 -648
  373. package/src/misc.ts +651 -651
  374. package/src/module.ts +781 -781
  375. package/src/programmers/CheckerProgrammer.ts +1182 -1182
  376. package/src/programmers/FeatureProgrammer.ts +495 -495
  377. package/src/programmers/IsProgrammer.ts +239 -239
  378. package/src/programmers/IsPruneProgrammer.ts +73 -73
  379. package/src/programmers/RandomProgrammer.ts +581 -581
  380. package/src/programmers/helpers/AtomicPredicator.ts +31 -31
  381. package/src/programmers/helpers/IExpressionEntry.ts +12 -12
  382. package/src/programmers/helpers/PruneJoiner.ts +143 -143
  383. package/src/programmers/helpers/RandomJoiner.ts +173 -173
  384. package/src/programmers/helpers/RandomRanger.ts +216 -216
  385. package/src/programmers/helpers/StringifyPredicator.ts +13 -13
  386. package/src/programmers/helpers/UnionExplorer.ts +301 -301
  387. package/src/programmers/helpers/UnionPredicator.ts +81 -81
  388. package/src/programmers/internal/application_alias.ts +66 -66
  389. package/src/programmers/internal/application_array.ts +30 -30
  390. package/src/programmers/internal/application_constant.ts +26 -26
  391. package/src/programmers/internal/application_default.ts +17 -17
  392. package/src/programmers/internal/application_default_string.ts +33 -33
  393. package/src/programmers/internal/application_native.ts +39 -39
  394. package/src/programmers/internal/application_number.ts +77 -77
  395. package/src/programmers/internal/application_object.ts +162 -162
  396. package/src/programmers/internal/application_resolved.ts +55 -55
  397. package/src/programmers/internal/application_schema.ts +157 -157
  398. package/src/programmers/internal/application_string.ts +44 -44
  399. package/src/programmers/internal/application_templates.ts +25 -25
  400. package/src/programmers/internal/application_tuple.ts +57 -57
  401. package/src/programmers/internal/check_array.ts +30 -30
  402. package/src/programmers/internal/check_array_length.ts +35 -35
  403. package/src/programmers/internal/check_bigint.ts +82 -82
  404. package/src/programmers/internal/check_custom.ts +31 -31
  405. package/src/programmers/internal/check_number.ts +177 -177
  406. package/src/programmers/internal/check_string.ts +25 -25
  407. package/src/programmers/internal/check_string_tags.ts +67 -67
  408. package/src/programmers/internal/check_template.ts +56 -56
  409. package/src/programmers/internal/check_union_array_like.ts +329 -329
  410. package/src/programmers/internal/decode_union_object.ts +73 -73
  411. package/src/programmers/internal/feature_object_entries.ts +63 -63
  412. package/src/programmers/internal/get_comment_tags.ts +23 -23
  413. package/src/programmers/internal/metadata_to_pattern.ts +34 -34
  414. package/src/programmers/internal/prune_object_properties.ts +60 -60
  415. package/src/programmers/internal/random_custom.ts +29 -29
  416. package/src/programmers/internal/stringify_regular_properties.ts +83 -83
  417. package/src/programmers/internal/template_to_pattern.ts +15 -15
  418. package/src/programmers/internal/wrap_metadata_rest_tuple.ts +16 -16
  419. package/src/programmers/json/JsonApplicationProgrammer.ts +47 -47
  420. package/src/programmers/json/JsonAssertParseProgrammer.ts +66 -66
  421. package/src/programmers/json/JsonAssertStringifyProgrammer.ts +66 -66
  422. package/src/programmers/json/JsonIsParseProgrammer.ts +72 -72
  423. package/src/programmers/json/JsonIsStringifyProgrammer.ts +76 -76
  424. package/src/programmers/json/JsonStringifyProgrammer.ts +979 -979
  425. package/src/programmers/json/JsonValidateParseProgrammer.ts +70 -70
  426. package/src/programmers/json/JsonValidateStringifyProgrammer.ts +84 -84
  427. package/src/programmers/misc/MiscAssertCloneProgrammer.ts +71 -71
  428. package/src/programmers/misc/MiscAssertPruneProgrammer.ts +68 -68
  429. package/src/programmers/misc/MiscCloneProgrammer.ts +587 -587
  430. package/src/programmers/misc/MiscIsCloneProgrammer.ts +78 -78
  431. package/src/programmers/misc/MiscLiteralsProgrammer.ts +63 -63
  432. package/src/programmers/misc/MiscPruneProgrammer.ts +542 -542
  433. package/src/programmers/misc/MiscValidateCloneProgrammer.ts +85 -85
  434. package/src/programmers/misc/MiscValidatePruneProgrammer.ts +78 -78
  435. package/src/programmers/protobuf/ProtobufAssertDecodeProgrammer.ts +69 -0
  436. package/src/programmers/protobuf/ProtobufAssertEncodeProgrammer.ts +66 -0
  437. package/src/programmers/protobuf/ProtobufDecodeProgrammer.ts +38 -0
  438. package/src/programmers/protobuf/ProtobufEncodeProgrammer.ts +36 -0
  439. package/src/programmers/protobuf/ProtobufIsDecodeProgrammer.ts +75 -0
  440. package/src/programmers/protobuf/ProtobufIsEncodeProgrammer.ts +76 -0
  441. package/src/programmers/protobuf/ProtobufMessageProgrammer.ts +125 -126
  442. package/src/programmers/protobuf/ProtobufValidateDecodeProgrammer.ts +83 -0
  443. package/src/programmers/protobuf/ProtobufValidateEncodeProgrammer.ts +86 -0
  444. package/src/protobuf.ts +210 -121
  445. package/src/schemas/{IJsonApplication.ts → json/IJsonApplication.ts} +8 -8
  446. package/src/schemas/{IJsonComponents.ts → json/IJsonComponents.ts} +33 -33
  447. package/src/schemas/{IJsonSchema.ts → json/IJsonSchema.ts} +133 -133
  448. package/src/{metadata → schemas/metadata}/ICommentTag.ts +4 -4
  449. package/src/{metadata → schemas/metadata}/IJsDocTagInfo.ts +10 -10
  450. package/src/{metadata → schemas/metadata}/IMetadata.ts +28 -28
  451. package/src/{metadata → schemas/metadata}/IMetadataAlias.ts +14 -14
  452. package/src/{metadata → schemas/metadata}/IMetadataApplication.ts +7 -7
  453. package/src/{metadata → schemas/metadata}/IMetadataArray.ts +10 -10
  454. package/src/{metadata → schemas/metadata}/IMetadataCollection.ts +11 -11
  455. package/src/{metadata → schemas/metadata}/IMetadataConstant.ts +16 -16
  456. package/src/{metadata → schemas/metadata}/IMetadataDictionary.ts +14 -14
  457. package/src/{metadata → schemas/metadata}/IMetadataEntry.ts +6 -6
  458. package/src/{metadata → schemas/metadata}/IMetadataObject.ts +18 -18
  459. package/src/{metadata → schemas/metadata}/IMetadataProperty.ts +11 -11
  460. package/src/{metadata → schemas/metadata}/IMetadataResolved.ts +6 -6
  461. package/src/{metadata → schemas/metadata}/IMetadataTag.ts +113 -113
  462. package/src/{metadata → schemas/metadata}/IMetadataTuple.ts +10 -10
  463. package/src/{metadata → schemas/metadata}/Metadata.ts +608 -606
  464. package/src/{metadata → schemas/metadata}/MetadataAlias.ts +66 -66
  465. package/src/{metadata → schemas/metadata}/MetadataArray.ts +55 -55
  466. package/src/{metadata → schemas/metadata}/MetadataConstant.ts +3 -3
  467. package/src/{metadata → schemas/metadata}/MetadataObject.ts +129 -129
  468. package/src/{metadata → schemas/metadata}/MetadataProperty.ts +64 -64
  469. package/src/{metadata → schemas/metadata}/MetadataResolved.ts +51 -51
  470. package/src/{metadata → schemas/metadata}/MetadataTuple.ts +53 -53
  471. package/src/{messages → schemas/protobuf}/IProtocolMap.ts +5 -5
  472. package/src/{messages → schemas/protobuf}/IProtocolMessage.ts +6 -6
  473. package/src/{messages → schemas/protobuf}/IProtocolProperty.ts +13 -13
  474. package/src/transformers/CallExpressionTransformer.ts +240 -196
  475. package/src/transformers/features/AssertTransformer.ts +11 -11
  476. package/src/transformers/features/CreateAssertTransformer.ts +13 -13
  477. package/src/transformers/features/CreateIsTransformer.ts +11 -11
  478. package/src/transformers/features/CreateRandomTransformer.ts +39 -39
  479. package/src/transformers/features/CreateValidateTransformer.ts +13 -13
  480. package/src/transformers/features/IsTransformer.ts +11 -11
  481. package/src/transformers/features/RandomTransformer.ts +42 -42
  482. package/src/transformers/features/ValidateTransformer.ts +11 -11
  483. package/src/transformers/features/{misc/ApplicationTransformer.ts → json/JsonApplicationTransformer.ts} +102 -102
  484. package/src/transformers/features/json/{AssertParseTransformer.ts → JsonAssertParseTransformer.ts} +10 -10
  485. package/src/transformers/features/json/{AssertStringifyTransformer.ts → JsonAssertStringifyTransformer.ts} +10 -10
  486. package/src/transformers/features/json/{CreateAssertParseTransformer.ts → JsonCreateAssertParseTransformer.ts} +10 -10
  487. package/src/transformers/features/json/{CreateAssertStringifyTransformer.ts → JsonCreateAssertStringifyTransformer.ts} +12 -12
  488. package/src/transformers/features/json/{CreateIsParseTransformer.ts → JsonCreateIsParseTransformer.ts} +9 -9
  489. package/src/transformers/features/json/JsonCreateIsStringifyTransformer.ts +10 -0
  490. package/src/transformers/features/json/{CreateStringifyTransformer.ts → JsonCreateStringifyTransformer.ts} +9 -9
  491. package/src/transformers/features/json/{CreateValidateParseTransformer.ts → JsonCreateValidateParseTransformer.ts} +10 -10
  492. package/src/transformers/features/json/{CreateValidateStringifyProgrammer.ts → JsonCreateValidateStringifyProgrammer.ts} +12 -12
  493. package/src/transformers/features/json/{IsParseTransformer.ts → JsonIsParseTransformer.ts} +9 -9
  494. package/src/transformers/features/json/JsonIsStringifyTransformer.ts +10 -0
  495. package/src/transformers/features/json/{StringifyTransformer.ts → JsonStringifyTransformer.ts} +9 -9
  496. package/src/transformers/features/json/{ValidateParseTransformer.ts → JsonValidateParseTransformer.ts} +10 -10
  497. package/src/transformers/features/json/{ValidateStringifyTransformer.ts → JsonValidateStringifyTransformer.ts} +10 -10
  498. package/src/transformers/features/misc/MetadataTransformer.ts +53 -53
  499. package/src/transformers/features/misc/{AssertCloneTransformer.ts → MiscAssertCloneTransformer.ts} +10 -10
  500. package/src/transformers/features/misc/{AssertPruneTransformer.ts → MiscAssertPruneTransformer.ts} +10 -10
  501. package/src/transformers/features/misc/{CloneTransformer.ts → MiscCloneTransformer.ts} +9 -9
  502. package/src/transformers/features/misc/{CreateAssertCloneTransformer.ts → MiscCreateAssertCloneTransformer.ts} +10 -10
  503. package/src/transformers/features/misc/{CreateAssertPruneTransformer.ts → MiscCreateAssertPruneTransformer.ts} +10 -10
  504. package/src/transformers/features/misc/{CreateCloneTransformer.ts → MiscCreateCloneTransformer.ts} +9 -9
  505. package/src/transformers/features/misc/{CreateIsCloneTransformer.ts → MiscCreateIsCloneTransformer.ts} +9 -9
  506. package/src/transformers/features/misc/{CreateIsPruneTransformer.ts → MiscCreateIsPruneTransformer.ts} +9 -9
  507. package/src/transformers/features/misc/{CreatePruneTransformer.ts → MiscCreatePruneTransformer.ts} +9 -9
  508. package/src/transformers/features/misc/{CreateValidateCloneTransformer.ts → MiscCreateValidateCloneTransformer.ts} +10 -10
  509. package/src/transformers/features/misc/{CreateValidatePruneTransformer.ts → MiscCreateValidatePruneTransformer.ts} +10 -10
  510. package/src/transformers/features/misc/{IsCloneTransformer.ts → MiscIsCloneTransformer.ts} +9 -9
  511. package/src/transformers/features/misc/{IsPruneTransformer.ts → MiscIsPruneTransformer.ts} +9 -9
  512. package/src/transformers/features/misc/{LiteralsTransformer.ts → MiscLiteralsTransformer.ts} +28 -28
  513. package/src/transformers/features/misc/{PruneTransformer.ts → MiscPruneTransformer.ts} +9 -9
  514. package/src/transformers/features/misc/{ValidateCloneTransformer.ts → MiscValidateCloneTransformer.ts} +10 -10
  515. package/src/transformers/features/misc/{ValidatePruneTransformer.ts → MiscValidatePruneTransformer.ts} +10 -10
  516. package/src/transformers/features/protobuf/CreateProtobufAssertDecodeTransformer.ts +10 -0
  517. package/src/transformers/features/protobuf/CreateProtobufAssertEncodeTransformer.ts +10 -0
  518. package/src/transformers/features/protobuf/CreateProtobufDecodeTransformer.ts +10 -0
  519. package/src/transformers/features/protobuf/CreateProtobufEncodeTransformer.ts +10 -0
  520. package/src/transformers/features/protobuf/CreateProtobufIsDecodeTransformer.ts +10 -0
  521. package/src/transformers/features/protobuf/CreateProtobufIsEncodeTransformer.ts +10 -0
  522. package/src/transformers/features/protobuf/CreateProtobufValidateDecodeTransformer.ts +10 -0
  523. package/src/transformers/features/protobuf/CreateProtobufValidateEncodeTransformer.ts +10 -0
  524. package/src/transformers/features/protobuf/ProtobufAssertDecodeTransformer.ts +10 -0
  525. package/src/transformers/features/protobuf/ProtobufAssertEncodeTransformer.ts +10 -0
  526. package/src/transformers/features/protobuf/ProtobufDecodeTransformer.ts +10 -0
  527. package/src/transformers/features/protobuf/ProtobufEncodeTransformer.ts +10 -0
  528. package/src/transformers/features/protobuf/ProtobufIsDecodeTransformer.ts +10 -0
  529. package/src/transformers/features/protobuf/ProtobufIsEncodeTransformer.ts +10 -0
  530. package/src/transformers/features/protobuf/{MessageTransformer.ts → ProtobufMessageTransformer.ts} +31 -31
  531. package/src/transformers/features/protobuf/ProtobufValidateDecodeTransformer.ts +10 -0
  532. package/src/transformers/features/protobuf/ProtobufValidateEncodeTransformer.ts +10 -0
  533. package/src/utils/NameEncoder.ts +32 -32
  534. package/lib/messages/IProtocolMap.js.map +0 -1
  535. package/lib/messages/IProtocolMessage.js.map +0 -1
  536. package/lib/messages/IProtocolProperty.js.map +0 -1
  537. package/lib/metadata/ICommentTag.js.map +0 -1
  538. package/lib/metadata/IJsDocTagInfo.js.map +0 -1
  539. package/lib/metadata/IMetadata.js.map +0 -1
  540. package/lib/metadata/IMetadataAlias.js.map +0 -1
  541. package/lib/metadata/IMetadataApplication.js.map +0 -1
  542. package/lib/metadata/IMetadataArray.js.map +0 -1
  543. package/lib/metadata/IMetadataCollection.js.map +0 -1
  544. package/lib/metadata/IMetadataConstant.js.map +0 -1
  545. package/lib/metadata/IMetadataDictionary.js.map +0 -1
  546. package/lib/metadata/IMetadataEntry.js.map +0 -1
  547. package/lib/metadata/IMetadataObject.js.map +0 -1
  548. package/lib/metadata/IMetadataProperty.js.map +0 -1
  549. package/lib/metadata/IMetadataResolved.js.map +0 -1
  550. package/lib/metadata/IMetadataTag.js.map +0 -1
  551. package/lib/metadata/IMetadataTuple.js.map +0 -1
  552. package/lib/metadata/Metadata.js.map +0 -1
  553. package/lib/metadata/MetadataAlias.js.map +0 -1
  554. package/lib/metadata/MetadataArray.js.map +0 -1
  555. package/lib/metadata/MetadataConstant.js.map +0 -1
  556. package/lib/metadata/MetadataObject.js.map +0 -1
  557. package/lib/metadata/MetadataProperty.js.map +0 -1
  558. package/lib/metadata/MetadataResolved.js.map +0 -1
  559. package/lib/metadata/MetadataTuple.js.map +0 -1
  560. package/lib/schemas/IJsonApplication.js.map +0 -1
  561. package/lib/schemas/IJsonComponents.js.map +0 -1
  562. package/lib/schemas/IJsonSchema.js.map +0 -1
  563. package/lib/transformers/features/json/AssertParseTransformer.js +0 -12
  564. package/lib/transformers/features/json/AssertParseTransformer.js.map +0 -1
  565. package/lib/transformers/features/json/AssertStringifyTransformer.js +0 -12
  566. package/lib/transformers/features/json/AssertStringifyTransformer.js.map +0 -1
  567. package/lib/transformers/features/json/CreateAssertParseTransformer.js +0 -12
  568. package/lib/transformers/features/json/CreateAssertParseTransformer.js.map +0 -1
  569. package/lib/transformers/features/json/CreateAssertStringifyTransformer.js +0 -12
  570. package/lib/transformers/features/json/CreateAssertStringifyTransformer.js.map +0 -1
  571. package/lib/transformers/features/json/CreateIsParseTransformer.js +0 -10
  572. package/lib/transformers/features/json/CreateIsParseTransformer.js.map +0 -1
  573. package/lib/transformers/features/json/CreateIsStringifyTransformer.js +0 -10
  574. package/lib/transformers/features/json/CreateIsStringifyTransformer.js.map +0 -1
  575. package/lib/transformers/features/json/CreateStringifyTransformer.js +0 -10
  576. package/lib/transformers/features/json/CreateStringifyTransformer.js.map +0 -1
  577. package/lib/transformers/features/json/CreateValidateParseTransformer.d.ts +0 -3
  578. package/lib/transformers/features/json/CreateValidateParseTransformer.js +0 -12
  579. package/lib/transformers/features/json/CreateValidateParseTransformer.js.map +0 -1
  580. package/lib/transformers/features/json/CreateValidateStringifyProgrammer.d.ts +0 -3
  581. package/lib/transformers/features/json/CreateValidateStringifyProgrammer.js +0 -12
  582. package/lib/transformers/features/json/CreateValidateStringifyProgrammer.js.map +0 -1
  583. package/lib/transformers/features/json/IsParseTransformer.js +0 -10
  584. package/lib/transformers/features/json/IsParseTransformer.js.map +0 -1
  585. package/lib/transformers/features/json/IsStringifyTransformer.js +0 -10
  586. package/lib/transformers/features/json/IsStringifyTransformer.js.map +0 -1
  587. package/lib/transformers/features/json/StringifyTransformer.js +0 -10
  588. package/lib/transformers/features/json/StringifyTransformer.js.map +0 -1
  589. package/lib/transformers/features/json/ValidateParseTransformer.d.ts +0 -3
  590. package/lib/transformers/features/json/ValidateParseTransformer.js +0 -12
  591. package/lib/transformers/features/json/ValidateParseTransformer.js.map +0 -1
  592. package/lib/transformers/features/json/ValidateStringifyTransformer.d.ts +0 -3
  593. package/lib/transformers/features/json/ValidateStringifyTransformer.js +0 -12
  594. package/lib/transformers/features/json/ValidateStringifyTransformer.js.map +0 -1
  595. package/lib/transformers/features/misc/ApplicationTransformer.js.map +0 -1
  596. package/lib/transformers/features/misc/AssertCloneTransformer.d.ts +0 -3
  597. package/lib/transformers/features/misc/AssertCloneTransformer.js +0 -12
  598. package/lib/transformers/features/misc/AssertCloneTransformer.js.map +0 -1
  599. package/lib/transformers/features/misc/AssertPruneTransformer.d.ts +0 -3
  600. package/lib/transformers/features/misc/AssertPruneTransformer.js +0 -12
  601. package/lib/transformers/features/misc/AssertPruneTransformer.js.map +0 -1
  602. package/lib/transformers/features/misc/CloneTransformer.js +0 -10
  603. package/lib/transformers/features/misc/CloneTransformer.js.map +0 -1
  604. package/lib/transformers/features/misc/CreateAssertCloneTransformer.d.ts +0 -3
  605. package/lib/transformers/features/misc/CreateAssertCloneTransformer.js +0 -12
  606. package/lib/transformers/features/misc/CreateAssertCloneTransformer.js.map +0 -1
  607. package/lib/transformers/features/misc/CreateAssertPruneTransformer.d.ts +0 -3
  608. package/lib/transformers/features/misc/CreateAssertPruneTransformer.js +0 -12
  609. package/lib/transformers/features/misc/CreateAssertPruneTransformer.js.map +0 -1
  610. package/lib/transformers/features/misc/CreateCloneTransformer.js +0 -10
  611. package/lib/transformers/features/misc/CreateCloneTransformer.js.map +0 -1
  612. package/lib/transformers/features/misc/CreateIsCloneTransformer.d.ts +0 -3
  613. package/lib/transformers/features/misc/CreateIsCloneTransformer.js +0 -10
  614. package/lib/transformers/features/misc/CreateIsCloneTransformer.js.map +0 -1
  615. package/lib/transformers/features/misc/CreateIsPruneTransformer.d.ts +0 -3
  616. package/lib/transformers/features/misc/CreateIsPruneTransformer.js +0 -10
  617. package/lib/transformers/features/misc/CreateIsPruneTransformer.js.map +0 -1
  618. package/lib/transformers/features/misc/CreatePruneTransformer.d.ts +0 -3
  619. package/lib/transformers/features/misc/CreatePruneTransformer.js +0 -10
  620. package/lib/transformers/features/misc/CreatePruneTransformer.js.map +0 -1
  621. package/lib/transformers/features/misc/CreateValidateCloneTransformer.d.ts +0 -3
  622. package/lib/transformers/features/misc/CreateValidateCloneTransformer.js +0 -12
  623. package/lib/transformers/features/misc/CreateValidateCloneTransformer.js.map +0 -1
  624. package/lib/transformers/features/misc/CreateValidatePruneTransformer.d.ts +0 -3
  625. package/lib/transformers/features/misc/CreateValidatePruneTransformer.js +0 -12
  626. package/lib/transformers/features/misc/CreateValidatePruneTransformer.js.map +0 -1
  627. package/lib/transformers/features/misc/IsCloneTransformer.d.ts +0 -3
  628. package/lib/transformers/features/misc/IsCloneTransformer.js +0 -10
  629. package/lib/transformers/features/misc/IsCloneTransformer.js.map +0 -1
  630. package/lib/transformers/features/misc/IsPruneTransformer.d.ts +0 -3
  631. package/lib/transformers/features/misc/IsPruneTransformer.js +0 -10
  632. package/lib/transformers/features/misc/IsPruneTransformer.js.map +0 -1
  633. package/lib/transformers/features/misc/LiteralsTransformer.js.map +0 -1
  634. package/lib/transformers/features/misc/PruneTransformer.d.ts +0 -3
  635. package/lib/transformers/features/misc/PruneTransformer.js +0 -10
  636. package/lib/transformers/features/misc/PruneTransformer.js.map +0 -1
  637. package/lib/transformers/features/misc/ValidateCloneTransformer.d.ts +0 -3
  638. package/lib/transformers/features/misc/ValidateCloneTransformer.js +0 -12
  639. package/lib/transformers/features/misc/ValidateCloneTransformer.js.map +0 -1
  640. package/lib/transformers/features/misc/ValidatePruneTransformer.d.ts +0 -3
  641. package/lib/transformers/features/misc/ValidatePruneTransformer.js +0 -12
  642. package/lib/transformers/features/misc/ValidatePruneTransformer.js.map +0 -1
  643. package/lib/transformers/features/protobuf/MessageTransformer.js.map +0 -1
  644. package/src/transformers/features/json/CreateIsStringifyTransformer.ts +0 -9
  645. package/src/transformers/features/json/IsStringifyTransformer.ts +0 -9
  646. /package/lib/schemas/{IJsonApplication.d.ts → json/IJsonApplication.d.ts} +0 -0
  647. /package/lib/schemas/{IJsonApplication.js → json/IJsonApplication.js} +0 -0
  648. /package/lib/schemas/{IJsonComponents.d.ts → json/IJsonComponents.d.ts} +0 -0
  649. /package/lib/schemas/{IJsonComponents.js → json/IJsonComponents.js} +0 -0
  650. /package/lib/schemas/{IJsonSchema.js → json/IJsonSchema.js} +0 -0
  651. /package/lib/{metadata → schemas/metadata}/ICommentTag.d.ts +0 -0
  652. /package/lib/{metadata → schemas/metadata}/ICommentTag.js +0 -0
  653. /package/lib/{metadata → schemas/metadata}/IJsDocTagInfo.d.ts +0 -0
  654. /package/lib/{metadata → schemas/metadata}/IJsDocTagInfo.js +0 -0
  655. /package/lib/{metadata → schemas/metadata}/IMetadata.js +0 -0
  656. /package/lib/{metadata → schemas/metadata}/IMetadataAlias.d.ts +0 -0
  657. /package/lib/{metadata → schemas/metadata}/IMetadataAlias.js +0 -0
  658. /package/lib/{metadata → schemas/metadata}/IMetadataApplication.d.ts +0 -0
  659. /package/lib/{metadata → schemas/metadata}/IMetadataApplication.js +0 -0
  660. /package/lib/{metadata → schemas/metadata}/IMetadataArray.d.ts +0 -0
  661. /package/lib/{metadata → schemas/metadata}/IMetadataArray.js +0 -0
  662. /package/lib/{metadata → schemas/metadata}/IMetadataCollection.d.ts +0 -0
  663. /package/lib/{metadata → schemas/metadata}/IMetadataCollection.js +0 -0
  664. /package/lib/{metadata → schemas/metadata}/IMetadataConstant.js +0 -0
  665. /package/lib/{metadata → schemas/metadata}/IMetadataDictionary.d.ts +0 -0
  666. /package/lib/{metadata → schemas/metadata}/IMetadataDictionary.js +0 -0
  667. /package/lib/{metadata → schemas/metadata}/IMetadataEntry.d.ts +0 -0
  668. /package/lib/{metadata → schemas/metadata}/IMetadataEntry.js +0 -0
  669. /package/lib/{metadata → schemas/metadata}/IMetadataObject.d.ts +0 -0
  670. /package/lib/{metadata → schemas/metadata}/IMetadataObject.js +0 -0
  671. /package/lib/{metadata → schemas/metadata}/IMetadataProperty.d.ts +0 -0
  672. /package/lib/{metadata → schemas/metadata}/IMetadataProperty.js +0 -0
  673. /package/lib/{metadata → schemas/metadata}/IMetadataResolved.d.ts +0 -0
  674. /package/lib/{metadata → schemas/metadata}/IMetadataResolved.js +0 -0
  675. /package/lib/{metadata → schemas/metadata}/IMetadataTag.d.ts +0 -0
  676. /package/lib/{metadata → schemas/metadata}/IMetadataTag.js +0 -0
  677. /package/lib/{metadata → schemas/metadata}/IMetadataTuple.d.ts +0 -0
  678. /package/lib/{metadata → schemas/metadata}/IMetadataTuple.js +0 -0
  679. /package/lib/{metadata → schemas/metadata}/MetadataAlias.d.ts +0 -0
  680. /package/lib/{metadata → schemas/metadata}/MetadataAlias.js +0 -0
  681. /package/lib/{metadata → schemas/metadata}/MetadataArray.d.ts +0 -0
  682. /package/lib/{metadata → schemas/metadata}/MetadataArray.js +0 -0
  683. /package/lib/{metadata → schemas/metadata}/MetadataConstant.d.ts +0 -0
  684. /package/lib/{metadata → schemas/metadata}/MetadataConstant.js +0 -0
  685. /package/lib/{metadata → schemas/metadata}/MetadataObject.d.ts +0 -0
  686. /package/lib/{metadata → schemas/metadata}/MetadataObject.js +0 -0
  687. /package/lib/{metadata → schemas/metadata}/MetadataProperty.d.ts +0 -0
  688. /package/lib/{metadata → schemas/metadata}/MetadataProperty.js +0 -0
  689. /package/lib/{metadata → schemas/metadata}/MetadataResolved.d.ts +0 -0
  690. /package/lib/{metadata → schemas/metadata}/MetadataResolved.js +0 -0
  691. /package/lib/{metadata → schemas/metadata}/MetadataTuple.js +0 -0
  692. /package/lib/{messages → schemas/protobuf}/IProtocolMap.d.ts +0 -0
  693. /package/lib/{messages → schemas/protobuf}/IProtocolMap.js +0 -0
  694. /package/lib/{messages → schemas/protobuf}/IProtocolMessage.d.ts +0 -0
  695. /package/lib/{messages → schemas/protobuf}/IProtocolMessage.js +0 -0
  696. /package/lib/{messages → schemas/protobuf}/IProtocolProperty.d.ts +0 -0
  697. /package/lib/{messages → schemas/protobuf}/IProtocolProperty.js +0 -0
  698. /package/lib/transformers/features/protobuf/{MessageTransformer.d.ts → ProtobufMessageTransformer.d.ts} +0 -0
package/src/module.ts CHANGED
@@ -1,781 +1,781 @@
1
- import { $dictionary } from "./functional/$dictionary";
2
- import { Namespace } from "./functional/Namespace";
3
-
4
- import { IMetadataApplication } from "./metadata/IMetadataApplication";
5
-
6
- import { MapUtil } from "./utils/MapUtil";
7
-
8
- import { CustomValidatorMap } from "./CustomValidatorMap";
9
- import { IRandomGenerator } from "./IRandomGenerator";
10
- import { IValidation } from "./IValidation";
11
- import { Primitive } from "./Primitive";
12
-
13
- export * as json from "./json";
14
- export * as protobuf from "./protobuf";
15
- export * as misc from "./misc";
16
-
17
- export * from "./schemas/IJsonApplication";
18
- export * from "./schemas/IJsonComponents";
19
- export * from "./schemas/IJsonSchema";
20
- export * from "./IRandomGenerator";
21
- export * from "./IValidation";
22
- export * from "./Primitive";
23
- export * from "./TypeGuardError";
24
-
25
- /**
26
- * Custom validators.
27
- *
28
- * If you want to add a custom validation logic utilizing comment tags,
29
- * add a closure function with its tag and type name. Below example code
30
- * would helpful to understand how to use this instance.
31
- *
32
- * ```ts
33
- * typia.customValidators.insert("powerOf")("number")(
34
- * (text: string) => {
35
- * const denominator: number = Math.log(Number(text));
36
- * return (value: number) => {
37
- * value = Math.log(value) / denominator;
38
- * return value === Math.floor(value);
39
- * };
40
- * }
41
- * );
42
- * typia.customValidators.insert("dollar")("string")(
43
- * () => (value: string) => value.startsWith("$"),
44
- * );
45
- *
46
- * interface TagCustom {
47
- * /**
48
- * * @powerOf 10
49
- * *\/
50
- * powerOf: number;
51
- *
52
- * /**
53
- * * @dollar
54
- * *\/
55
- * dollar: string;
56
- * }
57
- * ```
58
- *
59
- * @author Jeongho Nam - https://github.com/samchon
60
- */
61
- export const customValidators: CustomValidatorMap = {
62
- size: (name?: string) =>
63
- name ? $dictionary.get(name)?.size ?? 0 : $dictionary.size,
64
- has: (name) => (type) => $dictionary.get(name)?.has(type) ?? false,
65
- get: (name) => (type) => $dictionary.get(name)?.get(type),
66
- insert: (name) => (type) => (closure) => {
67
- const internal = MapUtil.take($dictionary)(name, () => new Map());
68
- if (internal.has(type)) return false;
69
- internal.set(type, closure);
70
- return true;
71
- },
72
- erase: (name) => (type) => $dictionary.get(name)?.delete(type) ?? false,
73
- };
74
-
75
- /* -----------------------------------------------------------
76
- BASIC VALIDATORS
77
- ----------------------------------------------------------- */
78
- /**
79
- * Asserts a value type.
80
- *
81
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
82
- * reason, if the parametric value is not following the type `T`. Otherwise, the
83
- * value is following the type `T`, just input parameter would be returned.
84
- *
85
- * If what you want is not asserting but just knowing whether the parametric value is
86
- * following the type `T` or not, you can choose the {@link is} function instead.
87
- * Otherwise you want to know all the errors, {@link validate} is the way to go.
88
- *
89
- * On the other and, if you don't want to allow any superfluous property that is not
90
- * enrolled to the type `T`, you can use {@link assertEquals} function instead.
91
- *
92
- * @template T Type of the input value
93
- * @param input A value to be asserted
94
- * @returns Parametric input value
95
- * @throws A {@link TypeGuardError} instance with detailed reason
96
- *
97
- * @author Jeongho Nam - https://github.com/samchon
98
- */
99
- export function assert<T>(input: T): T;
100
-
101
- /**
102
- * Asserts a value type.
103
- *
104
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
105
- * reason, if the parametric value is not following the type `T`. Otherwise, the
106
- * value is following the type `T`, just input parameter would be returned.
107
- *
108
- * If what you want is not asserting but just knowing whether the parametric value is
109
- * following the type `T` or not, you can choose the {@link is} function instead.
110
- * Otherwise, you want to know all the errors, {@link validate} is the way to go.
111
- *
112
- * On the other and, if you don't want to allow any superfluous property that is not
113
- * enrolled to the type `T`, you can use {@link assertEquals} function instead.
114
- *
115
- * @template T Type of the input value
116
- * @param input A value to be asserted
117
- * @returns Parametric input value casted as `T`
118
- * @throws A {@link TypeGuardError} instance with detailed reason
119
- *
120
- * @author Jeongho Nam - https://github.com/samchon
121
- */
122
- export function assert<T>(input: unknown): T;
123
-
124
- /**
125
- * @internal
126
- */
127
- export function assert(): never {
128
- halt("assert");
129
- }
130
- Object.assign(assert, Namespace.assert("assert"));
131
-
132
- /**
133
- * Asserts a value type.
134
- *
135
- * Duplicated function of {@link assert} for `typescript-is` users.
136
- *
137
- * @template T Type of the input value
138
- * @param input A value to be asserted
139
- * @returns Parametric input value
140
- * @throws A {@link TypeGuardError} instance with detailed reason
141
- *
142
- * @author Jeongho Nam - https://github.com/samchon
143
- * @deprecated
144
- */
145
- export function assertType<T>(input: T): T;
146
-
147
- /**
148
- * Asserts a value type.
149
- *
150
- * Duplicated function of {@link assert} for `typescript-is` users.
151
- *
152
- * @template T Type of the input value
153
- * @param input A value to be asserted
154
- * @returns Parametric input value
155
- * @throws A {@link TypeGuardError} instance with detailed reason
156
- *
157
- * @author Jeongho Nam - https://github.com/samchon
158
- * @deprecated
159
- */
160
- export function assertType<T>(input: unknown): T;
161
-
162
- /**
163
- * @internal
164
- */
165
- export function assertType(): never {
166
- halt("assertType");
167
- }
168
- Object.assign(assertType, Namespace.assert("assertType"));
169
-
170
- /**
171
- * Tests a value type.
172
- *
173
- * Tests a parametric value type and returns whether it's following the type `T` or not.
174
- * If the parametric value is matched with the type `T`, `true` value would be returned.
175
- * Otherwise, the parametric value is not following the type `T`, `false` value would be
176
- * returned.
177
- *
178
- * If what you want is not just knowing whether the parametric value is following the
179
- * type `T` or not, but throwing an exception with detailed reason, you can choose
180
- * {@link assert} function instead. Also, if you want to know all the errors with
181
- * detailed reasons, {@link validate} function would be useful.
182
- *
183
- * On the other and, if you don't want to allow any superfluous property that is not
184
- * enrolled to the type `T`, you can use {@link equals} function instead.
185
- *
186
- * @template T Type of the input value
187
- * @param input A value to be tested
188
- * @returns Whether the parametric value is following the type `T` or not
189
- *
190
- * @author Jeongho Nam - https://github.com/samchon
191
- */
192
- export function is<T>(input: T): input is T;
193
-
194
- /**
195
- * Tests a value type.
196
- *
197
- * Tests a parametric value type and returns whether it's following the type `T` or not.
198
- * If the parametric value is matched with the type `T`, `true` value would be returned.
199
- * Otherwise, the parametric value is not following the type `T`, `false` value would be
200
- * returned.
201
- *
202
- * If what you want is not just knowing whether the parametric value is following the
203
- * type `T` or not, but throwing an exception with detailed reason, you can choose
204
- * {@link assert} function instead. Also, if you want to know all the errors with
205
- * detailed reasons, {@link validate} function would be useful.
206
- *
207
- * On the other and, if you don't want to allow any superfluous property that is not
208
- * enrolled to the type `T`, you can use {@link equals} function instead.
209
- *
210
- * @template T Type of the input value
211
- * @param input A value to be tested
212
- * @returns Whether the parametric value is following the type `T` or not
213
- *
214
- * @author Jeongho Nam - https://github.com/samchon
215
- */
216
- export function is<T>(input: unknown): input is T;
217
-
218
- /**
219
- * @internal
220
- */
221
- export function is(): never {
222
- halt("is");
223
- }
224
- Object.assign(is, Namespace.assert("is"));
225
-
226
- /**
227
- * Validates a value type.
228
- *
229
- * Validates a parametric value type and archives all the type errors into an
230
- * {@link IValidation.errors} array, if the parametric value is not following the
231
- * type `T`. Of course, if the parametric value is following the type `T`, the
232
- * {@link IValidation.errors} array would be empty and {@link IValidation.success}
233
- * would have the `true` value.
234
- *
235
- * If what you want is not finding all the error, but asserting the parametric value
236
- * type with exception throwing, you can choose {@link assert} function instead.
237
- * Otherwise, you just want to know whether the parametric value is matched with the
238
- * type `T`, {@link is} function is the way to go.
239
- *
240
- * On the other and, if you don't want to allow any superfluous property that is not
241
- * enrolled to the type `T`, you can use {@link validateEquals} function instead.
242
- *
243
- * @template Type of the input value
244
- * @param input A value to be validated
245
- * @returns Validation result
246
- *
247
- * @author Jeongho Nam - https://github.com/samchon
248
- */
249
- export function validate<T>(input: T): IValidation<T>;
250
-
251
- /**
252
- * Validates a value type.
253
- *
254
- * Validates a parametric value type and archives all the type errors into an
255
- * {@link IValidation.errors} array, if the parametric value is not following the
256
- * type `T`. Of course, if the parametric value is following the type `T`, the
257
- * {@link IValidation.errors} array would be empty and {@link IValidation.success}
258
- * would have the `true` value.
259
- *
260
- * If what you want is not finding all the error, but asserting the parametric value
261
- * type with exception throwing, you can choose {@link assert} function instead.
262
- * Otherwise, you just want to know whether the parametric value is matched with the
263
- * type `T`, {@link is} function is the way to go.
264
- *
265
- * On the other and, if you don't want to allow any superfluous property that is not
266
- * enrolled to the type `T`, you can use {@link validateEquals} function instead.
267
- *
268
- * @template Type of the input value
269
- * @param input A value to be validated
270
- * @returns Validation result
271
- *
272
- * @author Jeongho Nam - https://github.com/samchon
273
- */
274
- export function validate<T>(input: unknown): IValidation<T>;
275
-
276
- /**
277
- * @internal
278
- */
279
- export function validate(): never {
280
- halt("validate");
281
- }
282
- Object.assign(validate, Namespace.validate());
283
-
284
- /* -----------------------------------------------------------
285
- STRICT VALIDATORS
286
- ----------------------------------------------------------- */
287
- /**
288
- * Asserts equality between a value and its type.
289
- *
290
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
291
- * reason, if the parametric value is not following the type `T` or some superfluous
292
- * property that is not listed on the type `T` has been found. Otherwise, the value is
293
- * following the type `T` without any superfluous property, just input parameter would
294
- * be returned.
295
- *
296
- * If what you want is not asserting but just knowing whether the parametric value is
297
- * following the type `T` or not, you can choose the {@link equals} function instead.
298
- * Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
299
- *
300
- * On the other hand, if you want to allow superfluous property that is not enrolled
301
- * to the type `T`, you can use {@link assert} function instead.
302
- *
303
- * @template T Type of the input value
304
- * @param input A value to be asserted
305
- * @returns Parametric input value
306
- * @throws A {@link TypeGuardError} instance with detailed reason
307
- *
308
- * @author Jeongho Nam - https://github.com/samchon
309
- */
310
- export function assertEquals<T>(input: T): T;
311
-
312
- /**
313
- * Asserts equality between a value and its type.
314
- *
315
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
316
- * reason, if the parametric value is not following the type `T` or some superfluous
317
- * property that is not listed on the type `T` has been found. Otherwise, the value is
318
- * following the type `T` without any superfluous property, just input parameter would
319
- * be returned.
320
- *
321
- * If what you want is not asserting but just knowing whether the parametric value is
322
- * following the type `T` or not, you can choose the {@link equals} function instead.
323
- * Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
324
- *
325
- * On the other hand, if you want to allow superfluous property that is not enrolled
326
- * to the type `T`, you can use {@link assert} function instead.
327
- *
328
- * @template T Type of the input value
329
- * @param input A value to be asserted
330
- * @returns Parametric input value casted as `T`
331
- * @throws A {@link TypeGuardError} instance with detailed reason
332
- *
333
- * @author Jeongho Nam - https://github.com/samchon
334
- */
335
- export function assertEquals<T>(input: unknown): T;
336
-
337
- /**
338
- * @internal
339
- */
340
- export function assertEquals(): never {
341
- halt("assertEquals");
342
- }
343
- Object.assign(assertEquals, Namespace.assert("assertEquals"));
344
-
345
- /**
346
- * Tests equality between a value and its type.
347
- *
348
- * Tests a parametric value type and returns whether it's equivalent to the type `T`
349
- * or not. If the parametric value is matched with the type `T` and there's not any
350
- * superfluous property that is not listed on the type `T`, `true` value would be
351
- * returned. Otherwise, the parametric value is not following the type `T` or some
352
- * superfluous property exists, `false` value would be returned.
353
- *
354
- * If what you want is not just knowing whether the parametric value is following the
355
- * type `T` or not, but throwing an exception with detailed reason, you can choose
356
- * {@link assertEquals} function instead. Also, if you want to know all the errors with
357
- * detailed reasons, {@link validateEquals} function would be useful.
358
- *
359
- * On the other hand, if you want to allow superfluous property that is not enrolled
360
- * to the type `T`, you can use {@link is} function instead.
361
- *
362
- * @template T Type of the input value
363
- * @param input A value to be tested
364
- * @returns Whether the parametric value is equivalent to the type `T` or not
365
- *
366
- * @author Jeongho Nam - https://github.com/samchon
367
- */
368
- export function equals<T>(input: T): input is T;
369
-
370
- /**
371
- * Tests equality between a value and its type.
372
- *
373
- * Tests a parametric value type and returns whether it's equivalent to the type `T`
374
- * or not. If the parametric value is matched with the type `T` and there's not any
375
- * superfluous property that is not listed on the type `T`, `true` value would be
376
- * returned. Otherwise, the parametric value is not following the type `T` or some
377
- * superfluous property exists, `false` value would be returned.
378
- *
379
- * If what you want is not just knowing whether the parametric value is following the
380
- * type `T` or not, but throwing an exception with detailed reason, you can choose
381
- * {@link assertEquals} function instead. Also, if you want to know all the errors with
382
- * detailed reasons, {@link validateEquals} function would be useful.
383
- *
384
- * On the other hand, if you want to allow superfluous property that is not enrolled
385
- * to the type `T`, you can use {@link is} function instead.
386
- *
387
- * @template T Type of the input value
388
- * @param input A value to be tested
389
- * @returns Whether the parametric value is equivalent to the type `T` or not
390
- *
391
- * @author Jeongho Nam - https://github.com/samchon
392
- */
393
- export function equals<T>(input: unknown): input is T;
394
-
395
- /**
396
- * @internal
397
- */
398
- export function equals(): never {
399
- halt("equals");
400
- }
401
- Object.assign(equals, Namespace.is());
402
-
403
- /**
404
- * Validates equality between a value and its type.
405
- *
406
- * Validates a parametric value type and archives all the type errors into an
407
- * {@link IValidation.errors} array, if the parametric value is not following the
408
- * type `T` or some superfluous property that is not listed on the type `T` has been
409
- * found. Of course, if the parametric value is following the type `T` and no
410
- * superfluous property exists, the {@link IValidation.errors} array would be empty
411
- * and {@link IValidation.success} would have the `true` value.
412
- *
413
- * If what you want is not finding all the error, but asserting the parametric value
414
- * type with exception throwing, you can choose {@link assert} function instead.
415
- * Otherwise, you just want to know whether the parametric value is matched with the
416
- * type `T`, {@link is} function is the way to go.
417
- *
418
- * On the other and, if you don't want to allow any superfluous property that is not
419
- * enrolled to the type `T`, you can use {@link validateEquals} function instead.
420
- *
421
- * @template Type of the input value
422
- * @param input A value to be validated
423
- * @returns Validation result
424
- *
425
- * @author Jeongho Nam - https://github.com/samchon
426
- */
427
- export function validateEquals<T>(input: T): IValidation<T>;
428
-
429
- /**
430
- * Validates equality between a value and its type.
431
- *
432
- * Validates a parametric value type and archives all the type errors into an
433
- * {@link IValidation.errors} array, if the parametric value is not following the
434
- * type `T` or some superfluous property that is not listed on the type `T` has been
435
- * found. Of course, if the parametric value is following the type `T` and no
436
- * superfluous property exists, the {@link IValidation.errors} array would be empty
437
- * and {@link IValidation.success} would have the `true` value.
438
- *
439
- * If what you want is not finding all the error, but asserting the parametric value
440
- * type with exception throwing, you can choose {@link assert} function instead.
441
- * Otherwise, you just want to know whether the parametric value is matched with the
442
- * type `T`, {@link is} function is the way to go.
443
- *
444
- * On the other and, if you don't want to allow any superfluous property that is not
445
- * enrolled to the type `T`, you can use {@link validateEquals} function instead.
446
- *
447
- * @template Type of the input value
448
- * @param input A value to be validated
449
- * @returns Validation result
450
- *
451
- * @author Jeongho Nam - https://github.com/samchon
452
- */
453
- export function validateEquals<T>(input: unknown): IValidation<T>;
454
-
455
- /**
456
- * @internal
457
- */
458
- export function validateEquals(): never {
459
- halt("validateEquals");
460
- }
461
- Object.assign(validateEquals, Namespace.validate());
462
-
463
- /* -----------------------------------------------------------
464
- RANDOM
465
- ----------------------------------------------------------- */
466
- /**
467
- * > You must configure the generic argument `T`.
468
- *
469
- * Generate random data.
470
- *
471
- * Generates a random data following type the `T`.
472
- *
473
- * For reference, this `typia.random()` function generates only primitive type.
474
- * If there're some methods in the type `T` or its nested instances, those would
475
- * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
476
- * would be generated instead.
477
- *
478
- * @template T Type of data to generate
479
- * @param generator Random data generator
480
- * @return Randomly generated data
481
- *
482
- * @author Jeongho Nam - https://github.com/samchon
483
- */
484
- export function random(generator?: Partial<IRandomGenerator>): never;
485
-
486
- /**
487
- * Generate random data.
488
- *
489
- * Generates a random data following type the `T`.
490
- *
491
- * For reference, this `typia.random()` function generates only primitive type.
492
- * If there're some methods in the type `T` or its nested instances, those would
493
- * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
494
- * would be generated instead.
495
- *
496
- * @template T Type of data to generate
497
- * @param generator Random data generator
498
- * @return Randomly generated data
499
- *
500
- * @author Jeongho Nam - https://github.com/samchon
501
- */
502
- export function random<T>(generator?: Partial<IRandomGenerator>): Primitive<T>;
503
-
504
- /**
505
- * @internal
506
- */
507
- export function random(): never {
508
- halt("random");
509
- }
510
- Object.assign(random, Namespace.random());
511
-
512
- /**
513
- * @internal
514
- */
515
- export function metadata(): never;
516
-
517
- /**
518
- * @internal
519
- */
520
- export function metadata<Types extends unknown[]>(): IMetadataApplication;
521
-
522
- /**
523
- * @internal
524
- */
525
- export function metadata(): never {
526
- halt("metadata");
527
- }
528
-
529
- /* -----------------------------------------------------------
530
- FACTORY FUNCTIONS
531
- ----------------------------------------------------------- */
532
- /**
533
- * Creates a reusable {@link assert} function.
534
- *
535
- * @danger You have to specify the generic argument `T`
536
- * @return Nothing until specifying the generic argument `T`
537
- * @throws compile error
538
- *
539
- * @author Jeongho Nam - https://github.com/samchon
540
- */
541
- export function createAssert(): never;
542
-
543
- /**
544
- * Creates a reusable {@link assert} function.
545
- *
546
- * @template T Type of the input value
547
- * @returns A reusable `assert` function
548
- *
549
- * @author Jeongho Nam - https://github.com/samchon
550
- */
551
- export function createAssert<T>(): (input: unknown) => T;
552
-
553
- /**
554
- * @internal
555
- */
556
- export function createAssert<T>(): (input: unknown) => T {
557
- halt("createAssert");
558
- }
559
- Object.assign(createAssert, assert);
560
-
561
- /**
562
- * Creates a reusable {@link assertType} function.
563
- *
564
- * Duplicated function of {@link createAssert} for `typescript-is` users.
565
- *
566
- * @danger You have to specify the generic argument `T`
567
- * @return Nothing until specifying the generic argument `T`
568
- * @throws compile error
569
- *
570
- * @author Jeongho Nam - https://github.com/samchon
571
- * @deprecated
572
- */
573
- export function createAssertType(): never;
574
-
575
- /**
576
- * Creates a reusable {@link assertType} function.
577
- *
578
- * Duplicated function of {@link createAssert} for `typescript-is` users.
579
- *
580
- * @template T Type of the input value
581
- * @returns A reusable `assert` function
582
- *
583
- * @author Jeongho Nam - https://github.com/samchon
584
- * @deprecated
585
- */
586
- export function createAssertType<T>(): (input: unknown) => T;
587
-
588
- /**
589
- * @internal
590
- */
591
- export function createAssertType<T>(): (input: unknown) => T {
592
- halt("createAssertType");
593
- }
594
- Object.assign(createAssertType, assertType);
595
-
596
- /**
597
- * Creates a reusable {@link is} function.
598
- *
599
- * @danger You have to specify the generic argument `T`
600
- * @return Nothing until specifying the generic argument `T`
601
- * @throws compile error
602
- *
603
- * @author Jeongho Nam - https://github.com/samchon
604
- */
605
- export function createIs(): never;
606
-
607
- /**
608
- * Creates a reusable {@link is} function.
609
- *
610
- * @template T Type of the input value
611
- * @returns A reusable `is` function
612
- *
613
- * @author Jeongho Nam - https://github.com/samchon
614
- */
615
- export function createIs<T>(): (input: unknown) => input is T;
616
-
617
- /**
618
- * @internal
619
- */
620
- export function createIs<T>(): (input: unknown) => input is T {
621
- halt("createIs");
622
- }
623
- Object.assign(createIs, is);
624
-
625
- /**
626
- * Creates a reusable {@link validate} function.
627
- *
628
- * @danger You have to specify the generic argument `T`
629
- * @return Nothing until specifying the generic argument `T`
630
- * @throws compile error
631
- *
632
- * @author Jeongho Nam - https://github.com/samchon
633
- */
634
- export function createValidate(): never;
635
-
636
- /**
637
- * Creates a reusable {@link validate} function.
638
- *
639
- * @template T Type of the input value
640
- * @returns A reusable `validate` function
641
- *
642
- * @author Jeongho Nam - https://github.com/samchon
643
- */
644
- export function createValidate<T>(): (input: unknown) => IValidation<T>;
645
-
646
- /**
647
- * @internal
648
- */
649
- export function createValidate(): (input: unknown) => IValidation {
650
- halt("createValidate");
651
- }
652
- Object.assign(createValidate, validate);
653
-
654
- /**
655
- * Creates a reusable {@link assertEquals} function.
656
- *
657
- * @danger You have to specify the generic argument `T`
658
- * @return Nothing until specifying the generic argument `T`
659
- * @throws compile error
660
- *
661
- * @author Jeongho Nam - https://github.com/samchon
662
- */
663
- export function createAssertEquals(): never;
664
-
665
- /**
666
- * Creates a reusable {@link assertEquals} function.
667
- *
668
- * @template T Type of the input value
669
- * @returns A reusable `assertEquals` function
670
- *
671
- * @author Jeongho Nam - https://github.com/samchon
672
- */
673
- export function createAssertEquals<T>(): (input: unknown) => T;
674
-
675
- /**
676
- * @internal
677
- */
678
- export function createAssertEquals<T>(): (input: unknown) => T {
679
- halt("createAssertEquals");
680
- }
681
- Object.assign(createAssertEquals, assertEquals);
682
-
683
- /**
684
- * Creates a reusable {@link equals} function.
685
- *
686
- * @danger You have to specify the generic argument `T`
687
- * @return Nothing until specifying the generic argument `T`
688
- * @throws compile error
689
- *
690
- * @author Jeongho Nam - https://github.com/samchon
691
- */
692
- export function createEquals(): never;
693
-
694
- /**
695
- * Creates a reusable {@link equals} function.
696
- *
697
- * @template T Type of the input value
698
- * @returns A reusable `equals` function
699
- *
700
- * @author Jeongho Nam - https://github.com/samchon
701
- */
702
- export function createEquals<T>(): (input: unknown) => input is T;
703
-
704
- /**
705
- * @internal
706
- */
707
- export function createEquals<T>(): (input: unknown) => input is T {
708
- halt("createEquals");
709
- }
710
- Object.assign(createEquals, equals);
711
-
712
- /**
713
- * Creates a reusable {@link validateEquals} function.
714
- *
715
- * @danger You have to specify the generic argument `T`
716
- * @return Nothing until specifying the generic argument `T`
717
- * @throws compile error
718
- *
719
- * @author Jeongho Nam - https://github.com/samchon
720
- */
721
- export function createValidateEquals(): never;
722
-
723
- /**
724
- * Creates a reusable {@link validateEquals} function.
725
- *
726
- * @template T Type of the input value
727
- * @returns A reusable `validateEquals` function
728
- *
729
- * @author Jeongho Nam - https://github.com/samchon
730
- */
731
- export function createValidateEquals<T>(): (input: unknown) => IValidation<T>;
732
-
733
- /**
734
- * @internal
735
- */
736
- export function createValidateEquals(): (input: unknown) => IValidation {
737
- halt("createValidateEquals");
738
- }
739
- Object.assign(createValidateEquals, validateEquals);
740
-
741
- /**
742
- * Creates a reusable {@link random} function.
743
- *
744
- * @danger You have to specify the generic argument `T`
745
- * @param generator Random data generator
746
- * @return Nothing until specifying the generic argument `T`
747
- * @throws compile error
748
- *
749
- * @author Jeongho Nam - https://github.com/samchon
750
- */
751
- export function createRandom(generator?: Partial<IRandomGenerator>): never;
752
-
753
- /**
754
- * Creates a resuable {@link random} function.
755
- *
756
- * @template T Type of the input value
757
- * @param generator Random data generator
758
- * @returns A reusable `random` function
759
- *
760
- * @author Jeongho Nam - https://github.com/samchon
761
- */
762
- export function createRandom<T>(
763
- generator?: Partial<IRandomGenerator>,
764
- ): () => Primitive<T>;
765
-
766
- /**
767
- * @internal
768
- */
769
- export function createRandom(): never {
770
- halt("createRandom");
771
- }
772
- Object.assign(createRandom, random);
773
-
774
- /**
775
- * @internal
776
- */
777
- function halt(name: string): never {
778
- throw new Error(
779
- `Error on typia.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`,
780
- );
781
- }
1
+ import { $dictionary } from "./functional/$dictionary";
2
+ import { Namespace } from "./functional/Namespace";
3
+
4
+ import { IMetadataApplication } from "./schemas/metadata/IMetadataApplication";
5
+
6
+ import { MapUtil } from "./utils/MapUtil";
7
+
8
+ import { CustomValidatorMap } from "./CustomValidatorMap";
9
+ import { IRandomGenerator } from "./IRandomGenerator";
10
+ import { IValidation } from "./IValidation";
11
+ import { Primitive } from "./Primitive";
12
+
13
+ export * as json from "./json";
14
+ export * as protobuf from "./protobuf";
15
+ export * as misc from "./misc";
16
+
17
+ export * from "./schemas/json/IJsonApplication";
18
+ export * from "./schemas/json/IJsonComponents";
19
+ export * from "./schemas/json/IJsonSchema";
20
+ export * from "./IRandomGenerator";
21
+ export * from "./IValidation";
22
+ export * from "./Primitive";
23
+ export * from "./TypeGuardError";
24
+
25
+ /**
26
+ * Custom validators.
27
+ *
28
+ * If you want to add a custom validation logic utilizing comment tags,
29
+ * add a closure function with its tag and type name. Below example code
30
+ * would helpful to understand how to use this instance.
31
+ *
32
+ * ```ts
33
+ * typia.customValidators.insert("powerOf")("number")(
34
+ * (text: string) => {
35
+ * const denominator: number = Math.log(Number(text));
36
+ * return (value: number) => {
37
+ * value = Math.log(value) / denominator;
38
+ * return value === Math.floor(value);
39
+ * };
40
+ * }
41
+ * );
42
+ * typia.customValidators.insert("dollar")("string")(
43
+ * () => (value: string) => value.startsWith("$"),
44
+ * );
45
+ *
46
+ * interface TagCustom {
47
+ * /**
48
+ * * @powerOf 10
49
+ * *\/
50
+ * powerOf: number;
51
+ *
52
+ * /**
53
+ * * @dollar
54
+ * *\/
55
+ * dollar: string;
56
+ * }
57
+ * ```
58
+ *
59
+ * @author Jeongho Nam - https://github.com/samchon
60
+ */
61
+ export const customValidators: CustomValidatorMap = {
62
+ size: (name?: string) =>
63
+ name ? $dictionary.get(name)?.size ?? 0 : $dictionary.size,
64
+ has: (name) => (type) => $dictionary.get(name)?.has(type) ?? false,
65
+ get: (name) => (type) => $dictionary.get(name)?.get(type),
66
+ insert: (name) => (type) => (closure) => {
67
+ const internal = MapUtil.take($dictionary)(name, () => new Map());
68
+ if (internal.has(type)) return false;
69
+ internal.set(type, closure);
70
+ return true;
71
+ },
72
+ erase: (name) => (type) => $dictionary.get(name)?.delete(type) ?? false,
73
+ };
74
+
75
+ /* -----------------------------------------------------------
76
+ BASIC VALIDATORS
77
+ ----------------------------------------------------------- */
78
+ /**
79
+ * Asserts a value type.
80
+ *
81
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
82
+ * reason, if the parametric value is not following the type `T`. Otherwise, the
83
+ * value is following the type `T`, just input parameter would be returned.
84
+ *
85
+ * If what you want is not asserting but just knowing whether the parametric value is
86
+ * following the type `T` or not, you can choose the {@link is} function instead.
87
+ * Otherwise you want to know all the errors, {@link validate} is the way to go.
88
+ *
89
+ * On the other and, if you don't want to allow any superfluous property that is not
90
+ * enrolled to the type `T`, you can use {@link assertEquals} function instead.
91
+ *
92
+ * @template T Type of the input value
93
+ * @param input A value to be asserted
94
+ * @returns Parametric input value
95
+ * @throws A {@link TypeGuardError} instance with detailed reason
96
+ *
97
+ * @author Jeongho Nam - https://github.com/samchon
98
+ */
99
+ export function assert<T>(input: T): T;
100
+
101
+ /**
102
+ * Asserts a value type.
103
+ *
104
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
105
+ * reason, if the parametric value is not following the type `T`. Otherwise, the
106
+ * value is following the type `T`, just input parameter would be returned.
107
+ *
108
+ * If what you want is not asserting but just knowing whether the parametric value is
109
+ * following the type `T` or not, you can choose the {@link is} function instead.
110
+ * Otherwise, you want to know all the errors, {@link validate} is the way to go.
111
+ *
112
+ * On the other and, if you don't want to allow any superfluous property that is not
113
+ * enrolled to the type `T`, you can use {@link assertEquals} function instead.
114
+ *
115
+ * @template T Type of the input value
116
+ * @param input A value to be asserted
117
+ * @returns Parametric input value casted as `T`
118
+ * @throws A {@link TypeGuardError} instance with detailed reason
119
+ *
120
+ * @author Jeongho Nam - https://github.com/samchon
121
+ */
122
+ export function assert<T>(input: unknown): T;
123
+
124
+ /**
125
+ * @internal
126
+ */
127
+ export function assert(): never {
128
+ halt("assert");
129
+ }
130
+ Object.assign(assert, Namespace.assert("assert"));
131
+
132
+ /**
133
+ * Asserts a value type.
134
+ *
135
+ * Duplicated function of {@link assert} for `typescript-is` users.
136
+ *
137
+ * @template T Type of the input value
138
+ * @param input A value to be asserted
139
+ * @returns Parametric input value
140
+ * @throws A {@link TypeGuardError} instance with detailed reason
141
+ *
142
+ * @author Jeongho Nam - https://github.com/samchon
143
+ * @deprecated
144
+ */
145
+ export function assertType<T>(input: T): T;
146
+
147
+ /**
148
+ * Asserts a value type.
149
+ *
150
+ * Duplicated function of {@link assert} for `typescript-is` users.
151
+ *
152
+ * @template T Type of the input value
153
+ * @param input A value to be asserted
154
+ * @returns Parametric input value
155
+ * @throws A {@link TypeGuardError} instance with detailed reason
156
+ *
157
+ * @author Jeongho Nam - https://github.com/samchon
158
+ * @deprecated
159
+ */
160
+ export function assertType<T>(input: unknown): T;
161
+
162
+ /**
163
+ * @internal
164
+ */
165
+ export function assertType(): never {
166
+ halt("assertType");
167
+ }
168
+ Object.assign(assertType, Namespace.assert("assertType"));
169
+
170
+ /**
171
+ * Tests a value type.
172
+ *
173
+ * Tests a parametric value type and returns whether it's following the type `T` or not.
174
+ * If the parametric value is matched with the type `T`, `true` value would be returned.
175
+ * Otherwise, the parametric value is not following the type `T`, `false` value would be
176
+ * returned.
177
+ *
178
+ * If what you want is not just knowing whether the parametric value is following the
179
+ * type `T` or not, but throwing an exception with detailed reason, you can choose
180
+ * {@link assert} function instead. Also, if you want to know all the errors with
181
+ * detailed reasons, {@link validate} function would be useful.
182
+ *
183
+ * On the other and, if you don't want to allow any superfluous property that is not
184
+ * enrolled to the type `T`, you can use {@link equals} function instead.
185
+ *
186
+ * @template T Type of the input value
187
+ * @param input A value to be tested
188
+ * @returns Whether the parametric value is following the type `T` or not
189
+ *
190
+ * @author Jeongho Nam - https://github.com/samchon
191
+ */
192
+ export function is<T>(input: T): input is T;
193
+
194
+ /**
195
+ * Tests a value type.
196
+ *
197
+ * Tests a parametric value type and returns whether it's following the type `T` or not.
198
+ * If the parametric value is matched with the type `T`, `true` value would be returned.
199
+ * Otherwise, the parametric value is not following the type `T`, `false` value would be
200
+ * returned.
201
+ *
202
+ * If what you want is not just knowing whether the parametric value is following the
203
+ * type `T` or not, but throwing an exception with detailed reason, you can choose
204
+ * {@link assert} function instead. Also, if you want to know all the errors with
205
+ * detailed reasons, {@link validate} function would be useful.
206
+ *
207
+ * On the other and, if you don't want to allow any superfluous property that is not
208
+ * enrolled to the type `T`, you can use {@link equals} function instead.
209
+ *
210
+ * @template T Type of the input value
211
+ * @param input A value to be tested
212
+ * @returns Whether the parametric value is following the type `T` or not
213
+ *
214
+ * @author Jeongho Nam - https://github.com/samchon
215
+ */
216
+ export function is<T>(input: unknown): input is T;
217
+
218
+ /**
219
+ * @internal
220
+ */
221
+ export function is(): never {
222
+ halt("is");
223
+ }
224
+ Object.assign(is, Namespace.assert("is"));
225
+
226
+ /**
227
+ * Validates a value type.
228
+ *
229
+ * Validates a parametric value type and archives all the type errors into an
230
+ * {@link IValidation.errors} array, if the parametric value is not following the
231
+ * type `T`. Of course, if the parametric value is following the type `T`, the
232
+ * {@link IValidation.errors} array would be empty and {@link IValidation.success}
233
+ * would have the `true` value.
234
+ *
235
+ * If what you want is not finding all the error, but asserting the parametric value
236
+ * type with exception throwing, you can choose {@link assert} function instead.
237
+ * Otherwise, you just want to know whether the parametric value is matched with the
238
+ * type `T`, {@link is} function is the way to go.
239
+ *
240
+ * On the other and, if you don't want to allow any superfluous property that is not
241
+ * enrolled to the type `T`, you can use {@link validateEquals} function instead.
242
+ *
243
+ * @template Type of the input value
244
+ * @param input A value to be validated
245
+ * @returns Validation result
246
+ *
247
+ * @author Jeongho Nam - https://github.com/samchon
248
+ */
249
+ export function validate<T>(input: T): IValidation<T>;
250
+
251
+ /**
252
+ * Validates a value type.
253
+ *
254
+ * Validates a parametric value type and archives all the type errors into an
255
+ * {@link IValidation.errors} array, if the parametric value is not following the
256
+ * type `T`. Of course, if the parametric value is following the type `T`, the
257
+ * {@link IValidation.errors} array would be empty and {@link IValidation.success}
258
+ * would have the `true` value.
259
+ *
260
+ * If what you want is not finding all the error, but asserting the parametric value
261
+ * type with exception throwing, you can choose {@link assert} function instead.
262
+ * Otherwise, you just want to know whether the parametric value is matched with the
263
+ * type `T`, {@link is} function is the way to go.
264
+ *
265
+ * On the other and, if you don't want to allow any superfluous property that is not
266
+ * enrolled to the type `T`, you can use {@link validateEquals} function instead.
267
+ *
268
+ * @template Type of the input value
269
+ * @param input A value to be validated
270
+ * @returns Validation result
271
+ *
272
+ * @author Jeongho Nam - https://github.com/samchon
273
+ */
274
+ export function validate<T>(input: unknown): IValidation<T>;
275
+
276
+ /**
277
+ * @internal
278
+ */
279
+ export function validate(): never {
280
+ halt("validate");
281
+ }
282
+ Object.assign(validate, Namespace.validate());
283
+
284
+ /* -----------------------------------------------------------
285
+ STRICT VALIDATORS
286
+ ----------------------------------------------------------- */
287
+ /**
288
+ * Asserts equality between a value and its type.
289
+ *
290
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
291
+ * reason, if the parametric value is not following the type `T` or some superfluous
292
+ * property that is not listed on the type `T` has been found. Otherwise, the value is
293
+ * following the type `T` without any superfluous property, just input parameter would
294
+ * be returned.
295
+ *
296
+ * If what you want is not asserting but just knowing whether the parametric value is
297
+ * following the type `T` or not, you can choose the {@link equals} function instead.
298
+ * Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
299
+ *
300
+ * On the other hand, if you want to allow superfluous property that is not enrolled
301
+ * to the type `T`, you can use {@link assert} function instead.
302
+ *
303
+ * @template T Type of the input value
304
+ * @param input A value to be asserted
305
+ * @returns Parametric input value
306
+ * @throws A {@link TypeGuardError} instance with detailed reason
307
+ *
308
+ * @author Jeongho Nam - https://github.com/samchon
309
+ */
310
+ export function assertEquals<T>(input: T): T;
311
+
312
+ /**
313
+ * Asserts equality between a value and its type.
314
+ *
315
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
316
+ * reason, if the parametric value is not following the type `T` or some superfluous
317
+ * property that is not listed on the type `T` has been found. Otherwise, the value is
318
+ * following the type `T` without any superfluous property, just input parameter would
319
+ * be returned.
320
+ *
321
+ * If what you want is not asserting but just knowing whether the parametric value is
322
+ * following the type `T` or not, you can choose the {@link equals} function instead.
323
+ * Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
324
+ *
325
+ * On the other hand, if you want to allow superfluous property that is not enrolled
326
+ * to the type `T`, you can use {@link assert} function instead.
327
+ *
328
+ * @template T Type of the input value
329
+ * @param input A value to be asserted
330
+ * @returns Parametric input value casted as `T`
331
+ * @throws A {@link TypeGuardError} instance with detailed reason
332
+ *
333
+ * @author Jeongho Nam - https://github.com/samchon
334
+ */
335
+ export function assertEquals<T>(input: unknown): T;
336
+
337
+ /**
338
+ * @internal
339
+ */
340
+ export function assertEquals(): never {
341
+ halt("assertEquals");
342
+ }
343
+ Object.assign(assertEquals, Namespace.assert("assertEquals"));
344
+
345
+ /**
346
+ * Tests equality between a value and its type.
347
+ *
348
+ * Tests a parametric value type and returns whether it's equivalent to the type `T`
349
+ * or not. If the parametric value is matched with the type `T` and there's not any
350
+ * superfluous property that is not listed on the type `T`, `true` value would be
351
+ * returned. Otherwise, the parametric value is not following the type `T` or some
352
+ * superfluous property exists, `false` value would be returned.
353
+ *
354
+ * If what you want is not just knowing whether the parametric value is following the
355
+ * type `T` or not, but throwing an exception with detailed reason, you can choose
356
+ * {@link assertEquals} function instead. Also, if you want to know all the errors with
357
+ * detailed reasons, {@link validateEquals} function would be useful.
358
+ *
359
+ * On the other hand, if you want to allow superfluous property that is not enrolled
360
+ * to the type `T`, you can use {@link is} function instead.
361
+ *
362
+ * @template T Type of the input value
363
+ * @param input A value to be tested
364
+ * @returns Whether the parametric value is equivalent to the type `T` or not
365
+ *
366
+ * @author Jeongho Nam - https://github.com/samchon
367
+ */
368
+ export function equals<T>(input: T): input is T;
369
+
370
+ /**
371
+ * Tests equality between a value and its type.
372
+ *
373
+ * Tests a parametric value type and returns whether it's equivalent to the type `T`
374
+ * or not. If the parametric value is matched with the type `T` and there's not any
375
+ * superfluous property that is not listed on the type `T`, `true` value would be
376
+ * returned. Otherwise, the parametric value is not following the type `T` or some
377
+ * superfluous property exists, `false` value would be returned.
378
+ *
379
+ * If what you want is not just knowing whether the parametric value is following the
380
+ * type `T` or not, but throwing an exception with detailed reason, you can choose
381
+ * {@link assertEquals} function instead. Also, if you want to know all the errors with
382
+ * detailed reasons, {@link validateEquals} function would be useful.
383
+ *
384
+ * On the other hand, if you want to allow superfluous property that is not enrolled
385
+ * to the type `T`, you can use {@link is} function instead.
386
+ *
387
+ * @template T Type of the input value
388
+ * @param input A value to be tested
389
+ * @returns Whether the parametric value is equivalent to the type `T` or not
390
+ *
391
+ * @author Jeongho Nam - https://github.com/samchon
392
+ */
393
+ export function equals<T>(input: unknown): input is T;
394
+
395
+ /**
396
+ * @internal
397
+ */
398
+ export function equals(): never {
399
+ halt("equals");
400
+ }
401
+ Object.assign(equals, Namespace.is());
402
+
403
+ /**
404
+ * Validates equality between a value and its type.
405
+ *
406
+ * Validates a parametric value type and archives all the type errors into an
407
+ * {@link IValidation.errors} array, if the parametric value is not following the
408
+ * type `T` or some superfluous property that is not listed on the type `T` has been
409
+ * found. Of course, if the parametric value is following the type `T` and no
410
+ * superfluous property exists, the {@link IValidation.errors} array would be empty
411
+ * and {@link IValidation.success} would have the `true` value.
412
+ *
413
+ * If what you want is not finding all the error, but asserting the parametric value
414
+ * type with exception throwing, you can choose {@link assert} function instead.
415
+ * Otherwise, you just want to know whether the parametric value is matched with the
416
+ * type `T`, {@link is} function is the way to go.
417
+ *
418
+ * On the other and, if you don't want to allow any superfluous property that is not
419
+ * enrolled to the type `T`, you can use {@link validateEquals} function instead.
420
+ *
421
+ * @template Type of the input value
422
+ * @param input A value to be validated
423
+ * @returns Validation result
424
+ *
425
+ * @author Jeongho Nam - https://github.com/samchon
426
+ */
427
+ export function validateEquals<T>(input: T): IValidation<T>;
428
+
429
+ /**
430
+ * Validates equality between a value and its type.
431
+ *
432
+ * Validates a parametric value type and archives all the type errors into an
433
+ * {@link IValidation.errors} array, if the parametric value is not following the
434
+ * type `T` or some superfluous property that is not listed on the type `T` has been
435
+ * found. Of course, if the parametric value is following the type `T` and no
436
+ * superfluous property exists, the {@link IValidation.errors} array would be empty
437
+ * and {@link IValidation.success} would have the `true` value.
438
+ *
439
+ * If what you want is not finding all the error, but asserting the parametric value
440
+ * type with exception throwing, you can choose {@link assert} function instead.
441
+ * Otherwise, you just want to know whether the parametric value is matched with the
442
+ * type `T`, {@link is} function is the way to go.
443
+ *
444
+ * On the other and, if you don't want to allow any superfluous property that is not
445
+ * enrolled to the type `T`, you can use {@link validateEquals} function instead.
446
+ *
447
+ * @template Type of the input value
448
+ * @param input A value to be validated
449
+ * @returns Validation result
450
+ *
451
+ * @author Jeongho Nam - https://github.com/samchon
452
+ */
453
+ export function validateEquals<T>(input: unknown): IValidation<T>;
454
+
455
+ /**
456
+ * @internal
457
+ */
458
+ export function validateEquals(): never {
459
+ halt("validateEquals");
460
+ }
461
+ Object.assign(validateEquals, Namespace.validate());
462
+
463
+ /* -----------------------------------------------------------
464
+ RANDOM
465
+ ----------------------------------------------------------- */
466
+ /**
467
+ * > You must configure the generic argument `T`.
468
+ *
469
+ * Generate random data.
470
+ *
471
+ * Generates a random data following type the `T`.
472
+ *
473
+ * For reference, this `typia.random()` function generates only primitive type.
474
+ * If there're some methods in the type `T` or its nested instances, those would
475
+ * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
476
+ * would be generated instead.
477
+ *
478
+ * @template T Type of data to generate
479
+ * @param generator Random data generator
480
+ * @return Randomly generated data
481
+ *
482
+ * @author Jeongho Nam - https://github.com/samchon
483
+ */
484
+ export function random(generator?: Partial<IRandomGenerator>): never;
485
+
486
+ /**
487
+ * Generate random data.
488
+ *
489
+ * Generates a random data following type the `T`.
490
+ *
491
+ * For reference, this `typia.random()` function generates only primitive type.
492
+ * If there're some methods in the type `T` or its nested instances, those would
493
+ * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
494
+ * would be generated instead.
495
+ *
496
+ * @template T Type of data to generate
497
+ * @param generator Random data generator
498
+ * @return Randomly generated data
499
+ *
500
+ * @author Jeongho Nam - https://github.com/samchon
501
+ */
502
+ export function random<T>(generator?: Partial<IRandomGenerator>): Primitive<T>;
503
+
504
+ /**
505
+ * @internal
506
+ */
507
+ export function random(): never {
508
+ halt("random");
509
+ }
510
+ Object.assign(random, Namespace.random());
511
+
512
+ /**
513
+ * @internal
514
+ */
515
+ export function metadata(): never;
516
+
517
+ /**
518
+ * @internal
519
+ */
520
+ export function metadata<Types extends unknown[]>(): IMetadataApplication;
521
+
522
+ /**
523
+ * @internal
524
+ */
525
+ export function metadata(): never {
526
+ halt("metadata");
527
+ }
528
+
529
+ /* -----------------------------------------------------------
530
+ FACTORY FUNCTIONS
531
+ ----------------------------------------------------------- */
532
+ /**
533
+ * Creates a reusable {@link assert} function.
534
+ *
535
+ * @danger You have to specify the generic argument `T`
536
+ * @return Nothing until specifying the generic argument `T`
537
+ * @throws compile error
538
+ *
539
+ * @author Jeongho Nam - https://github.com/samchon
540
+ */
541
+ export function createAssert(): never;
542
+
543
+ /**
544
+ * Creates a reusable {@link assert} function.
545
+ *
546
+ * @template T Type of the input value
547
+ * @returns A reusable `assert` function
548
+ *
549
+ * @author Jeongho Nam - https://github.com/samchon
550
+ */
551
+ export function createAssert<T>(): (input: unknown) => T;
552
+
553
+ /**
554
+ * @internal
555
+ */
556
+ export function createAssert<T>(): (input: unknown) => T {
557
+ halt("createAssert");
558
+ }
559
+ Object.assign(createAssert, assert);
560
+
561
+ /**
562
+ * Creates a reusable {@link assertType} function.
563
+ *
564
+ * Duplicated function of {@link createAssert} for `typescript-is` users.
565
+ *
566
+ * @danger You have to specify the generic argument `T`
567
+ * @return Nothing until specifying the generic argument `T`
568
+ * @throws compile error
569
+ *
570
+ * @author Jeongho Nam - https://github.com/samchon
571
+ * @deprecated
572
+ */
573
+ export function createAssertType(): never;
574
+
575
+ /**
576
+ * Creates a reusable {@link assertType} function.
577
+ *
578
+ * Duplicated function of {@link createAssert} for `typescript-is` users.
579
+ *
580
+ * @template T Type of the input value
581
+ * @returns A reusable `assert` function
582
+ *
583
+ * @author Jeongho Nam - https://github.com/samchon
584
+ * @deprecated
585
+ */
586
+ export function createAssertType<T>(): (input: unknown) => T;
587
+
588
+ /**
589
+ * @internal
590
+ */
591
+ export function createAssertType<T>(): (input: unknown) => T {
592
+ halt("createAssertType");
593
+ }
594
+ Object.assign(createAssertType, assertType);
595
+
596
+ /**
597
+ * Creates a reusable {@link is} function.
598
+ *
599
+ * @danger You have to specify the generic argument `T`
600
+ * @return Nothing until specifying the generic argument `T`
601
+ * @throws compile error
602
+ *
603
+ * @author Jeongho Nam - https://github.com/samchon
604
+ */
605
+ export function createIs(): never;
606
+
607
+ /**
608
+ * Creates a reusable {@link is} function.
609
+ *
610
+ * @template T Type of the input value
611
+ * @returns A reusable `is` function
612
+ *
613
+ * @author Jeongho Nam - https://github.com/samchon
614
+ */
615
+ export function createIs<T>(): (input: unknown) => input is T;
616
+
617
+ /**
618
+ * @internal
619
+ */
620
+ export function createIs<T>(): (input: unknown) => input is T {
621
+ halt("createIs");
622
+ }
623
+ Object.assign(createIs, is);
624
+
625
+ /**
626
+ * Creates a reusable {@link validate} function.
627
+ *
628
+ * @danger You have to specify the generic argument `T`
629
+ * @return Nothing until specifying the generic argument `T`
630
+ * @throws compile error
631
+ *
632
+ * @author Jeongho Nam - https://github.com/samchon
633
+ */
634
+ export function createValidate(): never;
635
+
636
+ /**
637
+ * Creates a reusable {@link validate} function.
638
+ *
639
+ * @template T Type of the input value
640
+ * @returns A reusable `validate` function
641
+ *
642
+ * @author Jeongho Nam - https://github.com/samchon
643
+ */
644
+ export function createValidate<T>(): (input: unknown) => IValidation<T>;
645
+
646
+ /**
647
+ * @internal
648
+ */
649
+ export function createValidate(): (input: unknown) => IValidation {
650
+ halt("createValidate");
651
+ }
652
+ Object.assign(createValidate, validate);
653
+
654
+ /**
655
+ * Creates a reusable {@link assertEquals} function.
656
+ *
657
+ * @danger You have to specify the generic argument `T`
658
+ * @return Nothing until specifying the generic argument `T`
659
+ * @throws compile error
660
+ *
661
+ * @author Jeongho Nam - https://github.com/samchon
662
+ */
663
+ export function createAssertEquals(): never;
664
+
665
+ /**
666
+ * Creates a reusable {@link assertEquals} function.
667
+ *
668
+ * @template T Type of the input value
669
+ * @returns A reusable `assertEquals` function
670
+ *
671
+ * @author Jeongho Nam - https://github.com/samchon
672
+ */
673
+ export function createAssertEquals<T>(): (input: unknown) => T;
674
+
675
+ /**
676
+ * @internal
677
+ */
678
+ export function createAssertEquals<T>(): (input: unknown) => T {
679
+ halt("createAssertEquals");
680
+ }
681
+ Object.assign(createAssertEquals, assertEquals);
682
+
683
+ /**
684
+ * Creates a reusable {@link equals} function.
685
+ *
686
+ * @danger You have to specify the generic argument `T`
687
+ * @return Nothing until specifying the generic argument `T`
688
+ * @throws compile error
689
+ *
690
+ * @author Jeongho Nam - https://github.com/samchon
691
+ */
692
+ export function createEquals(): never;
693
+
694
+ /**
695
+ * Creates a reusable {@link equals} function.
696
+ *
697
+ * @template T Type of the input value
698
+ * @returns A reusable `equals` function
699
+ *
700
+ * @author Jeongho Nam - https://github.com/samchon
701
+ */
702
+ export function createEquals<T>(): (input: unknown) => input is T;
703
+
704
+ /**
705
+ * @internal
706
+ */
707
+ export function createEquals<T>(): (input: unknown) => input is T {
708
+ halt("createEquals");
709
+ }
710
+ Object.assign(createEquals, equals);
711
+
712
+ /**
713
+ * Creates a reusable {@link validateEquals} function.
714
+ *
715
+ * @danger You have to specify the generic argument `T`
716
+ * @return Nothing until specifying the generic argument `T`
717
+ * @throws compile error
718
+ *
719
+ * @author Jeongho Nam - https://github.com/samchon
720
+ */
721
+ export function createValidateEquals(): never;
722
+
723
+ /**
724
+ * Creates a reusable {@link validateEquals} function.
725
+ *
726
+ * @template T Type of the input value
727
+ * @returns A reusable `validateEquals` function
728
+ *
729
+ * @author Jeongho Nam - https://github.com/samchon
730
+ */
731
+ export function createValidateEquals<T>(): (input: unknown) => IValidation<T>;
732
+
733
+ /**
734
+ * @internal
735
+ */
736
+ export function createValidateEquals(): (input: unknown) => IValidation {
737
+ halt("createValidateEquals");
738
+ }
739
+ Object.assign(createValidateEquals, validateEquals);
740
+
741
+ /**
742
+ * Creates a reusable {@link random} function.
743
+ *
744
+ * @danger You have to specify the generic argument `T`
745
+ * @param generator Random data generator
746
+ * @return Nothing until specifying the generic argument `T`
747
+ * @throws compile error
748
+ *
749
+ * @author Jeongho Nam - https://github.com/samchon
750
+ */
751
+ export function createRandom(generator?: Partial<IRandomGenerator>): never;
752
+
753
+ /**
754
+ * Creates a resuable {@link random} function.
755
+ *
756
+ * @template T Type of the input value
757
+ * @param generator Random data generator
758
+ * @returns A reusable `random` function
759
+ *
760
+ * @author Jeongho Nam - https://github.com/samchon
761
+ */
762
+ export function createRandom<T>(
763
+ generator?: Partial<IRandomGenerator>,
764
+ ): () => Primitive<T>;
765
+
766
+ /**
767
+ * @internal
768
+ */
769
+ export function createRandom(): never {
770
+ halt("createRandom");
771
+ }
772
+ Object.assign(createRandom, random);
773
+
774
+ /**
775
+ * @internal
776
+ */
777
+ function halt(name: string): never {
778
+ throw new Error(
779
+ `Error on typia.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`,
780
+ );
781
+ }