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