typia 5.3.5-dev.20231206 → 5.3.5

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 (513) hide show
  1. package/README.md +1 -1
  2. package/lib/TypeGuardError.js.map +1 -1
  3. package/lib/executable/TypiaSetupWizard.js.map +1 -1
  4. package/lib/factories/CommentFactory.d.ts +1 -0
  5. package/lib/factories/CommentFactory.js.map +1 -1
  6. package/lib/factories/ExpressionFactory.d.ts +1 -0
  7. package/lib/factories/IdentifierFactory.d.ts +1 -0
  8. package/lib/factories/JsonMetadataFactory.d.ts +1 -0
  9. package/lib/factories/LiteralFactory.d.ts +1 -0
  10. package/lib/factories/MetadataCollection.d.ts +1 -0
  11. package/lib/factories/MetadataCommentTagFactory.js.map +1 -1
  12. package/lib/factories/MetadataFactory.d.ts +1 -0
  13. package/lib/factories/MetadataFactory.js.map +1 -1
  14. package/lib/factories/MetadataTypeTagFactory.js.map +1 -1
  15. package/lib/factories/NumericRangeFactory.d.ts +1 -0
  16. package/lib/factories/ProtobufFactory.d.ts +1 -0
  17. package/lib/factories/ProtobufFactory.js.map +1 -1
  18. package/lib/factories/StatementFactory.d.ts +1 -0
  19. package/lib/factories/TemplateFactory.d.ts +1 -0
  20. package/lib/factories/TemplateFactory.js.map +1 -1
  21. package/lib/factories/TypeFactory.d.ts +1 -0
  22. package/lib/factories/TypeFactory.js.map +1 -1
  23. package/lib/factories/ValueFactory.d.ts +1 -0
  24. package/lib/factories/internal/metadata/emend_metadata_atomics.js.map +1 -1
  25. package/lib/factories/internal/metadata/emplace_metadata_alias.d.ts +1 -0
  26. package/lib/factories/internal/metadata/emplace_metadata_array_type.d.ts +1 -0
  27. package/lib/factories/internal/metadata/emplace_metadata_object.d.ts +1 -0
  28. package/lib/factories/internal/metadata/emplace_metadata_object.js.map +1 -1
  29. package/lib/factories/internal/metadata/emplace_metadata_tuple.d.ts +1 -0
  30. package/lib/factories/internal/metadata/explore_metadata.d.ts +1 -0
  31. package/lib/factories/internal/metadata/explore_metadata.js.map +1 -1
  32. package/lib/factories/internal/metadata/iterate_metadata.d.ts +1 -0
  33. package/lib/factories/internal/metadata/iterate_metadata.js.map +1 -1
  34. package/lib/factories/internal/metadata/iterate_metadata_alias.d.ts +1 -0
  35. package/lib/factories/internal/metadata/iterate_metadata_array.d.ts +1 -0
  36. package/lib/factories/internal/metadata/iterate_metadata_atomic.d.ts +1 -0
  37. package/lib/factories/internal/metadata/iterate_metadata_atomic.js.map +1 -1
  38. package/lib/factories/internal/metadata/iterate_metadata_coalesce.d.ts +1 -0
  39. package/lib/factories/internal/metadata/iterate_metadata_coalesce.js.map +1 -1
  40. package/lib/factories/internal/metadata/iterate_metadata_collection.js.map +1 -1
  41. package/lib/factories/internal/metadata/iterate_metadata_comment_tags.js.map +1 -1
  42. package/lib/factories/internal/metadata/iterate_metadata_constant.d.ts +1 -0
  43. package/lib/factories/internal/metadata/iterate_metadata_constant.js.map +1 -1
  44. package/lib/factories/internal/metadata/iterate_metadata_intersection.d.ts +1 -0
  45. package/lib/factories/internal/metadata/iterate_metadata_intersection.js.map +1 -1
  46. package/lib/factories/internal/metadata/iterate_metadata_map.d.ts +1 -0
  47. package/lib/factories/internal/metadata/iterate_metadata_native.d.ts +1 -0
  48. package/lib/factories/internal/metadata/iterate_metadata_native.js.map +1 -1
  49. package/lib/factories/internal/metadata/iterate_metadata_object.d.ts +1 -0
  50. package/lib/factories/internal/metadata/iterate_metadata_object.js.map +1 -1
  51. package/lib/factories/internal/metadata/iterate_metadata_resolve.d.ts +1 -0
  52. package/lib/factories/internal/metadata/iterate_metadata_resolve.js.map +1 -1
  53. package/lib/factories/internal/metadata/iterate_metadata_set.d.ts +1 -0
  54. package/lib/factories/internal/metadata/iterate_metadata_sort.js.map +1 -1
  55. package/lib/factories/internal/metadata/iterate_metadata_template.d.ts +1 -0
  56. package/lib/factories/internal/metadata/iterate_metadata_tuple.d.ts +1 -0
  57. package/lib/factories/internal/metadata/iterate_metadata_union.d.ts +1 -0
  58. package/lib/functional/$HeadersReader.js.map +1 -1
  59. package/lib/functional/$ParameterReader.js.map +1 -1
  60. package/lib/functional/$ProtobufReader.js.map +1 -1
  61. package/lib/functional/$ProtobufSizer.js.map +1 -1
  62. package/lib/functional/$ProtobufWriter.js.map +1 -1
  63. package/lib/functional/$QueryReader.js.map +1 -1
  64. package/lib/functional/$stoll.js.map +1 -1
  65. package/lib/functional/$string.js.map +1 -1
  66. package/lib/functional/$varint.js.map +1 -1
  67. package/lib/functional/$zigzag.js.map +1 -1
  68. package/lib/functional/Namespace.js.map +1 -1
  69. package/lib/http.js.map +1 -1
  70. package/lib/misc.js.map +1 -1
  71. package/lib/programmers/AssertProgrammer.d.ts +1 -0
  72. package/lib/programmers/CheckerProgrammer.d.ts +1 -0
  73. package/lib/programmers/CheckerProgrammer.js.map +1 -1
  74. package/lib/programmers/FeatureProgrammer.d.ts +1 -0
  75. package/lib/programmers/IsProgrammer.d.ts +1 -0
  76. package/lib/programmers/IsProgrammer.js.map +1 -1
  77. package/lib/programmers/RandomProgrammer.d.ts +1 -0
  78. package/lib/programmers/ValidateProgrammer.d.ts +1 -0
  79. package/lib/programmers/helpers/CloneJoiner.d.ts +1 -0
  80. package/lib/programmers/helpers/FunctionImporeter.d.ts +1 -0
  81. package/lib/programmers/helpers/ICheckEntry.d.ts +1 -0
  82. package/lib/programmers/helpers/IExpressionEntry.d.ts +1 -0
  83. package/lib/programmers/helpers/NotationJoiner.d.ts +1 -0
  84. package/lib/programmers/helpers/ProtobufUtil.js.map +1 -1
  85. package/lib/programmers/helpers/PruneJoiner.d.ts +1 -0
  86. package/lib/programmers/helpers/RandomJoiner.d.ts +1 -0
  87. package/lib/programmers/helpers/RandomRanger.d.ts +1 -0
  88. package/lib/programmers/helpers/RandomRanger.js.map +1 -1
  89. package/lib/programmers/helpers/StringifyJoinder.d.ts +1 -0
  90. package/lib/programmers/helpers/UnionExplorer.d.ts +1 -0
  91. package/lib/programmers/helpers/UnionExplorer.js.map +1 -1
  92. package/lib/programmers/helpers/UnionPredicator.js.map +1 -1
  93. package/lib/programmers/http/HttpAssertHeadersProgrammer.d.ts +1 -0
  94. package/lib/programmers/http/HttpAssertQueryProgrammer.d.ts +1 -0
  95. package/lib/programmers/http/HttpHeadersProgrammer.d.ts +1 -0
  96. package/lib/programmers/http/HttpHeadersProgrammer.js.map +1 -1
  97. package/lib/programmers/http/HttpIsHeadersProgrammer.d.ts +1 -0
  98. package/lib/programmers/http/HttpIsQueryProgrammer.d.ts +1 -0
  99. package/lib/programmers/http/HttpParameterProgrammer.d.ts +1 -0
  100. package/lib/programmers/http/HttpQueryProgrammer.d.ts +1 -0
  101. package/lib/programmers/http/HttpQueryProgrammer.js.map +1 -1
  102. package/lib/programmers/http/HttpValidateHeadersProgrammer.d.ts +1 -0
  103. package/lib/programmers/http/HttpValidateQueryProgrammer.d.ts +1 -0
  104. package/lib/programmers/internal/application_alias.js.map +1 -1
  105. package/lib/programmers/internal/application_escaped.js.map +1 -1
  106. package/lib/programmers/internal/application_native.js.map +1 -1
  107. package/lib/programmers/internal/application_number.js.map +1 -1
  108. package/lib/programmers/internal/application_object.js.map +1 -1
  109. package/lib/programmers/internal/application_schema.js.map +1 -1
  110. package/lib/programmers/internal/check_dynamic_key.d.ts +1 -0
  111. package/lib/programmers/internal/check_union_array_like.js.map +1 -1
  112. package/lib/programmers/internal/stringify_dynamic_properties.js.map +1 -1
  113. package/lib/programmers/json/JsonAssertParseProgrammer.d.ts +1 -0
  114. package/lib/programmers/json/JsonAssertStringifyProgrammer.d.ts +1 -0
  115. package/lib/programmers/json/JsonIsParseProgrammer.d.ts +1 -0
  116. package/lib/programmers/json/JsonIsStringifyProgrammer.d.ts +1 -0
  117. package/lib/programmers/json/JsonStringifyProgrammer.d.ts +1 -0
  118. package/lib/programmers/json/JsonStringifyProgrammer.js.map +1 -1
  119. package/lib/programmers/json/JsonValidateParseProgrammer.d.ts +1 -0
  120. package/lib/programmers/json/JsonValidateStringifyProgrammer.d.ts +1 -0
  121. package/lib/programmers/misc/MiscAssertCloneProgrammer.d.ts +1 -0
  122. package/lib/programmers/misc/MiscAssertPruneProgrammer.d.ts +1 -0
  123. package/lib/programmers/misc/MiscCloneProgrammer.d.ts +1 -0
  124. package/lib/programmers/misc/MiscIsCloneProgrammer.d.ts +1 -0
  125. package/lib/programmers/misc/MiscIsPruneProgrammer.d.ts +1 -0
  126. package/lib/programmers/misc/MiscLiteralsProgrammer.d.ts +1 -0
  127. package/lib/programmers/misc/MiscPruneProgrammer.d.ts +1 -0
  128. package/lib/programmers/misc/MiscValidateCloneProgrammer.d.ts +1 -0
  129. package/lib/programmers/misc/MiscValidatePruneProgrammer.d.ts +1 -0
  130. package/lib/programmers/notations/NotationAssertGeneralProgrammer.d.ts +1 -0
  131. package/lib/programmers/notations/NotationGeneralProgrammer.d.ts +1 -0
  132. package/lib/programmers/notations/NotationIsGeneralProgrammer.d.ts +1 -0
  133. package/lib/programmers/notations/NotationValidateGeneralProgrammer.d.ts +1 -0
  134. package/lib/programmers/protobuf/ProtobufAssertDecodeProgrammer.d.ts +1 -0
  135. package/lib/programmers/protobuf/ProtobufAssertEncodeProgrammer.d.ts +1 -0
  136. package/lib/programmers/protobuf/ProtobufDecodeProgrammer.d.ts +1 -0
  137. package/lib/programmers/protobuf/ProtobufDecodeProgrammer.js.map +1 -1
  138. package/lib/programmers/protobuf/ProtobufEncodeProgrammer.d.ts +1 -0
  139. package/lib/programmers/protobuf/ProtobufEncodeProgrammer.js +2 -2
  140. package/lib/programmers/protobuf/ProtobufEncodeProgrammer.js.map +1 -1
  141. package/lib/programmers/protobuf/ProtobufIsDecodeProgrammer.d.ts +1 -0
  142. package/lib/programmers/protobuf/ProtobufIsEncodeProgrammer.d.ts +1 -0
  143. package/lib/programmers/protobuf/ProtobufMessageProgrammer.d.ts +1 -0
  144. package/lib/programmers/protobuf/ProtobufMessageProgrammer.js.map +1 -1
  145. package/lib/programmers/protobuf/ProtobufValidateDecodeProgrammer.d.ts +1 -0
  146. package/lib/programmers/protobuf/ProtobufValidateEncodeProgrammer.d.ts +1 -0
  147. package/lib/schemas/metadata/Metadata.js.map +1 -1
  148. package/lib/schemas/metadata/MetadataArray.js.map +1 -1
  149. package/lib/schemas/metadata/MetadataAtomic.js.map +1 -1
  150. package/lib/transform.d.ts +1 -0
  151. package/lib/transformers/CallExpressionTransformer.d.ts +1 -0
  152. package/lib/transformers/FileTransformer.d.ts +1 -0
  153. package/lib/transformers/FileTransformer.js.map +1 -1
  154. package/lib/transformers/IProject.d.ts +1 -0
  155. package/lib/transformers/ImportTransformer.d.ts +1 -0
  156. package/lib/transformers/NodeTransformer.d.ts +1 -0
  157. package/lib/transformers/TransformerError.js.map +1 -1
  158. package/lib/transformers/features/CreateRandomTransformer.d.ts +1 -0
  159. package/lib/transformers/features/RandomTransformer.d.ts +1 -0
  160. package/lib/transformers/features/json/JsonApplicationTransformer.d.ts +1 -0
  161. package/lib/transformers/features/json/JsonApplicationTransformer.js.map +1 -1
  162. package/lib/transformers/features/misc/MiscLiteralsTransformer.d.ts +1 -0
  163. package/lib/transformers/features/protobuf/ProtobufMessageTransformer.d.ts +1 -0
  164. package/lib/transformers/features/reflect/ReflectMetadataTransformer.d.ts +1 -0
  165. package/lib/transformers/internal/GenericTransformer.d.ts +1 -0
  166. package/lib/utils/NamingConvention.js.map +1 -1
  167. package/package.json +7 -2
  168. package/src/AssertionGuard.ts +1 -1
  169. package/src/CamelCase.ts +114 -114
  170. package/src/IRandomGenerator.ts +35 -35
  171. package/src/IValidation.ts +21 -21
  172. package/src/PascalCase.ts +114 -114
  173. package/src/Primitive.ts +135 -135
  174. package/src/Resolved.ts +116 -116
  175. package/src/SnakeCase.ts +156 -156
  176. package/src/TypeGuardError.ts +36 -36
  177. package/src/executable/TypiaGenerateWizard.ts +83 -83
  178. package/src/executable/TypiaPatchWizard.ts +42 -42
  179. package/src/executable/TypiaSetupWizard.ts +151 -151
  180. package/src/executable/setup/ArgumentParser.ts +43 -43
  181. package/src/executable/setup/CommandExecutor.ts +8 -8
  182. package/src/executable/setup/FileRetriever.ts +22 -22
  183. package/src/executable/setup/PackageManager.ts +71 -71
  184. package/src/executable/setup/PluginConfigurator.ts +69 -69
  185. package/src/executable/typia.ts +55 -55
  186. package/src/factories/CommentFactory.ts +79 -79
  187. package/src/factories/ExpressionFactory.ts +150 -150
  188. package/src/factories/IdentifierFactory.ts +70 -70
  189. package/src/factories/JsonMetadataFactory.ts +53 -53
  190. package/src/factories/LiteralFactory.ts +47 -47
  191. package/src/factories/MetadataCollection.ts +269 -269
  192. package/src/factories/MetadataCommentTagFactory.ts +601 -601
  193. package/src/factories/MetadataFactory.ts +267 -267
  194. package/src/factories/MetadataTypeTagFactory.ts +313 -313
  195. package/src/factories/NumericRangeFactory.ts +72 -72
  196. package/src/factories/ProtobufFactory.ts +259 -259
  197. package/src/factories/StatementFactory.ts +72 -72
  198. package/src/factories/TemplateFactory.ts +56 -56
  199. package/src/factories/TypeFactory.ts +118 -118
  200. package/src/factories/ValueFactory.ts +12 -12
  201. package/src/factories/internal/metadata/MetadataHelper.ts +15 -15
  202. package/src/factories/internal/metadata/emend_metadata_atomics.ts +37 -37
  203. package/src/factories/internal/metadata/emplace_metadata_alias.ts +41 -41
  204. package/src/factories/internal/metadata/emplace_metadata_array_type.ts +38 -38
  205. package/src/factories/internal/metadata/emplace_metadata_object.ts +175 -175
  206. package/src/factories/internal/metadata/emplace_metadata_tuple.ts +57 -57
  207. package/src/factories/internal/metadata/explore_metadata.ts +28 -28
  208. package/src/factories/internal/metadata/iterate_metadata.ts +94 -94
  209. package/src/factories/internal/metadata/iterate_metadata_alias.ts +34 -34
  210. package/src/factories/internal/metadata/iterate_metadata_array.ts +37 -37
  211. package/src/factories/internal/metadata/iterate_metadata_atomic.ts +62 -62
  212. package/src/factories/internal/metadata/iterate_metadata_coalesce.ts +33 -33
  213. package/src/factories/internal/metadata/iterate_metadata_collection.ts +131 -131
  214. package/src/factories/internal/metadata/iterate_metadata_comment_tags.ts +26 -26
  215. package/src/factories/internal/metadata/iterate_metadata_constant.ts +48 -48
  216. package/src/factories/internal/metadata/iterate_metadata_intersection.ts +230 -230
  217. package/src/factories/internal/metadata/iterate_metadata_map.ts +50 -50
  218. package/src/factories/internal/metadata/iterate_metadata_native.ts +208 -208
  219. package/src/factories/internal/metadata/iterate_metadata_object.ts +43 -43
  220. package/src/factories/internal/metadata/iterate_metadata_resolve.ts +52 -52
  221. package/src/factories/internal/metadata/iterate_metadata_set.ts +41 -41
  222. package/src/factories/internal/metadata/iterate_metadata_sort.ts +61 -61
  223. package/src/factories/internal/metadata/iterate_metadata_template.ts +44 -44
  224. package/src/factories/internal/metadata/iterate_metadata_tuple.ts +37 -37
  225. package/src/factories/internal/metadata/iterate_metadata_union.ts +27 -27
  226. package/src/functional/$HeadersReader.ts +28 -28
  227. package/src/functional/$ParameterReader.ts +31 -31
  228. package/src/functional/$ProtobufReader.ts +195 -195
  229. package/src/functional/$ProtobufSizer.ts +147 -147
  230. package/src/functional/$ProtobufWriter.ts +150 -150
  231. package/src/functional/$QueryReader.ts +56 -56
  232. package/src/functional/$any.ts +4 -4
  233. package/src/functional/$clone.ts +4 -4
  234. package/src/functional/$convention.ts +37 -37
  235. package/src/functional/$dictionary.ts +22 -22
  236. package/src/functional/$every.ts +11 -11
  237. package/src/functional/$from.ts +5 -5
  238. package/src/functional/$guard.ts +35 -35
  239. package/src/functional/$is_between.ts +2 -2
  240. package/src/functional/$join.ts +46 -46
  241. package/src/functional/$number.ts +12 -12
  242. package/src/functional/$report.ts +13 -13
  243. package/src/functional/$rest.ts +3 -3
  244. package/src/functional/$stoll.ts +8 -8
  245. package/src/functional/$string.ts +50 -50
  246. package/src/functional/$strlen.ts +7 -7
  247. package/src/functional/$tail.ts +5 -5
  248. package/src/functional/$varint.ts +130 -130
  249. package/src/functional/$zigzag.ts +39 -39
  250. package/src/functional/IProtobufWriter.ts +18 -18
  251. package/src/functional/Namespace.ts +174 -174
  252. package/src/http.ts +1149 -1149
  253. package/src/json.ts +648 -648
  254. package/src/misc.ts +651 -651
  255. package/src/module.ts +897 -897
  256. package/src/notations.ts +855 -855
  257. package/src/programmers/AssertProgrammer.ts +293 -293
  258. package/src/programmers/CheckerProgrammer.ts +1025 -1025
  259. package/src/programmers/FeatureProgrammer.ts +460 -460
  260. package/src/programmers/IsProgrammer.ts +232 -232
  261. package/src/programmers/RandomProgrammer.ts +825 -825
  262. package/src/programmers/TypiaProgrammer.ts +167 -167
  263. package/src/programmers/ValidateProgrammer.ts +307 -307
  264. package/src/programmers/helpers/AtomicPredicator.ts +25 -25
  265. package/src/programmers/helpers/CloneJoiner.ts +130 -130
  266. package/src/programmers/helpers/FunctionImporeter.ts +87 -87
  267. package/src/programmers/helpers/HttpMetadataUtil.ts +21 -21
  268. package/src/programmers/helpers/ICheckEntry.ts +13 -13
  269. package/src/programmers/helpers/IExpressionEntry.ts +12 -12
  270. package/src/programmers/helpers/NotationJoiner.ts +132 -132
  271. package/src/programmers/helpers/OptionPredicator.ts +15 -15
  272. package/src/programmers/helpers/ProtobufUtil.ts +125 -125
  273. package/src/programmers/helpers/ProtobufWire.ts +34 -34
  274. package/src/programmers/helpers/PruneJoiner.ts +141 -141
  275. package/src/programmers/helpers/RandomJoiner.ts +140 -140
  276. package/src/programmers/helpers/RandomRanger.ts +171 -171
  277. package/src/programmers/helpers/StringifyJoinder.ts +105 -105
  278. package/src/programmers/helpers/StringifyPredicator.ts +12 -12
  279. package/src/programmers/helpers/UnionExplorer.ts +269 -269
  280. package/src/programmers/helpers/UnionPredicator.ts +77 -77
  281. package/src/programmers/helpers/disable_function_importer_declare.ts +32 -32
  282. package/src/programmers/http/HttpAssertHeadersProgrammer.ts +77 -77
  283. package/src/programmers/http/HttpAssertQueryProgrammer.ts +75 -75
  284. package/src/programmers/http/HttpHeadersProgrammer.ts +314 -314
  285. package/src/programmers/http/HttpIsHeadersProgrammer.ts +84 -84
  286. package/src/programmers/http/HttpIsQueryProgrammer.ts +82 -82
  287. package/src/programmers/http/HttpParameterProgrammer.ts +97 -97
  288. package/src/programmers/http/HttpQueryProgrammer.ts +252 -252
  289. package/src/programmers/http/HttpValidateHeadersProgrammer.ts +77 -77
  290. package/src/programmers/http/HttpValidateQueryProgrammer.ts +75 -75
  291. package/src/programmers/internal/application_alias.ts +65 -65
  292. package/src/programmers/internal/application_array.ts +59 -59
  293. package/src/programmers/internal/application_boolean.ts +30 -30
  294. package/src/programmers/internal/application_constant.ts +26 -26
  295. package/src/programmers/internal/application_default.ts +17 -17
  296. package/src/programmers/internal/application_default_string.ts +33 -33
  297. package/src/programmers/internal/application_escaped.ts +53 -53
  298. package/src/programmers/internal/application_native.ts +38 -38
  299. package/src/programmers/internal/application_number.ts +94 -94
  300. package/src/programmers/internal/application_object.ts +153 -153
  301. package/src/programmers/internal/application_schema.ts +180 -180
  302. package/src/programmers/internal/application_string.ts +58 -58
  303. package/src/programmers/internal/application_templates.ts +25 -25
  304. package/src/programmers/internal/application_tuple.ts +55 -55
  305. package/src/programmers/internal/check_array_length.ts +45 -45
  306. package/src/programmers/internal/check_bigint.ts +49 -49
  307. package/src/programmers/internal/check_dynamic_key.ts +175 -175
  308. package/src/programmers/internal/check_dynamic_properties.ts +198 -198
  309. package/src/programmers/internal/check_everything.ts +23 -23
  310. package/src/programmers/internal/check_native.ts +21 -21
  311. package/src/programmers/internal/check_number.ts +106 -106
  312. package/src/programmers/internal/check_object.ts +60 -60
  313. package/src/programmers/internal/check_string.ts +48 -48
  314. package/src/programmers/internal/check_template.ts +61 -61
  315. package/src/programmers/internal/check_union_array_like.ts +307 -307
  316. package/src/programmers/internal/decode_union_object.ts +78 -78
  317. package/src/programmers/internal/feature_object_entries.ts +58 -58
  318. package/src/programmers/internal/metadata_to_pattern.ts +33 -33
  319. package/src/programmers/internal/prune_object_properties.ts +60 -60
  320. package/src/programmers/internal/random_custom.ts +37 -37
  321. package/src/programmers/internal/stringify_dynamic_properties.ts +157 -157
  322. package/src/programmers/internal/stringify_native.ts +7 -7
  323. package/src/programmers/internal/stringify_regular_properties.ts +81 -81
  324. package/src/programmers/internal/template_to_pattern.ts +15 -15
  325. package/src/programmers/internal/wrap_metadata_rest_tuple.ts +20 -20
  326. package/src/programmers/json/JsonApplicationProgrammer.ts +50 -50
  327. package/src/programmers/json/JsonAssertParseProgrammer.ts +67 -67
  328. package/src/programmers/json/JsonAssertStringifyProgrammer.ts +61 -61
  329. package/src/programmers/json/JsonIsParseProgrammer.ts +73 -73
  330. package/src/programmers/json/JsonIsStringifyProgrammer.ts +75 -75
  331. package/src/programmers/json/JsonStringifyProgrammer.ts +893 -893
  332. package/src/programmers/json/JsonValidateParseProgrammer.ts +64 -64
  333. package/src/programmers/json/JsonValidateStringifyProgrammer.ts +83 -83
  334. package/src/programmers/misc/MiscAssertCloneProgrammer.ts +63 -63
  335. package/src/programmers/misc/MiscAssertPruneProgrammer.ts +60 -60
  336. package/src/programmers/misc/MiscCloneProgrammer.ts +713 -713
  337. package/src/programmers/misc/MiscIsCloneProgrammer.ts +70 -70
  338. package/src/programmers/misc/MiscIsPruneProgrammer.ts +66 -66
  339. package/src/programmers/misc/MiscLiteralsProgrammer.ts +72 -72
  340. package/src/programmers/misc/MiscPruneProgrammer.ts +523 -523
  341. package/src/programmers/misc/MiscValidateCloneProgrammer.ts +80 -80
  342. package/src/programmers/misc/MiscValidatePruneProgrammer.ts +73 -73
  343. package/src/programmers/notations/NotationAssertGeneralProgrammer.ts +64 -64
  344. package/src/programmers/notations/NotationGeneralProgrammer.ts +647 -647
  345. package/src/programmers/notations/NotationIsGeneralProgrammer.ts +71 -71
  346. package/src/programmers/notations/NotationValidateGeneralProgrammer.ts +81 -81
  347. package/src/programmers/protobuf/ProtobufAssertDecodeProgrammer.ts +75 -75
  348. package/src/programmers/protobuf/ProtobufAssertEncodeProgrammer.ts +61 -61
  349. package/src/programmers/protobuf/ProtobufDecodeProgrammer.ts +607 -607
  350. package/src/programmers/protobuf/ProtobufEncodeProgrammer.ts +819 -819
  351. package/src/programmers/protobuf/ProtobufIsDecodeProgrammer.ts +82 -82
  352. package/src/programmers/protobuf/ProtobufIsEncodeProgrammer.ts +75 -75
  353. package/src/programmers/protobuf/ProtobufMessageProgrammer.ts +160 -160
  354. package/src/programmers/protobuf/ProtobufValidateDecodeProgrammer.ts +75 -75
  355. package/src/programmers/protobuf/ProtobufValidateEncodeProgrammer.ts +83 -83
  356. package/src/protobuf.ts +887 -887
  357. package/src/reflect.ts +24 -24
  358. package/src/schemas/json/IJsonApplication.ts +8 -8
  359. package/src/schemas/json/IJsonComponents.ts +36 -36
  360. package/src/schemas/json/IJsonSchema.ts +113 -113
  361. package/src/schemas/metadata/IJsDocTagInfo.ts +10 -10
  362. package/src/schemas/metadata/IMetadata.ts +34 -34
  363. package/src/schemas/metadata/IMetadataAlias.ts +12 -12
  364. package/src/schemas/metadata/IMetadataApplication.ts +7 -7
  365. package/src/schemas/metadata/IMetadataArray.ts +7 -7
  366. package/src/schemas/metadata/IMetadataArrayType.ts +10 -10
  367. package/src/schemas/metadata/IMetadataAtomic.ts +6 -6
  368. package/src/schemas/metadata/IMetadataComponents.ts +11 -11
  369. package/src/schemas/metadata/IMetadataConstant.ts +23 -23
  370. package/src/schemas/metadata/IMetadataDictionary.ts +11 -11
  371. package/src/schemas/metadata/IMetadataEntry.ts +6 -6
  372. package/src/schemas/metadata/IMetadataEscaped.ts +6 -6
  373. package/src/schemas/metadata/IMetadataObject.ts +18 -18
  374. package/src/schemas/metadata/IMetadataProperty.ts +9 -9
  375. package/src/schemas/metadata/IMetadataTuple.ts +7 -7
  376. package/src/schemas/metadata/IMetadataTupleType.ts +10 -10
  377. package/src/schemas/metadata/IMetadataTypeTag.ts +15 -15
  378. package/src/schemas/metadata/Metadata.ts +612 -612
  379. package/src/schemas/metadata/MetadataAlias.ts +61 -61
  380. package/src/schemas/metadata/MetadataApplication.ts +44 -44
  381. package/src/schemas/metadata/MetadataArray.ts +49 -49
  382. package/src/schemas/metadata/MetadataArrayType.ts +57 -57
  383. package/src/schemas/metadata/MetadataAtomic.ts +84 -84
  384. package/src/schemas/metadata/MetadataComponents.ts +98 -98
  385. package/src/schemas/metadata/MetadataConstant.ts +46 -46
  386. package/src/schemas/metadata/MetadataEscaped.ts +51 -51
  387. package/src/schemas/metadata/MetadataObject.ts +135 -135
  388. package/src/schemas/metadata/MetadataProperty.ts +56 -56
  389. package/src/schemas/metadata/MetadataTuple.ts +32 -32
  390. package/src/schemas/metadata/MetadataTupleType.ts +67 -67
  391. package/src/tags/Default.ts +15 -15
  392. package/src/tags/ExclusiveMaximum.ts +13 -13
  393. package/src/tags/ExclusiveMinimum.ts +13 -13
  394. package/src/tags/Format.ts +30 -30
  395. package/src/tags/MaxItems.ts +9 -9
  396. package/src/tags/MaxLength.ts +9 -9
  397. package/src/tags/Maximum.ts +13 -13
  398. package/src/tags/MinItems.ts +9 -9
  399. package/src/tags/MinLength.ts +9 -9
  400. package/src/tags/Minimum.ts +13 -13
  401. package/src/tags/MultipleOf.ts +15 -15
  402. package/src/tags/Pattern.ts +9 -9
  403. package/src/tags/TagBase.ts +68 -68
  404. package/src/tags/Type.ts +27 -27
  405. package/src/transform.ts +35 -35
  406. package/src/transformers/CallExpressionTransformer.ts +351 -351
  407. package/src/transformers/FileTransformer.ts +91 -91
  408. package/src/transformers/IProject.ts +15 -15
  409. package/src/transformers/ITransformOptions.ts +62 -62
  410. package/src/transformers/ImportTransformer.ts +66 -66
  411. package/src/transformers/NodeTransformer.ts +13 -13
  412. package/src/transformers/TransformerError.ts +55 -55
  413. package/src/transformers/features/AssertTransformer.ts +16 -16
  414. package/src/transformers/features/CreateAssertTransformer.ts +16 -16
  415. package/src/transformers/features/CreateIsTransformer.ts +10 -10
  416. package/src/transformers/features/CreateRandomTransformer.ts +40 -40
  417. package/src/transformers/features/CreateValidateTransformer.ts +13 -13
  418. package/src/transformers/features/IsTransformer.ts +10 -10
  419. package/src/transformers/features/RandomTransformer.ts +44 -44
  420. package/src/transformers/features/ValidateTransformer.ts +11 -11
  421. package/src/transformers/features/http/CreateHttpAssertHeadersTransformer.ts +11 -11
  422. package/src/transformers/features/http/CreateHttpAssertQueryTransformer.ts +9 -9
  423. package/src/transformers/features/http/CreateHttpHeadersTransformer.ts +9 -9
  424. package/src/transformers/features/http/CreateHttpIsHeadersTransformer.ts +9 -9
  425. package/src/transformers/features/http/CreateHttpIsQueryTransformer.ts +9 -9
  426. package/src/transformers/features/http/CreateHttpParameterTransformer.ts +9 -9
  427. package/src/transformers/features/http/CreateHttpQueryTransformer.ts +9 -9
  428. package/src/transformers/features/http/CreateHttpValidateHeadersTransformer.ts +12 -12
  429. package/src/transformers/features/http/CreateHttpValidateQueryTransformer.ts +11 -11
  430. package/src/transformers/features/http/HttpAssertHeadersTransformer.ts +9 -9
  431. package/src/transformers/features/http/HttpAssertQueryTransformer.ts +9 -9
  432. package/src/transformers/features/http/HttpHeadersTransformer.ts +9 -9
  433. package/src/transformers/features/http/HttpIsHeadersTransformer.ts +9 -9
  434. package/src/transformers/features/http/HttpIsQueryTransformer.ts +9 -9
  435. package/src/transformers/features/http/HttpParameterTransformer.ts +9 -9
  436. package/src/transformers/features/http/HttpQueryTransformer.ts +9 -9
  437. package/src/transformers/features/http/HttpValidateHeadersTransformer.ts +10 -10
  438. package/src/transformers/features/http/HttpValidateQueryTransformer.ts +9 -9
  439. package/src/transformers/features/json/JsonApplicationTransformer.ts +121 -121
  440. package/src/transformers/features/json/JsonAssertParseTransformer.ts +9 -9
  441. package/src/transformers/features/json/JsonAssertStringifyTransformer.ts +10 -10
  442. package/src/transformers/features/json/JsonCreateAssertParseTransformer.ts +9 -9
  443. package/src/transformers/features/json/JsonCreateAssertStringifyTransformer.ts +12 -12
  444. package/src/transformers/features/json/JsonCreateIsParseTransformer.ts +9 -9
  445. package/src/transformers/features/json/JsonCreateIsStringifyTransformer.ts +9 -9
  446. package/src/transformers/features/json/JsonCreateStringifyTransformer.ts +9 -9
  447. package/src/transformers/features/json/JsonCreateValidateParseTransformer.ts +11 -11
  448. package/src/transformers/features/json/JsonCreateValidateStringifyProgrammer.ts +12 -12
  449. package/src/transformers/features/json/JsonIsParseTransformer.ts +9 -9
  450. package/src/transformers/features/json/JsonIsStringifyTransformer.ts +9 -9
  451. package/src/transformers/features/json/JsonStringifyTransformer.ts +9 -9
  452. package/src/transformers/features/json/JsonValidateParseTransformer.ts +9 -9
  453. package/src/transformers/features/json/JsonValidateStringifyTransformer.ts +10 -10
  454. package/src/transformers/features/misc/MiscAssertCloneTransformer.ts +9 -9
  455. package/src/transformers/features/misc/MiscAssertPruneTransformer.ts +9 -9
  456. package/src/transformers/features/misc/MiscCloneTransformer.ts +9 -9
  457. package/src/transformers/features/misc/MiscCreateAssertCloneTransformer.ts +9 -9
  458. package/src/transformers/features/misc/MiscCreateAssertPruneTransformer.ts +9 -9
  459. package/src/transformers/features/misc/MiscCreateCloneTransformer.ts +9 -9
  460. package/src/transformers/features/misc/MiscCreateIsCloneTransformer.ts +9 -9
  461. package/src/transformers/features/misc/MiscCreateIsPruneTransformer.ts +9 -9
  462. package/src/transformers/features/misc/MiscCreatePruneTransformer.ts +9 -9
  463. package/src/transformers/features/misc/MiscCreateValidateCloneTransformer.ts +11 -11
  464. package/src/transformers/features/misc/MiscCreateValidatePruneTransformer.ts +11 -11
  465. package/src/transformers/features/misc/MiscIsCloneTransformer.ts +9 -9
  466. package/src/transformers/features/misc/MiscIsPruneTransformer.ts +9 -9
  467. package/src/transformers/features/misc/MiscLiteralsTransformer.ts +32 -32
  468. package/src/transformers/features/misc/MiscPruneTransformer.ts +9 -9
  469. package/src/transformers/features/misc/MiscValidateCloneTransformer.ts +9 -9
  470. package/src/transformers/features/misc/MiscValidatePruneTransformer.ts +9 -9
  471. package/src/transformers/features/notations/NotationAssertGeneralTransformer.ts +15 -15
  472. package/src/transformers/features/notations/NotationCreateAssertGeneralTransformer.ts +15 -15
  473. package/src/transformers/features/notations/NotationCreateGeneralTransformer.ts +15 -15
  474. package/src/transformers/features/notations/NotationCreateIsGeneralTransformer.ts +15 -15
  475. package/src/transformers/features/notations/NotationCreateValidateGeneralTransformer.ts +15 -15
  476. package/src/transformers/features/notations/NotationGeneralTransformer.ts +11 -11
  477. package/src/transformers/features/notations/NotationIsGeneralTransformer.ts +15 -15
  478. package/src/transformers/features/notations/NotationValidateGeneralTransformer.ts +15 -15
  479. package/src/transformers/features/protobuf/ProtobufAssertDecodeTransformer.ts +10 -10
  480. package/src/transformers/features/protobuf/ProtobufAssertEncodeTransformer.ts +10 -10
  481. package/src/transformers/features/protobuf/ProtobufCreateAssertDecodeTransformer.ts +12 -12
  482. package/src/transformers/features/protobuf/ProtobufCreateAssertEncodeTransformer.ts +12 -12
  483. package/src/transformers/features/protobuf/ProtobufCreateDecodeTransformer.ts +9 -9
  484. package/src/transformers/features/protobuf/ProtobufCreateEncodeTransformer.ts +9 -9
  485. package/src/transformers/features/protobuf/ProtobufCreateIsDecodeTransformer.ts +9 -9
  486. package/src/transformers/features/protobuf/ProtobufCreateIsEncodeTransformer.ts +9 -9
  487. package/src/transformers/features/protobuf/ProtobufCreateValidateDecodeTransformer.ts +12 -12
  488. package/src/transformers/features/protobuf/ProtobufCreateValidateEncodeTransformer.ts +12 -12
  489. package/src/transformers/features/protobuf/ProtobufDecodeTransformer.ts +9 -9
  490. package/src/transformers/features/protobuf/ProtobufEncodeTransformer.ts +9 -9
  491. package/src/transformers/features/protobuf/ProtobufIsDecodeTransformer.ts +9 -9
  492. package/src/transformers/features/protobuf/ProtobufIsEncodeTransformer.ts +9 -9
  493. package/src/transformers/features/protobuf/ProtobufMessageTransformer.ts +33 -33
  494. package/src/transformers/features/protobuf/ProtobufValidateDecodeTransformer.ts +10 -10
  495. package/src/transformers/features/protobuf/ProtobufValidateEncodeTransformer.ts +10 -10
  496. package/src/transformers/features/reflect/ReflectMetadataTransformer.ts +73 -73
  497. package/src/transformers/internal/GenericTransformer.ts +96 -96
  498. package/src/typings/Atomic.ts +13 -13
  499. package/src/typings/ClassProperties.ts +5 -5
  500. package/src/typings/Customizable.ts +5 -5
  501. package/src/typings/ProtobufAtomic.ts +19 -19
  502. package/src/typings/SpecialFields.ts +3 -3
  503. package/src/typings/ValidationPipe.ts +9 -9
  504. package/src/typings/Writable.ts +11 -11
  505. package/src/utils/ArrayUtil.ts +43 -43
  506. package/src/utils/Escaper.ts +46 -46
  507. package/src/utils/MapUtil.ts +12 -12
  508. package/src/utils/NameEncoder.ts +32 -32
  509. package/src/utils/NamingConvention.ts +87 -87
  510. package/src/utils/PatternUtil.ts +29 -29
  511. package/src/utils/RandomGenerator.ts +83 -83
  512. package/src/utils/Singleton.ts +16 -16
  513. package/src/utils/StringUtil.ts +4 -4
