typia 5.3.12-dev.20240118 → 5.3.12-dev.20240119

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