package/src/module.ts CHANGED
@@ -1,897 +1,897 @@
1
- import { Namespace } from "./functional/Namespace";
2
-
3
- import { AssertionGuard } from "./AssertionGuard";
4
- import { IRandomGenerator } from "./IRandomGenerator";
5
- import { IValidation } from "./IValidation";
6
- import { Resolved } from "./Resolved";
7
-
8
- export * as http from "./http";
9
- export * as json from "./json";
10
- export * as misc from "./misc";
11
- export * as notations from "./notations";
12
- export * as protobuf from "./protobuf";
13
- export * as reflect from "./reflect";
14
- export * as tags from "./tags";
15
-
16
- export * from "./schemas/metadata/IJsDocTagInfo";
17
- export * from "./schemas/json/IJsonApplication";
18
- export * from "./schemas/json/IJsonComponents";
19
- export * from "./schemas/json/IJsonSchema";
20
- export * from "./AssertionGuard";
21
- export * from "./IRandomGenerator";
22
- export * from "./IValidation";
23
- export * from "./TypeGuardError";
24
-
25
- export * from "./Primitive";
26
- export * from "./Resolved";
27
- export * from "./CamelCase";
28
- export * from "./PascalCase";
29
- export * from "./SnakeCase";
30
-
31
- /* -----------------------------------------------------------
32
- BASIC VALIDATORS
33
- ----------------------------------------------------------- */
34
- /**
35
- * Asserts a value type.
36
- *
37
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
38
- * reason, if the parametric value is not following the type `T`. Otherwise, the
39
- * value is following the type `T`, just input parameter would be returned.
40
- *
41
- * If what you want is not asserting but just knowing whether the parametric value is
42
- * following the type `T` or not, you can choose the {@link is} function instead.
43
- * Otherwise you want to know all the errors, {@link validate} is the way to go.
44
- * Also, if you want to automatically cast the parametric value to the type `T`
45
- * when no problem (perform the assertion guard of type).
46
- *
47
- * On the other and, if you don't want to allow any superfluous property that is not
48
- * enrolled to the type `T`, you can use {@link assertEquals} function instead.
49
- *
50
- * @template T Type of the input value
51
- * @param input A value to be asserted
52
- * @returns Parametric input value
53
- * @throws A {@link TypeGuardError} instance with detailed reason
54
- *
55
- * @author Jeongho Nam - https://github.com/samchon
56
- */
57
- export function assert<T>(input: T): T;
58
-
59
- /**
60
- * Asserts a value type.
61
- *
62
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
63
- * reason, if the parametric value is not following the type `T`. Otherwise, the
64
- * value is following the type `T`, just input parameter would be returned.
65
- *
66
- * If what you want is not asserting but just knowing whether the parametric value is
67
- * following the type `T` or not, you can choose the {@link is} function instead.
68
- * Otherwise, you want to know all the errors, {@link validate} is the way to go.
69
- *
70
- * On the other and, if you don't want to allow any superfluous property that is not
71
- * enrolled to the type `T`, you can use {@link assertEquals} function instead.
72
- *
73
- * @template T Type of the input value
74
- * @param input A value to be asserted
75
- * @returns Parametric input value casted as `T`
76
- * @throws A {@link TypeGuardError} instance with detailed reason
77
- *
78
- * @author Jeongho Nam - https://github.com/samchon
79
- */
80
- export function assert<T>(input: unknown): T;
81
-
82
- /**
83
- * @internal
84
- */
85
- export function assert(): never {
86
- halt("assert");
87
- }
88
- Object.assign(assert, Namespace.assert("assert"));
89
-
90
- /**
91
- * Assertion guard of a value type.
92
- *
93
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
94
- * reason, if the parametric value is not following the type `T`. Otherwise, the
95
- * value is following the type `T`, nothing would be returned, but the input value
96
- * would be automatically casted to the type `T`. This is the concept of
97
- * "Assertion Guard" of a value type.
98
- *
99
- * If what you want is not asserting but just knowing whether the parametric value is
100
- * following the type `T` or not, you can choose the {@link is} function instead.
101
- * Otherwise you want to know all the errors, {@link validate} is the way to go.
102
- * Also, if you want to returns the parametric value when no problem, you can use
103
- * {@link assert} function instead.
104
- *
105
- * On the other and, if you don't want to allow any superfluous property that is not
106
- * enrolled to the type `T`, you can use {@link assertGuardEquals} function instead.
107
- *
108
- * @template T Type of the input value
109
- * @param input A value to be asserted
110
- * @throws A {@link TypeGuardError} instance with detailed reason
111
- *
112
- * @author Jeongho Nam - https://github.com/samchon
113
- */
114
- export function assertGuard<T>(input: T): asserts input is T;
115
-
116
- /**
117
- * Assertion guard of a value type.
118
- *
119
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
120
- * reason, if the parametric value is not following the type `T`. Otherwise, the
121
- * value is following the type `T`, nothing would be returned, but the input value
122
- * would be automatically casted to the type `T`. This is the concept of
123
- * "Assertion Guard" of a value type.
124
- *
125
- * If what you want is not asserting but just knowing whether the parametric value is
126
- * following the type `T` or not, you can choose the {@link is} function instead.
127
- * Otherwise you want to know all the errors, {@link validate} is the way to go.
128
- * Also, if you want to returns the parametric value when no problem, you can use
129
- * {@link assert} function instead.
130
- *
131
- * On the other and, if you don't want to allow any superfluous property that is not
132
- * enrolled to the type `T`, you can use {@link assertGuardEquals} function instead.
133
- *
134
- * @template T Type of the input value
135
- * @param input A value to be asserted
136
- * @throws A {@link TypeGuardError} instance with detailed reason
137
- *
138
- * @author Jeongho Nam - https://github.com/samchon
139
- */
140
- export function assertGuard<T>(input: unknown): asserts input is T;
141
-
142
- /**
143
- * @internal
144
- */
145
- export function assertGuard(): never {
146
- halt("assertGuard");
147
- }
148
- Object.assign(assertGuard, Namespace.assert("assertGuard"));
149
-
150
- /**
151
- * Tests a value type.
152
- *
153
- * Tests a parametric value type and returns whether it's following the type `T` or not.
154
- * If the parametric value is matched with the type `T`, `true` value would be returned.
155
- * Otherwise, the parametric value is not following the type `T`, `false` value would be
156
- * returned.
157
- *
158
- * If what you want is not just knowing whether the parametric value is following the
159
- * type `T` or not, but throwing an exception with detailed reason, you can choose
160
- * {@link assert} function instead. Also, if you want to know all the errors with
161
- * detailed reasons, {@link validate} function would be useful.
162
- *
163
- * On the other and, if you don't want to allow any superfluous property that is not
164
- * enrolled to the type `T`, you can use {@link equals} function instead.
165
- *
166
- * @template T Type of the input value
167
- * @param input A value to be tested
168
- * @returns Whether the parametric value is following the type `T` or not
169
- *
170
- * @author Jeongho Nam - https://github.com/samchon
171
- */
172
- export function is<T>(input: T): input is T;
173
-
174
- /**
175
- * Tests a value type.
176
- *
177
- * Tests a parametric value type and returns whether it's following the type `T` or not.
178
- * If the parametric value is matched with the type `T`, `true` value would be returned.
179
- * Otherwise, the parametric value is not following the type `T`, `false` value would be
180
- * returned.
181
- *
182
- * If what you want is not just knowing whether the parametric value is following the
183
- * type `T` or not, but throwing an exception with detailed reason, you can choose
184
- * {@link assert} function instead. Also, if you want to know all the errors with
185
- * detailed reasons, {@link validate} function would be useful.
186
- *
187
- * On the other and, if you don't want to allow any superfluous property that is not
188
- * enrolled to the type `T`, you can use {@link equals} function instead.
189
- *
190
- * @template T Type of the input value
191
- * @param input A value to be tested
192
- * @returns Whether the parametric value is following the type `T` or not
193
- *
194
- * @author Jeongho Nam - https://github.com/samchon
195
- */
196
- export function is<T>(input: unknown): input is T;
197
-
198
- /**
199
- * @internal
200
- */
201
- export function is(): never {
202
- halt("is");
203
- }
204
- Object.assign(is, Namespace.assert("is"));
205
-
206
- /**
207
- * Validates a value type.
208
- *
209
- * Validates a parametric value type and archives all the type errors into an
210
- * {@link IValidation.errors} array, if the parametric value is not following the
211
- * type `T`. Of course, if the parametric value is following the type `T`, the
212
- * {@link IValidation.errors} array would be empty and {@link IValidation.success}
213
- * would have the `true` value.
214
- *
215
- * If what you want is not finding all the error, but asserting the parametric value
216
- * type with exception throwing, you can choose {@link assert} function instead.
217
- * Otherwise, you just want to know whether the parametric value is matched with the
218
- * type `T`, {@link is} function is the way to go.
219
- *
220
- * On the other and, if you don't want to allow any superfluous property that is not
221
- * enrolled to the type `T`, you can use {@link validateEquals} function instead.
222
- *
223
- * @template Type of the input value
224
- * @param input A value to be validated
225
- * @returns Validation result
226
- *
227
- * @author Jeongho Nam - https://github.com/samchon
228
- */
229
- export function validate<T>(input: T): IValidation<T>;
230
-
231
- /**
232
- * Validates a value type.
233
- *
234
- * Validates a parametric value type and archives all the type errors into an
235
- * {@link IValidation.errors} array, if the parametric value is not following the
236
- * type `T`. Of course, if the parametric value is following the type `T`, the
237
- * {@link IValidation.errors} array would be empty and {@link IValidation.success}
238
- * would have the `true` value.
239
- *
240
- * If what you want is not finding all the error, but asserting the parametric value
241
- * type with exception throwing, you can choose {@link assert} function instead.
242
- * Otherwise, you just want to know whether the parametric value is matched with the
243
- * type `T`, {@link is} function is the way to go.
244
- *
245
- * On the other and, if you don't want to allow any superfluous property that is not
246
- * enrolled to the type `T`, you can use {@link validateEquals} function instead.
247
- *
248
- * @template Type of the input value
249
- * @param input A value to be validated
250
- * @returns Validation result
251
- *
252
- * @author Jeongho Nam - https://github.com/samchon
253
- */
254
- export function validate<T>(input: unknown): IValidation<T>;
255
-
256
- /**
257
- * @internal
258
- */
259
- export function validate(): never {
260
- halt("validate");
261
- }
262
- Object.assign(validate, Namespace.validate());
263
-
264
- /* -----------------------------------------------------------
265
- STRICT VALIDATORS
266
- ----------------------------------------------------------- */
267
- /**
268
- * Asserts equality between a value and its type.
269
- *
270
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
271
- * reason, if the parametric value is not following the type `T` or some superfluous
272
- * property that is not listed on the type `T` has been found. Otherwise, the value is
273
- * following the type `T` without any superfluous property, just input parameter would
274
- * be returned.
275
- *
276
- * If what you want is not asserting but just knowing whether the parametric value is
277
- * following the type `T` or not, you can choose the {@link equals} function instead.
278
- * Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
279
- *
280
- * On the other hand, if you want to allow superfluous property that is not enrolled
281
- * to the type `T`, you can use {@link assert} function instead.
282
- *
283
- * @template T Type of the input value
284
- * @param input A value to be asserted
285
- * @returns Parametric input value
286
- * @throws A {@link TypeGuardError} instance with detailed reason
287
- *
288
- * @author Jeongho Nam - https://github.com/samchon
289
- */
290
- export function assertEquals<T>(input: T): T;
291
-
292
- /**
293
- * Asserts equality between a value and its type.
294
- *
295
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
296
- * reason, if the parametric value is not following the type `T` or some superfluous
297
- * property that is not listed on the type `T` has been found. Otherwise, the value is
298
- * following the type `T` without any superfluous property, just input parameter would
299
- * be returned.
300
- *
301
- * If what you want is not asserting but just knowing whether the parametric value is
302
- * following the type `T` or not, you can choose the {@link equals} function instead.
303
- * Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
304
- *
305
- * On the other hand, if you want to allow superfluous property that is not enrolled
306
- * to the type `T`, you can use {@link assert} function instead.
307
- *
308
- * @template T Type of the input value
309
- * @param input A value to be asserted
310
- * @returns Parametric input value casted as `T`
311
- * @throws A {@link TypeGuardError} instance with detailed reason
312
- *
313
- * @author Jeongho Nam - https://github.com/samchon
314
- */
315
- export function assertEquals<T>(input: unknown): T;
316
-
317
- /**
318
- * @internal
319
- */
320
- export function assertEquals(): never {
321
- halt("assertEquals");
322
- }
323
- Object.assign(assertEquals, Namespace.assert("assertEquals"));
324
-
325
- /**
326
- * Assertion guard of a type with equality.
327
- *
328
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
329
- * reason, if the parametric value is not following the type `T` or some superfluous
330
- * property that is not listed on the type `T` has been found.
331
- *
332
- * Otherwise, the value is following the type `T` without any superfluous property,
333
- * nothing would be returned, but the input value would be automatically casted to
334
- * the type `T`. This is the concept of "Assertion Guard" of a value type.
335
- *
336
- * If what you want is not asserting but just knowing whether the parametric value is
337
- * following the type `T` or not, you can choose the {@link equals} function instead.
338
- * Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
339
- * Also, if you want to returns the parametric value when no problem, you can use
340
- * {@link assert} function instead.
341
- *
342
- * On the other hand, if you want to allow superfluous property that is not enrolled
343
- * to the type `T`, you can use {@link assertEquals} function instead.
344
- *
345
- * @template T Type of the input value
346
- * @param input A value to be asserted
347
- * @returns Parametric input value casted as `T`
348
- * @throws A {@link TypeGuardError} instance with detailed reason
349
- *
350
- * @author Jeongho Nam - https://github.com/samchon
351
- */
352
- export function assertGuardEquals<T>(input: T): asserts input is T;
353
-
354
- /**
355
- * Assertion guard of a type with equality.
356
- *
357
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
358
- * reason, if the parametric value is not following the type `T` or some superfluous
359
- * property that is not listed on the type `T` has been found.
360
- *
361
- * Otherwise, the value is following the type `T` without any superfluous property,
362
- * nothing would be returned, but the input value would be automatically casted to
363
- * the type `T`. This is the concept of "Assertion Guard" of a value type.
364
- *
365
- * If what you want is not asserting but just knowing whether the parametric value is
366
- * following the type `T` or not, you can choose the {@link equals} function instead.
367
- * Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
368
- * Also, if you want to returns the parametric value when no problem, you can use
369
- * {@link assertEquals} function instead.
370
- *
371
- * On the other hand, if you want to allow superfluous property that is not enrolled
372
- * to the type `T`, you can use {@link assertGuard} function instead.
373
- *
374
- * @template T Type of the input value
375
- * @param input A value to be asserted
376
- * @returns Parametric input value casted as `T`
377
- * @throws A {@link TypeGuardError} instance with detailed reason
378
- *
379
- * @author Jeongho Nam - https://github.com/samchon
380
- */
381
- export function assertGuardEquals<T>(input: unknown): asserts input is T;
382
-
383
- /**
384
- * @internal
385
- */
386
- export function assertGuardEquals(): never {
387
- halt("assertGuardEquals");
388
- }
389
- Object.assign(assertGuardEquals, Namespace.assert("assertGuardEquals"));
390
-
391
- /**
392
- * Tests equality between a value and its type.
393
- *
394
- * Tests a parametric value type and returns whether it's equivalent to the type `T`
395
- * or not. If the parametric value is matched with the type `T` and there's not any
396
- * superfluous property that is not listed on the type `T`, `true` value would be
397
- * returned. Otherwise, the parametric value is not following the type `T` or some
398
- * superfluous property exists, `false` value would be returned.
399
- *
400
- * If what you want is not just knowing whether the parametric value is following the
401
- * type `T` or not, but throwing an exception with detailed reason, you can choose
402
- * {@link assertEquals} function instead. Also, if you want to know all the errors with
403
- * detailed reasons, {@link validateEquals} function would be useful.
404
- *
405
- * On the other hand, if you want to allow superfluous property that is not enrolled
406
- * to the type `T`, you can use {@link is} function instead.
407
- *
408
- * @template T Type of the input value
409
- * @param input A value to be tested
410
- * @returns Whether the parametric value is equivalent to the type `T` or not
411
- *
412
- * @author Jeongho Nam - https://github.com/samchon
413
- */
414
- export function equals<T>(input: T): input is T;
415
-
416
- /**
417
- * Tests equality between a value and its type.
418
- *
419
- * Tests a parametric value type and returns whether it's equivalent to the type `T`
420
- * or not. If the parametric value is matched with the type `T` and there's not any
421
- * superfluous property that is not listed on the type `T`, `true` value would be
422
- * returned. Otherwise, the parametric value is not following the type `T` or some
423
- * superfluous property exists, `false` value would be returned.
424
- *
425
- * If what you want is not just knowing whether the parametric value is following the
426
- * type `T` or not, but throwing an exception with detailed reason, you can choose
427
- * {@link assertEquals} function instead. Also, if you want to know all the errors with
428
- * detailed reasons, {@link validateEquals} function would be useful.
429
- *
430
- * On the other hand, if you want to allow superfluous property that is not enrolled
431
- * to the type `T`, you can use {@link is} function instead.
432
- *
433
- * @template T Type of the input value
434
- * @param input A value to be tested
435
- * @returns Whether the parametric value is equivalent to the type `T` or not
436
- *
437
- * @author Jeongho Nam - https://github.com/samchon
438
- */
439
- export function equals<T>(input: unknown): input is T;
440
-
441
- /**
442
- * @internal
443
- */
444
- export function equals(): never {
445
- halt("equals");
446
- }
447
- Object.assign(equals, Namespace.is());
448
-
449
- /**
450
- * Validates equality between a value and its type.
451
- *
452
- * Validates a parametric value type and archives all the type errors into an
453
- * {@link IValidation.errors} array, if the parametric value is not following the
454
- * type `T` or some superfluous property that is not listed on the type `T` has been
455
- * found. Of course, if the parametric value is following the type `T` and no
456
- * superfluous property exists, the {@link IValidation.errors} array would be empty
457
- * and {@link IValidation.success} would have the `true` value.
458
- *
459
- * If what you want is not finding all the error, but asserting the parametric value
460
- * type with exception throwing, you can choose {@link assert} function instead.
461
- * Otherwise, you just want to know whether the parametric value is matched with the
462
- * type `T`, {@link is} function is the way to go.
463
- *
464
- * On the other and, if you don't want to allow any superfluous property that is not
465
- * enrolled to the type `T`, you can use {@link validateEquals} function instead.
466
- *
467
- * @template Type of the input value
468
- * @param input A value to be validated
469
- * @returns Validation result
470
- *
471
- * @author Jeongho Nam - https://github.com/samchon
472
- */
473
- export function validateEquals<T>(input: T): IValidation<T>;
474
-
475
- /**
476
- * Validates equality between a value and its type.
477
- *
478
- * Validates a parametric value type and archives all the type errors into an
479
- * {@link IValidation.errors} array, if the parametric value is not following the
480
- * type `T` or some superfluous property that is not listed on the type `T` has been
481
- * found. Of course, if the parametric value is following the type `T` and no
482
- * superfluous property exists, the {@link IValidation.errors} array would be empty
483
- * and {@link IValidation.success} would have the `true` value.
484
- *
485
- * If what you want is not finding all the error, but asserting the parametric value
486
- * type with exception throwing, you can choose {@link assert} function instead.
487
- * Otherwise, you just want to know whether the parametric value is matched with the
488
- * type `T`, {@link is} function is the way to go.
489
- *
490
- * On the other and, if you don't want to allow any superfluous property that is not
491
- * enrolled to the type `T`, you can use {@link validateEquals} function instead.
492
- *
493
- * @template Type of the input value
494
- * @param input A value to be validated
495
- * @returns Validation result
496
- *
497
- * @author Jeongho Nam - https://github.com/samchon
498
- */
499
- export function validateEquals<T>(input: unknown): IValidation<T>;
500
-
501
- /**
502
- * @internal
503
- */
504
- export function validateEquals(): never {
505
- halt("validateEquals");
506
- }
507
- Object.assign(validateEquals, Namespace.validate());
508
-
509
- /* -----------------------------------------------------------
510
- RANDOM
511
- ----------------------------------------------------------- */
512
- /**
513
- * > You must configure the generic argument `T`.
514
- *
515
- * Generate random data.
516
- *
517
- * Generates a random data following type the `T`.
518
- *
519
- * For reference, this `typia.random()` function generates only primitive type.
520
- * If there're some methods in the type `T` or its nested instances, those would
521
- * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
522
- * would be generated instead.
523
- *
524
- * @template T Type of data to generate
525
- * @param generator Random data generator
526
- * @return Randomly generated data
527
- *
528
- * @author Jeongho Nam - https://github.com/samchon
529
- */
530
- export function random(generator?: Partial<IRandomGenerator>): never;
531
-
532
- /**
533
- * Generate random data.
534
- *
535
- * Generates a random data following type the `T`.
536
- *
537
- * For reference, this `typia.random()` function generates only primitive type.
538
- * If there're some methods in the type `T` or its nested instances, those would
539
- * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
540
- * would be generated instead.
541
- *
542
- * @template T Type of data to generate
543
- * @param generator Random data generator
544
- * @return Randomly generated data
545
- *
546
- * @author Jeongho Nam - https://github.com/samchon
547
- */
548
- export function random<T>(generator?: Partial<IRandomGenerator>): Resolved<T>;
549
-
550
- /**
551
- * @internal
552
- */
553
- export function random(): never {
554
- halt("random");
555
- }
556
- Object.assign(random, Namespace.random());
557
-
558
- /* -----------------------------------------------------------
559
- FACTORY FUNCTIONS
560
- ----------------------------------------------------------- */
561
- /**
562
- * Creates a reusable {@link assert} function.
563
- *
564
- * @danger You must configure the generic argument `T`
565
- * @returns Nothing until you configure the generic argument `T`
566
- * @throws compile error
567
- *
568
- * @author Jeongho Nam - https://github.com/samchon
569
- */
570
- export function createAssert(): never;
571
-
572
- /**
573
- * Creates a reusable {@link assert} function.
574
- *
575
- * @template T Type of the input value
576
- * @returns A reusable `assert` function
577
- *
578
- * @author Jeongho Nam - https://github.com/samchon
579
- */
580
- export function createAssert<T>(): (input: unknown) => T;
581
-
582
- /**
583
- * @internal
584
- */
585
- export function createAssert<T>(): (input: unknown) => T {
586
- halt("createAssert");
587
- }
588
- Object.assign(createAssert, assert);
589
-
590
- /**
591
- * Creates a reusable {@link assertGuard} function.
592
- *
593
- * Note that, you've to declare the variable type of the factory function caller
594
- * like below. If you don't declare the variable type, compilation error be thrown.
595
- * This is the special rule of the TypeScript compiler.
596
- *
597
- * ```typescript
598
- * // MUST DECLARE THE VARIABLE TYPE
599
- * const func: typia.AssertionGuard<number> = typia.createAssertGuard<number>();
600
- *
601
- * // IF NOT, COMPILATION ERROR BE OCCURED
602
- * const func = typia.createAssertGuard<number>();
603
- * ```
604
- *
605
- * > *Assertions require every name in the call target to be declared with an*
606
- * > *explicit type annotation.*
607
- *
608
- * @danger You must configure the generic argument `T`
609
- * @returns Nothing until you configure the generic argument `T`
610
- * @throws compile error
611
- *
612
- * @author Jeongho Nam - https://github.com/samchon
613
- */
614
- export function createAssertGuard(): never;
615
-
616
- /**
617
- * Creates a reusable {@link assertGuard} function.
618
- *
619
- * Note that, you've to declare the variable type of the factory function caller
620
- * like below. If you don't declare the variable type, compilation error be thrown.
621
- * This is the special rule of the TypeScript compiler.
622
- *
623
- * ```typescript
624
- * // MUST DECLARE THE VARIABLE TYPE
625
- * const func: typia.AssertionGuard<number> = typia.createAssertGuard<number>();
626
- *
627
- * // IF NOT, COMPILATION ERROR BE OCCURED
628
- * const func = typia.createAssertGuard<number>();
629
- * ```
630
- *
631
- * > *Assertions require every name in the call target to be declared with an*
632
- * > *explicit type annotation.*
633
- *
634
- * @returns Nothing until you configure the generic argument `T`
635
- * @throws compile error
636
- *
637
- * @author Jeongho Nam - https://github.com/samchon
638
- */
639
- export function createAssertGuard<T>(): (input: unknown) => AssertionGuard<T>;
640
-
641
- /**
642
- * @internal
643
- */
644
- export function createAssertGuard<T>(): (input: unknown) => AssertionGuard<T> {
645
- halt("createAssertGuard");
646
- }
647
- Object.assign(createAssertGuard, assertGuard);
648
-
649
- /**
650
- * Creates a reusable {@link is} function.
651
- *
652
- * @danger You must configure the generic argument `T`
653
- * @returns Nothing until you configure the generic argument `T`
654
- * @throws compile error
655
- *
656
- * @author Jeongho Nam - https://github.com/samchon
657
- */
658
- export function createIs(): never;
659
-
660
- /**
661
- * Creates a reusable {@link is} function.
662
- *
663
- * @template T Type of the input value
664
- * @returns A reusable `is` function
665
- *
666
- * @author Jeongho Nam - https://github.com/samchon
667
- */
668
- export function createIs<T>(): (input: unknown) => input is T;
669
-
670
- /**
671
- * @internal
672
- */
673
- export function createIs<T>(): (input: unknown) => input is T {
674
- halt("createIs");
675
- }
676
- Object.assign(createIs, is);
677
-
678
- /**
679
- * Creates a reusable {@link validate} function.
680
- *
681
- * @danger You must configure the generic argument `T`
682
- * @returns Nothing until you configure the generic argument `T`
683
- * @throws compile error
684
- *
685
- * @author Jeongho Nam - https://github.com/samchon
686
- */
687
- export function createValidate(): never;
688
-
689
- /**
690
- * Creates a reusable {@link validate} function.
691
- *
692
- * @template T Type of the input value
693
- * @returns A reusable `validate` function
694
- *
695
- * @author Jeongho Nam - https://github.com/samchon
696
- */
697
- export function createValidate<T>(): (input: unknown) => IValidation<T>;
698
-
699
- /**
700
- * @internal
701
- */
702
- export function createValidate(): (input: unknown) => IValidation {
703
- halt("createValidate");
704
- }
705
- Object.assign(createValidate, validate);
706
-
707
- /**
708
- * Creates a reusable {@link assertEquals} function.
709
- *
710
- * @danger You must configure the generic argument `T`
711
- * @returns Nothing until you configure the generic argument `T`
712
- * @throws compile error
713
- *
714
- * @author Jeongho Nam - https://github.com/samchon
715
- */
716
- export function createAssertEquals(): never;
717
-
718
- /**
719
- * Creates a reusable {@link assertEquals} function.
720
- *
721
- * @template T Type of the input value
722
- * @returns A reusable `assertEquals` function
723
- *
724
- * @author Jeongho Nam - https://github.com/samchon
725
- */
726
- export function createAssertEquals<T>(): (input: unknown) => T;
727
-
728
- /**
729
- * @internal
730
- */
731
- export function createAssertEquals<T>(): (input: unknown) => T {
732
- halt("createAssertEquals");
733
- }
734
- Object.assign(createAssertEquals, assertEquals);
735
-
736
- /**
737
- * Creates a reusable {@link assertGuardEquals} function.
738
- *
739
- * Note that, you've to declare the variable type of the factory function caller
740
- * like below. If you don't declare the variable type, compilation error be thrown.
741
- * This is the special rule of the TypeScript compiler.
742
- *
743
- * ```typescript
744
- * // MUST DECLARE THE VARIABLE TYPE
745
- * const func: typia.AssertionGuard<number> = typia.createAssertGuardEquals<number>();
746
- *
747
- * // IF NOT, COMPILATION ERROR BE OCCURED
748
- * const func = typia.createAssertGuardEquals<number>();
749
- * ```
750
- *
751
- * > *Assertions require every name in the call target to be declared with an*
752
- * > *explicit type annotation.*
753
- *
754
- * @danger You must configure the generic argument `T`
755
- * @returns Nothing until you configure the generic argument `T`
756
- * @throws compile error
757
- *
758
- * @author Jeongho Nam - https://github.com/samchon
759
- */
760
- export function createAssertGuardEquals(): never;
761
-
762
- /**
763
- * Creates a reusable {@link assertGuardEquals} function.
764
- *
765
- * Note that, you've to declare the variable type of the factory function caller
766
- * like below. If you don't declare the variable type, compilation error be thrown.
767
- * This is the special rule of the TypeScript compiler.
768
- *
769
- * ```typescript
770
- * // MUST DECLARE THE VARIABLE TYPE
771
- * const func: typia.AssertionGuard<number> = typia.createAssertGuardEquals<number>();
772
- *
773
- * // IF NOT, COMPILATION ERROR BE OCCURED
774
- * const func = typia.createAssertGuardEquals<number>();
775
- * ```
776
- *
777
- * > *Assertions require every name in the call target to be declared with an*
778
- * > *explicit type annotation.*
779
- *
780
- * @returns Nothing until you configure the generic argument `T`
781
- * @throws compile error
782
- *
783
- * @author Jeongho Nam - https://github.com/samchon
784
- */
785
- export function createAssertGuardEquals<T>(): (
786
- input: unknown,
787
- ) => AssertionGuard<T>;
788
-
789
- /**
790
- * @internal
791
- */
792
- export function createAssertGuardEquals<T>(): (
793
- input: unknown,
794
- ) => AssertionGuard<T> {
795
- halt("createAssertGuardEquals");
796
- }
797
- Object.assign(createAssertGuardEquals, assertGuardEquals);
798
-
799
- /**
800
- * Creates a reusable {@link equals} function.
801
- *
802
- * @danger You must configure the generic argument `T`
803
- * @returns Nothing until you configure the generic argument `T`
804
- * @throws compile error
805
- *
806
- * @author Jeongho Nam - https://github.com/samchon
807
- */
808
- export function createEquals(): never;
809
-
810
- /**
811
- * Creates a reusable {@link equals} function.
812
- *
813
- * @template T Type of the input value
814
- * @returns A reusable `equals` function
815
- *
816
- * @author Jeongho Nam - https://github.com/samchon
817
- */
818
- export function createEquals<T>(): (input: unknown) => input is T;
819
-
820
- /**
821
- * @internal
822
- */
823
- export function createEquals<T>(): (input: unknown) => input is T {
824
- halt("createEquals");
825
- }
826
- Object.assign(createEquals, equals);
827
-
828
- /**
829
- * Creates a reusable {@link validateEquals} function.
830
- *
831
- * @danger You must configure the generic argument `T`
832
- * @returns Nothing until you configure the generic argument `T`
833
- * @throws compile error
834
- *
835
- * @author Jeongho Nam - https://github.com/samchon
836
- */
837
- export function createValidateEquals(): never;
838
-
839
- /**
840
- * Creates a reusable {@link validateEquals} function.
841
- *
842
- * @template T Type of the input value
843
- * @returns A reusable `validateEquals` function
844
- *
845
- * @author Jeongho Nam - https://github.com/samchon
846
- */
847
- export function createValidateEquals<T>(): (input: unknown) => IValidation<T>;
848
-
849
- /**
850
- * @internal
851
- */
852
- export function createValidateEquals(): (input: unknown) => IValidation {
853
- halt("createValidateEquals");
854
- }
855
- Object.assign(createValidateEquals, validateEquals);
856
-
857
- /**
858
- * Creates a reusable {@link random} function.
859
- *
860
- * @danger You must configure the generic argument `T`
861
- * @param generator Random data generator
862
- * @returns Nothing until you configure the generic argument `T`
863
- * @throws compile error
864
- *
865
- * @author Jeongho Nam - https://github.com/samchon
866
- */
867
- export function createRandom(generator?: Partial<IRandomGenerator>): never;
868
-
869
- /**
870
- * Creates a resuable {@link random} function.
871
- *
872
- * @template T Type of the input value
873
- * @param generator Random data generator
874
- * @returns A reusable `random` function
875
- *
876
- * @author Jeongho Nam - https://github.com/samchon
877
- */
878
- export function createRandom<T>(
879
- generator?: Partial<IRandomGenerator>,
880
- ): () => Resolved<T>;
881
-
882
- /**
883
- * @internal
884
- */
885
- export function createRandom(): never {
886
- halt("createRandom");
887
- }
888
- Object.assign(createRandom, random);
889
-
890
- /**
891
- * @internal
892
- */
893
- function halt(name: string): never {
894
- throw new Error(
895
- `Error on typia.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`,
896
- );
897
- }
1
+ import { Namespace } from "./functional/Namespace";
2
+
3
+ import { AssertionGuard } from "./AssertionGuard";
4
+ import { IRandomGenerator } from "./IRandomGenerator";
5
+ import { IValidation } from "./IValidation";
6
+ import { Resolved } from "./Resolved";
7
+
8
+ export * as http from "./http";
9
+ export * as json from "./json";
10
+ export * as misc from "./misc";
11
+ export * as notations from "./notations";
12
+ export * as protobuf from "./protobuf";
13
+ export * as reflect from "./reflect";
14
+ export * as tags from "./tags";
15
+
16
+ export * from "./schemas/metadata/IJsDocTagInfo";
17
+ export * from "./schemas/json/IJsonApplication";
18
+ export * from "./schemas/json/IJsonComponents";
19
+ export * from "./schemas/json/IJsonSchema";
20
+ export * from "./AssertionGuard";
21
+ export * from "./IRandomGenerator";
22
+ export * from "./IValidation";
23
+ export * from "./TypeGuardError";
24
+
25
+ export * from "./Primitive";
26
+ export * from "./Resolved";
27
+ export * from "./CamelCase";
28
+ export * from "./PascalCase";
29
+ export * from "./SnakeCase";
30
+
31
+ /* -----------------------------------------------------------
32
+ BASIC VALIDATORS
33
+ ----------------------------------------------------------- */
34
+ /**
35
+ * Asserts a value type.
36
+ *
37
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
38
+ * reason, if the parametric value is not following the type `T`. Otherwise, the
39
+ * value is following the type `T`, just input parameter would be returned.
40
+ *
41
+ * If what you want is not asserting but just knowing whether the parametric value is
42
+ * following the type `T` or not, you can choose the {@link is} function instead.
43
+ * Otherwise you want to know all the errors, {@link validate} is the way to go.
44
+ * Also, if you want to automatically cast the parametric value to the type `T`
45
+ * when no problem (perform the assertion guard of type).
46
+ *
47
+ * On the other and, if you don't want to allow any superfluous property that is not
48
+ * enrolled to the type `T`, you can use {@link assertEquals} function instead.
49
+ *
50
+ * @template T Type of the input value
51
+ * @param input A value to be asserted
52
+ * @returns Parametric input value
53
+ * @throws A {@link TypeGuardError} instance with detailed reason
54
+ *
55
+ * @author Jeongho Nam - https://github.com/samchon
56
+ */
57
+ export function assert<T>(input: T): T;
58
+
59
+ /**
60
+ * Asserts a value type.
61
+ *
62
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
63
+ * reason, if the parametric value is not following the type `T`. Otherwise, the
64
+ * value is following the type `T`, just input parameter would be returned.
65
+ *
66
+ * If what you want is not asserting but just knowing whether the parametric value is
67
+ * following the type `T` or not, you can choose the {@link is} function instead.
68
+ * Otherwise, you want to know all the errors, {@link validate} is the way to go.
69
+ *
70
+ * On the other and, if you don't want to allow any superfluous property that is not
71
+ * enrolled to the type `T`, you can use {@link assertEquals} function instead.
72
+ *
73
+ * @template T Type of the input value
74
+ * @param input A value to be asserted
75
+ * @returns Parametric input value casted as `T`
76
+ * @throws A {@link TypeGuardError} instance with detailed reason
77
+ *
78
+ * @author Jeongho Nam - https://github.com/samchon
79
+ */
80
+ export function assert<T>(input: unknown): T;
81
+
82
+ /**
83
+ * @internal
84
+ */
85
+ export function assert(): never {
86
+ halt("assert");
87
+ }
88
+ Object.assign(assert, Namespace.assert("assert"));
89
+
90
+ /**
91
+ * Assertion guard of a value type.
92
+ *
93
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
94
+ * reason, if the parametric value is not following the type `T`. Otherwise, the
95
+ * value is following the type `T`, nothing would be returned, but the input value
96
+ * would be automatically casted to the type `T`. This is the concept of
97
+ * "Assertion Guard" of a value type.
98
+ *
99
+ * If what you want is not asserting but just knowing whether the parametric value is
100
+ * following the type `T` or not, you can choose the {@link is} function instead.
101
+ * Otherwise you want to know all the errors, {@link validate} is the way to go.
102
+ * Also, if you want to returns the parametric value when no problem, you can use
103
+ * {@link assert} function instead.
104
+ *
105
+ * On the other and, if you don't want to allow any superfluous property that is not
106
+ * enrolled to the type `T`, you can use {@link assertGuardEquals} function instead.
107
+ *
108
+ * @template T Type of the input value
109
+ * @param input A value to be asserted
110
+ * @throws A {@link TypeGuardError} instance with detailed reason
111
+ *
112
+ * @author Jeongho Nam - https://github.com/samchon
113
+ */
114
+ export function assertGuard<T>(input: T): asserts input is T;
115
+
116
+ /**
117
+ * Assertion guard of a value type.
118
+ *
119
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
120
+ * reason, if the parametric value is not following the type `T`. Otherwise, the
121
+ * value is following the type `T`, nothing would be returned, but the input value
122
+ * would be automatically casted to the type `T`. This is the concept of
123
+ * "Assertion Guard" of a value type.
124
+ *
125
+ * If what you want is not asserting but just knowing whether the parametric value is
126
+ * following the type `T` or not, you can choose the {@link is} function instead.
127
+ * Otherwise you want to know all the errors, {@link validate} is the way to go.
128
+ * Also, if you want to returns the parametric value when no problem, you can use
129
+ * {@link assert} function instead.
130
+ *
131
+ * On the other and, if you don't want to allow any superfluous property that is not
132
+ * enrolled to the type `T`, you can use {@link assertGuardEquals} function instead.
133
+ *
134
+ * @template T Type of the input value
135
+ * @param input A value to be asserted
136
+ * @throws A {@link TypeGuardError} instance with detailed reason
137
+ *
138
+ * @author Jeongho Nam - https://github.com/samchon
139
+ */
140
+ export function assertGuard<T>(input: unknown): asserts input is T;
141
+
142
+ /**
143
+ * @internal
144
+ */
145
+ export function assertGuard(): never {
146
+ halt("assertGuard");
147
+ }
148
+ Object.assign(assertGuard, Namespace.assert("assertGuard"));
149
+
150
+ /**
151
+ * Tests a value type.
152
+ *
153
+ * Tests a parametric value type and returns whether it's following the type `T` or not.
154
+ * If the parametric value is matched with the type `T`, `true` value would be returned.
155
+ * Otherwise, the parametric value is not following the type `T`, `false` value would be
156
+ * returned.
157
+ *
158
+ * If what you want is not just knowing whether the parametric value is following the
159
+ * type `T` or not, but throwing an exception with detailed reason, you can choose
160
+ * {@link assert} function instead. Also, if you want to know all the errors with
161
+ * detailed reasons, {@link validate} function would be useful.
162
+ *
163
+ * On the other and, if you don't want to allow any superfluous property that is not
164
+ * enrolled to the type `T`, you can use {@link equals} function instead.
165
+ *
166
+ * @template T Type of the input value
167
+ * @param input A value to be tested
168
+ * @returns Whether the parametric value is following the type `T` or not
169
+ *
170
+ * @author Jeongho Nam - https://github.com/samchon
171
+ */
172
+ export function is<T>(input: T): input is T;
173
+
174
+ /**
175
+ * Tests a value type.
176
+ *
177
+ * Tests a parametric value type and returns whether it's following the type `T` or not.
178
+ * If the parametric value is matched with the type `T`, `true` value would be returned.
179
+ * Otherwise, the parametric value is not following the type `T`, `false` value would be
180
+ * returned.
181
+ *
182
+ * If what you want is not just knowing whether the parametric value is following the
183
+ * type `T` or not, but throwing an exception with detailed reason, you can choose
184
+ * {@link assert} function instead. Also, if you want to know all the errors with
185
+ * detailed reasons, {@link validate} function would be useful.
186
+ *
187
+ * On the other and, if you don't want to allow any superfluous property that is not
188
+ * enrolled to the type `T`, you can use {@link equals} function instead.
189
+ *
190
+ * @template T Type of the input value
191
+ * @param input A value to be tested
192
+ * @returns Whether the parametric value is following the type `T` or not
193
+ *
194
+ * @author Jeongho Nam - https://github.com/samchon
195
+ */
196
+ export function is<T>(input: unknown): input is T;
197
+
198
+ /**
199
+ * @internal
200
+ */
201
+ export function is(): never {
202
+ halt("is");
203
+ }
204
+ Object.assign(is, Namespace.assert("is"));
205
+
206
+ /**
207
+ * Validates a value type.
208
+ *
209
+ * Validates a parametric value type and archives all the type errors into an
210
+ * {@link IValidation.errors} array, if the parametric value is not following the
211
+ * type `T`. Of course, if the parametric value is following the type `T`, the
212
+ * {@link IValidation.errors} array would be empty and {@link IValidation.success}
213
+ * would have the `true` value.
214
+ *
215
+ * If what you want is not finding all the error, but asserting the parametric value
216
+ * type with exception throwing, you can choose {@link assert} function instead.
217
+ * Otherwise, you just want to know whether the parametric value is matched with the
218
+ * type `T`, {@link is} function is the way to go.
219
+ *
220
+ * On the other and, if you don't want to allow any superfluous property that is not
221
+ * enrolled to the type `T`, you can use {@link validateEquals} function instead.
222
+ *
223
+ * @template Type of the input value
224
+ * @param input A value to be validated
225
+ * @returns Validation result
226
+ *
227
+ * @author Jeongho Nam - https://github.com/samchon
228
+ */
229
+ export function validate<T>(input: T): IValidation<T>;
230
+
231
+ /**
232
+ * Validates a value type.
233
+ *
234
+ * Validates a parametric value type and archives all the type errors into an
235
+ * {@link IValidation.errors} array, if the parametric value is not following the
236
+ * type `T`. Of course, if the parametric value is following the type `T`, the
237
+ * {@link IValidation.errors} array would be empty and {@link IValidation.success}
238
+ * would have the `true` value.
239
+ *
240
+ * If what you want is not finding all the error, but asserting the parametric value
241
+ * type with exception throwing, you can choose {@link assert} function instead.
242
+ * Otherwise, you just want to know whether the parametric value is matched with the
243
+ * type `T`, {@link is} function is the way to go.
244
+ *
245
+ * On the other and, if you don't want to allow any superfluous property that is not
246
+ * enrolled to the type `T`, you can use {@link validateEquals} function instead.
247
+ *
248
+ * @template Type of the input value
249
+ * @param input A value to be validated
250
+ * @returns Validation result
251
+ *
252
+ * @author Jeongho Nam - https://github.com/samchon
253
+ */
254
+ export function validate<T>(input: unknown): IValidation<T>;
255
+
256
+ /**
257
+ * @internal
258
+ */
259
+ export function validate(): never {
260
+ halt("validate");
261
+ }
262
+ Object.assign(validate, Namespace.validate());
263
+
264
+ /* -----------------------------------------------------------
265
+ STRICT VALIDATORS
266
+ ----------------------------------------------------------- */
267
+ /**
268
+ * Asserts equality between a value and its type.
269
+ *
270
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
271
+ * reason, if the parametric value is not following the type `T` or some superfluous
272
+ * property that is not listed on the type `T` has been found. Otherwise, the value is
273
+ * following the type `T` without any superfluous property, just input parameter would
274
+ * be returned.
275
+ *
276
+ * If what you want is not asserting but just knowing whether the parametric value is
277
+ * following the type `T` or not, you can choose the {@link equals} function instead.
278
+ * Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
279
+ *
280
+ * On the other hand, if you want to allow superfluous property that is not enrolled
281
+ * to the type `T`, you can use {@link assert} function instead.
282
+ *
283
+ * @template T Type of the input value
284
+ * @param input A value to be asserted
285
+ * @returns Parametric input value
286
+ * @throws A {@link TypeGuardError} instance with detailed reason
287
+ *
288
+ * @author Jeongho Nam - https://github.com/samchon
289
+ */
290
+ export function assertEquals<T>(input: T): T;
291
+
292
+ /**
293
+ * Asserts equality between a value and its type.
294
+ *
295
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
296
+ * reason, if the parametric value is not following the type `T` or some superfluous
297
+ * property that is not listed on the type `T` has been found. Otherwise, the value is
298
+ * following the type `T` without any superfluous property, just input parameter would
299
+ * be returned.
300
+ *
301
+ * If what you want is not asserting but just knowing whether the parametric value is
302
+ * following the type `T` or not, you can choose the {@link equals} function instead.
303
+ * Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
304
+ *
305
+ * On the other hand, if you want to allow superfluous property that is not enrolled
306
+ * to the type `T`, you can use {@link assert} function instead.
307
+ *
308
+ * @template T Type of the input value
309
+ * @param input A value to be asserted
310
+ * @returns Parametric input value casted as `T`
311
+ * @throws A {@link TypeGuardError} instance with detailed reason
312
+ *
313
+ * @author Jeongho Nam - https://github.com/samchon
314
+ */
315
+ export function assertEquals<T>(input: unknown): T;
316
+
317
+ /**
318
+ * @internal
319
+ */
320
+ export function assertEquals(): never {
321
+ halt("assertEquals");
322
+ }
323
+ Object.assign(assertEquals, Namespace.assert("assertEquals"));
324
+
325
+ /**
326
+ * Assertion guard of a type with equality.
327
+ *
328
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
329
+ * reason, if the parametric value is not following the type `T` or some superfluous
330
+ * property that is not listed on the type `T` has been found.
331
+ *
332
+ * Otherwise, the value is following the type `T` without any superfluous property,
333
+ * nothing would be returned, but the input value would be automatically casted to
334
+ * the type `T`. This is the concept of "Assertion Guard" of a value type.
335
+ *
336
+ * If what you want is not asserting but just knowing whether the parametric value is
337
+ * following the type `T` or not, you can choose the {@link equals} function instead.
338
+ * Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
339
+ * Also, if you want to returns the parametric value when no problem, you can use
340
+ * {@link assert} function instead.
341
+ *
342
+ * On the other hand, if you want to allow superfluous property that is not enrolled
343
+ * to the type `T`, you can use {@link assertEquals} function instead.
344
+ *
345
+ * @template T Type of the input value
346
+ * @param input A value to be asserted
347
+ * @returns Parametric input value casted as `T`
348
+ * @throws A {@link TypeGuardError} instance with detailed reason
349
+ *
350
+ * @author Jeongho Nam - https://github.com/samchon
351
+ */
352
+ export function assertGuardEquals<T>(input: T): asserts input is T;
353
+
354
+ /**
355
+ * Assertion guard of a type with equality.
356
+ *
357
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
358
+ * reason, if the parametric value is not following the type `T` or some superfluous
359
+ * property that is not listed on the type `T` has been found.
360
+ *
361
+ * Otherwise, the value is following the type `T` without any superfluous property,
362
+ * nothing would be returned, but the input value would be automatically casted to
363
+ * the type `T`. This is the concept of "Assertion Guard" of a value type.
364
+ *
365
+ * If what you want is not asserting but just knowing whether the parametric value is
366
+ * following the type `T` or not, you can choose the {@link equals} function instead.
367
+ * Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
368
+ * Also, if you want to returns the parametric value when no problem, you can use
369
+ * {@link assertEquals} function instead.
370
+ *
371
+ * On the other hand, if you want to allow superfluous property that is not enrolled
372
+ * to the type `T`, you can use {@link assertGuard} function instead.
373
+ *
374
+ * @template T Type of the input value
375
+ * @param input A value to be asserted
376
+ * @returns Parametric input value casted as `T`
377
+ * @throws A {@link TypeGuardError} instance with detailed reason
378
+ *
379
+ * @author Jeongho Nam - https://github.com/samchon
380
+ */
381
+ export function assertGuardEquals<T>(input: unknown): asserts input is T;
382
+
383
+ /**
384
+ * @internal
385
+ */
386
+ export function assertGuardEquals(): never {
387
+ halt("assertGuardEquals");
388
+ }
389
+ Object.assign(assertGuardEquals, Namespace.assert("assertGuardEquals"));
390
+
391
+ /**
392
+ * Tests equality between a value and its type.
393
+ *
394
+ * Tests a parametric value type and returns whether it's equivalent to the type `T`
395
+ * or not. If the parametric value is matched with the type `T` and there's not any
396
+ * superfluous property that is not listed on the type `T`, `true` value would be
397
+ * returned. Otherwise, the parametric value is not following the type `T` or some
398
+ * superfluous property exists, `false` value would be returned.
399
+ *
400
+ * If what you want is not just knowing whether the parametric value is following the
401
+ * type `T` or not, but throwing an exception with detailed reason, you can choose
402
+ * {@link assertEquals} function instead. Also, if you want to know all the errors with
403
+ * detailed reasons, {@link validateEquals} function would be useful.
404
+ *
405
+ * On the other hand, if you want to allow superfluous property that is not enrolled
406
+ * to the type `T`, you can use {@link is} function instead.
407
+ *
408
+ * @template T Type of the input value
409
+ * @param input A value to be tested
410
+ * @returns Whether the parametric value is equivalent to the type `T` or not
411
+ *
412
+ * @author Jeongho Nam - https://github.com/samchon
413
+ */
414
+ export function equals<T>(input: T): input is T;
415
+
416
+ /**
417
+ * Tests equality between a value and its type.
418
+ *
419
+ * Tests a parametric value type and returns whether it's equivalent to the type `T`
420
+ * or not. If the parametric value is matched with the type `T` and there's not any
421
+ * superfluous property that is not listed on the type `T`, `true` value would be
422
+ * returned. Otherwise, the parametric value is not following the type `T` or some
423
+ * superfluous property exists, `false` value would be returned.
424
+ *
425
+ * If what you want is not just knowing whether the parametric value is following the
426
+ * type `T` or not, but throwing an exception with detailed reason, you can choose
427
+ * {@link assertEquals} function instead. Also, if you want to know all the errors with
428
+ * detailed reasons, {@link validateEquals} function would be useful.
429
+ *
430
+ * On the other hand, if you want to allow superfluous property that is not enrolled
431
+ * to the type `T`, you can use {@link is} function instead.
432
+ *
433
+ * @template T Type of the input value
434
+ * @param input A value to be tested
435
+ * @returns Whether the parametric value is equivalent to the type `T` or not
436
+ *
437
+ * @author Jeongho Nam - https://github.com/samchon
438
+ */
439
+ export function equals<T>(input: unknown): input is T;
440
+
441
+ /**
442
+ * @internal
443
+ */
444
+ export function equals(): never {
445
+ halt("equals");
446
+ }
447
+ Object.assign(equals, Namespace.is());
448
+
449
+ /**
450
+ * Validates equality between a value and its type.
451
+ *
452
+ * Validates a parametric value type and archives all the type errors into an
453
+ * {@link IValidation.errors} array, if the parametric value is not following the
454
+ * type `T` or some superfluous property that is not listed on the type `T` has been
455
+ * found. Of course, if the parametric value is following the type `T` and no
456
+ * superfluous property exists, the {@link IValidation.errors} array would be empty
457
+ * and {@link IValidation.success} would have the `true` value.
458
+ *
459
+ * If what you want is not finding all the error, but asserting the parametric value
460
+ * type with exception throwing, you can choose {@link assert} function instead.
461
+ * Otherwise, you just want to know whether the parametric value is matched with the
462
+ * type `T`, {@link is} function is the way to go.
463
+ *
464
+ * On the other and, if you don't want to allow any superfluous property that is not
465
+ * enrolled to the type `T`, you can use {@link validateEquals} function instead.
466
+ *
467
+ * @template Type of the input value
468
+ * @param input A value to be validated
469
+ * @returns Validation result
470
+ *
471
+ * @author Jeongho Nam - https://github.com/samchon
472
+ */
473
+ export function validateEquals<T>(input: T): IValidation<T>;
474
+
475
+ /**
476
+ * Validates equality between a value and its type.
477
+ *
478
+ * Validates a parametric value type and archives all the type errors into an
479
+ * {@link IValidation.errors} array, if the parametric value is not following the
480
+ * type `T` or some superfluous property that is not listed on the type `T` has been
481
+ * found. Of course, if the parametric value is following the type `T` and no
482
+ * superfluous property exists, the {@link IValidation.errors} array would be empty
483
+ * and {@link IValidation.success} would have the `true` value.
484
+ *
485
+ * If what you want is not finding all the error, but asserting the parametric value
486
+ * type with exception throwing, you can choose {@link assert} function instead.
487
+ * Otherwise, you just want to know whether the parametric value is matched with the
488
+ * type `T`, {@link is} function is the way to go.
489
+ *
490
+ * On the other and, if you don't want to allow any superfluous property that is not
491
+ * enrolled to the type `T`, you can use {@link validateEquals} function instead.
492
+ *
493
+ * @template Type of the input value
494
+ * @param input A value to be validated
495
+ * @returns Validation result
496
+ *
497
+ * @author Jeongho Nam - https://github.com/samchon
498
+ */
499
+ export function validateEquals<T>(input: unknown): IValidation<T>;
500
+
501
+ /**
502
+ * @internal
503
+ */
504
+ export function validateEquals(): never {
505
+ halt("validateEquals");
506
+ }
507
+ Object.assign(validateEquals, Namespace.validate());
508
+
509
+ /* -----------------------------------------------------------
510
+ RANDOM
511
+ ----------------------------------------------------------- */
512
+ /**
513
+ * > You must configure the generic argument `T`.
514
+ *
515
+ * Generate random data.
516
+ *
517
+ * Generates a random data following type the `T`.
518
+ *
519
+ * For reference, this `typia.random()` function generates only primitive type.
520
+ * If there're some methods in the type `T` or its nested instances, those would
521
+ * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
522
+ * would be generated instead.
523
+ *
524
+ * @template T Type of data to generate
525
+ * @param generator Random data generator
526
+ * @return Randomly generated data
527
+ *
528
+ * @author Jeongho Nam - https://github.com/samchon
529
+ */
530
+ export function random(generator?: Partial<IRandomGenerator>): never;
531
+
532
+ /**
533
+ * Generate random data.
534
+ *
535
+ * Generates a random data following type the `T`.
536
+ *
537
+ * For reference, this `typia.random()` function generates only primitive type.
538
+ * If there're some methods in the type `T` or its nested instances, those would
539
+ * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
540
+ * would be generated instead.
541
+ *
542
+ * @template T Type of data to generate
543
+ * @param generator Random data generator
544
+ * @return Randomly generated data
545
+ *
546
+ * @author Jeongho Nam - https://github.com/samchon
547
+ */
548
+ export function random<T>(generator?: Partial<IRandomGenerator>): Resolved<T>;
549
+
550
+ /**
551
+ * @internal
552
+ */
553
+ export function random(): never {
554
+ halt("random");
555
+ }
556
+ Object.assign(random, Namespace.random());
557
+
558
+ /* -----------------------------------------------------------
559
+ FACTORY FUNCTIONS
560
+ ----------------------------------------------------------- */
561
+ /**
562
+ * Creates a reusable {@link assert} function.
563
+ *
564
+ * @danger You must configure the generic argument `T`
565
+ * @returns Nothing until you configure the generic argument `T`
566
+ * @throws compile error
567
+ *
568
+ * @author Jeongho Nam - https://github.com/samchon
569
+ */
570
+ export function createAssert(): never;
571
+
572
+ /**
573
+ * Creates a reusable {@link assert} function.
574
+ *
575
+ * @template T Type of the input value
576
+ * @returns A reusable `assert` function
577
+ *
578
+ * @author Jeongho Nam - https://github.com/samchon
579
+ */
580
+ export function createAssert<T>(): (input: unknown) => T;
581
+
582
+ /**
583
+ * @internal
584
+ */
585
+ export function createAssert<T>(): (input: unknown) => T {
586
+ halt("createAssert");
587
+ }
588
+ Object.assign(createAssert, assert);
589
+
590
+ /**
591
+ * Creates a reusable {@link assertGuard} function.
592
+ *
593
+ * Note that, you've to declare the variable type of the factory function caller
594
+ * like below. If you don't declare the variable type, compilation error be thrown.
595
+ * This is the special rule of the TypeScript compiler.
596
+ *
597
+ * ```typescript
598
+ * // MUST DECLARE THE VARIABLE TYPE
599
+ * const func: typia.AssertionGuard<number> = typia.createAssertGuard<number>();
600
+ *
601
+ * // IF NOT, COMPILATION ERROR BE OCCURED
602
+ * const func = typia.createAssertGuard<number>();
603
+ * ```
604
+ *
605
+ * > *Assertions require every name in the call target to be declared with an*
606
+ * > *explicit type annotation.*
607
+ *
608
+ * @danger You must configure the generic argument `T`
609
+ * @returns Nothing until you configure the generic argument `T`
610
+ * @throws compile error
611
+ *
612
+ * @author Jeongho Nam - https://github.com/samchon
613
+ */
614
+ export function createAssertGuard(): never;
615
+
616
+ /**
617
+ * Creates a reusable {@link assertGuard} function.
618
+ *
619
+ * Note that, you've to declare the variable type of the factory function caller
620
+ * like below. If you don't declare the variable type, compilation error be thrown.
621
+ * This is the special rule of the TypeScript compiler.
622
+ *
623
+ * ```typescript
624
+ * // MUST DECLARE THE VARIABLE TYPE
625
+ * const func: typia.AssertionGuard<number> = typia.createAssertGuard<number>();
626
+ *
627
+ * // IF NOT, COMPILATION ERROR BE OCCURED
628
+ * const func = typia.createAssertGuard<number>();
629
+ * ```
630
+ *
631
+ * > *Assertions require every name in the call target to be declared with an*
632
+ * > *explicit type annotation.*
633
+ *
634
+ * @returns Nothing until you configure the generic argument `T`
635
+ * @throws compile error
636
+ *
637
+ * @author Jeongho Nam - https://github.com/samchon
638
+ */
639
+ export function createAssertGuard<T>(): (input: unknown) => AssertionGuard<T>;
640
+
641
+ /**
642
+ * @internal
643
+ */
644
+ export function createAssertGuard<T>(): (input: unknown) => AssertionGuard<T> {
645
+ halt("createAssertGuard");
646
+ }
647
+ Object.assign(createAssertGuard, assertGuard);
648
+
649
+ /**
650
+ * Creates a reusable {@link is} function.
651
+ *
652
+ * @danger You must configure the generic argument `T`
653
+ * @returns Nothing until you configure the generic argument `T`
654
+ * @throws compile error
655
+ *
656
+ * @author Jeongho Nam - https://github.com/samchon
657
+ */
658
+ export function createIs(): never;
659
+
660
+ /**
661
+ * Creates a reusable {@link is} function.
662
+ *
663
+ * @template T Type of the input value
664
+ * @returns A reusable `is` function
665
+ *
666
+ * @author Jeongho Nam - https://github.com/samchon
667
+ */
668
+ export function createIs<T>(): (input: unknown) => input is T;
669
+
670
+ /**
671
+ * @internal
672
+ */
673
+ export function createIs<T>(): (input: unknown) => input is T {
674
+ halt("createIs");
675
+ }
676
+ Object.assign(createIs, is);
677
+
678
+ /**
679
+ * Creates a reusable {@link validate} function.
680
+ *
681
+ * @danger You must configure the generic argument `T`
682
+ * @returns Nothing until you configure the generic argument `T`
683
+ * @throws compile error
684
+ *
685
+ * @author Jeongho Nam - https://github.com/samchon
686
+ */
687
+ export function createValidate(): never;
688
+
689
+ /**
690
+ * Creates a reusable {@link validate} function.
691
+ *
692
+ * @template T Type of the input value
693
+ * @returns A reusable `validate` function
694
+ *
695
+ * @author Jeongho Nam - https://github.com/samchon
696
+ */
697
+ export function createValidate<T>(): (input: unknown) => IValidation<T>;
698
+
699
+ /**
700
+ * @internal
701
+ */
702
+ export function createValidate(): (input: unknown) => IValidation {
703
+ halt("createValidate");
704
+ }
705
+ Object.assign(createValidate, validate);
706
+
707
+ /**
708
+ * Creates a reusable {@link assertEquals} function.
709
+ *
710
+ * @danger You must configure the generic argument `T`
711
+ * @returns Nothing until you configure the generic argument `T`
712
+ * @throws compile error
713
+ *
714
+ * @author Jeongho Nam - https://github.com/samchon
715
+ */
716
+ export function createAssertEquals(): never;
717
+
718
+ /**
719
+ * Creates a reusable {@link assertEquals} function.
720
+ *
721
+ * @template T Type of the input value
722
+ * @returns A reusable `assertEquals` function
723
+ *
724
+ * @author Jeongho Nam - https://github.com/samchon
725
+ */
726
+ export function createAssertEquals<T>(): (input: unknown) => T;
727
+
728
+ /**
729
+ * @internal
730
+ */
731
+ export function createAssertEquals<T>(): (input: unknown) => T {
732
+ halt("createAssertEquals");
733
+ }
734
+ Object.assign(createAssertEquals, assertEquals);
735
+
736
+ /**
737
+ * Creates a reusable {@link assertGuardEquals} function.
738
+ *
739
+ * Note that, you've to declare the variable type of the factory function caller
740
+ * like below. If you don't declare the variable type, compilation error be thrown.
741
+ * This is the special rule of the TypeScript compiler.
742
+ *
743
+ * ```typescript
744
+ * // MUST DECLARE THE VARIABLE TYPE
745
+ * const func: typia.AssertionGuard<number> = typia.createAssertGuardEquals<number>();
746
+ *
747
+ * // IF NOT, COMPILATION ERROR BE OCCURED
748
+ * const func = typia.createAssertGuardEquals<number>();
749
+ * ```
750
+ *
751
+ * > *Assertions require every name in the call target to be declared with an*
752
+ * > *explicit type annotation.*
753
+ *
754
+ * @danger You must configure the generic argument `T`
755
+ * @returns Nothing until you configure the generic argument `T`
756
+ * @throws compile error
757
+ *
758
+ * @author Jeongho Nam - https://github.com/samchon
759
+ */
760
+ export function createAssertGuardEquals(): never;
761
+
762
+ /**
763
+ * Creates a reusable {@link assertGuardEquals} function.
764
+ *
765
+ * Note that, you've to declare the variable type of the factory function caller
766
+ * like below. If you don't declare the variable type, compilation error be thrown.
767
+ * This is the special rule of the TypeScript compiler.
768
+ *
769
+ * ```typescript
770
+ * // MUST DECLARE THE VARIABLE TYPE
771
+ * const func: typia.AssertionGuard<number> = typia.createAssertGuardEquals<number>();
772
+ *
773
+ * // IF NOT, COMPILATION ERROR BE OCCURED
774
+ * const func = typia.createAssertGuardEquals<number>();
775
+ * ```
776
+ *
777
+ * > *Assertions require every name in the call target to be declared with an*
778
+ * > *explicit type annotation.*
779
+ *
780
+ * @returns Nothing until you configure the generic argument `T`
781
+ * @throws compile error
782
+ *
783
+ * @author Jeongho Nam - https://github.com/samchon
784
+ */
785
+ export function createAssertGuardEquals<T>(): (
786
+ input: unknown,
787
+ ) => AssertionGuard<T>;
788
+
789
+ /**
790
+ * @internal
791
+ */
792
+ export function createAssertGuardEquals<T>(): (
793
+ input: unknown,
794
+ ) => AssertionGuard<T> {
795
+ halt("createAssertGuardEquals");
796
+ }
797
+ Object.assign(createAssertGuardEquals, assertGuardEquals);
798
+
799
+ /**
800
+ * Creates a reusable {@link equals} function.
801
+ *
802
+ * @danger You must configure the generic argument `T`
803
+ * @returns Nothing until you configure the generic argument `T`
804
+ * @throws compile error
805
+ *
806
+ * @author Jeongho Nam - https://github.com/samchon
807
+ */
808
+ export function createEquals(): never;
809
+
810
+ /**
811
+ * Creates a reusable {@link equals} function.
812
+ *
813
+ * @template T Type of the input value
814
+ * @returns A reusable `equals` function
815
+ *
816
+ * @author Jeongho Nam - https://github.com/samchon
817
+ */
818
+ export function createEquals<T>(): (input: unknown) => input is T;
819
+
820
+ /**
821
+ * @internal
822
+ */
823
+ export function createEquals<T>(): (input: unknown) => input is T {
824
+ halt("createEquals");
825
+ }
826
+ Object.assign(createEquals, equals);
827
+
828
+ /**
829
+ * Creates a reusable {@link validateEquals} function.
830
+ *
831
+ * @danger You must configure the generic argument `T`
832
+ * @returns Nothing until you configure the generic argument `T`
833
+ * @throws compile error
834
+ *
835
+ * @author Jeongho Nam - https://github.com/samchon
836
+ */
837
+ export function createValidateEquals(): never;
838
+
839
+ /**
840
+ * Creates a reusable {@link validateEquals} function.
841
+ *
842
+ * @template T Type of the input value
843
+ * @returns A reusable `validateEquals` function
844
+ *
845
+ * @author Jeongho Nam - https://github.com/samchon
846
+ */
847
+ export function createValidateEquals<T>(): (input: unknown) => IValidation<T>;
848
+
849
+ /**
850
+ * @internal
851
+ */
852
+ export function createValidateEquals(): (input: unknown) => IValidation {
853
+ halt("createValidateEquals");
854
+ }
855
+ Object.assign(createValidateEquals, validateEquals);
856
+
857
+ /**
858
+ * Creates a reusable {@link random} function.
859
+ *
860
+ * @danger You must configure the generic argument `T`
861
+ * @param generator Random data generator
862
+ * @returns Nothing until you configure the generic argument `T`
863
+ * @throws compile error
864
+ *
865
+ * @author Jeongho Nam - https://github.com/samchon
866
+ */
867
+ export function createRandom(generator?: Partial<IRandomGenerator>): never;
868
+
869
+ /**
870
+ * Creates a resuable {@link random} function.
871
+ *
872
+ * @template T Type of the input value
873
+ * @param generator Random data generator
874
+ * @returns A reusable `random` function
875
+ *
876
+ * @author Jeongho Nam - https://github.com/samchon
877
+ */
878
+ export function createRandom<T>(
879
+ generator?: Partial<IRandomGenerator>,
880
+ ): () => Resolved<T>;
881
+
882
+ /**
883
+ * @internal
884
+ */
885
+ export function createRandom(): never {
886
+ halt("createRandom");
887
+ }
888
+ Object.assign(createRandom, random);
889
+
890
+ /**
891
+ * @internal
892
+ */
893
+ function halt(name: string): never {
894
+ throw new Error(
895
+ `Error on typia.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`,
896
+ );
897
+ }