typia 4.0.0-dev.20230502 → 4.0.0-dev.20230517

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 (663) hide show
  1. package/README.md +2 -9
  2. package/lib/executable/TypiaGenerateWizard.js +1 -1
  3. package/lib/executable/TypiaGenerateWizard.js.map +1 -1
  4. package/lib/executable/TypiaSetupWizard.js +1 -1
  5. package/lib/executable/TypiaSetupWizard.js.map +1 -1
  6. package/lib/executable/setup/ArgumentParser.js +1 -1
  7. package/lib/executable/setup/ArgumentParser.js.map +1 -1
  8. package/lib/executable/setup/CommandExecutor.js +1 -1
  9. package/lib/executable/setup/CommandExecutor.js.map +1 -1
  10. package/lib/executable/setup/FileRetriever.js +1 -1
  11. package/lib/executable/setup/FileRetriever.js.map +1 -1
  12. package/lib/executable/setup/PluginConfigurator.js +1 -1
  13. package/lib/executable/setup/PluginConfigurator.js.map +1 -1
  14. package/lib/factories/CommentFactory.d.ts +3 -3
  15. package/lib/factories/CommentFactory.js +1 -1
  16. package/lib/factories/CommentFactory.js.map +1 -1
  17. package/lib/factories/ExpressionFactory.d.ts +1 -1
  18. package/lib/factories/ExpressionFactory.js +10 -10
  19. package/lib/factories/ExpressionFactory.js.map +1 -1
  20. package/lib/factories/IdentifierFactory.d.ts +1 -1
  21. package/lib/factories/IdentifierFactory.js +14 -14
  22. package/lib/factories/IdentifierFactory.js.map +1 -1
  23. package/lib/factories/LiteralFactory.d.ts +1 -1
  24. package/lib/factories/LiteralFactory.js +9 -9
  25. package/lib/factories/LiteralFactory.js.map +1 -1
  26. package/lib/factories/MetadataCollection.d.ts +1 -1
  27. package/lib/factories/MetadataCollection.js +8 -7
  28. package/lib/factories/MetadataCollection.js.map +1 -1
  29. package/lib/factories/MetadataFactory.d.ts +1 -1
  30. package/lib/factories/MetadataFactory.js +1 -1
  31. package/lib/factories/MetadataFactory.js.map +1 -1
  32. package/lib/factories/MetadataTagFactory.d.ts +2 -2
  33. package/lib/factories/MetadataTagFactory.js +6 -6
  34. package/lib/factories/MetadataTagFactory.js.map +1 -1
  35. package/lib/factories/StatementFactory.d.ts +1 -1
  36. package/lib/factories/StatementFactory.js +7 -6
  37. package/lib/factories/StatementFactory.js.map +1 -1
  38. package/lib/factories/TemplateFactory.d.ts +1 -1
  39. package/lib/factories/TemplateFactory.js +10 -10
  40. package/lib/factories/TemplateFactory.js.map +1 -1
  41. package/lib/factories/TypeFactory.d.ts +1 -1
  42. package/lib/factories/TypeFactory.js +28 -22
  43. package/lib/factories/TypeFactory.js.map +1 -1
  44. package/lib/factories/ValueFactory.d.ts +1 -1
  45. package/lib/factories/ValueFactory.js +7 -7
  46. package/lib/factories/ValueFactory.js.map +1 -1
  47. package/lib/factories/internal/metadata/MetadataHelper.js +1 -1
  48. package/lib/factories/internal/metadata/MetadataHelper.js.map +1 -1
  49. package/lib/factories/internal/metadata/emplace_metadata_object.d.ts +1 -1
  50. package/lib/factories/internal/metadata/emplace_metadata_object.js +32 -23
  51. package/lib/factories/internal/metadata/emplace_metadata_object.js.map +1 -1
  52. package/lib/factories/internal/metadata/explore_metadata.d.ts +1 -1
  53. package/lib/factories/internal/metadata/iterate_metadata.d.ts +1 -1
  54. package/lib/factories/internal/metadata/iterate_metadata.js +2 -1
  55. package/lib/factories/internal/metadata/iterate_metadata.js.map +1 -1
  56. package/lib/factories/internal/metadata/iterate_metadata_array.d.ts +1 -1
  57. package/lib/factories/internal/metadata/iterate_metadata_array.js +6 -1
  58. package/lib/factories/internal/metadata/iterate_metadata_array.js.map +1 -1
  59. package/lib/factories/internal/metadata/iterate_metadata_atomic.d.ts +1 -1
  60. package/lib/factories/internal/metadata/iterate_metadata_atomic.js +10 -10
  61. package/lib/factories/internal/metadata/iterate_metadata_atomic.js.map +1 -1
  62. package/lib/factories/internal/metadata/iterate_metadata_coalesce.d.ts +1 -1
  63. package/lib/factories/internal/metadata/iterate_metadata_coalesce.js +8 -8
  64. package/lib/factories/internal/metadata/iterate_metadata_coalesce.js.map +1 -1
  65. package/lib/factories/internal/metadata/iterate_metadata_constant.d.ts +1 -1
  66. package/lib/factories/internal/metadata/iterate_metadata_constant.js +5 -4
  67. package/lib/factories/internal/metadata/iterate_metadata_constant.js.map +1 -1
  68. package/lib/factories/internal/metadata/iterate_metadata_map.d.ts +1 -1
  69. package/lib/factories/internal/metadata/iterate_metadata_map.js +1 -1
  70. package/lib/factories/internal/metadata/iterate_metadata_map.js.map +1 -1
  71. package/lib/factories/internal/metadata/iterate_metadata_native.d.ts +1 -1
  72. package/lib/factories/internal/metadata/iterate_metadata_native.js +1 -1
  73. package/lib/factories/internal/metadata/iterate_metadata_native.js.map +1 -1
  74. package/lib/factories/internal/metadata/iterate_metadata_object.d.ts +1 -1
  75. package/lib/factories/internal/metadata/iterate_metadata_object.js +6 -5
  76. package/lib/factories/internal/metadata/iterate_metadata_object.js.map +1 -1
  77. package/lib/factories/internal/metadata/iterate_metadata_resolve.d.ts +1 -1
  78. package/lib/factories/internal/metadata/iterate_metadata_set.d.ts +1 -1
  79. package/lib/factories/internal/metadata/iterate_metadata_set.js +1 -1
  80. package/lib/factories/internal/metadata/iterate_metadata_set.js.map +1 -1
  81. package/lib/factories/internal/metadata/iterate_metadata_template.d.ts +1 -1
  82. package/lib/factories/internal/metadata/iterate_metadata_template.js +3 -3
  83. package/lib/factories/internal/metadata/iterate_metadata_template.js.map +1 -1
  84. package/lib/factories/internal/metadata/iterate_metadata_tuple.d.ts +1 -1
  85. package/lib/factories/internal/metadata/iterate_metadata_tuple.js +3 -3
  86. package/lib/factories/internal/metadata/iterate_metadata_tuple.js.map +1 -1
  87. package/lib/factories/internal/metadata/iterate_metadata_union.d.ts +1 -1
  88. package/lib/factories/internal/metadata/iterate_metadata_union.js +5 -4
  89. package/lib/factories/internal/metadata/iterate_metadata_union.js.map +1 -1
  90. package/lib/functional/Namespace.js +1 -1
  91. package/lib/functional/Namespace.js.map +1 -1
  92. package/lib/metadata/IMetadataTag.d.ts +3 -3
  93. package/lib/metadata/Metadata.js +2 -3
  94. package/lib/metadata/Metadata.js.map +1 -1
  95. package/lib/metadata/MetadataObject.js +1 -2
  96. package/lib/metadata/MetadataObject.js.map +1 -1
  97. package/lib/module.d.ts +1 -5
  98. package/lib/module.js +1 -6
  99. package/lib/module.js.map +1 -1
  100. package/lib/programmers/ApplicationProgrammer.d.ts +1 -4
  101. package/lib/programmers/ApplicationProgrammer.js +3 -7
  102. package/lib/programmers/ApplicationProgrammer.js.map +1 -1
  103. package/lib/programmers/AssertCloneProgrammer.d.ts +1 -1
  104. package/lib/programmers/AssertCloneProgrammer.js +7 -7
  105. package/lib/programmers/AssertCloneProgrammer.js.map +1 -1
  106. package/lib/programmers/AssertParseProgrammer.d.ts +1 -1
  107. package/lib/programmers/AssertParseProgrammer.js +6 -6
  108. package/lib/programmers/AssertParseProgrammer.js.map +1 -1
  109. package/lib/programmers/AssertProgrammer.d.ts +1 -1
  110. package/lib/programmers/AssertProgrammer.js +38 -38
  111. package/lib/programmers/AssertProgrammer.js.map +1 -1
  112. package/lib/programmers/AssertPruneProgrammer.d.ts +1 -1
  113. package/lib/programmers/AssertPruneProgrammer.js +7 -7
  114. package/lib/programmers/AssertPruneProgrammer.js.map +1 -1
  115. package/lib/programmers/AssertStringifyProgrammer.d.ts +1 -1
  116. package/lib/programmers/AssertStringifyProgrammer.js +6 -6
  117. package/lib/programmers/AssertStringifyProgrammer.js.map +1 -1
  118. package/lib/programmers/CheckerProgrammer.d.ts +3 -2
  119. package/lib/programmers/CheckerProgrammer.js +26 -26
  120. package/lib/programmers/CheckerProgrammer.js.map +1 -1
  121. package/lib/programmers/CloneProgrammer.d.ts +1 -1
  122. package/lib/programmers/CloneProgrammer.js +21 -21
  123. package/lib/programmers/CloneProgrammer.js.map +1 -1
  124. package/lib/programmers/FeatureProgrammer.d.ts +4 -3
  125. package/lib/programmers/FeatureProgrammer.js +18 -18
  126. package/lib/programmers/FeatureProgrammer.js.map +1 -1
  127. package/lib/programmers/IsCloneProgrammer.d.ts +1 -1
  128. package/lib/programmers/IsCloneProgrammer.js +10 -10
  129. package/lib/programmers/IsCloneProgrammer.js.map +1 -1
  130. package/lib/programmers/IsParseProgrammer.d.ts +1 -1
  131. package/lib/programmers/IsParseProgrammer.js +6 -6
  132. package/lib/programmers/IsParseProgrammer.js.map +1 -1
  133. package/lib/programmers/IsProgrammer.d.ts +3 -3
  134. package/lib/programmers/IsProgrammer.js +25 -22
  135. package/lib/programmers/IsProgrammer.js.map +1 -1
  136. package/lib/programmers/IsPruneProgrammer.d.ts +1 -1
  137. package/lib/programmers/IsPruneProgrammer.js +7 -7
  138. package/lib/programmers/IsPruneProgrammer.js.map +1 -1
  139. package/lib/programmers/IsStringifyProgrammer.d.ts +1 -1
  140. package/lib/programmers/IsStringifyProgrammer.js +8 -8
  141. package/lib/programmers/IsStringifyProgrammer.js.map +1 -1
  142. package/lib/programmers/LiteralsProgrammer.d.ts +1 -1
  143. package/lib/programmers/LiteralsProgrammer.js +9 -9
  144. package/lib/programmers/LiteralsProgrammer.js.map +1 -1
  145. package/lib/programmers/PruneProgrammer.d.ts +1 -1
  146. package/lib/programmers/PruneProgrammer.js +20 -20
  147. package/lib/programmers/PruneProgrammer.js.map +1 -1
  148. package/lib/programmers/RandomProgrammer.d.ts +1 -1
  149. package/lib/programmers/RandomProgrammer.js +38 -38
  150. package/lib/programmers/RandomProgrammer.js.map +1 -1
  151. package/lib/programmers/StringifyProgrammer.d.ts +1 -1
  152. package/lib/programmers/StringifyProgrammer.js +44 -44
  153. package/lib/programmers/StringifyProgrammer.js.map +1 -1
  154. package/lib/programmers/TypiaProgrammer.js +16 -7
  155. package/lib/programmers/TypiaProgrammer.js.map +1 -1
  156. package/lib/programmers/ValidateCloneProgrammer.d.ts +1 -1
  157. package/lib/programmers/ValidateCloneProgrammer.js +7 -7
  158. package/lib/programmers/ValidateCloneProgrammer.js.map +1 -1
  159. package/lib/programmers/ValidateParseProgrammer.d.ts +1 -1
  160. package/lib/programmers/ValidateParseProgrammer.js +7 -7
  161. package/lib/programmers/ValidateParseProgrammer.js.map +1 -1
  162. package/lib/programmers/ValidateProgrammer.d.ts +1 -1
  163. package/lib/programmers/ValidateProgrammer.js +44 -44
  164. package/lib/programmers/ValidateProgrammer.js.map +1 -1
  165. package/lib/programmers/ValidatePruneProgrammer.d.ts +1 -1
  166. package/lib/programmers/ValidatePruneProgrammer.js +7 -7
  167. package/lib/programmers/ValidatePruneProgrammer.js.map +1 -1
  168. package/lib/programmers/ValidateStringifyProgrammer.d.ts +1 -1
  169. package/lib/programmers/ValidateStringifyProgrammer.js +8 -8
  170. package/lib/programmers/ValidateStringifyProgrammer.js.map +1 -1
  171. package/lib/programmers/helpers/AtomicPredicator.js +1 -1
  172. package/lib/programmers/helpers/AtomicPredicator.js.map +1 -1
  173. package/lib/programmers/helpers/CloneJoiner.d.ts +1 -1
  174. package/lib/programmers/helpers/CloneJoiner.js +23 -23
  175. package/lib/programmers/helpers/CloneJoiner.js.map +1 -1
  176. package/lib/programmers/helpers/FunctionImporeter.d.ts +1 -1
  177. package/lib/programmers/helpers/FunctionImporeter.js +3 -3
  178. package/lib/programmers/helpers/FunctionImporeter.js.map +1 -1
  179. package/lib/programmers/helpers/ICheckEntry.d.ts +1 -1
  180. package/lib/programmers/helpers/IExpressionEntry.d.ts +1 -1
  181. package/lib/programmers/helpers/OptionPredicator.js +1 -1
  182. package/lib/programmers/helpers/OptionPredicator.js.map +1 -1
  183. package/lib/programmers/helpers/PruneJoiner.d.ts +1 -1
  184. package/lib/programmers/helpers/PruneJoiner.js +20 -20
  185. package/lib/programmers/helpers/PruneJoiner.js.map +1 -1
  186. package/lib/programmers/helpers/RandomJoiner.d.ts +1 -1
  187. package/lib/programmers/helpers/RandomJoiner.js +19 -19
  188. package/lib/programmers/helpers/RandomJoiner.js.map +1 -1
  189. package/lib/programmers/helpers/RandomRanger.d.ts +1 -1
  190. package/lib/programmers/helpers/RandomRanger.js +8 -8
  191. package/lib/programmers/helpers/RandomRanger.js.map +1 -1
  192. package/lib/programmers/helpers/StringifyJoinder.d.ts +1 -1
  193. package/lib/programmers/helpers/StringifyJoinder.js +15 -15
  194. package/lib/programmers/helpers/StringifyJoinder.js.map +1 -1
  195. package/lib/programmers/helpers/StringifyPredicator.js +1 -1
  196. package/lib/programmers/helpers/StringifyPredicator.js.map +1 -1
  197. package/lib/programmers/helpers/UnionExplorer.d.ts +9 -8
  198. package/lib/programmers/helpers/UnionExplorer.js +11 -11
  199. package/lib/programmers/helpers/UnionExplorer.js.map +1 -1
  200. package/lib/programmers/helpers/UnionPredicator.js +1 -1
  201. package/lib/programmers/helpers/UnionPredicator.js.map +1 -1
  202. package/lib/programmers/helpers/disable_function_importer_declare.d.ts +2 -0
  203. package/lib/programmers/helpers/disable_function_importer_declare.js +15 -0
  204. package/lib/programmers/helpers/disable_function_importer_declare.js.map +1 -0
  205. package/lib/programmers/internal/JSON_SCHEMA_PREFIX.d.ts +1 -0
  206. package/lib/programmers/internal/JSON_SCHEMA_PREFIX.js +5 -0
  207. package/lib/programmers/internal/JSON_SCHEMA_PREFIX.js.map +1 -0
  208. package/lib/programmers/internal/application_array.js +6 -5
  209. package/lib/programmers/internal/application_array.js.map +1 -1
  210. package/lib/programmers/internal/application_boolean.js +1 -1
  211. package/lib/programmers/internal/application_boolean.js.map +1 -1
  212. package/lib/programmers/internal/application_constant.js +1 -1
  213. package/lib/programmers/internal/application_constant.js.map +1 -1
  214. package/lib/programmers/internal/application_default.js +3 -3
  215. package/lib/programmers/internal/application_default.js.map +1 -1
  216. package/lib/programmers/internal/application_native.js +15 -11
  217. package/lib/programmers/internal/application_native.js.map +1 -1
  218. package/lib/programmers/internal/application_number.js +8 -7
  219. package/lib/programmers/internal/application_number.js.map +1 -1
  220. package/lib/programmers/internal/application_object.js +18 -13
  221. package/lib/programmers/internal/application_object.js.map +1 -1
  222. package/lib/programmers/internal/application_schema.js +43 -63
  223. package/lib/programmers/internal/application_schema.js.map +1 -1
  224. package/lib/programmers/internal/application_string.js +29 -27
  225. package/lib/programmers/internal/application_string.js.map +1 -1
  226. package/lib/programmers/internal/application_templates.js +1 -1
  227. package/lib/programmers/internal/application_templates.js.map +1 -1
  228. package/lib/programmers/internal/application_tuple.js +3 -3
  229. package/lib/programmers/internal/application_tuple.js.map +1 -1
  230. package/lib/programmers/internal/check_array_length.js +4 -4
  231. package/lib/programmers/internal/check_array_length.js.map +1 -1
  232. package/lib/programmers/internal/check_bigint.js +11 -11
  233. package/lib/programmers/internal/check_bigint.js.map +1 -1
  234. package/lib/programmers/internal/check_custom.js +5 -5
  235. package/lib/programmers/internal/check_custom.js.map +1 -1
  236. package/lib/programmers/internal/check_dynamic_properties.js +23 -23
  237. package/lib/programmers/internal/check_dynamic_properties.js.map +1 -1
  238. package/lib/programmers/internal/check_everything.js +4 -4
  239. package/lib/programmers/internal/check_everything.js.map +1 -1
  240. package/lib/programmers/internal/check_native.js +2 -2
  241. package/lib/programmers/internal/check_native.js.map +1 -1
  242. package/lib/programmers/internal/check_number.js +15 -15
  243. package/lib/programmers/internal/check_number.js.map +1 -1
  244. package/lib/programmers/internal/check_object.js +2 -2
  245. package/lib/programmers/internal/check_object.js.map +1 -1
  246. package/lib/programmers/internal/check_string.js +2 -2
  247. package/lib/programmers/internal/check_string.js.map +1 -1
  248. package/lib/programmers/internal/check_string_tags.js +6 -6
  249. package/lib/programmers/internal/check_string_tags.js.map +1 -1
  250. package/lib/programmers/internal/check_template.js +5 -5
  251. package/lib/programmers/internal/check_template.js.map +1 -1
  252. package/lib/programmers/internal/check_union_array_like.js +18 -18
  253. package/lib/programmers/internal/check_union_array_like.js.map +1 -1
  254. package/lib/programmers/internal/check_union_tuple.js.map +1 -1
  255. package/lib/programmers/internal/decode_union_object.js +4 -4
  256. package/lib/programmers/internal/decode_union_object.js.map +1 -1
  257. package/lib/programmers/internal/feature_object_entries.js +4 -4
  258. package/lib/programmers/internal/feature_object_entries.js.map +1 -1
  259. package/lib/programmers/internal/prune_object_properties.js +9 -9
  260. package/lib/programmers/internal/prune_object_properties.js.map +1 -1
  261. package/lib/programmers/internal/random_custom.js +2 -2
  262. package/lib/programmers/internal/random_custom.js.map +1 -1
  263. package/lib/programmers/internal/stringify_dynamic_properties.js +20 -20
  264. package/lib/programmers/internal/stringify_dynamic_properties.js.map +1 -1
  265. package/lib/programmers/internal/stringify_native.js +2 -2
  266. package/lib/programmers/internal/stringify_native.js.map +1 -1
  267. package/lib/programmers/internal/stringify_regular_properties.js +8 -8
  268. package/lib/programmers/internal/stringify_regular_properties.js.map +1 -1
  269. package/lib/schemas/IJsonApplication.d.ts +3 -0
  270. package/lib/schemas/IJsonComponents.d.ts +7 -1
  271. package/lib/schemas/IJsonSchema.d.ts +4 -1
  272. package/lib/transform.d.ts +3 -4
  273. package/lib/transform.js +18 -15
  274. package/lib/transform.js.map +1 -1
  275. package/lib/transformers/CallExpressionTransformer.d.ts +1 -1
  276. package/lib/transformers/CallExpressionTransformer.js +8 -9
  277. package/lib/transformers/CallExpressionTransformer.js.map +1 -1
  278. package/lib/transformers/FileTransformer.d.ts +1 -1
  279. package/lib/transformers/FileTransformer.js +7 -6
  280. package/lib/transformers/FileTransformer.js.map +1 -1
  281. package/lib/transformers/IProject.d.ts +1 -1
  282. package/lib/transformers/ImportTransformer.d.ts +1 -1
  283. package/lib/transformers/ImportTransformer.js +8 -7
  284. package/lib/transformers/ImportTransformer.js.map +1 -1
  285. package/lib/transformers/NodeTransformer.d.ts +1 -1
  286. package/lib/transformers/NodeTransformer.js +3 -3
  287. package/lib/transformers/NodeTransformer.js.map +1 -1
  288. package/lib/transformers/features/miscellaneous/ApplicationTransformer.d.ts +1 -1
  289. package/lib/transformers/features/miscellaneous/ApplicationTransformer.js +9 -12
  290. package/lib/transformers/features/miscellaneous/ApplicationTransformer.js.map +1 -1
  291. package/lib/transformers/features/miscellaneous/AssertCloneTransformer.d.ts +1 -1
  292. package/lib/transformers/features/miscellaneous/AssertCloneTransformer.js +1 -1
  293. package/lib/transformers/features/miscellaneous/AssertCloneTransformer.js.map +1 -1
  294. package/lib/transformers/features/miscellaneous/AssertPruneTransformer.d.ts +1 -1
  295. package/lib/transformers/features/miscellaneous/AssertPruneTransformer.js +1 -1
  296. package/lib/transformers/features/miscellaneous/AssertPruneTransformer.js.map +1 -1
  297. package/lib/transformers/features/miscellaneous/CloneTransformer.d.ts +1 -1
  298. package/lib/transformers/features/miscellaneous/CloneTransformer.js +1 -1
  299. package/lib/transformers/features/miscellaneous/CloneTransformer.js.map +1 -1
  300. package/lib/transformers/features/miscellaneous/CreateAssertCloneTransformer.d.ts +1 -1
  301. package/lib/transformers/features/miscellaneous/CreateAssertCloneTransformer.js +1 -1
  302. package/lib/transformers/features/miscellaneous/CreateAssertCloneTransformer.js.map +1 -1
  303. package/lib/transformers/features/miscellaneous/CreateAssertPruneTransformer.d.ts +1 -1
  304. package/lib/transformers/features/miscellaneous/CreateAssertPruneTransformer.js +1 -1
  305. package/lib/transformers/features/miscellaneous/CreateAssertPruneTransformer.js.map +1 -1
  306. package/lib/transformers/features/miscellaneous/CreateCloneTransformer.d.ts +1 -1
  307. package/lib/transformers/features/miscellaneous/CreateCloneTransformer.js +1 -1
  308. package/lib/transformers/features/miscellaneous/CreateCloneTransformer.js.map +1 -1
  309. package/lib/transformers/features/miscellaneous/CreateIsCloneTransformer.d.ts +1 -1
  310. package/lib/transformers/features/miscellaneous/CreateIsCloneTransformer.js +1 -1
  311. package/lib/transformers/features/miscellaneous/CreateIsCloneTransformer.js.map +1 -1
  312. package/lib/transformers/features/miscellaneous/CreateIsPruneTransformer.d.ts +1 -1
  313. package/lib/transformers/features/miscellaneous/CreateIsPruneTransformer.js +1 -1
  314. package/lib/transformers/features/miscellaneous/CreateIsPruneTransformer.js.map +1 -1
  315. package/lib/transformers/features/miscellaneous/CreatePruneTransformer.d.ts +1 -1
  316. package/lib/transformers/features/miscellaneous/CreatePruneTransformer.js +1 -1
  317. package/lib/transformers/features/miscellaneous/CreatePruneTransformer.js.map +1 -1
  318. package/lib/transformers/features/miscellaneous/CreateRandomTransformer.d.ts +1 -1
  319. package/lib/transformers/features/miscellaneous/CreateRandomTransformer.js +5 -3
  320. package/lib/transformers/features/miscellaneous/CreateRandomTransformer.js.map +1 -1
  321. package/lib/transformers/features/miscellaneous/CreateValidateCloneTransformer.d.ts +1 -1
  322. package/lib/transformers/features/miscellaneous/CreateValidateCloneTransformer.js +1 -1
  323. package/lib/transformers/features/miscellaneous/CreateValidateCloneTransformer.js.map +1 -1
  324. package/lib/transformers/features/miscellaneous/CreateValidatePruneTransformer.d.ts +1 -1
  325. package/lib/transformers/features/miscellaneous/CreateValidatePruneTransformer.js +1 -1
  326. package/lib/transformers/features/miscellaneous/CreateValidatePruneTransformer.js.map +1 -1
  327. package/lib/transformers/features/miscellaneous/IsCloneTransformer.d.ts +1 -1
  328. package/lib/transformers/features/miscellaneous/IsCloneTransformer.js +1 -1
  329. package/lib/transformers/features/miscellaneous/IsCloneTransformer.js.map +1 -1
  330. package/lib/transformers/features/miscellaneous/IsPruneTransformer.d.ts +1 -1
  331. package/lib/transformers/features/miscellaneous/IsPruneTransformer.js +1 -1
  332. package/lib/transformers/features/miscellaneous/IsPruneTransformer.js.map +1 -1
  333. package/lib/transformers/features/miscellaneous/LiteralsTransformer.d.ts +1 -1
  334. package/lib/transformers/features/miscellaneous/LiteralsTransformer.js +3 -2
  335. package/lib/transformers/features/miscellaneous/LiteralsTransformer.js.map +1 -1
  336. package/lib/transformers/features/miscellaneous/MetadataTransformer.d.ts +1 -1
  337. package/lib/transformers/features/miscellaneous/MetadataTransformer.js +6 -5
  338. package/lib/transformers/features/miscellaneous/MetadataTransformer.js.map +1 -1
  339. package/lib/transformers/features/miscellaneous/PruneTransformer.d.ts +1 -1
  340. package/lib/transformers/features/miscellaneous/PruneTransformer.js +1 -1
  341. package/lib/transformers/features/miscellaneous/PruneTransformer.js.map +1 -1
  342. package/lib/transformers/features/miscellaneous/RandomTransformer.d.ts +1 -1
  343. package/lib/transformers/features/miscellaneous/RandomTransformer.js +6 -4
  344. package/lib/transformers/features/miscellaneous/RandomTransformer.js.map +1 -1
  345. package/lib/transformers/features/miscellaneous/ValidateCloneTransformer.d.ts +1 -1
  346. package/lib/transformers/features/miscellaneous/ValidateCloneTransformer.js +1 -1
  347. package/lib/transformers/features/miscellaneous/ValidateCloneTransformer.js.map +1 -1
  348. package/lib/transformers/features/miscellaneous/ValidatePruneTransformer.d.ts +1 -1
  349. package/lib/transformers/features/miscellaneous/ValidatePruneTransformer.js +1 -1
  350. package/lib/transformers/features/miscellaneous/ValidatePruneTransformer.js.map +1 -1
  351. package/lib/transformers/features/parsers/AssertParseTransformer.d.ts +1 -1
  352. package/lib/transformers/features/parsers/AssertParseTransformer.js +1 -1
  353. package/lib/transformers/features/parsers/AssertParseTransformer.js.map +1 -1
  354. package/lib/transformers/features/parsers/CreateAssertParseTransformer.d.ts +1 -1
  355. package/lib/transformers/features/parsers/CreateAssertParseTransformer.js +1 -1
  356. package/lib/transformers/features/parsers/CreateAssertParseTransformer.js.map +1 -1
  357. package/lib/transformers/features/parsers/CreateIsParseTransformer.d.ts +1 -1
  358. package/lib/transformers/features/parsers/CreateIsParseTransformer.js +1 -1
  359. package/lib/transformers/features/parsers/CreateIsParseTransformer.js.map +1 -1
  360. package/lib/transformers/features/parsers/CreateValidateParseTransformer.d.ts +1 -1
  361. package/lib/transformers/features/parsers/CreateValidateParseTransformer.js +1 -1
  362. package/lib/transformers/features/parsers/CreateValidateParseTransformer.js.map +1 -1
  363. package/lib/transformers/features/parsers/IsParseTransformer.d.ts +1 -1
  364. package/lib/transformers/features/parsers/IsParseTransformer.js +1 -1
  365. package/lib/transformers/features/parsers/IsParseTransformer.js.map +1 -1
  366. package/lib/transformers/features/parsers/ValidateParseTransformer.d.ts +1 -1
  367. package/lib/transformers/features/parsers/ValidateParseTransformer.js +1 -1
  368. package/lib/transformers/features/parsers/ValidateParseTransformer.js.map +1 -1
  369. package/lib/transformers/features/stringifiers/AssertStringifyTransformer.d.ts +1 -1
  370. package/lib/transformers/features/stringifiers/AssertStringifyTransformer.js +1 -1
  371. package/lib/transformers/features/stringifiers/AssertStringifyTransformer.js.map +1 -1
  372. package/lib/transformers/features/stringifiers/CreateAssertStringifyTransformer.d.ts +1 -1
  373. package/lib/transformers/features/stringifiers/CreateAssertStringifyTransformer.js +1 -1
  374. package/lib/transformers/features/stringifiers/CreateAssertStringifyTransformer.js.map +1 -1
  375. package/lib/transformers/features/stringifiers/CreateIsStringifyTransformer.d.ts +1 -1
  376. package/lib/transformers/features/stringifiers/CreateIsStringifyTransformer.js +1 -1
  377. package/lib/transformers/features/stringifiers/CreateIsStringifyTransformer.js.map +1 -1
  378. package/lib/transformers/features/stringifiers/CreateStringifyTransformer.d.ts +1 -1
  379. package/lib/transformers/features/stringifiers/CreateStringifyTransformer.js +1 -1
  380. package/lib/transformers/features/stringifiers/CreateStringifyTransformer.js.map +1 -1
  381. package/lib/transformers/features/stringifiers/CreateValidateStringifyProgrammer.d.ts +1 -1
  382. package/lib/transformers/features/stringifiers/CreateValidateStringifyProgrammer.js +1 -1
  383. package/lib/transformers/features/stringifiers/CreateValidateStringifyProgrammer.js.map +1 -1
  384. package/lib/transformers/features/stringifiers/IsStringifyTransformer.d.ts +1 -1
  385. package/lib/transformers/features/stringifiers/IsStringifyTransformer.js +1 -1
  386. package/lib/transformers/features/stringifiers/IsStringifyTransformer.js.map +1 -1
  387. package/lib/transformers/features/stringifiers/StringifyTransformer.d.ts +1 -1
  388. package/lib/transformers/features/stringifiers/StringifyTransformer.js +1 -1
  389. package/lib/transformers/features/stringifiers/StringifyTransformer.js.map +1 -1
  390. package/lib/transformers/features/stringifiers/ValidateStringifyTransformer.d.ts +1 -1
  391. package/lib/transformers/features/stringifiers/ValidateStringifyTransformer.js +1 -1
  392. package/lib/transformers/features/stringifiers/ValidateStringifyTransformer.js.map +1 -1
  393. package/lib/transformers/features/validators/AssertTransformer.d.ts +1 -1
  394. package/lib/transformers/features/validators/AssertTransformer.js +1 -1
  395. package/lib/transformers/features/validators/AssertTransformer.js.map +1 -1
  396. package/lib/transformers/features/validators/CreateAssertTransformer.d.ts +1 -1
  397. package/lib/transformers/features/validators/CreateAssertTransformer.js +1 -1
  398. package/lib/transformers/features/validators/CreateAssertTransformer.js.map +1 -1
  399. package/lib/transformers/features/validators/CreateIsTransformer.d.ts +1 -1
  400. package/lib/transformers/features/validators/CreateIsTransformer.js +1 -1
  401. package/lib/transformers/features/validators/CreateIsTransformer.js.map +1 -1
  402. package/lib/transformers/features/validators/CreateValidateTransformer.d.ts +1 -1
  403. package/lib/transformers/features/validators/CreateValidateTransformer.js +1 -1
  404. package/lib/transformers/features/validators/CreateValidateTransformer.js.map +1 -1
  405. package/lib/transformers/features/validators/IsTransformer.d.ts +1 -1
  406. package/lib/transformers/features/validators/IsTransformer.js +1 -1
  407. package/lib/transformers/features/validators/IsTransformer.js.map +1 -1
  408. package/lib/transformers/features/validators/ValidateTransformer.d.ts +1 -1
  409. package/lib/transformers/features/validators/ValidateTransformer.js +1 -1
  410. package/lib/transformers/features/validators/ValidateTransformer.js.map +1 -1
  411. package/lib/transformers/internal/GenericTransformer.d.ts +1 -1
  412. package/lib/transformers/internal/GenericTransformer.js +10 -8
  413. package/lib/transformers/internal/GenericTransformer.js.map +1 -1
  414. package/lib/utils/ArrayUtil.js +1 -1
  415. package/lib/utils/ArrayUtil.js.map +1 -1
  416. package/lib/utils/Escaper.js +1 -1
  417. package/lib/utils/Escaper.js.map +1 -1
  418. package/lib/utils/MapUtil.js +1 -1
  419. package/lib/utils/MapUtil.js.map +1 -1
  420. package/lib/utils/PatternUtil.js +1 -1
  421. package/lib/utils/PatternUtil.js.map +1 -1
  422. package/lib/utils/RandomGenerator.js +1 -1
  423. package/lib/utils/RandomGenerator.js.map +1 -1
  424. package/lib/utils/TsNodeUtil.d.ts +5 -0
  425. package/lib/utils/TsNodeUtil.js +19 -0
  426. package/lib/utils/TsNodeUtil.js.map +1 -0
  427. package/lib/utils/TsSymbolUtil.d.ts +6 -0
  428. package/lib/utils/TsSymbolUtil.js +43 -0
  429. package/lib/utils/TsSymbolUtil.js.map +1 -0
  430. package/lib/utils/TsTypeUtil.d.ts +9 -0
  431. package/lib/utils/TsTypeUtil.js +32 -0
  432. package/lib/utils/TsTypeUtil.js.map +1 -0
  433. package/package.json +129 -131
  434. package/src/factories/CommentFactory.ts +14 -14
  435. package/src/factories/ExpressionFactory.ts +70 -70
  436. package/src/factories/IdentifierFactory.ts +63 -63
  437. package/src/factories/LiteralFactory.ts +39 -39
  438. package/src/factories/MetadataCollection.ts +121 -121
  439. package/src/factories/MetadataFactory.ts +62 -62
  440. package/src/factories/MetadataTagFactory.ts +295 -297
  441. package/src/factories/StatementFactory.ts +25 -24
  442. package/src/factories/TemplateFactory.ts +58 -58
  443. package/src/factories/TypeFactory.ts +136 -124
  444. package/src/factories/ValueFactory.ts +12 -12
  445. package/src/factories/internal/metadata/emplace_metadata_object.ts +148 -143
  446. package/src/factories/internal/metadata/explore_metadata.ts +92 -92
  447. package/src/factories/internal/metadata/iterate_metadata.ts +69 -67
  448. package/src/factories/internal/metadata/iterate_metadata_array.ts +30 -29
  449. package/src/factories/internal/metadata/iterate_metadata_atomic.ts +59 -59
  450. package/src/factories/internal/metadata/iterate_metadata_coalesce.ts +33 -33
  451. package/src/factories/internal/metadata/iterate_metadata_constant.ts +59 -58
  452. package/src/factories/internal/metadata/iterate_metadata_map.ts +41 -41
  453. package/src/factories/internal/metadata/iterate_metadata_native.ts +219 -219
  454. package/src/factories/internal/metadata/iterate_metadata_object.ts +49 -48
  455. package/src/factories/internal/metadata/iterate_metadata_resolve.ts +27 -27
  456. package/src/factories/internal/metadata/iterate_metadata_set.ts +33 -33
  457. package/src/factories/internal/metadata/iterate_metadata_template.ts +38 -38
  458. package/src/factories/internal/metadata/iterate_metadata_tuple.ts +48 -48
  459. package/src/factories/internal/metadata/iterate_metadata_union.ts +59 -57
  460. package/src/metadata/IMetadataTag.ts +3 -11
  461. package/src/metadata/Metadata.ts +1 -5
  462. package/src/module.ts +2038 -2054
  463. package/src/programmers/ApplicationProgrammer.ts +56 -62
  464. package/src/programmers/AssertCloneProgrammer.ts +79 -79
  465. package/src/programmers/AssertParseProgrammer.ts +74 -74
  466. package/src/programmers/AssertProgrammer.ts +285 -285
  467. package/src/programmers/AssertPruneProgrammer.ts +76 -76
  468. package/src/programmers/AssertStringifyProgrammer.ts +74 -74
  469. package/src/programmers/CheckerProgrammer.ts +902 -901
  470. package/src/programmers/CloneProgrammer.ts +389 -389
  471. package/src/programmers/FeatureProgrammer.ts +501 -500
  472. package/src/programmers/IsCloneProgrammer.ts +86 -86
  473. package/src/programmers/IsParseProgrammer.ts +80 -80
  474. package/src/programmers/IsProgrammer.ts +216 -212
  475. package/src/programmers/IsPruneProgrammer.ts +81 -81
  476. package/src/programmers/IsStringifyProgrammer.ts +84 -84
  477. package/src/programmers/LiteralsProgrammer.ts +65 -65
  478. package/src/programmers/PruneProgrammer.ts +347 -347
  479. package/src/programmers/RandomProgrammer.ts +423 -423
  480. package/src/programmers/StringifyProgrammer.ts +798 -798
  481. package/src/programmers/TypiaProgrammer.ts +136 -129
  482. package/src/programmers/ValidateCloneProgrammer.ts +93 -93
  483. package/src/programmers/ValidateParseProgrammer.ts +78 -78
  484. package/src/programmers/ValidateProgrammer.ts +316 -316
  485. package/src/programmers/ValidatePruneProgrammer.ts +86 -86
  486. package/src/programmers/ValidateStringifyProgrammer.ts +92 -92
  487. package/src/programmers/helpers/CloneJoiner.ts +131 -131
  488. package/src/programmers/helpers/FunctionImporeter.ts +54 -54
  489. package/src/programmers/helpers/ICheckEntry.ts +12 -12
  490. package/src/programmers/helpers/IExpressionEntry.ts +12 -12
  491. package/src/programmers/helpers/PruneJoiner.ts +144 -144
  492. package/src/programmers/helpers/RandomJoiner.ts +161 -161
  493. package/src/programmers/helpers/RandomRanger.ts +216 -216
  494. package/src/programmers/helpers/StringifyJoinder.ts +113 -113
  495. package/src/programmers/helpers/UnionExplorer.ts +276 -275
  496. package/src/programmers/helpers/disable_function_importer_declare.ts +21 -0
  497. package/src/programmers/internal/JSON_SCHEMA_PREFIX.ts +1 -0
  498. package/src/programmers/internal/application_array.ts +32 -36
  499. package/src/programmers/internal/application_boolean.ts +15 -17
  500. package/src/programmers/internal/application_constant.ts +26 -30
  501. package/src/programmers/internal/application_default.ts +17 -17
  502. package/src/programmers/internal/application_native.ts +36 -32
  503. package/src/programmers/internal/application_number.ts +71 -73
  504. package/src/programmers/internal/application_object.ts +162 -155
  505. package/src/programmers/internal/application_schema.ts +198 -213
  506. package/src/programmers/internal/application_string.ts +44 -45
  507. package/src/programmers/internal/application_templates.ts +25 -26
  508. package/src/programmers/internal/application_tuple.ts +27 -31
  509. package/src/programmers/internal/check_array.ts +30 -30
  510. package/src/programmers/internal/check_array_length.ts +35 -35
  511. package/src/programmers/internal/check_bigint.ts +82 -82
  512. package/src/programmers/internal/check_custom.ts +31 -31
  513. package/src/programmers/internal/check_dynamic_properties.ts +194 -194
  514. package/src/programmers/internal/check_everything.ts +28 -28
  515. package/src/programmers/internal/check_native.ts +21 -21
  516. package/src/programmers/internal/check_number.ts +177 -177
  517. package/src/programmers/internal/check_object.ts +55 -55
  518. package/src/programmers/internal/check_string.ts +26 -25
  519. package/src/programmers/internal/check_string_tags.ts +67 -67
  520. package/src/programmers/internal/check_template.ts +56 -56
  521. package/src/programmers/internal/check_union_array_like.ts +272 -271
  522. package/src/programmers/internal/check_union_tuple.ts +34 -33
  523. package/src/programmers/internal/decode_union_object.ts +73 -73
  524. package/src/programmers/internal/feature_object_entries.ts +63 -63
  525. package/src/programmers/internal/prune_object_properties.ts +60 -60
  526. package/src/programmers/internal/random_custom.ts +29 -29
  527. package/src/programmers/internal/stringify_dynamic_properties.ts +167 -167
  528. package/src/programmers/internal/stringify_native.ts +7 -7
  529. package/src/programmers/internal/stringify_regular_properties.ts +83 -83
  530. package/src/schemas/IJsonApplication.ts +13 -9
  531. package/src/schemas/IJsonComponents.ts +33 -26
  532. package/src/schemas/IJsonSchema.ts +134 -130
  533. package/src/transform.ts +17 -13
  534. package/src/transformers/CallExpressionTransformer.ts +180 -184
  535. package/src/transformers/FileTransformer.ts +50 -47
  536. package/src/transformers/IProject.ts +11 -11
  537. package/src/transformers/ImportTransformer.ts +68 -66
  538. package/src/transformers/NodeTransformer.ts +13 -13
  539. package/src/transformers/features/miscellaneous/ApplicationTransformer.ts +105 -112
  540. package/src/transformers/features/miscellaneous/CreateRandomTransformer.ts +43 -39
  541. package/src/transformers/features/miscellaneous/LiteralsTransformer.ts +31 -28
  542. package/src/transformers/features/miscellaneous/MetadataTransformer.ts +54 -52
  543. package/src/transformers/features/miscellaneous/RandomTransformer.ts +46 -42
  544. package/src/transformers/internal/GenericTransformer.ts +103 -97
  545. package/src/utils/TsNodeUtil.ts +12 -0
  546. package/src/utils/TsSymbolUtil.ts +41 -0
  547. package/src/utils/TsTypeUtil.ts +30 -0
  548. package/lib/factories/ProtocolFactory.d.ts +0 -8
  549. package/lib/factories/ProtocolFactory.js +0 -112
  550. package/lib/factories/ProtocolFactory.js.map +0 -1
  551. package/lib/factories/internal/protocols/ProtocolMetadataUtil.d.ts +0 -16
  552. package/lib/factories/internal/protocols/ProtocolMetadataUtil.js +0 -160
  553. package/lib/factories/internal/protocols/ProtocolMetadataUtil.js.map +0 -1
  554. package/lib/factories/internal/protocols/emplace_protocol_object.d.ts +0 -3
  555. package/lib/factories/internal/protocols/emplace_protocol_object.js +0 -47
  556. package/lib/factories/internal/protocols/emplace_protocol_object.js.map +0 -1
  557. package/lib/factories/internal/protocols/emplace_protocol_property.d.ts +0 -4
  558. package/lib/factories/internal/protocols/emplace_protocol_property.js +0 -20
  559. package/lib/factories/internal/protocols/emplace_protocol_property.js.map +0 -1
  560. package/lib/factories/internal/protocols/iterate_protocol_atomic.d.ts +0 -3
  561. package/lib/factories/internal/protocols/iterate_protocol_atomic.js +0 -69
  562. package/lib/factories/internal/protocols/iterate_protocol_atomic.js.map +0 -1
  563. package/lib/factories/internal/protocols/iterate_protocol_constant.d.ts +0 -2
  564. package/lib/factories/internal/protocols/iterate_protocol_constant.js +0 -30
  565. package/lib/factories/internal/protocols/iterate_protocol_constant.js.map +0 -1
  566. package/lib/factories/internal/protocols/iterate_protocol_main.d.ts +0 -3
  567. package/lib/factories/internal/protocols/iterate_protocol_main.js +0 -17
  568. package/lib/factories/internal/protocols/iterate_protocol_main.js.map +0 -1
  569. package/lib/factories/internal/protocols/iterate_protocol_map.d.ts +0 -4
  570. package/lib/factories/internal/protocols/iterate_protocol_map.js +0 -75
  571. package/lib/factories/internal/protocols/iterate_protocol_map.js.map +0 -1
  572. package/lib/factories/internal/protocols/iterate_protocol_metadata.d.ts +0 -5
  573. package/lib/factories/internal/protocols/iterate_protocol_metadata.js +0 -190
  574. package/lib/factories/internal/protocols/iterate_protocol_metadata.js.map +0 -1
  575. package/lib/factories/internal/protocols/iterate_protocol_native.d.ts +0 -2
  576. package/lib/factories/internal/protocols/iterate_protocol_native.js +0 -33
  577. package/lib/factories/internal/protocols/iterate_protocol_native.js.map +0 -1
  578. package/lib/factories/internal/protocols/iterate_protocol_never.d.ts +0 -1
  579. package/lib/factories/internal/protocols/iterate_protocol_never.js +0 -6
  580. package/lib/factories/internal/protocols/iterate_protocol_never.js.map +0 -1
  581. package/lib/factories/internal/protocols/iterate_protocol_object.d.ts +0 -4
  582. package/lib/factories/internal/protocols/iterate_protocol_object.js +0 -157
  583. package/lib/factories/internal/protocols/iterate_protocol_object.js.map +0 -1
  584. package/lib/factories/internal/protocols/iterate_protocol_repeated.d.ts +0 -5
  585. package/lib/factories/internal/protocols/iterate_protocol_repeated.js +0 -25
  586. package/lib/factories/internal/protocols/iterate_protocol_repeated.js.map +0 -1
  587. package/lib/factories/internal/protocols/iterate_protocol_tuple.d.ts +0 -3
  588. package/lib/factories/internal/protocols/iterate_protocol_tuple.js +0 -46
  589. package/lib/factories/internal/protocols/iterate_protocol_tuple.js.map +0 -1
  590. package/lib/functional/$proto_bytes.d.ts +0 -2
  591. package/lib/functional/$proto_bytes.js +0 -37
  592. package/lib/functional/$proto_bytes.js.map +0 -1
  593. package/lib/functional/$proto_field.d.ts +0 -10
  594. package/lib/functional/$proto_field.js +0 -42
  595. package/lib/functional/$proto_field.js.map +0 -1
  596. package/lib/functional/$proto_float.d.ts +0 -4
  597. package/lib/functional/$proto_float.js +0 -28
  598. package/lib/functional/$proto_float.js.map +0 -1
  599. package/lib/functional/$proto_i32.d.ts +0 -2
  600. package/lib/functional/$proto_i32.js +0 -23
  601. package/lib/functional/$proto_i32.js.map +0 -1
  602. package/lib/functional/$proto_i64.d.ts +0 -2
  603. package/lib/functional/$proto_i64.js +0 -31
  604. package/lib/functional/$proto_i64.js.map +0 -1
  605. package/lib/functional/$proto_size.d.ts +0 -6
  606. package/lib/functional/$proto_size.js +0 -76
  607. package/lib/functional/$proto_size.js.map +0 -1
  608. package/lib/functional/$proto_string.d.ts +0 -2
  609. package/lib/functional/$proto_string.js +0 -34
  610. package/lib/functional/$proto_string.js.map +0 -1
  611. package/lib/functional/$varint.d.ts +0 -6
  612. package/lib/functional/$varint.js +0 -99
  613. package/lib/functional/$varint.js.map +0 -1
  614. package/lib/functional/$zigzag.d.ts +0 -4
  615. package/lib/functional/$zigzag.js +0 -34
  616. package/lib/functional/$zigzag.js.map +0 -1
  617. package/lib/messages/IProtocolMap.d.ts +0 -5
  618. package/lib/messages/IProtocolMap.js +0 -3
  619. package/lib/messages/IProtocolMap.js.map +0 -1
  620. package/lib/messages/IProtocolMessage.d.ts +0 -5
  621. package/lib/messages/IProtocolMessage.js +0 -3
  622. package/lib/messages/IProtocolMessage.js.map +0 -1
  623. package/lib/messages/IProtocolProperty.d.ts +0 -12
  624. package/lib/messages/IProtocolProperty.js +0 -3
  625. package/lib/messages/IProtocolProperty.js.map +0 -1
  626. package/lib/programmers/MessageProgrammer.d.ts +0 -5
  627. package/lib/programmers/MessageProgrammer.js +0 -141
  628. package/lib/programmers/MessageProgrammer.js.map +0 -1
  629. package/lib/transformers/features/protocols/MessageTransformer.d.ts +0 -5
  630. package/lib/transformers/features/protocols/MessageTransformer.js +0 -20
  631. package/lib/transformers/features/protocols/MessageTransformer.js.map +0 -1
  632. package/lib/utils/NameEncoder.d.ts +0 -4
  633. package/lib/utils/NameEncoder.js +0 -89
  634. package/lib/utils/NameEncoder.js.map +0 -1
  635. package/src/factories/ProtocolFactory.ts +0 -79
  636. package/src/factories/internal/protocols/ProtocolMetadataUtil.ts +0 -167
  637. package/src/factories/internal/protocols/emplace_protocol_object.ts +0 -25
  638. package/src/factories/internal/protocols/emplace_protocol_property.ts +0 -12
  639. package/src/factories/internal/protocols/iterate_protocol_atomic.ts +0 -34
  640. package/src/factories/internal/protocols/iterate_protocol_constant.ts +0 -27
  641. package/src/factories/internal/protocols/iterate_protocol_main.ts +0 -19
  642. package/src/factories/internal/protocols/iterate_protocol_map.ts +0 -58
  643. package/src/factories/internal/protocols/iterate_protocol_metadata.ts +0 -96
  644. package/src/factories/internal/protocols/iterate_protocol_native.ts +0 -34
  645. package/src/factories/internal/protocols/iterate_protocol_never.ts +0 -1
  646. package/src/factories/internal/protocols/iterate_protocol_object.ts +0 -110
  647. package/src/factories/internal/protocols/iterate_protocol_repeated.ts +0 -34
  648. package/src/factories/internal/protocols/iterate_protocol_tuple.ts +0 -29
  649. package/src/functional/$proto_bytes.ts +0 -25
  650. package/src/functional/$proto_field.ts +0 -30
  651. package/src/functional/$proto_float.ts +0 -37
  652. package/src/functional/$proto_i32.ts +0 -29
  653. package/src/functional/$proto_i64.ts +0 -37
  654. package/src/functional/$proto_size.ts +0 -82
  655. package/src/functional/$proto_string.ts +0 -24
  656. package/src/functional/$varint.ts +0 -130
  657. package/src/functional/$zigzag.ts +0 -39
  658. package/src/messages/IProtocolMap.ts +0 -5
  659. package/src/messages/IProtocolMessage.ts +0 -6
  660. package/src/messages/IProtocolProperty.ts +0 -13
  661. package/src/programmers/MessageProgrammer.ts +0 -126
  662. package/src/transformers/features/protocols/MessageTransformer.ts +0 -31
  663. package/src/utils/NameEncoder.ts +0 -32
package/src/module.ts CHANGED
@@ -1,2054 +1,2038 @@
1
- import { $dictionary } from "./functional/$dictionary";
2
- import { Namespace } from "./functional/Namespace";
3
-
4
- import { IMetadataApplication } from "./metadata/IMetadataApplication";
5
- import { IJsonApplication } from "./schemas/IJsonApplication";
6
-
7
- import { Atomic } from "./typings/Atomic";
8
-
9
- import { MapUtil } from "./utils/MapUtil";
10
-
11
- import { CustomValidatorMap } from "./CustomValidatorMap";
12
- import { IRandomGenerator } from "./IRandomGenerator";
13
- import { IValidation } from "./IValidation";
14
- import { Primitive } from "./Primitive";
15
- import { TypeGuardError } from "./TypeGuardError";
16
-
17
- export * from "./schemas/IJsonApplication";
18
- export * from "./schemas/IJsonComponents";
19
- export * from "./schemas/IJsonSchema";
20
- export * from "./IRandomGenerator";
21
- export * from "./IValidation";
22
- export * from "./Primitive";
23
- export * from "./TypeGuardError";
24
-
25
- /* ===========================================================
26
- SINGLE FUNCTIONS
27
- - BASIC VALIDATORS
28
- - STRICT VALIDATORS
29
- - PROTOCOL BUFFER FUNCTIONS
30
- - JSON FUNCTIONS
31
- - MISCELLANEOUS
32
- ==============================================================
33
- BASIC VALIDATORS
34
- ----------------------------------------------------------- */
35
- /**
36
- * Asserts a value type.
37
- *
38
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
39
- * reason, if the parametric value is not following the type `T`. Otherwise, the
40
- * value is following the type `T`, just input parameter would be returned.
41
- *
42
- * If what you want is not asserting but just knowing whether the parametric value is
43
- * following the type `T` or not, you can choose the {@link is} function instead.
44
- * Otherwise you want to know all the errors, {@link validate} is the way to go.
45
- *
46
- * On the other and, if you don't want to allow any superfluous property that is not
47
- * enrolled to the type `T`, you can use {@link assertEquals} function instead.
48
- *
49
- * @template T Type of the input value
50
- * @param input A value to be asserted
51
- * @returns Parametric input value
52
- * @throws A {@link TypeGuardError} instance with detailed reason
53
- *
54
- * @author Jeongho Nam - https://github.com/samchon
55
- */
56
- export function assert<T>(input: T): T;
57
-
58
- /**
59
- * Asserts a value type.
60
- *
61
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
62
- * reason, if the parametric value is not following the type `T`. Otherwise, the
63
- * value is following the type `T`, just input parameter would be returned.
64
- *
65
- * If what you want is not asserting but just knowing whether the parametric value is
66
- * following the type `T` or not, you can choose the {@link is} function instead.
67
- * Otherwise, you want to know all the errors, {@link validate} is the way to go.
68
- *
69
- * On the other and, if you don't want to allow any superfluous property that is not
70
- * enrolled to the type `T`, you can use {@link assertEquals} function instead.
71
- *
72
- * @template T Type of the input value
73
- * @param input A value to be asserted
74
- * @returns Parametric input value casted as `T`
75
- * @throws A {@link TypeGuardError} instance with detailed reason
76
- *
77
- * @author Jeongho Nam - https://github.com/samchon
78
- */
79
- export function assert<T>(input: unknown): T;
80
-
81
- /**
82
- * @internal
83
- */
84
- export function assert(): never {
85
- halt("assert");
86
- }
87
- Object.assign(assert, Namespace.assert("assert"));
88
-
89
- /**
90
- * Asserts a value type.
91
- *
92
- * Duplicated function of {@link assert} for `typescript-is` users.
93
- *
94
- * @template T Type of the input value
95
- * @param input A value to be asserted
96
- * @returns Parametric input value
97
- * @throws A {@link TypeGuardError} instance with detailed reason
98
- *
99
- * @author Jeongho Nam - https://github.com/samchon
100
- * @deprecated
101
- */
102
- export function assertType<T>(input: T): T;
103
-
104
- /**
105
- * Asserts a value type.
106
- *
107
- * Duplicated function of {@link assert} for `typescript-is` users.
108
- *
109
- * @template T Type of the input value
110
- * @param input A value to be asserted
111
- * @returns Parametric input value
112
- * @throws A {@link TypeGuardError} instance with detailed reason
113
- *
114
- * @author Jeongho Nam - https://github.com/samchon
115
- * @deprecated
116
- */
117
- export function assertType<T>(input: unknown): T;
118
-
119
- /**
120
- * @internal
121
- */
122
- export function assertType(): never {
123
- halt("assertType");
124
- }
125
- Object.assign(assertType, Namespace.assert("assertType"));
126
-
127
- /**
128
- * Tests a value type.
129
- *
130
- * Tests a parametric value type and returns whether it's following the type `T` or not.
131
- * If the parametric value is matched with the type `T`, `true` value would be returned.
132
- * Otherwise, the parametric value is not following the type `T`, `false` value would be
133
- * returned.
134
- *
135
- * If what you want is not just knowing whether the parametric value is following the
136
- * type `T` or not, but throwing an exception with detailed reason, you can choose
137
- * {@link assert} function instead. Also, if you want to know all the errors with
138
- * detailed reasons, {@link validate} function would be useful.
139
- *
140
- * On the other and, if you don't want to allow any superfluous property that is not
141
- * enrolled to the type `T`, you can use {@link equals} function instead.
142
- *
143
- * @template T Type of the input value
144
- * @param input A value to be tested
145
- * @returns Whether the parametric value is following the type `T` or not
146
- *
147
- * @author Jeongho Nam - https://github.com/samchon
148
- */
149
- export function is<T>(input: T): input is T;
150
-
151
- /**
152
- * Tests a value type.
153
- *
154
- * Tests a parametric value type and returns whether it's following the type `T` or not.
155
- * If the parametric value is matched with the type `T`, `true` value would be returned.
156
- * Otherwise, the parametric value is not following the type `T`, `false` value would be
157
- * returned.
158
- *
159
- * If what you want is not just knowing whether the parametric value is following the
160
- * type `T` or not, but throwing an exception with detailed reason, you can choose
161
- * {@link assert} function instead. Also, if you want to know all the errors with
162
- * detailed reasons, {@link validate} function would be useful.
163
- *
164
- * On the other and, if you don't want to allow any superfluous property that is not
165
- * enrolled to the type `T`, you can use {@link equals} function instead.
166
- *
167
- * @template T Type of the input value
168
- * @param input A value to be tested
169
- * @returns Whether the parametric value is following the type `T` or not
170
- *
171
- * @author Jeongho Nam - https://github.com/samchon
172
- */
173
- export function is<T>(input: unknown): input is T;
174
-
175
- /**
176
- * @internal
177
- */
178
- export function is(): never {
179
- halt("is");
180
- }
181
- Object.assign(is, Namespace.assert("is"));
182
-
183
- /**
184
- * Validates a value type.
185
- *
186
- * Validates a parametric value type and archives all the type errors into an
187
- * {@link IValidation.errors} array, if the parametric value is not following the
188
- * type `T`. Of course, if the parametric value is following the type `T`, the
189
- * {@link IValidation.errors} array would be empty and {@link IValidation.success}
190
- * would have the `true` value.
191
- *
192
- * If what you want is not finding all the error, but asserting the parametric value
193
- * type with exception throwing, you can choose {@link assert} function instead.
194
- * Otherwise, you just want to know whether the parametric value is matched with the
195
- * type `T`, {@link is} function is the way to go.
196
- *
197
- * On the other and, if you don't want to allow any superfluous property that is not
198
- * enrolled to the type `T`, you can use {@link validateEquals} function instead.
199
- *
200
- * @template Type of the input value
201
- * @param input A value to be validated
202
- * @returns Validation result
203
- *
204
- * @author Jeongho Nam - https://github.com/samchon
205
- */
206
- export function validate<T>(input: T): IValidation<T>;
207
-
208
- /**
209
- * Validates a value type.
210
- *
211
- * Validates a parametric value type and archives all the type errors into an
212
- * {@link IValidation.errors} array, if the parametric value is not following the
213
- * type `T`. Of course, if the parametric value is following the type `T`, the
214
- * {@link IValidation.errors} array would be empty and {@link IValidation.success}
215
- * would have the `true` value.
216
- *
217
- * If what you want is not finding all the error, but asserting the parametric value
218
- * type with exception throwing, you can choose {@link assert} function instead.
219
- * Otherwise, you just want to know whether the parametric value is matched with the
220
- * type `T`, {@link is} function is the way to go.
221
- *
222
- * On the other and, if you don't want to allow any superfluous property that is not
223
- * enrolled to the type `T`, you can use {@link validateEquals} function instead.
224
- *
225
- * @template Type of the input value
226
- * @param input A value to be validated
227
- * @returns Validation result
228
- *
229
- * @author Jeongho Nam - https://github.com/samchon
230
- */
231
- export function validate<T>(input: unknown): IValidation<T>;
232
-
233
- /**
234
- * @internal
235
- */
236
- export function validate(): never {
237
- halt("validate");
238
- }
239
- Object.assign(validate, Namespace.validate());
240
-
241
- /* -----------------------------------------------------------
242
- STRICT VALIDATORS
243
- ----------------------------------------------------------- */
244
- /**
245
- * Asserts equality between a value and its type.
246
- *
247
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
248
- * reason, if the parametric value is not following the type `T` or some superfluous
249
- * property that is not listed on the type `T` has been found. Otherwise, the value is
250
- * following the type `T` without any superfluous property, just input parameter would
251
- * be returned.
252
- *
253
- * If what you want is not asserting but just knowing whether the parametric value is
254
- * following the type `T` or not, you can choose the {@link equals} function instead.
255
- * Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
256
- *
257
- * On the other hand, if you want to allow superfluous property that is not enrolled
258
- * to the type `T`, you can use {@link assert} function instead.
259
- *
260
- * @template T Type of the input value
261
- * @param input A value to be asserted
262
- * @returns Parametric input value
263
- * @throws A {@link TypeGuardError} instance with detailed reason
264
- *
265
- * @author Jeongho Nam - https://github.com/samchon
266
- */
267
- export function assertEquals<T>(input: T): T;
268
-
269
- /**
270
- * Asserts equality between a value and its type.
271
- *
272
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
273
- * reason, if the parametric value is not following the type `T` or some superfluous
274
- * property that is not listed on the type `T` has been found. Otherwise, the value is
275
- * following the type `T` without any superfluous property, just input parameter would
276
- * be returned.
277
- *
278
- * If what you want is not asserting but just knowing whether the parametric value is
279
- * following the type `T` or not, you can choose the {@link equals} function instead.
280
- * Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
281
- *
282
- * On the other hand, if you want to allow superfluous property that is not enrolled
283
- * to the type `T`, you can use {@link assert} function instead.
284
- *
285
- * @template T Type of the input value
286
- * @param input A value to be asserted
287
- * @returns Parametric input value casted as `T`
288
- * @throws A {@link TypeGuardError} instance with detailed reason
289
- *
290
- * @author Jeongho Nam - https://github.com/samchon
291
- */
292
- export function assertEquals<T>(input: unknown): T;
293
-
294
- /**
295
- * @internal
296
- */
297
- export function assertEquals(): never {
298
- halt("assertEquals");
299
- }
300
- Object.assign(assertEquals, Namespace.assert("assertEquals"));
301
-
302
- /**
303
- * Tests equality between a value and its type.
304
- *
305
- * Tests a parametric value type and returns whether it's equivalent to the type `T`
306
- * or not. If the parametric value is matched with the type `T` and there's not any
307
- * superfluous property that is not listed on the type `T`, `true` value would be
308
- * returned. Otherwise, the parametric value is not following the type `T` or some
309
- * superfluous property exists, `false` value would be returned.
310
- *
311
- * If what you want is not just knowing whether the parametric value is following the
312
- * type `T` or not, but throwing an exception with detailed reason, you can choose
313
- * {@link assertEquals} function instead. Also, if you want to know all the errors with
314
- * detailed reasons, {@link validateEquals} function would be useful.
315
- *
316
- * On the other hand, if you want to allow superfluous property that is not enrolled
317
- * to the type `T`, you can use {@link is} function instead.
318
- *
319
- * @template T Type of the input value
320
- * @param input A value to be tested
321
- * @returns Whether the parametric value is equivalent to the type `T` or not
322
- *
323
- * @author Jeongho Nam - https://github.com/samchon
324
- */
325
- export function equals<T>(input: T): input is T;
326
-
327
- /**
328
- * Tests equality between a value and its type.
329
- *
330
- * Tests a parametric value type and returns whether it's equivalent to the type `T`
331
- * or not. If the parametric value is matched with the type `T` and there's not any
332
- * superfluous property that is not listed on the type `T`, `true` value would be
333
- * returned. Otherwise, the parametric value is not following the type `T` or some
334
- * superfluous property exists, `false` value would be returned.
335
- *
336
- * If what you want is not just knowing whether the parametric value is following the
337
- * type `T` or not, but throwing an exception with detailed reason, you can choose
338
- * {@link assertEquals} function instead. Also, if you want to know all the errors with
339
- * detailed reasons, {@link validateEquals} function would be useful.
340
- *
341
- * On the other hand, if you want to allow superfluous property that is not enrolled
342
- * to the type `T`, you can use {@link is} function instead.
343
- *
344
- * @template T Type of the input value
345
- * @param input A value to be tested
346
- * @returns Whether the parametric value is equivalent to the type `T` or not
347
- *
348
- * @author Jeongho Nam - https://github.com/samchon
349
- */
350
- export function equals<T>(input: unknown): input is T;
351
-
352
- /**
353
- * @internal
354
- */
355
- export function equals(): never {
356
- halt("equals");
357
- }
358
- Object.assign(equals, Namespace.is());
359
-
360
- /**
361
- * Validates equality between a value and its type.
362
- *
363
- * Validates a parametric value type and archives all the type errors into an
364
- * {@link IValidation.errors} array, if the parametric value is not following the
365
- * type `T` or some superfluous property that is not listed on the type `T` has been
366
- * found. Of course, if the parametric value is following the type `T` and no
367
- * superfluous property exists, the {@link IValidation.errors} array would be empty
368
- * and {@link IValidation.success} would have the `true` value.
369
- *
370
- * If what you want is not finding all the error, but asserting the parametric value
371
- * type with exception throwing, you can choose {@link assert} function instead.
372
- * Otherwise, you just want to know whether the parametric value is matched with the
373
- * type `T`, {@link is} function is the way to go.
374
- *
375
- * On the other and, if you don't want to allow any superfluous property that is not
376
- * enrolled to the type `T`, you can use {@link validateEquals} function instead.
377
- *
378
- * @template Type of the input value
379
- * @param input A value to be validated
380
- * @returns Validation result
381
- *
382
- * @author Jeongho Nam - https://github.com/samchon
383
- */
384
- export function validateEquals<T>(input: T): IValidation<T>;
385
-
386
- /**
387
- * Validates equality between a value and its type.
388
- *
389
- * Validates a parametric value type and archives all the type errors into an
390
- * {@link IValidation.errors} array, if the parametric value is not following the
391
- * type `T` or some superfluous property that is not listed on the type `T` has been
392
- * found. Of course, if the parametric value is following the type `T` and no
393
- * superfluous property exists, the {@link IValidation.errors} array would be empty
394
- * and {@link IValidation.success} would have the `true` value.
395
- *
396
- * If what you want is not finding all the error, but asserting the parametric value
397
- * type with exception throwing, you can choose {@link assert} function instead.
398
- * Otherwise, you just want to know whether the parametric value is matched with the
399
- * type `T`, {@link is} function is the way to go.
400
- *
401
- * On the other and, if you don't want to allow any superfluous property that is not
402
- * enrolled to the type `T`, you can use {@link validateEquals} function instead.
403
- *
404
- * @template Type of the input value
405
- * @param input A value to be validated
406
- * @returns Validation result
407
- *
408
- * @author Jeongho Nam - https://github.com/samchon
409
- */
410
- export function validateEquals<T>(input: unknown): IValidation<T>;
411
-
412
- /**
413
- * @internal
414
- */
415
- export function validateEquals(): never {
416
- halt("validateEquals");
417
- }
418
- Object.assign(validateEquals, Namespace.validate());
419
-
420
- /**
421
- * Custom validators.
422
- *
423
- * If you want to add a custom validation logic utilizing comment tags,
424
- * add a closure function with its tag and type name. Below example code
425
- * would helpful to understand how to use this instance.
426
- *
427
- * ```ts
428
- * typia.customValidators.insert("powerOf")("number")(
429
- * (text: string) => {
430
- * const denominator: number = Math.log(Number(text));
431
- * return (value: number) => {
432
- * value = Math.log(value) / denominator;
433
- * return value === Math.floor(value);
434
- * };
435
- * }
436
- * );
437
- * typia.customValidators.insert("dollar")("string")(
438
- * () => (value: string) => value.startsWith("$"),
439
- * );
440
- *
441
- * interface TagCustom {
442
- * /**
443
- * * @powerOf 10
444
- * *\/
445
- * powerOf: number;
446
- *
447
- * /**
448
- * * @dollar
449
- * *\/
450
- * dollar: string;
451
- * }
452
- * ```
453
- *
454
- * @author Jeongho Nam - https://github.com/samchon
455
- */
456
- export const customValidators: CustomValidatorMap = {
457
- size: (name?: string) =>
458
- name ? $dictionary.get(name)?.size ?? 0 : $dictionary.size,
459
- has: (name) => (type) => $dictionary.get(name)?.has(type) ?? false,
460
- get: (name) => (type) => $dictionary.get(name)?.get(type),
461
- insert: (name) => (type) => (closure) => {
462
- const internal = MapUtil.take($dictionary)(name, () => new Map());
463
- if (internal.has(type)) return false;
464
- internal.set(type, closure);
465
- return true;
466
- },
467
- erase: (name) => (type) => $dictionary.get(name)?.delete(type) ?? false,
468
- };
469
-
470
- /* -----------------------------------------------------------
471
- PROTOCOL BUFFER FUNCTIONS
472
- ----------------------------------------------------------- */
473
- export function message(): never;
474
- export function message<T>(): string;
475
-
476
- export function message(): string {
477
- halt("message");
478
- }
479
-
480
- /* -----------------------------------------------------------
481
- JSON FUNCTIONS
482
- ----------------------------------------------------------- */
483
- /**
484
- * > You must configure the generic argument `T`.
485
- *
486
- * JSON Schema Application.
487
- *
488
- * Creates a JSON schema application which contains both main JSON schemas and components.
489
- * Note that, all of the object types are stored in the {@link IJsonApplication.components}
490
- * property for the `$ref` referencing.
491
- *
492
- * Also, `typia.application()` has additional generic arguments, *Purpose*.
493
- * As JSON schema definitions used by `swagger` and `ajv` are different a little bit,
494
- * you should configure the *Purpose* appropriately.
495
- *
496
- * For an example, `ajv` has an extra property "$recursiveRef" that are not exists
497
- * in the standard JSON schema definition spec. Otherwise, `swagger` can't identify
498
- * the tuple definition.
499
- *
500
- * @template Types Tuple of target types
501
- * @template Purpose Purpose of the JSON schema`
502
- * @template Prefix Prefix of the JSON components referenced by `$ref` tag
503
- * @return JSON schema application
504
- *
505
- * @author Jeongho Nam - https://github.com/samchon
506
- */
507
- export function application(): never;
508
-
509
- /**
510
- * JSON Schema Application.
511
- *
512
- * Creates a JSON schema application which contains both main JSON schemas and components.
513
- * Note that, all of the object types are stored in the {@link IJsonApplication.components}
514
- * property for the `$ref` referencing.
515
- *
516
- * Also, `typia.application()` has additional generic arguments, *Purpose*.
517
- * As JSON schema definitions used by `swagger` and `ajv` are different a little bit,
518
- * you should configure the *Purpose* appropriately.
519
- *
520
- * For an example, `ajv` has an extra property "$recursiveRef" that are not exists
521
- * in the standard JSON schema definition spec. Otherwise, `swagger` can't identify
522
- * the tuple definition.
523
- *
524
- * @template Types Tuple of target types
525
- * @template Purpose Purpose of the JSON schema
526
- * @template Prefix Prefix of the JSON components referenced by `$ref` tag
527
- * @return JSON schema application
528
- *
529
- * @author Jeongho Nam - https://github.com/samchon
530
- */
531
- export function application<
532
- Types extends unknown[],
533
- Purpose extends "swagger" | "ajv" = "swagger",
534
- Prefix extends string = Purpose extends "swagger"
535
- ? "#/components/schemas"
536
- : "components#/schemas",
537
- >(): IJsonApplication;
538
-
539
- /**
540
- * @internal
541
- */
542
- export function application(): never {
543
- halt("application");
544
- }
545
-
546
- /**
547
- * > You must configure the generic argument `T`.
548
- *
549
- * Safe `JSON.parse()` function with type assertion.
550
- *
551
- * `typia.assertParse()` is a combination function of `JSON.parse()` and {@link assert}.
552
- * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
553
- * instance with type assertion.
554
- *
555
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
556
- * throws {@link TypeGuardError}. Otherwise, there's no problem on the parsed value,
557
- * the parsed value would be returned.
558
- *
559
- * @template T Expected type of parsed value
560
- * @param input JSON string
561
- * @returns Parsed value
562
- *
563
- * @author Jeongho Nam - https://github.com/samchon
564
- */
565
- export function assertParse(input: string): never;
566
-
567
- /**
568
- * Safe `JSON.parse()` function with type assertion.
569
- *
570
- * `typia.assertParse()` is a combination function of `JSON.parse()` and {@link assert}.
571
- * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
572
- * instance with type assertion.
573
- *
574
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
575
- * throws {@link TypeGuardError}. Otherwise, there's no problem on the parsed value,
576
- * the parsed value would be returned.
577
- *
578
- * @template T Expected type of parsed value
579
- * @param input JSON string
580
- * @returns Parsed value
581
- *
582
- * @author Jeongho Nam - https://github.com/samchon
583
- */
584
- export function assertParse<T>(input: string): Primitive<T>;
585
-
586
- /**
587
- * @internal
588
- */
589
- export function assertParse<T>(): Primitive<T> {
590
- halt("assertParse");
591
- }
592
- Object.assign(assertParse, Namespace.assert("assertParse"));
593
-
594
- /**
595
- * > You must configure the generic argument `T`.
596
- *
597
- * Safe `JSON.parse()` function with type checking.
598
- *
599
- * `typia.isParse()` is a combination function of `JSON.parse()` and {@link is}.
600
- * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
601
- * instance with type checking.
602
- *
603
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
604
- * returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
605
- * value would be returned.
606
- *
607
- * @template T Expected type of parsed value
608
- * @param input JSON string
609
- * @returns Parsed value when exact type, otherwise `null`
610
- *
611
- * @author Jeongho Nam - https://github.com/samchon
612
- */
613
- export function isParse(input: string): never;
614
-
615
- /**
616
- * Safe `JSON.parse()` function with type checking.
617
- *
618
- * `typia.isParse()` is a combination function of `JSON.parse()` and {@link is}.
619
- * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
620
- * instance with type checking.
621
- *
622
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
623
- * returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
624
- * value would be returned.
625
- *
626
- * @template T Expected type of parsed value
627
- * @param input JSON string
628
- * @returns Parsed value when exact type, otherwise `null`
629
- *
630
- * @author Jeongho Nam - https://github.com/samchon
631
- */
632
- export function isParse<T>(input: string): Primitive<T> | null;
633
-
634
- /**
635
- * @internal
636
- */
637
- export function isParse<T>(): Primitive<T> | null {
638
- halt("isParse");
639
- }
640
- Object.assign(isParse, is);
641
-
642
- /**
643
- * > You must configure the generic argument `T`.
644
- *
645
- * Safe `JSON.parse()` function with detailed type validation.
646
- *
647
- * `typia.validateParse()` is a combination function of `JSON.parse()` and
648
- * {@link validate}. Therefore, it convers a JSON (JavaScript Object Notation) string
649
- * to a `T` typed instance with detailed type validation.
650
- *
651
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
652
- * returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
653
- * there's no problem on the parsed value, the parsed value would be stored in `data`
654
- * property of the output {@link IValidation.ISuccess} instance.
655
- *
656
- * @template T Expected type of parsed value
657
- * @param input JSON string
658
- * @returns Validation result with JSON parsed value
659
- *
660
- * @author Jeongho Nam - https://github.com/samchon
661
- */
662
- export function validateParse(input: string): never;
663
-
664
- /**
665
- * Safe `JSON.parse()` function with detailed type validation.
666
- *
667
- * `typia.validateParse()` is a combination function of `JSON.parse()` and
668
- * {@link validate}. Therefore, it convers a JSON (JavaScript Object Notation) string
669
- * to a `T` typed instance with detailed type validation.
670
- *
671
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
672
- * returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
673
- * there's no problem on the parsed value, the parsed value would be stored in `data`
674
- * property of the output {@link IValidation.ISuccess} instance.
675
- *
676
- * @template T Expected type of parsed value
677
- * @param input JSON string
678
- * @returns Validation result with JSON parsed value
679
- *
680
- * @author Jeongho Nam - https://github.com/samchon
681
- */
682
- export function validateParse<T>(input: string): IValidation<Primitive<T>>;
683
-
684
- /**
685
- * @internal
686
- */
687
- export function validateParse<T>(): IValidation<Primitive<T>> {
688
- halt("validateParse");
689
- }
690
- Object.assign(validateParse, validate);
691
-
692
- /**
693
- * 8x faster `JSON.stringify()` function.
694
- *
695
- * Converts an input value to a JSON (JavaScript Object Notation) string, about 8x faster
696
- * than the native `JSON.stringify()` function. The 5x faster principle is because
697
- * it writes an optimized JSON conversion plan, only for the type `T`.
698
- *
699
- * For reference, this `typia.stringify()` does not validate the input value type.
700
- * It just believes that the input value is following the type `T`. Therefore, if you
701
- * can't ensure the input value type, it would be better to call one of below functions
702
- * instead.
703
- *
704
- * - {@link assertStringify}
705
- * - {@link isStringify}
706
- * - {@link validateStringify}
707
- *
708
- * @template T Type of the input value
709
- * @param input A value to be converted
710
- * @return JSON string value
711
- *
712
- * @author Jeongho Nam - https://github.com/samchon
713
- */
714
- export function stringify<T>(input: T): string;
715
-
716
- /**
717
- * @internal
718
- */
719
- export function stringify(): never {
720
- halt("stringify");
721
- }
722
- Object.assign(stringify, Namespace.stringify("stringify"));
723
-
724
- /**
725
- * 5x faster `JSON.stringify()` function with type assertion.
726
- *
727
- * `typia.assertStringify()` is a combination function of {@link assert} and
728
- * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
729
- * Notation) string, with type assertion.
730
- *
731
- * In such reason, when `input` value is not matched with the type `T`, it throws an
732
- * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, JSON
733
- * string would be returned.
734
- *
735
- * For reference, with type assertion, it is even 5x times faster than the native
736
- * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
737
- * with confidence.
738
- *
739
- * @template T Type of the input value
740
- * @param input A value to be asserted and converted
741
- * @return JSON string value
742
- *
743
- * @author Jeongho Nam - https://github.com/samchon
744
- */
745
- export function assertStringify<T>(input: T): string;
746
-
747
- /**
748
- * 5x faster `JSON.stringify()` function with type assertion.
749
- *
750
- * `typia.assertStringify()` is a combination function of {@link assert} and
751
- * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
752
- * Notation) string, with type assertion.
753
- *
754
- * In such reason, when `input` value is not matched with the type `T`, it throws an
755
- * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, JSON
756
- * string would be returned.
757
- *
758
- * For reference, with type assertion, it is even 5x times faster than the native
759
- * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
760
- * with confidence.
761
- *
762
- * @template T Type of the input value
763
- * @param input A value to be asserted and converted
764
- * @return JSON string value
765
- *
766
- * @author Jeongho Nam - https://github.com/samchon
767
- */
768
- export function assertStringify<T>(input: T): unknown;
769
-
770
- /**
771
- * @internal
772
- */
773
- export function assertStringify(): string {
774
- halt("assertStringify");
775
- }
776
- Object.assign(assertStringify, Namespace.assert("assertStringify"));
777
- Object.assign(assertStringify, Namespace.stringify("assertStringify"));
778
-
779
- /**
780
- * 7x faster `JSON.stringify()` function with type checking.
781
- *
782
- * `typia.stringify()` is a combination function of {@link is} and
783
- * {@link stringify}. Therefore, it converts an input value to JSON
784
- * (JavaScript Object Notation) string, with type checking.
785
- *
786
- * In such reason, when `input` value is not matched with the type `T`, it returns
787
- * `null` value. Otherwise, there's no problem on the `input` value, JSON string would
788
- * be returned.
789
- *
790
- * For reference, with type checking, it is even 7x times faster than the native
791
- * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
792
- * with confidence.
793
- *
794
- * @template T Type of the input value
795
- * @param input A value to be checked and converted
796
- * @return JSON string value when exact type, otherwise null
797
- *
798
- * @author Jeongho Nam - https://github.com/samchon
799
- */
800
- export function isStringify<T>(input: T): string | null;
801
-
802
- /**
803
- * 7x faster `JSON.stringify()` function with type checking.
804
- *
805
- * `typia.isStringify()` is a combination function of {@link is} and
806
- * {@link stringify}. Therefore, it converts an input value to JSON
807
- * (JavaScript Object Notation) string, with type checking.
808
- *f
809
- * In such reason, when `input` value is not matched with the type `T`, it returns
810
- * `null` value. Otherwise, there's no problem on the `input` value, JSON string would
811
- * be returned.
812
- *
813
- * For reference, with type checking, it is even 7x times faster than the native
814
- * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
815
- * with confidence.
816
- *
817
- * @template T Type of the input value
818
- * @param input A value to be checked and converted
819
- * @return JSON string value when exact type, otherwise null
820
- *
821
- * @author Jeongho Nam - https://github.com/samchon
822
- */
823
- export function isStringify<T>(input: unknown): string | null;
824
-
825
- /**
826
- * @internal
827
- */
828
- export function isStringify(): string | null {
829
- halt("isStringify");
830
- }
831
-
832
- Object.assign(isStringify, Namespace.is());
833
- Object.assign(isStringify, Namespace.stringify("isStringify"));
834
-
835
- /**
836
- * 5x faster `JSON.stringify()` function with detailed type validation.
837
- *
838
- * `typia.validateStringify()` is a combination function of {@link validate} and
839
- * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
840
- * Notation) string, with detailed type validation.
841
- *
842
- * In such reason, when `input` value is not matched with the type `T`, it returns
843
- * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's no
844
- * problem on the `input` value, JSON string would be stored in `data` property of
845
- * the output {@link IValidation.ISuccess} instance.
846
- *
847
- * For reference, with detailed type validation, it is even 5x times faster than the
848
- * native `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
849
- * with confidence.
850
- *
851
- * @template T Type of the input value
852
- * @param input A value to be checked and converted
853
- * @returns Validation result with JSON string value
854
- *
855
- * @author Jeongho Nam - https://github.com/samchon
856
- */
857
- export function validateStringify<T>(input: T): IValidation<string>;
858
-
859
- /**
860
- * 5x faster `JSON.stringify()` function with detailed type validation.
861
- *
862
- * `typia.validateStringify()` is a combination function of {@link validate} and
863
- * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
864
- * Notation) string, with detailed type validation.
865
- *
866
- * In such reason, when `input` value is not matched with the type `T`, it returns
867
- * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's no
868
- * problem on the `input` value, JSON string would be stored in `data` property of
869
- * the output {@link IValidation.ISuccess} instance.
870
- *
871
- * For reference, with detailed type validation, it is even 5x times faster than the
872
- * native `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
873
- * with confidence.
874
- *
875
- * @template T Type of the input value
876
- * @param input A value to be checked and converted
877
- * @returns Validation result with JSON string value
878
- *
879
- * @author Jeongho Nam - https://github.com/samchon
880
- */
881
- export function validateStringify<T>(input: unknown): IValidation<string>;
882
-
883
- /**
884
- * @internal
885
- */
886
- export function validateStringify(): IValidation<string> {
887
- halt("validateStringify");
888
- }
889
- Object.assign(validateStringify, Namespace.validate());
890
- Object.assign(validateStringify, Namespace.stringify("validateStringify"));
891
-
892
- /* -----------------------------------------------------------
893
- MISCELLANEOUS
894
- ----------------------------------------------------------- */
895
- /**
896
- * @internal
897
- */
898
- export function metadata(): never;
899
-
900
- /**
901
- * @internal
902
- */
903
- export function metadata<Types extends unknown[]>(): IMetadataApplication;
904
-
905
- /**
906
- * @internal
907
- */
908
- export function metadata(): never {
909
- halt("metadata");
910
- }
911
-
912
- /**
913
- * > You must configure the generic argument `T`.
914
- *
915
- * Generate random data.
916
- *
917
- * Generates a random data following type the `T`.
918
- *
919
- * For reference, this `typia.random()` function generates only primitive type.
920
- * If there're some methods in the type `T` or its nested instances, those would
921
- * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
922
- * would be generated instead.
923
- *
924
- * @template T Type of data to generate
925
- * @param generator Random data generator
926
- * @return Randomly generated data
927
- *
928
- * @author Jeongho Nam - https://github.com/samchon
929
- */
930
- export function random(generator?: Partial<IRandomGenerator>): never;
931
-
932
- /**
933
- * Generate random data.
934
- *
935
- * Generates a random data following type the `T`.
936
- *
937
- * For reference, this `typia.random()` function generates only primitive type.
938
- * If there're some methods in the type `T` or its nested instances, those would
939
- * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
940
- * would be generated instead.
941
- *
942
- * @template T Type of data to generate
943
- * @param generator Random data generator
944
- * @return Randomly generated data
945
- *
946
- * @author Jeongho Nam - https://github.com/samchon
947
- */
948
- export function random<T>(generator?: Partial<IRandomGenerator>): Primitive<T>;
949
-
950
- /**
951
- * @internal
952
- */
953
- export function random(): never {
954
- halt("random");
955
- }
956
- Object.assign(random, Namespace.random());
957
-
958
- /**
959
- * > You must configure the generic argument `T`.
960
- *
961
- * Union literal type to array.
962
- *
963
- * Converts a union literal type to an array of its members.
964
- *
965
- * ```typescript
966
- * literals<"A" | "B" | 1>; // [1, 2, 3] as const
967
- * ```
968
- *
969
- * @template T Union literal type
970
- * @return Array of union literal type's members
971
- *
972
- * @author Jeongho Nam - https://github.com/samchon
973
- */
974
- export function literals(): never;
975
-
976
- /**
977
- * Union literal type to array.
978
- *
979
- * Converts a union literal type to an array of its members.
980
- *
981
- * ```typescript
982
- * literals<"A" | "B" | 1>; // [1, 2, 3] as const
983
- * ```
984
- *
985
- * @template T Union literal type
986
- * @return Array of union literal type's members
987
- *
988
- * @author Jeongho Nam - https://github.com/samchon
989
- */
990
- export function literals<T extends Atomic.Type>(): T[];
991
-
992
- /**
993
- * @internal
994
- */
995
- export function literals(): never {
996
- halt("literals");
997
- }
998
-
999
- /**
1000
- * Clone a data.
1001
- *
1002
- * Clones an instance following type `T`. If the target *input* value or its member
1003
- * variable contains a class instance that is having a `toJSON()` method, its return
1004
- * value would be cloned.
1005
- *
1006
- * For reference, this `typia.clone()` function does not validate the input value type.
1007
- * It just believes that the input value is following the type `T`. Therefore, if you
1008
- * can't ensure the input value type, it would be better to call {@link assertClone}
1009
- * function instead.
1010
- *
1011
- * @template T Type of the input value
1012
- * @param input A value to be cloned
1013
- * @return Cloned data
1014
- *
1015
- * @author Jeongho Nam - https://github.com/samchon
1016
- */
1017
- export function clone<T>(input: T): Primitive<T>;
1018
-
1019
- /**
1020
- * @internal
1021
- */
1022
- export function clone(): never {
1023
- halt("clone");
1024
- }
1025
- Object.assign(clone, Namespace.clone("clone"));
1026
-
1027
- /**
1028
- * Clone a data with type assertion.
1029
- *
1030
- * Clones an instance following type `T`, with type assertion. If the target `input`
1031
- * value or its member variable contains a class instance that is having a `toJSON()`
1032
- * method, its return value would be cloned.
1033
- *
1034
- * In such reason, when `input` value is not matched with the type `T`, it throws an
1035
- * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, cloned
1036
- * data would be returned.
1037
- *
1038
- * @template T Type of the input value
1039
- * @param input A value to be cloned
1040
- * @return Cloned data
1041
- *
1042
- * @author Jeongho Nam - https://github.com/samchon
1043
- */
1044
- export function assertClone<T>(input: T): Primitive<T>;
1045
-
1046
- /**
1047
- * Clone a data with type assertion.
1048
- *
1049
- * Clones an instance following type `T`, with type assertion. If the target `input`
1050
- * value or its member variable contains a class instance that is having a `toJSON()`
1051
- * method, its return value would be cloned.
1052
- *
1053
- * In such reason, when `input` value is not matched with the type `T`, it throws an
1054
- * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, cloned
1055
- * data would be returned.
1056
- *
1057
- * @template T Type of the input value
1058
- * @param input A value to be cloned
1059
- * @return Cloned data
1060
- *
1061
- * @author Jeongho Nam - https://github.com/samchon
1062
- */
1063
- export function assertClone<T>(input: unknown): Primitive<T>;
1064
-
1065
- /**
1066
- * @internal
1067
- */
1068
- export function assertClone(): never {
1069
- halt("assertClone");
1070
- }
1071
- Object.assign(assertClone, Namespace.assert("assertClone"));
1072
- Object.assign(assertClone, Namespace.clone("assertClone"));
1073
-
1074
- /**
1075
- * Clone a data with type checking.
1076
- *
1077
- * Clones an instance following type `T`, with type checking. If the target `input`
1078
- * value or its member variable contains a class instance that is having a `toJSON()`
1079
- * method, its return value would be cloned.
1080
- *
1081
- * In such reason, when `input` value is not matched with the type `T`, it returns
1082
- * `null` value instead. Otherwise, there's no problem on the `input` value, cloned
1083
- * data would be returned.
1084
- *
1085
- * @template T Type of the input value
1086
- * @param input A value to be cloned
1087
- * @return Cloned data when exact type, otherwise null
1088
- *
1089
- * @author Jeongho Nam - https://github.com/samchon
1090
- */
1091
- export function isClone<T>(input: T): Primitive<T> | null;
1092
-
1093
- /**
1094
- * Clone a data with type checking.
1095
- *
1096
- * Clones an instance following type `T`, with type checking. If the target `input`
1097
- * value or its member variable contains a class instance that is having a `toJSON()`
1098
- * method, its return value would be cloned.
1099
- *
1100
- * In such reason, when `input` value is not matched with the type `T`, it returns
1101
- * `null` value instead. Otherwise, there's no problem on the `input` value, cloned
1102
- * data would be returned.
1103
- *
1104
- * @template T Type of the input value
1105
- * @param input A value to be cloned
1106
- * @return Cloned data when exact type, otherwise null
1107
- *
1108
- * @author Jeongho Nam - https://github.com/samchon
1109
- */
1110
- export function isClone<T>(input: unknown): Primitive<T> | null;
1111
-
1112
- /**
1113
- * @internal
1114
- */
1115
- export function isClone(): never {
1116
- halt("isClone");
1117
- }
1118
- Object.assign(isClone, Namespace.is());
1119
- Object.assign(isClone, Namespace.clone("isClone"));
1120
-
1121
- /**
1122
- * Clone a data with detailed type validation.
1123
- *
1124
- * Clones an instance following type `T`, with detailed type validation. If the target
1125
- * `input` value or its member variable contains a class instance that is having a
1126
- * `toJSON()` method, its return value would be cloned.
1127
- *
1128
- * In such reason, when `input` value is not matched with the type `T`, it returns
1129
- * {@link IValidation.Failure} value. Otherwise, there's no problem on the `input`
1130
- * value, cloned data would be stored in `data` property of the output
1131
- * {@link IValidation.Success} instance.
1132
- *
1133
- * @template T Type of the input value
1134
- * @param input A value to be cloned
1135
- * @returns Validation result with cloned value
1136
- */
1137
- export function validateClone<T>(input: T): IValidation<Primitive<T>>;
1138
-
1139
- /**
1140
- * Clone a data with detailed type validation.
1141
- *
1142
- * Clones an instance following type `T`, with detailed type validation. If the target
1143
- * `input` value or its member variable contains a class instance that is having a
1144
- * `toJSON()` method, its return value would be cloned.
1145
- *
1146
- * In such reason, when `input` value is not matched with the type `T`, it returns
1147
- * {@link IValidation.Failure} value. Otherwise, there's no problem on the `input`
1148
- * value, cloned data would be stored in `data` property of the output
1149
- * {@link IValidation.Success} instance.
1150
- *
1151
- * @template T Type of the input value
1152
- * @param input A value to be cloned
1153
- * @returns Validation result with cloned value
1154
- */
1155
- export function validateClone<T>(input: unknown): IValidation<Primitive<T>>;
1156
-
1157
- /**
1158
- * @internal
1159
- */
1160
- export function validateClone(): never {
1161
- halt("validateClone");
1162
- }
1163
- Object.assign(validateClone, Namespace.validate());
1164
- Object.assign(validateClone, Namespace.clone("validateClone"));
1165
-
1166
- /**
1167
- * Prune, erase superfluous properties.
1168
- *
1169
- * Remove every superfluous properties from the `input` object, even including nested
1170
- * objects. Note that, as every superfluous properties would be deleted, you never can
1171
- * read those superfluous properties after calling this `prune()` function.
1172
- *
1173
- * For reference, this `typia.prune()` function does not validate the input value type.
1174
- * It just believes that the input value is following the type `T`. Therefore, if you
1175
- * can't ensure the input value type, it would better to call one of below functions
1176
- * instead.
1177
- *
1178
- * - {@link assertPrune}
1179
- * - {@link isPrune}
1180
- * - {@link validatePrune}
1181
- *
1182
- * @template T Type of the input value
1183
- * @param input Target instance to prune
1184
- *
1185
- * @author Jeongho Nam - https://github.com/samchon
1186
- */
1187
- export function prune<T extends object>(input: T): void;
1188
-
1189
- /**
1190
- * @internal
1191
- */
1192
- export function prune(): never {
1193
- halt("prune");
1194
- }
1195
- Object.assign(prune, Namespace.prune("prune"));
1196
-
1197
- /**
1198
- * Prune, erase superfluous properties, with type assertion.
1199
- *
1200
- * `typia.assertPrune()` is a combination function of {@link assert} and {@link prune}.
1201
- * Therefore, it removes every superfluous properties from the `input` object including
1202
- * nested objects, with type assertion.
1203
- *
1204
- * In such reason, when `input` value is not matched with the type `T`, it throws an
1205
- * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, its
1206
- * every superfluous properties would be removed, including nested objects.
1207
- *
1208
- * @template T Type of the input value
1209
- * @param input Target instance to assert and prune
1210
- *
1211
- * @author Jeongho Nam - https://github.com/samchon
1212
- */
1213
- export function assertPrune<T>(input: T): T;
1214
-
1215
- /**
1216
- * Prune, erase superfluous properties, with type assertion.
1217
- *
1218
- * `typia.assertPrune()` is a combination function of {@link assert} and {@link prune}.
1219
- * Therefore, it removes every superfluous properties from the `input` object including
1220
- * nested objects, with type assertion.
1221
- *
1222
- * In such reason, when `input` value is not matched with the type `T`, it throws an
1223
- * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, its
1224
- * every superfluous properties would be removed, including nested objects.
1225
- *
1226
- * @template T Type of the input value
1227
- * @param input Target instance to assert and prune
1228
- *
1229
- * @author Jeongho Nam - https://github.com/samchon
1230
- */
1231
- export function assertPrune<T>(input: unknown): T;
1232
-
1233
- /**
1234
- * @internal
1235
- */
1236
- export function assertPrune(): unknown {
1237
- halt("assertPrune");
1238
- }
1239
- Object.assign(assertPrune, Namespace.assert("assertPrune"));
1240
- Object.assign(assertPrune, Namespace.prune("assertPrune"));
1241
-
1242
- /**
1243
- * Prune, erase superfluous properties, with type checking.
1244
- *
1245
- * `typia.assertPrune()` is a combination function of {@link is} and {@link prune}.
1246
- * Therefore, it removes every superfluous properties from the `input` object including
1247
- * nested objects, with type checking.
1248
- *
1249
- * In such reason, when `input` value is not matched with the type `T`, it returns
1250
- * `false` value. Otherwise, there's no problem on the `input` value, it returns
1251
- * `true` after removing every superfluous properties, including nested objects.
1252
- *
1253
- * @template T Type of the input value
1254
- * @param input Target instance to check and prune
1255
- * @returns Whether the parametric value is following the type `T` or not
1256
- *
1257
- * @author Jeongho Nam - https://github.com/samchon
1258
- */
1259
- export function isPrune<T>(input: T): input is T;
1260
-
1261
- /**
1262
- * Prune, erase superfluous properties, with type checking.
1263
- *
1264
- * `typia.assertPrune()` is a combination function of {@link is} and {@link prune}.
1265
- * Therefore, it removes every superfluous properties from the `input` object including
1266
- * nested objects, with type checking.
1267
- *
1268
- * In such reason, when `input` value is not matched with the type `T`, it returns
1269
- * `false` value. Otherwise, there's no problem on the `input` value, it returns
1270
- * `true` after removing every superfluous properties, including nested objects.
1271
- *
1272
- * @template T Type of the input value
1273
- * @param input Target instance to check and prune
1274
- * @returns Whether the parametric value is following the type `T` or not
1275
- *
1276
- * @author Jeongho Nam - https://github.com/samchon
1277
- */
1278
- export function isPrune<T>(input: unknown): input is T;
1279
-
1280
- /**
1281
- * @internal
1282
- */
1283
- export function isPrune(): never {
1284
- halt("isPrune");
1285
- }
1286
- Object.assign(isPrune, Namespace.is());
1287
- Object.assign(isPrune, Namespace.prune("isPrune"));
1288
-
1289
- /**
1290
- * Prune, erase superfluous properties, with type validation.
1291
- *
1292
- * `typia.validatePrune()` is a combination function of {@link validate} and {@link prune}.
1293
- * Therefore, it removes every superfluous properties from the `input` object including
1294
- * nested objects, with type validation.
1295
- *
1296
- * In such reason, when `input` value is not matched with the type `T`, it returns
1297
- * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's
1298
- * no problem on the `input` value, it returns {@link IValidation.ISucess} value after
1299
- * removing every superfluous properties, including nested objects.
1300
- *
1301
- * @template T Type of the input value
1302
- * @param input Target instance to validate and prune
1303
- * @returns Validation result
1304
- *
1305
- * @author Jeongho Nam - https://github.com/samchon
1306
- */
1307
- export function validatePrune<T>(input: T): IValidation<T>;
1308
-
1309
- /**
1310
- * Prune, erase superfluous properties, with type validation.
1311
- *
1312
- * `typia.validatePrune()` is a combination function of {@link validate} and {@link prune}.
1313
- * Therefore, it removes every superfluous properties from the `input` object including
1314
- * nested objects, with type validation.
1315
- *
1316
- * In such reason, when `input` value is not matched with the type `T`, it returns
1317
- * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's
1318
- * no problem on the `input` value, it returns {@link IValidation.ISucess} value after
1319
- * removing every superfluous properties, including nested objects.
1320
- *
1321
- * @template T Type of the input value
1322
- * @param input Target instance to validate and prune
1323
- * @returns Validation result
1324
- *
1325
- * @author Jeongho Nam - https://github.com/samchon
1326
- */
1327
- export function validatePrune<T>(input: unknown): IValidation<T>;
1328
-
1329
- /**
1330
- * @internal
1331
- */
1332
- export function validatePrune<T>(): IValidation<T> {
1333
- halt("validatePrune");
1334
- }
1335
- Object.assign(validatePrune, Namespace.prune("validatePrune"));
1336
- Object.assign(validatePrune, Namespace.validate());
1337
-
1338
- /* ===========================================================
1339
- FACTORY FUNCTIONS
1340
- - BASIC VALIDATORS
1341
- - STRICT VALIDATORS
1342
- - JSON FUNCTIONS
1343
- - MISCELLANEOUS
1344
- ==============================================================
1345
- BASIC VALIDATORS
1346
- ----------------------------------------------------------- */
1347
- /**
1348
- * Creates a reusable {@link assert} function.
1349
- *
1350
- * @danger You have to specify the generic argument `T`
1351
- * @return Nothing until specifying the generic argument `T`
1352
- * @throws compile error
1353
- *
1354
- * @author Jeongho Nam - https://github.com/samchon
1355
- */
1356
- export function createAssert(): never;
1357
-
1358
- /**
1359
- * Creates a reusable {@link assert} function.
1360
- *
1361
- * @template T Type of the input value
1362
- * @returns A reusable `assert` function
1363
- *
1364
- * @author Jeongho Nam - https://github.com/samchon
1365
- */
1366
- export function createAssert<T>(): (input: unknown) => T;
1367
-
1368
- /**
1369
- * @internal
1370
- */
1371
- export function createAssert<T>(): (input: unknown) => T {
1372
- halt("createAssert");
1373
- }
1374
- Object.assign(createAssert, assert);
1375
-
1376
- /**
1377
- * Creates a reusable {@link assertType} function.
1378
- *
1379
- * Duplicated function of {@link createAssert} for `typescript-is` users.
1380
- *
1381
- * @danger You have to specify the generic argument `T`
1382
- * @return Nothing until specifying the generic argument `T`
1383
- * @throws compile error
1384
- *
1385
- * @author Jeongho Nam - https://github.com/samchon
1386
- * @deprecated
1387
- */
1388
- export function createAssertType(): never;
1389
-
1390
- /**
1391
- * Creates a reusable {@link assertType} function.
1392
- *
1393
- * Duplicated function of {@link createAssert} for `typescript-is` users.
1394
- *
1395
- * @template T Type of the input value
1396
- * @returns A reusable `assert` function
1397
- *
1398
- * @author Jeongho Nam - https://github.com/samchon
1399
- * @deprecated
1400
- */
1401
- export function createAssertType<T>(): (input: unknown) => T;
1402
-
1403
- /**
1404
- * @internal
1405
- */
1406
- export function createAssertType<T>(): (input: unknown) => T {
1407
- halt("createAssertType");
1408
- }
1409
- Object.assign(createAssertType, assertType);
1410
-
1411
- /**
1412
- * Creates a reusable {@link is} function.
1413
- *
1414
- * @danger You have to specify the generic argument `T`
1415
- * @return Nothing until specifying the generic argument `T`
1416
- * @throws compile error
1417
- *
1418
- * @author Jeongho Nam - https://github.com/samchon
1419
- */
1420
- export function createIs(): never;
1421
-
1422
- /**
1423
- * Creates a reusable {@link is} function.
1424
- *
1425
- * @template T Type of the input value
1426
- * @returns A reusable `is` function
1427
- *
1428
- * @author Jeongho Nam - https://github.com/samchon
1429
- */
1430
- export function createIs<T>(): (input: unknown) => input is T;
1431
-
1432
- /**
1433
- * @internal
1434
- */
1435
- export function createIs<T>(): (input: unknown) => input is T {
1436
- halt("createIs");
1437
- }
1438
- Object.assign(createIs, is);
1439
-
1440
- /**
1441
- * Creates a reusable {@link validate} function.
1442
- *
1443
- * @danger You have to specify the generic argument `T`
1444
- * @return Nothing until specifying the generic argument `T`
1445
- * @throws compile error
1446
- *
1447
- * @author Jeongho Nam - https://github.com/samchon
1448
- */
1449
- export function createValidate(): never;
1450
-
1451
- /**
1452
- * Creates a reusable {@link validate} function.
1453
- *
1454
- * @template T Type of the input value
1455
- * @returns A reusable `validate` function
1456
- *
1457
- * @author Jeongho Nam - https://github.com/samchon
1458
- */
1459
- export function createValidate<T>(): (input: unknown) => IValidation<T>;
1460
-
1461
- /**
1462
- * @internal
1463
- */
1464
- export function createValidate(): (input: unknown) => IValidation {
1465
- halt("createValidate");
1466
- }
1467
- Object.assign(createValidate, validate);
1468
-
1469
- /* -----------------------------------------------------------
1470
- STRICT VALIDATORS
1471
- ----------------------------------------------------------- */
1472
- /**
1473
- * Creates a reusable {@link assertEquals} function.
1474
- *
1475
- * @danger You have to specify the generic argument `T`
1476
- * @return Nothing until specifying the generic argument `T`
1477
- * @throws compile error
1478
- *
1479
- * @author Jeongho Nam - https://github.com/samchon
1480
- */
1481
- export function createAssertEquals(): never;
1482
-
1483
- /**
1484
- * Creates a reusable {@link assertEquals} function.
1485
- *
1486
- * @template T Type of the input value
1487
- * @returns A reusable `assertEquals` function
1488
- *
1489
- * @author Jeongho Nam - https://github.com/samchon
1490
- */
1491
- export function createAssertEquals<T>(): (input: unknown) => T;
1492
-
1493
- /**
1494
- * @internal
1495
- */
1496
- export function createAssertEquals<T>(): (input: unknown) => T {
1497
- halt("createAssertEquals");
1498
- }
1499
- Object.assign(createAssertEquals, assertEquals);
1500
-
1501
- /**
1502
- * Creates a reusable {@link equals} function.
1503
- *
1504
- * @danger You have to specify the generic argument `T`
1505
- * @return Nothing until specifying the generic argument `T`
1506
- * @throws compile error
1507
- *
1508
- * @author Jeongho Nam - https://github.com/samchon
1509
- */
1510
- export function createEquals(): never;
1511
-
1512
- /**
1513
- * Creates a reusable {@link equals} function.
1514
- *
1515
- * @template T Type of the input value
1516
- * @returns A reusable `equals` function
1517
- *
1518
- * @author Jeongho Nam - https://github.com/samchon
1519
- */
1520
- export function createEquals<T>(): (input: unknown) => input is T;
1521
-
1522
- /**
1523
- * @internal
1524
- */
1525
- export function createEquals<T>(): (input: unknown) => input is T {
1526
- halt("createEquals");
1527
- }
1528
- Object.assign(createEquals, equals);
1529
-
1530
- /**
1531
- * Creates a reusable {@link validateEquals} function.
1532
- *
1533
- * @danger You have to specify the generic argument `T`
1534
- * @return Nothing until specifying the generic argument `T`
1535
- * @throws compile error
1536
- *
1537
- * @author Jeongho Nam - https://github.com/samchon
1538
- */
1539
- export function createValidateEquals(): never;
1540
-
1541
- /**
1542
- * Creates a reusable {@link validateEquals} function.
1543
- *
1544
- * @template T Type of the input value
1545
- * @returns A reusable `validateEquals` function
1546
- *
1547
- * @author Jeongho Nam - https://github.com/samchon
1548
- */
1549
- export function createValidateEquals<T>(): (input: unknown) => IValidation<T>;
1550
-
1551
- /**
1552
- * @internal
1553
- */
1554
- export function createValidateEquals(): (input: unknown) => IValidation {
1555
- halt("createValidateEquals");
1556
- }
1557
- Object.assign(createValidateEquals, validateEquals);
1558
-
1559
- /* -----------------------------------------------------------
1560
- JSON FUNCTIONS
1561
- ----------------------------------------------------------- */
1562
- /**
1563
- * Creates a reusable {@link isParse} function.
1564
- *
1565
- * @danger You have to specify the generic argument `T`
1566
- * @return Nothing until specifying the generic argument `T`
1567
- * @throws compile error
1568
- *
1569
- * @author Jeongho Nam - https://github.com/samchon
1570
- */
1571
- export function createIsParse(): never;
1572
-
1573
- /**
1574
- * Creates a reusable {@link isParse} function.
1575
- *
1576
- * @template T Expected type of parsed value
1577
- * @returns A reusable `isParse` function
1578
- *
1579
- * @author Jeongho Nam - https://github.com/samchon
1580
- */
1581
- export function createIsParse<T>(): (input: string) => Primitive<T> | null;
1582
-
1583
- /**
1584
- * @internal
1585
- */
1586
- export function createIsParse<T>(): (input: string) => Primitive<T> | null {
1587
- halt("createIsParse");
1588
- }
1589
- Object.assign(createIsParse, isParse);
1590
-
1591
- /**
1592
- * Creates a reusable {@link assertParse} function.
1593
- *
1594
- * @danger You have to specify the generic argument `T`
1595
- * @return Nothing until specifying the generic argument `T`
1596
- * @throws compile error
1597
- *
1598
- * @author Jeongho Nam - https://github.com/samchon
1599
- */
1600
- export function createAssertParse(): never;
1601
-
1602
- /**
1603
- * Creates a reusable {@link assertParse} function.
1604
- *
1605
- * @template T Expected type of parsed value
1606
- * @returns A reusable `assertParse` function
1607
- *
1608
- * @author Jeongho Nam - https://github.com/samchon
1609
- */
1610
- export function createAssertParse<T>(): (input: string) => Primitive<T>;
1611
-
1612
- /**
1613
- * @internal
1614
- */
1615
- export function createAssertParse<T>(): (input: string) => Primitive<T> {
1616
- halt("createAssertParse");
1617
- }
1618
- Object.assign(createAssertParse, assertParse);
1619
-
1620
- /**
1621
- * Creates a reusable {@link validateParse} function.
1622
- *
1623
- * @danger You have to specify the generic argument `T`
1624
- * @return Nothing until specifying the generic argument `T`
1625
- * @throws compile error
1626
- *
1627
- * @author Jeongho Nam - https://github.com/samchon
1628
- */
1629
- export function createValidateParse(): never;
1630
-
1631
- /**
1632
- * Creates a reusable {@link validateParse} function.
1633
- *
1634
- * @template T Expected type of parsed value
1635
- * @returns A reusable `validateParse` function
1636
- *
1637
- * @author Jeongho Nam - https://github.com/samchon
1638
- */
1639
- export function createValidateParse<T>(): (
1640
- input: string,
1641
- ) => IValidation<Primitive<T>>;
1642
-
1643
- /**
1644
- * @internal
1645
- */
1646
- export function createValidateParse<T>(): (
1647
- input: string,
1648
- ) => IValidation<Primitive<T>> {
1649
- halt("createValidateParse");
1650
- }
1651
- Object.assign(createValidateParse, validateParse);
1652
-
1653
- /**
1654
- * Creates a reusable {@link stringify} function.
1655
- *
1656
- * @danger You have to specify the generic argument `T`
1657
- * @return Nothing until specifying the generic argument `T`
1658
- * @throws compile error
1659
- *
1660
- * @author Jeongho Nam - https://github.com/samchon
1661
- */
1662
- export function createStringify(): never;
1663
-
1664
- /**
1665
- * Creates a reusable {@link stringify} function.
1666
- *
1667
- * @template T Type of the input value
1668
- * @returns A reusable `stringify` function
1669
- *
1670
- * @author Jeongho Nam - https://github.com/samchon
1671
- */
1672
- export function createStringify<T>(): (input: T) => string;
1673
-
1674
- /**
1675
- * @internal
1676
- */
1677
- export function createStringify<T>(): (input: T) => string {
1678
- halt("createStringify");
1679
- }
1680
- Object.assign(createStringify, stringify);
1681
-
1682
- /**
1683
- * Creates a reusable {@link assertStringify} function.
1684
- *
1685
- * @danger You have to specify the generic argument `T`
1686
- * @return Nothing until specifying the generic argument `T`
1687
- * @throws compile error
1688
- *
1689
- * @author Jeongho Nam - https://github.com/samchon
1690
- */
1691
- export function createAssertStringify(): never;
1692
-
1693
- /**
1694
- * Creates a reusable {@link assertStringify} function.
1695
- *
1696
- * @template T Type of the input value
1697
- * @returns A reusable `assertStringify` function
1698
- *
1699
- * @author Jeongho Nam - https://github.com/samchon
1700
- */
1701
- export function createAssertStringify<T>(): (input: unknown) => string;
1702
-
1703
- /**
1704
- * @internal
1705
- */
1706
- export function createAssertStringify(): (input: unknown) => string {
1707
- halt("createAssertStringify");
1708
- }
1709
- Object.assign(createAssertStringify, assertStringify);
1710
-
1711
- /**
1712
- * Creates a reusable {@link isStringify} function.
1713
- *
1714
- * @danger You have to specify the generic argument `T`
1715
- * @return Nothing until specifying the generic argument `T`
1716
- * @throws compile error
1717
- *
1718
- * @author Jeongho Nam - https://github.com/samchon
1719
- */
1720
- export function createIsStringify(): never;
1721
-
1722
- /**
1723
- * Creates a reusable {@link isStringify} function.
1724
- *
1725
- * @template T Type of the input value
1726
- * @returns A reusable `isStringify` function
1727
- *
1728
- * @author Jeongho Nam - https://github.com/samchon
1729
- */
1730
- export function createIsStringify<T>(): (input: unknown) => string | null;
1731
-
1732
- /**
1733
- * @internal
1734
- */
1735
- export function createIsStringify(): (input: unknown) => string | null {
1736
- halt("createIsStringify");
1737
- }
1738
- Object.assign(createIsStringify, isStringify);
1739
-
1740
- /**
1741
- * Creates a reusable {@link validateStringify} function.
1742
- *
1743
- * @danger You have to specify the generic argument `T`
1744
- * @return Nothing until specifying the generic argument `T`
1745
- * @throws compile error
1746
- *
1747
- * @author Jeongho Nam - https://github.com/samchon
1748
- */
1749
- export function createValidateStringify(): never;
1750
-
1751
- /**
1752
- * Creates a reusable {@link validateStringify} function.
1753
- *
1754
- * @template T Type of the input value
1755
- * @returns A reusable `validateStringify` function
1756
-
1757
- * @author Jeongho Nam - https://github.com/samchon
1758
- */
1759
- export function createValidateStringify<T>(): (
1760
- input: unknown,
1761
- ) => IValidation<string>;
1762
-
1763
- /**
1764
- * @internal
1765
- */
1766
- export function createValidateStringify(): (
1767
- input: unknown,
1768
- ) => IValidation<string> {
1769
- halt("createValidateStringify");
1770
- }
1771
- Object.assign(createValidateStringify, validateStringify);
1772
-
1773
- /* -----------------------------------------------------------
1774
- MISCELLANEOUS
1775
- ----------------------------------------------------------- */
1776
- /**
1777
- * Creates a reusable {@link random} function.
1778
- *
1779
- * @danger You have to specify the generic argument `T`
1780
- * @param generator Random data generator
1781
- * @return Nothing until specifying the generic argument `T`
1782
- * @throws compile error
1783
- *
1784
- * @author Jeongho Nam - https://github.com/samchon
1785
- */
1786
- export function createRandom(generator?: Partial<IRandomGenerator>): never;
1787
-
1788
- /**
1789
- * Creates a resuable {@link random} function.
1790
- *
1791
- * @template T Type of the input value
1792
- * @param generator Random data generator
1793
- * @returns A reusable `random` function
1794
- *
1795
- * @author Jeongho Nam - https://github.com/samchon
1796
- */
1797
- export function createRandom<T>(
1798
- generator?: Partial<IRandomGenerator>,
1799
- ): () => Primitive<T>;
1800
-
1801
- /**
1802
- * @internal
1803
- */
1804
- export function createRandom(): never {
1805
- halt("createRandom");
1806
- }
1807
- Object.assign(createRandom, random);
1808
-
1809
- /**
1810
- * Creates a reusable {@link clone} function.
1811
- *
1812
- * @danger You have to specify the generic argument `T`
1813
- * @return Nothing until specifying the generic argument `T`
1814
- * @throws compile error
1815
- *
1816
- * @author Jeongho Nam - https://github.com/samchon
1817
- */
1818
- export function createClone(): never;
1819
-
1820
- /**
1821
- * Creates a resuable {@link clone} function.
1822
- *
1823
- * @template T Type of the input value
1824
- * @returns A reusable `clone` function
1825
- *
1826
- * @author Jeongho Nam - https://github.com/samchon
1827
- */
1828
- export function createClone<T>(): (input: T) => Primitive<T>;
1829
-
1830
- /**
1831
- * @internal
1832
- */
1833
- export function createClone(): never {
1834
- halt("createClone");
1835
- }
1836
- Object.assign(createClone, clone);
1837
-
1838
- /**
1839
- * Creates a reusable {@link assertClone} function.
1840
- *
1841
- * @danger You have to specify the generic argument `T`
1842
- * @return Nothing until specifying the generic argument `T`
1843
- * @throws compile error
1844
- *
1845
- * @author Jeongho Nam - https://github.com/samchon
1846
- */
1847
- export function createAssertClone(): never;
1848
-
1849
- /**
1850
- * Creates a resuable {@link assertClone} function.
1851
- *
1852
- * @template T Type of the input value
1853
- * @returns A reusable `clone` function
1854
- *
1855
- * @author Jeongho Nam - https://github.com/samchon
1856
- */
1857
- export function createAssertClone<T>(): (input: unknown) => Primitive<T>;
1858
-
1859
- /**
1860
- * @internal
1861
- */
1862
- export function createAssertClone(): never {
1863
- halt("createAssertClone");
1864
- }
1865
- Object.assign(createAssertClone, assertClone);
1866
-
1867
- /**
1868
- * Creates a reusable {@link isClone} function.
1869
- *
1870
- * @danger You have to specify the generic argument `T`
1871
- * @return Nothing until specifying the generic argument `T`
1872
- * @throws compile error
1873
- *
1874
- * @author Jeongho Nam - https://github.com/samchon
1875
- */
1876
- export function createIsClone(): never;
1877
-
1878
- /**
1879
- * Creates a resuable {@link isClone} function.
1880
- *
1881
- * @template T Type of the input value
1882
- * @returns A reusable `clone` function
1883
- *
1884
- * @author Jeongho Nam - https://github.com/samchon
1885
- */
1886
- export function createIsClone<T>(): (input: unknown) => Primitive<T> | null;
1887
-
1888
- /**
1889
- * @internal
1890
- */
1891
- export function createIsClone(): never {
1892
- halt("createIsClone");
1893
- }
1894
- Object.assign(createIsClone, isClone);
1895
-
1896
- /**
1897
- * Creates a reusable {@link validateClone} function.
1898
- *
1899
- * @danger You have to specify the generic argument `T`
1900
- * @return Nothing until specifying the generic argument `T`
1901
- * @throws compile error
1902
- *
1903
- * @author Jeongho Nam - https://github.com/samchon
1904
- */
1905
- export function createValidateClone(): never;
1906
-
1907
- /**
1908
- * Creates a resuable {@link validateClone} function.
1909
- *
1910
- * @template T Type of the input value
1911
- * @returns A reusable `clone` function
1912
- *
1913
- * @author Jeongho Nam - https://github.com/samchon
1914
- */
1915
- export function createValidateClone<T>(): (
1916
- input: unknown,
1917
- ) => IValidation<Primitive<T>>;
1918
-
1919
- /**
1920
- * @internal
1921
- */
1922
- export function createValidateClone(): never {
1923
- halt("createValidateClone");
1924
- }
1925
- Object.assign(createValidateClone, validateClone);
1926
-
1927
- /**
1928
- * Creates a reusable {@link prune} function.
1929
- *
1930
- * @danger You have to specify the generic argument `T`
1931
- * @return Nothing until specifying the generic argument `T`
1932
- * @throws compile error
1933
- *
1934
- * @author Jeongho Nam - https://github.com/samchon
1935
- */
1936
- export function createPrune(): never;
1937
-
1938
- /**
1939
- * Creates a resuable {@link prune} function.
1940
- *
1941
- * @template T Type of the input value
1942
- * @returns A reusable `prune` function
1943
- *
1944
- * @author Jeongho Nam - https://github.com/samchon
1945
- */
1946
- export function createPrune<T extends object>(): (input: T) => void;
1947
-
1948
- /**
1949
- * @internal
1950
- */
1951
- export function createPrune<T extends object>(): (input: T) => void {
1952
- halt("createPrune");
1953
- }
1954
- Object.assign(createPrune, prune);
1955
-
1956
- /**
1957
- * Creates a reusable {@link assertPrune} function.
1958
- *
1959
- * @danger You have to specify the generic argument `T`
1960
- * @return Nothing until specifying the generic argument `T`
1961
- * @throws compile error
1962
- *
1963
- * @author Jeongho Nam - https://github.com/samchon
1964
- */
1965
- export function createAssertPrune(): never;
1966
-
1967
- /**
1968
- * Creates a resuable {@link assertPrune} function.
1969
- *
1970
- * @template T Type of the input value
1971
- * @returns A reusable `isPrune` function
1972
- *
1973
- * @author Jeongho Nam - https://github.com/samchon
1974
- */
1975
- export function createAssertPrune<T extends object>(): (input: T) => T;
1976
-
1977
- /**
1978
- * @internal
1979
- */
1980
- export function createAssertPrune<T extends object>(): (input: T) => T {
1981
- halt("createAssertPrune");
1982
- }
1983
- Object.assign(createAssertPrune, assertPrune);
1984
-
1985
- /**
1986
- * Creates a reusable {@link isPrune} function.
1987
- *
1988
- * @danger You have to specify the generic argument `T`
1989
- * @return Nothing until specifying the generic argument `T`
1990
- * @throws compile error
1991
- *
1992
- * @author Jeongho Nam - https://github.com/samchon
1993
- */
1994
- export function createIsPrune(): never;
1995
-
1996
- /**
1997
- * Creates a resuable {@link isPrune} function.
1998
- *
1999
- * @template T Type of the input value
2000
- * @returns A reusable `isPrune` function
2001
- *
2002
- * @author Jeongho Nam - https://github.com/samchon
2003
- */
2004
- export function createIsPrune<T extends object>(): (input: T) => input is T;
2005
-
2006
- /**
2007
- * @internal
2008
- */
2009
- export function createIsPrune<T extends object>(): (input: T) => input is T {
2010
- halt("createIsPrune");
2011
- }
2012
- Object.assign(createIsPrune, isPrune);
2013
-
2014
- /**
2015
- * Creates a reusable {@link validatePrune} function.
2016
- *
2017
- * @danger You have to specify the generic argument `T`
2018
- * @return Nothing until specifying the generic argument `T`
2019
- * @throws compile error
2020
- *
2021
- * @author Jeongho Nam - https://github.com/samchon
2022
- */
2023
- export function createValidatePrune(): never;
2024
-
2025
- /**
2026
- * Creates a resuable {@link validatePrune} function.
2027
- *
2028
- * @template T Type of the input value
2029
- * @returns A reusable `validatePrune` function
2030
- *
2031
- * @author Jeongho Nam - https://github.com/samchon
2032
- */
2033
- export function createValidatePrune<T extends object>(): (
2034
- input: T,
2035
- ) => IValidation<T>;
2036
-
2037
- /**
2038
- * @internal
2039
- */
2040
- export function createValidatePrune<T extends object>(): (
2041
- input: T,
2042
- ) => IValidation<T> {
2043
- halt("createValidatePrune");
2044
- }
2045
- Object.assign(createValidatePrune, validatePrune);
2046
-
2047
- /**
2048
- * @internal
2049
- */
2050
- function halt(name: string): never {
2051
- throw new Error(
2052
- `Error on typia.${name}(): no transform has been configured. Run "npx typia setup" command.`,
2053
- );
2054
- }
1
+ import { $dictionary } from "./functional/$dictionary";
2
+ import { Namespace } from "./functional/Namespace";
3
+
4
+ import { IMetadataApplication } from "./metadata/IMetadataApplication";
5
+ import { IJsonApplication } from "./schemas/IJsonApplication";
6
+
7
+ import { Atomic } from "./typings/Atomic";
8
+
9
+ import { MapUtil } from "./utils/MapUtil";
10
+
11
+ import { CustomValidatorMap } from "./CustomValidatorMap";
12
+ import { IRandomGenerator } from "./IRandomGenerator";
13
+ import { IValidation } from "./IValidation";
14
+ import { Primitive } from "./Primitive";
15
+ import { TypeGuardError } from "./TypeGuardError";
16
+
17
+ export * from "./schemas/IJsonApplication";
18
+ export * from "./schemas/IJsonComponents";
19
+ export * from "./schemas/IJsonSchema";
20
+ export * from "./IRandomGenerator";
21
+ export * from "./IValidation";
22
+ export * from "./Primitive";
23
+ export * from "./TypeGuardError";
24
+
25
+ /* ===========================================================
26
+ SINGLE FUNCTIONS
27
+ - BASIC VALIDATORS
28
+ - STRICT VALIDATORS
29
+ - JSON FUNCTIONS
30
+ - MISCELLANEOUS
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
+ *
45
+ * On the other and, if you don't want to allow any superfluous property that is not
46
+ * enrolled to the type `T`, you can use {@link assertEquals} function instead.
47
+ *
48
+ * @template T Type of the input value
49
+ * @param input A value to be asserted
50
+ * @returns Parametric input value
51
+ * @throws A {@link TypeGuardError} instance with detailed reason
52
+ *
53
+ * @author Jeongho Nam - https://github.com/samchon
54
+ */
55
+ export function assert<T>(input: T): T;
56
+
57
+ /**
58
+ * Asserts a value type.
59
+ *
60
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
61
+ * reason, if the parametric value is not following the type `T`. Otherwise, the
62
+ * value is following the type `T`, just input parameter would be returned.
63
+ *
64
+ * If what you want is not asserting but just knowing whether the parametric value is
65
+ * following the type `T` or not, you can choose the {@link is} function instead.
66
+ * Otherwise, you want to know all the errors, {@link validate} is the way to go.
67
+ *
68
+ * On the other and, if you don't want to allow any superfluous property that is not
69
+ * enrolled to the type `T`, you can use {@link assertEquals} function instead.
70
+ *
71
+ * @template T Type of the input value
72
+ * @param input A value to be asserted
73
+ * @returns Parametric input value casted as `T`
74
+ * @throws A {@link TypeGuardError} instance with detailed reason
75
+ *
76
+ * @author Jeongho Nam - https://github.com/samchon
77
+ */
78
+ export function assert<T>(input: unknown): T;
79
+
80
+ /**
81
+ * @internal
82
+ */
83
+ export function assert(): never {
84
+ halt("assert");
85
+ }
86
+ Object.assign(assert, Namespace.assert("assert"));
87
+
88
+ /**
89
+ * Asserts a value type.
90
+ *
91
+ * Duplicated function of {@link assert} for `typescript-is` users.
92
+ *
93
+ * @template T Type of the input value
94
+ * @param input A value to be asserted
95
+ * @returns Parametric input value
96
+ * @throws A {@link TypeGuardError} instance with detailed reason
97
+ *
98
+ * @author Jeongho Nam - https://github.com/samchon
99
+ * @deprecated
100
+ */
101
+ export function assertType<T>(input: T): T;
102
+
103
+ /**
104
+ * Asserts a value type.
105
+ *
106
+ * Duplicated function of {@link assert} for `typescript-is` users.
107
+ *
108
+ * @template T Type of the input value
109
+ * @param input A value to be asserted
110
+ * @returns Parametric input value
111
+ * @throws A {@link TypeGuardError} instance with detailed reason
112
+ *
113
+ * @author Jeongho Nam - https://github.com/samchon
114
+ * @deprecated
115
+ */
116
+ export function assertType<T>(input: unknown): T;
117
+
118
+ /**
119
+ * @internal
120
+ */
121
+ export function assertType(): never {
122
+ halt("assertType");
123
+ }
124
+ Object.assign(assertType, Namespace.assert("assertType"));
125
+
126
+ /**
127
+ * Tests a value type.
128
+ *
129
+ * Tests a parametric value type and returns whether it's following the type `T` or not.
130
+ * If the parametric value is matched with the type `T`, `true` value would be returned.
131
+ * Otherwise, the parametric value is not following the type `T`, `false` value would be
132
+ * returned.
133
+ *
134
+ * If what you want is not just knowing whether the parametric value is following the
135
+ * type `T` or not, but throwing an exception with detailed reason, you can choose
136
+ * {@link assert} function instead. Also, if you want to know all the errors with
137
+ * detailed reasons, {@link validate} function would be useful.
138
+ *
139
+ * On the other and, if you don't want to allow any superfluous property that is not
140
+ * enrolled to the type `T`, you can use {@link equals} function instead.
141
+ *
142
+ * @template T Type of the input value
143
+ * @param input A value to be tested
144
+ * @returns Whether the parametric value is following the type `T` or not
145
+ *
146
+ * @author Jeongho Nam - https://github.com/samchon
147
+ */
148
+ export function is<T>(input: T): input is T;
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: unknown): input is T;
173
+
174
+ /**
175
+ * @internal
176
+ */
177
+ export function is(): never {
178
+ halt("is");
179
+ }
180
+ Object.assign(is, Namespace.assert("is"));
181
+
182
+ /**
183
+ * Validates a value type.
184
+ *
185
+ * Validates a parametric value type and archives all the type errors into an
186
+ * {@link IValidation.errors} array, if the parametric value is not following the
187
+ * type `T`. Of course, if the parametric value is following the type `T`, the
188
+ * {@link IValidation.errors} array would be empty and {@link IValidation.success}
189
+ * would have the `true` value.
190
+ *
191
+ * If what you want is not finding all the error, but asserting the parametric value
192
+ * type with exception throwing, you can choose {@link assert} function instead.
193
+ * Otherwise, you just want to know whether the parametric value is matched with the
194
+ * type `T`, {@link is} function is the way to go.
195
+ *
196
+ * On the other and, if you don't want to allow any superfluous property that is not
197
+ * enrolled to the type `T`, you can use {@link validateEquals} function instead.
198
+ *
199
+ * @template Type of the input value
200
+ * @param input A value to be validated
201
+ * @returns Validation result
202
+ *
203
+ * @author Jeongho Nam - https://github.com/samchon
204
+ */
205
+ export function validate<T>(input: T): IValidation<T>;
206
+
207
+ /**
208
+ * Validates a value type.
209
+ *
210
+ * Validates a parametric value type and archives all the type errors into an
211
+ * {@link IValidation.errors} array, if the parametric value is not following the
212
+ * type `T`. Of course, if the parametric value is following the type `T`, the
213
+ * {@link IValidation.errors} array would be empty and {@link IValidation.success}
214
+ * would have the `true` value.
215
+ *
216
+ * If what you want is not finding all the error, but asserting the parametric value
217
+ * type with exception throwing, you can choose {@link assert} function instead.
218
+ * Otherwise, you just want to know whether the parametric value is matched with the
219
+ * type `T`, {@link is} function is the way to go.
220
+ *
221
+ * On the other and, if you don't want to allow any superfluous property that is not
222
+ * enrolled to the type `T`, you can use {@link validateEquals} function instead.
223
+ *
224
+ * @template Type of the input value
225
+ * @param input A value to be validated
226
+ * @returns Validation result
227
+ *
228
+ * @author Jeongho Nam - https://github.com/samchon
229
+ */
230
+ export function validate<T>(input: unknown): IValidation<T>;
231
+
232
+ /**
233
+ * @internal
234
+ */
235
+ export function validate(): never {
236
+ halt("validate");
237
+ }
238
+ Object.assign(validate, Namespace.validate());
239
+
240
+ /* -----------------------------------------------------------
241
+ STRICT VALIDATORS
242
+ ----------------------------------------------------------- */
243
+ /**
244
+ * Asserts equality between a value and its type.
245
+ *
246
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
247
+ * reason, if the parametric value is not following the type `T` or some superfluous
248
+ * property that is not listed on the type `T` has been found. Otherwise, the value is
249
+ * following the type `T` without any superfluous property, just input parameter would
250
+ * be returned.
251
+ *
252
+ * If what you want is not asserting but just knowing whether the parametric value is
253
+ * following the type `T` or not, you can choose the {@link equals} function instead.
254
+ * Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
255
+ *
256
+ * On the other hand, if you want to allow superfluous property that is not enrolled
257
+ * to the type `T`, you can use {@link assert} function instead.
258
+ *
259
+ * @template T Type of the input value
260
+ * @param input A value to be asserted
261
+ * @returns Parametric input value
262
+ * @throws A {@link TypeGuardError} instance with detailed reason
263
+ *
264
+ * @author Jeongho Nam - https://github.com/samchon
265
+ */
266
+ export function assertEquals<T>(input: T): T;
267
+
268
+ /**
269
+ * Asserts equality between a value and its type.
270
+ *
271
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
272
+ * reason, if the parametric value is not following the type `T` or some superfluous
273
+ * property that is not listed on the type `T` has been found. Otherwise, the value is
274
+ * following the type `T` without any superfluous property, just input parameter would
275
+ * be returned.
276
+ *
277
+ * If what you want is not asserting but just knowing whether the parametric value is
278
+ * following the type `T` or not, you can choose the {@link equals} function instead.
279
+ * Otherwise, you want to know all the errors, {@link validateEquals} is the way to go.
280
+ *
281
+ * On the other hand, if you want to allow superfluous property that is not enrolled
282
+ * to the type `T`, you can use {@link assert} function instead.
283
+ *
284
+ * @template T Type of the input value
285
+ * @param input A value to be asserted
286
+ * @returns Parametric input value casted as `T`
287
+ * @throws A {@link TypeGuardError} instance with detailed reason
288
+ *
289
+ * @author Jeongho Nam - https://github.com/samchon
290
+ */
291
+ export function assertEquals<T>(input: unknown): T;
292
+
293
+ /**
294
+ * @internal
295
+ */
296
+ export function assertEquals(): never {
297
+ halt("assertEquals");
298
+ }
299
+ Object.assign(assertEquals, Namespace.assert("assertEquals"));
300
+
301
+ /**
302
+ * Tests equality between a value and its type.
303
+ *
304
+ * Tests a parametric value type and returns whether it's equivalent to the type `T`
305
+ * or not. If the parametric value is matched with the type `T` and there's not any
306
+ * superfluous property that is not listed on the type `T`, `true` value would be
307
+ * returned. Otherwise, the parametric value is not following the type `T` or some
308
+ * superfluous property exists, `false` value would be returned.
309
+ *
310
+ * If what you want is not just knowing whether the parametric value is following the
311
+ * type `T` or not, but throwing an exception with detailed reason, you can choose
312
+ * {@link assertEquals} function instead. Also, if you want to know all the errors with
313
+ * detailed reasons, {@link validateEquals} function would be useful.
314
+ *
315
+ * On the other hand, if you want to allow superfluous property that is not enrolled
316
+ * to the type `T`, you can use {@link is} function instead.
317
+ *
318
+ * @template T Type of the input value
319
+ * @param input A value to be tested
320
+ * @returns Whether the parametric value is equivalent to the type `T` or not
321
+ *
322
+ * @author Jeongho Nam - https://github.com/samchon
323
+ */
324
+ export function equals<T>(input: T): input is T;
325
+
326
+ /**
327
+ * Tests equality between a value and its type.
328
+ *
329
+ * Tests a parametric value type and returns whether it's equivalent to the type `T`
330
+ * or not. If the parametric value is matched with the type `T` and there's not any
331
+ * superfluous property that is not listed on the type `T`, `true` value would be
332
+ * returned. Otherwise, the parametric value is not following the type `T` or some
333
+ * superfluous property exists, `false` value would be returned.
334
+ *
335
+ * If what you want is not just knowing whether the parametric value is following the
336
+ * type `T` or not, but throwing an exception with detailed reason, you can choose
337
+ * {@link assertEquals} function instead. Also, if you want to know all the errors with
338
+ * detailed reasons, {@link validateEquals} function would be useful.
339
+ *
340
+ * On the other hand, if you want to allow superfluous property that is not enrolled
341
+ * to the type `T`, you can use {@link is} function instead.
342
+ *
343
+ * @template T Type of the input value
344
+ * @param input A value to be tested
345
+ * @returns Whether the parametric value is equivalent to the type `T` or not
346
+ *
347
+ * @author Jeongho Nam - https://github.com/samchon
348
+ */
349
+ export function equals<T>(input: unknown): input is T;
350
+
351
+ /**
352
+ * @internal
353
+ */
354
+ export function equals(): never {
355
+ halt("equals");
356
+ }
357
+ Object.assign(equals, Namespace.is());
358
+
359
+ /**
360
+ * Validates equality between a value and its type.
361
+ *
362
+ * Validates a parametric value type and archives all the type errors into an
363
+ * {@link IValidation.errors} array, if the parametric value is not following the
364
+ * type `T` or some superfluous property that is not listed on the type `T` has been
365
+ * found. Of course, if the parametric value is following the type `T` and no
366
+ * superfluous property exists, the {@link IValidation.errors} array would be empty
367
+ * and {@link IValidation.success} would have the `true` value.
368
+ *
369
+ * If what you want is not finding all the error, but asserting the parametric value
370
+ * type with exception throwing, you can choose {@link assert} function instead.
371
+ * Otherwise, you just want to know whether the parametric value is matched with the
372
+ * type `T`, {@link is} function is the way to go.
373
+ *
374
+ * On the other and, if you don't want to allow any superfluous property that is not
375
+ * enrolled to the type `T`, you can use {@link validateEquals} function instead.
376
+ *
377
+ * @template Type of the input value
378
+ * @param input A value to be validated
379
+ * @returns Validation result
380
+ *
381
+ * @author Jeongho Nam - https://github.com/samchon
382
+ */
383
+ export function validateEquals<T>(input: T): IValidation<T>;
384
+
385
+ /**
386
+ * Validates equality between a value and its type.
387
+ *
388
+ * Validates a parametric value type and archives all the type errors into an
389
+ * {@link IValidation.errors} array, if the parametric value is not following the
390
+ * type `T` or some superfluous property that is not listed on the type `T` has been
391
+ * found. Of course, if the parametric value is following the type `T` and no
392
+ * superfluous property exists, the {@link IValidation.errors} array would be empty
393
+ * and {@link IValidation.success} would have the `true` value.
394
+ *
395
+ * If what you want is not finding all the error, but asserting the parametric value
396
+ * type with exception throwing, you can choose {@link assert} function instead.
397
+ * Otherwise, you just want to know whether the parametric value is matched with the
398
+ * type `T`, {@link is} function is the way to go.
399
+ *
400
+ * On the other and, if you don't want to allow any superfluous property that is not
401
+ * enrolled to the type `T`, you can use {@link validateEquals} function instead.
402
+ *
403
+ * @template Type of the input value
404
+ * @param input A value to be validated
405
+ * @returns Validation result
406
+ *
407
+ * @author Jeongho Nam - https://github.com/samchon
408
+ */
409
+ export function validateEquals<T>(input: unknown): IValidation<T>;
410
+
411
+ /**
412
+ * @internal
413
+ */
414
+ export function validateEquals(): never {
415
+ halt("validateEquals");
416
+ }
417
+ Object.assign(validateEquals, Namespace.validate());
418
+
419
+ /**
420
+ * Custom validators.
421
+ *
422
+ * If you want to add a custom validation logic utilizing comment tags,
423
+ * add a closure function with its tag and type name. Below example code
424
+ * would helpful to understand how to use this instance.
425
+ *
426
+ * ```ts
427
+ * typia.customValidators.insert("powerOf")("number")(
428
+ * (text: string) => {
429
+ * const denominator: number = Math.log(Number(text));
430
+ * return (value: number) => {
431
+ * value = Math.log(value) / denominator;
432
+ * return value === Math.floor(value);
433
+ * };
434
+ * }
435
+ * );
436
+ * typia.customValidators.insert("dollar")("string")(
437
+ * () => (value: string) => value.startsWith("$"),
438
+ * );
439
+ *
440
+ * interface TagCustom {
441
+ * /**
442
+ * * @powerOf 10
443
+ * *\/
444
+ * powerOf: number;
445
+ *
446
+ * /**
447
+ * * @dollar
448
+ * *\/
449
+ * dollar: string;
450
+ * }
451
+ * ```
452
+ *
453
+ * @author Jeongho Nam - https://github.com/samchon
454
+ */
455
+ export const customValidators: CustomValidatorMap = {
456
+ size: (name?: string) =>
457
+ name ? $dictionary.get(name)?.size ?? 0 : $dictionary.size,
458
+ has: (name) => (type) => $dictionary.get(name)?.has(type) ?? false,
459
+ get: (name) => (type) => $dictionary.get(name)?.get(type),
460
+ insert: (name) => (type) => (closure) => {
461
+ const internal = MapUtil.take($dictionary)(name, () => new Map());
462
+ if (internal.has(type)) return false;
463
+ internal.set(type, closure);
464
+ return true;
465
+ },
466
+ erase: (name) => (type) => $dictionary.get(name)?.delete(type) ?? false,
467
+ };
468
+
469
+ /* -----------------------------------------------------------
470
+ JSON FUNCTIONS
471
+ ----------------------------------------------------------- */
472
+ /**
473
+ * > You must configure the generic argument `T`.
474
+ *
475
+ * JSON Schema Application.
476
+ *
477
+ * Creates a JSON schema application which contains both main JSON schemas and components.
478
+ * Note that, all of the object types are stored in the {@link IJsonApplication.components}
479
+ * property for the `$ref` referencing.
480
+ *
481
+ * Also, `typia.application()` has additional generic arguments, *Purpose*.
482
+ * As JSON schema definitions used by `swagger` and `ajv` are different a little bit,
483
+ * you should configure the *Purpose* appropriately.
484
+ *
485
+ * For an example, `ajv` has an extra property "$recursiveRef" that are not exists
486
+ * in the standard JSON schema definition spec. Otherwise, `swagger` can't identify
487
+ * the tuple definition.
488
+ *
489
+ * @template Types Tuple of target types
490
+ * @template Purpose Purpose of the JSON schema`
491
+ * @return JSON schema application
492
+ *
493
+ * @author Jeongho Nam - https://github.com/samchon
494
+ */
495
+ export function application(): never;
496
+
497
+ /**
498
+ * JSON Schema Application.
499
+ *
500
+ * Creates a JSON schema application which contains both main JSON schemas and components.
501
+ * Note that, all of the object types are stored in the {@link IJsonApplication.components}
502
+ * property for the `$ref` referencing.
503
+ *
504
+ * Also, `typia.application()` has additional generic arguments, *Purpose*.
505
+ * As JSON schema definitions used by `swagger` and `ajv` are different a little bit,
506
+ * you should configure the *Purpose* appropriately.
507
+ *
508
+ * For an example, `ajv` has an extra property "$recursiveRef" that are not exists
509
+ * in the standard JSON schema definition spec. Otherwise, `swagger` can't identify
510
+ * the tuple definition.
511
+ *
512
+ * @template Types Tuple of target types
513
+ * @template Purpose Purpose of the JSON schema
514
+ * @return JSON schema application
515
+ *
516
+ * @author Jeongho Nam - https://github.com/samchon
517
+ */
518
+ export function application<
519
+ Types extends unknown[],
520
+ Purpose extends "ajv" | "swagger" = "swagger",
521
+ >(): IJsonApplication;
522
+
523
+ /**
524
+ * @internal
525
+ */
526
+ export function application(): never {
527
+ halt("application");
528
+ }
529
+
530
+ /**
531
+ * > You must configure the generic argument `T`.
532
+ *
533
+ * Safe `JSON.parse()` function with type assertion.
534
+ *
535
+ * `typia.assertParse()` is a combination function of `JSON.parse()` and {@link assert}.
536
+ * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
537
+ * instance with type assertion.
538
+ *
539
+ * In such reason, when parsed JSON string value is not matched with the type `T`, it
540
+ * throws {@link TypeGuardError}. Otherwise, there's no problem on the parsed value,
541
+ * the parsed value would be returned.
542
+ *
543
+ * @template T Expected type of parsed value
544
+ * @param input JSON string
545
+ * @returns Parsed value
546
+ *
547
+ * @author Jeongho Nam - https://github.com/samchon
548
+ */
549
+ export function assertParse(input: string): never;
550
+
551
+ /**
552
+ * Safe `JSON.parse()` function with type assertion.
553
+ *
554
+ * `typia.assertParse()` is a combination function of `JSON.parse()` and {@link assert}.
555
+ * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
556
+ * instance with type assertion.
557
+ *
558
+ * In such reason, when parsed JSON string value is not matched with the type `T`, it
559
+ * throws {@link TypeGuardError}. Otherwise, there's no problem on the parsed value,
560
+ * the parsed value would be returned.
561
+ *
562
+ * @template T Expected type of parsed value
563
+ * @param input JSON string
564
+ * @returns Parsed value
565
+ *
566
+ * @author Jeongho Nam - https://github.com/samchon
567
+ */
568
+ export function assertParse<T>(input: string): Primitive<T>;
569
+
570
+ /**
571
+ * @internal
572
+ */
573
+ export function assertParse<T>(): Primitive<T> {
574
+ halt("assertParse");
575
+ }
576
+ Object.assign(assertParse, Namespace.assert("assertParse"));
577
+
578
+ /**
579
+ * > You must configure the generic argument `T`.
580
+ *
581
+ * Safe `JSON.parse()` function with type checking.
582
+ *
583
+ * `typia.isParse()` is a combination function of `JSON.parse()` and {@link is}.
584
+ * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
585
+ * instance with type checking.
586
+ *
587
+ * In such reason, when parsed JSON string value is not matched with the type `T`, it
588
+ * returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
589
+ * value would be returned.
590
+ *
591
+ * @template T Expected type of parsed value
592
+ * @param input JSON string
593
+ * @returns Parsed value when exact type, otherwise `null`
594
+ *
595
+ * @author Jeongho Nam - https://github.com/samchon
596
+ */
597
+ export function isParse(input: string): never;
598
+
599
+ /**
600
+ * Safe `JSON.parse()` function with type checking.
601
+ *
602
+ * `typia.isParse()` is a combination function of `JSON.parse()` and {@link is}.
603
+ * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
604
+ * instance with type checking.
605
+ *
606
+ * In such reason, when parsed JSON string value is not matched with the type `T`, it
607
+ * returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
608
+ * value would be returned.
609
+ *
610
+ * @template T Expected type of parsed value
611
+ * @param input JSON string
612
+ * @returns Parsed value when exact type, otherwise `null`
613
+ *
614
+ * @author Jeongho Nam - https://github.com/samchon
615
+ */
616
+ export function isParse<T>(input: string): Primitive<T> | null;
617
+
618
+ /**
619
+ * @internal
620
+ */
621
+ export function isParse<T>(): Primitive<T> | null {
622
+ halt("isParse");
623
+ }
624
+ Object.assign(isParse, is);
625
+
626
+ /**
627
+ * > You must configure the generic argument `T`.
628
+ *
629
+ * Safe `JSON.parse()` function with detailed type validation.
630
+ *
631
+ * `typia.validateParse()` is a combination function of `JSON.parse()` and
632
+ * {@link validate}. Therefore, it convers a JSON (JavaScript Object Notation) string
633
+ * to a `T` typed instance with detailed type validation.
634
+ *
635
+ * In such reason, when parsed JSON string value is not matched with the type `T`, it
636
+ * returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
637
+ * there's no problem on the parsed value, the parsed value would be stored in `data`
638
+ * property of the output {@link IValidation.ISuccess} instance.
639
+ *
640
+ * @template T Expected type of parsed value
641
+ * @param input JSON string
642
+ * @returns Validation result with JSON parsed value
643
+ *
644
+ * @author Jeongho Nam - https://github.com/samchon
645
+ */
646
+ export function validateParse(input: string): never;
647
+
648
+ /**
649
+ * Safe `JSON.parse()` function with detailed type validation.
650
+ *
651
+ * `typia.validateParse()` is a combination function of `JSON.parse()` and
652
+ * {@link validate}. Therefore, it convers a JSON (JavaScript Object Notation) string
653
+ * to a `T` typed instance with detailed type validation.
654
+ *
655
+ * In such reason, when parsed JSON string value is not matched with the type `T`, it
656
+ * returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
657
+ * there's no problem on the parsed value, the parsed value would be stored in `data`
658
+ * property of the output {@link IValidation.ISuccess} instance.
659
+ *
660
+ * @template T Expected type of parsed value
661
+ * @param input JSON string
662
+ * @returns Validation result with JSON parsed value
663
+ *
664
+ * @author Jeongho Nam - https://github.com/samchon
665
+ */
666
+ export function validateParse<T>(input: string): IValidation<Primitive<T>>;
667
+
668
+ /**
669
+ * @internal
670
+ */
671
+ export function validateParse<T>(): IValidation<Primitive<T>> {
672
+ halt("validateParse");
673
+ }
674
+ Object.assign(validateParse, validate);
675
+
676
+ /**
677
+ * 8x faster `JSON.stringify()` function.
678
+ *
679
+ * Converts an input value to a JSON (JavaScript Object Notation) string, about 8x faster
680
+ * than the native `JSON.stringify()` function. The 5x faster principle is because
681
+ * it writes an optimized JSON conversion plan, only for the type `T`.
682
+ *
683
+ * For reference, this `typia.stringify()` does not validate the input value type.
684
+ * It just believes that the input value is following the type `T`. Therefore, if you
685
+ * can't ensure the input value type, it would be better to call one of below functions
686
+ * instead.
687
+ *
688
+ * - {@link assertStringify}
689
+ * - {@link isStringify}
690
+ * - {@link validateStringify}
691
+ *
692
+ * @template T Type of the input value
693
+ * @param input A value to be converted
694
+ * @return JSON string value
695
+ *
696
+ * @author Jeongho Nam - https://github.com/samchon
697
+ */
698
+ export function stringify<T>(input: T): string;
699
+
700
+ /**
701
+ * @internal
702
+ */
703
+ export function stringify(): never {
704
+ halt("stringify");
705
+ }
706
+ Object.assign(stringify, Namespace.stringify("stringify"));
707
+
708
+ /**
709
+ * 5x faster `JSON.stringify()` function with type assertion.
710
+ *
711
+ * `typia.assertStringify()` is a combination function of {@link assert} and
712
+ * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
713
+ * Notation) string, with type assertion.
714
+ *
715
+ * In such reason, when `input` value is not matched with the type `T`, it throws an
716
+ * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, JSON
717
+ * string would be returned.
718
+ *
719
+ * For reference, with type assertion, it is even 5x times faster than the native
720
+ * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
721
+ * with confidence.
722
+ *
723
+ * @template T Type of the input value
724
+ * @param input A value to be asserted and converted
725
+ * @return JSON string value
726
+ *
727
+ * @author Jeongho Nam - https://github.com/samchon
728
+ */
729
+ export function assertStringify<T>(input: T): string;
730
+
731
+ /**
732
+ * 5x faster `JSON.stringify()` function with type assertion.
733
+ *
734
+ * `typia.assertStringify()` is a combination function of {@link assert} and
735
+ * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
736
+ * Notation) string, with type assertion.
737
+ *
738
+ * In such reason, when `input` value is not matched with the type `T`, it throws an
739
+ * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, JSON
740
+ * string would be returned.
741
+ *
742
+ * For reference, with type assertion, it is even 5x times faster than the native
743
+ * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
744
+ * with confidence.
745
+ *
746
+ * @template T Type of the input value
747
+ * @param input A value to be asserted and converted
748
+ * @return JSON string value
749
+ *
750
+ * @author Jeongho Nam - https://github.com/samchon
751
+ */
752
+ export function assertStringify<T>(input: T): unknown;
753
+
754
+ /**
755
+ * @internal
756
+ */
757
+ export function assertStringify(): string {
758
+ halt("assertStringify");
759
+ }
760
+ Object.assign(assertStringify, Namespace.assert("assertStringify"));
761
+ Object.assign(assertStringify, Namespace.stringify("assertStringify"));
762
+
763
+ /**
764
+ * 7x faster `JSON.stringify()` function with type checking.
765
+ *
766
+ * `typia.stringify()` is a combination function of {@link is} and
767
+ * {@link stringify}. Therefore, it converts an input value to JSON
768
+ * (JavaScript Object Notation) string, with type checking.
769
+ *
770
+ * In such reason, when `input` value is not matched with the type `T`, it returns
771
+ * `null` value. Otherwise, there's no problem on the `input` value, JSON string would
772
+ * be returned.
773
+ *
774
+ * For reference, with type checking, it is even 7x times faster than the native
775
+ * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
776
+ * with confidence.
777
+ *
778
+ * @template T Type of the input value
779
+ * @param input A value to be checked and converted
780
+ * @return JSON string value when exact type, otherwise null
781
+ *
782
+ * @author Jeongho Nam - https://github.com/samchon
783
+ */
784
+ export function isStringify<T>(input: T): string | null;
785
+
786
+ /**
787
+ * 7x faster `JSON.stringify()` function with type checking.
788
+ *
789
+ * `typia.isStringify()` is a combination function of {@link is} and
790
+ * {@link stringify}. Therefore, it converts an input value to JSON
791
+ * (JavaScript Object Notation) string, with type checking.
792
+ *f
793
+ * In such reason, when `input` value is not matched with the type `T`, it returns
794
+ * `null` value. Otherwise, there's no problem on the `input` value, JSON string would
795
+ * be returned.
796
+ *
797
+ * For reference, with type checking, it is even 7x times faster than the native
798
+ * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
799
+ * with confidence.
800
+ *
801
+ * @template T Type of the input value
802
+ * @param input A value to be checked and converted
803
+ * @return JSON string value when exact type, otherwise null
804
+ *
805
+ * @author Jeongho Nam - https://github.com/samchon
806
+ */
807
+ export function isStringify<T>(input: unknown): string | null;
808
+
809
+ /**
810
+ * @internal
811
+ */
812
+ export function isStringify(): string | null {
813
+ halt("isStringify");
814
+ }
815
+
816
+ Object.assign(isStringify, Namespace.is());
817
+ Object.assign(isStringify, Namespace.stringify("isStringify"));
818
+
819
+ /**
820
+ * 5x faster `JSON.stringify()` function with detailed type validation.
821
+ *
822
+ * `typia.validateStringify()` is a combination function of {@link validate} and
823
+ * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
824
+ * Notation) string, with detailed type validation.
825
+ *
826
+ * In such reason, when `input` value is not matched with the type `T`, it returns
827
+ * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's no
828
+ * problem on the `input` value, JSON string would be stored in `data` property of
829
+ * the output {@link IValidation.ISuccess} instance.
830
+ *
831
+ * For reference, with detailed type validation, it is even 5x times faster than the
832
+ * native `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
833
+ * with confidence.
834
+ *
835
+ * @template T Type of the input value
836
+ * @param input A value to be checked and converted
837
+ * @returns Validation result with JSON string value
838
+ *
839
+ * @author Jeongho Nam - https://github.com/samchon
840
+ */
841
+ export function validateStringify<T>(input: T): IValidation<string>;
842
+
843
+ /**
844
+ * 5x faster `JSON.stringify()` function with detailed type validation.
845
+ *
846
+ * `typia.validateStringify()` is a combination function of {@link validate} and
847
+ * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
848
+ * Notation) string, with detailed type validation.
849
+ *
850
+ * In such reason, when `input` value is not matched with the type `T`, it returns
851
+ * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's no
852
+ * problem on the `input` value, JSON string would be stored in `data` property of
853
+ * the output {@link IValidation.ISuccess} instance.
854
+ *
855
+ * For reference, with detailed type validation, it is even 5x times faster than the
856
+ * native `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
857
+ * with confidence.
858
+ *
859
+ * @template T Type of the input value
860
+ * @param input A value to be checked and converted
861
+ * @returns Validation result with JSON string value
862
+ *
863
+ * @author Jeongho Nam - https://github.com/samchon
864
+ */
865
+ export function validateStringify<T>(input: unknown): IValidation<string>;
866
+
867
+ /**
868
+ * @internal
869
+ */
870
+ export function validateStringify(): IValidation<string> {
871
+ halt("validateStringify");
872
+ }
873
+ Object.assign(validateStringify, Namespace.validate());
874
+ Object.assign(validateStringify, Namespace.stringify("validateStringify"));
875
+
876
+ /* -----------------------------------------------------------
877
+ MISCELLANEOUS
878
+ ----------------------------------------------------------- */
879
+ /**
880
+ * @internal
881
+ */
882
+ export function metadata(): never;
883
+
884
+ /**
885
+ * @internal
886
+ */
887
+ export function metadata<Types extends unknown[]>(): IMetadataApplication;
888
+
889
+ /**
890
+ * @internal
891
+ */
892
+ export function metadata(): never {
893
+ halt("metadata");
894
+ }
895
+
896
+ /**
897
+ * > You must configure the generic argument `T`.
898
+ *
899
+ * Generate random data.
900
+ *
901
+ * Generates a random data following type the `T`.
902
+ *
903
+ * For reference, this `typia.random()` function generates only primitive type.
904
+ * If there're some methods in the type `T` or its nested instances, those would
905
+ * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
906
+ * would be generated instead.
907
+ *
908
+ * @template T Type of data to generate
909
+ * @param generator Random data generator
910
+ * @return Randomly generated data
911
+ *
912
+ * @author Jeongho Nam - https://github.com/samchon
913
+ */
914
+ export function random(generator?: Partial<IRandomGenerator>): never;
915
+
916
+ /**
917
+ * Generate random data.
918
+ *
919
+ * Generates a random data following type the `T`.
920
+ *
921
+ * For reference, this `typia.random()` function generates only primitive type.
922
+ * If there're some methods in the type `T` or its nested instances, those would
923
+ * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
924
+ * would be generated instead.
925
+ *
926
+ * @template T Type of data to generate
927
+ * @param generator Random data generator
928
+ * @return Randomly generated data
929
+ *
930
+ * @author Jeongho Nam - https://github.com/samchon
931
+ */
932
+ export function random<T>(generator?: Partial<IRandomGenerator>): Primitive<T>;
933
+
934
+ /**
935
+ * @internal
936
+ */
937
+ export function random(): never {
938
+ halt("random");
939
+ }
940
+ Object.assign(random, Namespace.random());
941
+
942
+ /**
943
+ * > You must configure the generic argument `T`.
944
+ *
945
+ * Union literal type to array.
946
+ *
947
+ * Converts a union literal type to an array of its members.
948
+ *
949
+ * ```typescript
950
+ * literals<"A" | "B" | 1>; // [1, 2, 3] as const
951
+ * ```
952
+ *
953
+ * @template T Union literal type
954
+ * @return Array of union literal type's members
955
+ *
956
+ * @author Jeongho Nam - https://github.com/samchon
957
+ */
958
+ export function literals(): never;
959
+
960
+ /**
961
+ * Union literal type to array.
962
+ *
963
+ * Converts a union literal type to an array of its members.
964
+ *
965
+ * ```typescript
966
+ * literals<"A" | "B" | 1>; // [1, 2, 3] as const
967
+ * ```
968
+ *
969
+ * @template T Union literal type
970
+ * @return Array of union literal type's members
971
+ *
972
+ * @author Jeongho Nam - https://github.com/samchon
973
+ */
974
+ export function literals<T extends Atomic.Type>(): T[];
975
+
976
+ /**
977
+ * @internal
978
+ */
979
+ export function literals(): never {
980
+ halt("literals");
981
+ }
982
+
983
+ /**
984
+ * Clone a data.
985
+ *
986
+ * Clones an instance following type `T`. If the target *input* value or its member
987
+ * variable contains a class instance that is having a `toJSON()` method, its return
988
+ * value would be cloned.
989
+ *
990
+ * For reference, this `typia.clone()` function does not validate the input value type.
991
+ * It just believes that the input value is following the type `T`. Therefore, if you
992
+ * can't ensure the input value type, it would be better to call {@link assertClone}
993
+ * function instead.
994
+ *
995
+ * @template T Type of the input value
996
+ * @param input A value to be cloned
997
+ * @return Cloned data
998
+ *
999
+ * @author Jeongho Nam - https://github.com/samchon
1000
+ */
1001
+ export function clone<T>(input: T): Primitive<T>;
1002
+
1003
+ /**
1004
+ * @internal
1005
+ */
1006
+ export function clone(): never {
1007
+ halt("clone");
1008
+ }
1009
+ Object.assign(clone, Namespace.clone("clone"));
1010
+
1011
+ /**
1012
+ * Clone a data with type assertion.
1013
+ *
1014
+ * Clones an instance following type `T`, with type assertion. If the target `input`
1015
+ * value or its member variable contains a class instance that is having a `toJSON()`
1016
+ * method, its return value would be cloned.
1017
+ *
1018
+ * In such reason, when `input` value is not matched with the type `T`, it throws an
1019
+ * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, cloned
1020
+ * data would be returned.
1021
+ *
1022
+ * @template T Type of the input value
1023
+ * @param input A value to be cloned
1024
+ * @return Cloned data
1025
+ *
1026
+ * @author Jeongho Nam - https://github.com/samchon
1027
+ */
1028
+ export function assertClone<T>(input: T): Primitive<T>;
1029
+
1030
+ /**
1031
+ * Clone a data with type assertion.
1032
+ *
1033
+ * Clones an instance following type `T`, with type assertion. If the target `input`
1034
+ * value or its member variable contains a class instance that is having a `toJSON()`
1035
+ * method, its return value would be cloned.
1036
+ *
1037
+ * In such reason, when `input` value is not matched with the type `T`, it throws an
1038
+ * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, cloned
1039
+ * data would be returned.
1040
+ *
1041
+ * @template T Type of the input value
1042
+ * @param input A value to be cloned
1043
+ * @return Cloned data
1044
+ *
1045
+ * @author Jeongho Nam - https://github.com/samchon
1046
+ */
1047
+ export function assertClone<T>(input: unknown): Primitive<T>;
1048
+
1049
+ /**
1050
+ * @internal
1051
+ */
1052
+ export function assertClone(): never {
1053
+ halt("assertClone");
1054
+ }
1055
+ Object.assign(assertClone, Namespace.assert("assertClone"));
1056
+ Object.assign(assertClone, Namespace.clone("assertClone"));
1057
+
1058
+ /**
1059
+ * Clone a data with type checking.
1060
+ *
1061
+ * Clones an instance following type `T`, with type checking. If the target `input`
1062
+ * value or its member variable contains a class instance that is having a `toJSON()`
1063
+ * method, its return value would be cloned.
1064
+ *
1065
+ * In such reason, when `input` value is not matched with the type `T`, it returns
1066
+ * `null` value instead. Otherwise, there's no problem on the `input` value, cloned
1067
+ * data would be returned.
1068
+ *
1069
+ * @template T Type of the input value
1070
+ * @param input A value to be cloned
1071
+ * @return Cloned data when exact type, otherwise null
1072
+ *
1073
+ * @author Jeongho Nam - https://github.com/samchon
1074
+ */
1075
+ export function isClone<T>(input: T): Primitive<T> | null;
1076
+
1077
+ /**
1078
+ * Clone a data with type checking.
1079
+ *
1080
+ * Clones an instance following type `T`, with type checking. If the target `input`
1081
+ * value or its member variable contains a class instance that is having a `toJSON()`
1082
+ * method, its return value would be cloned.
1083
+ *
1084
+ * In such reason, when `input` value is not matched with the type `T`, it returns
1085
+ * `null` value instead. Otherwise, there's no problem on the `input` value, cloned
1086
+ * data would be returned.
1087
+ *
1088
+ * @template T Type of the input value
1089
+ * @param input A value to be cloned
1090
+ * @return Cloned data when exact type, otherwise null
1091
+ *
1092
+ * @author Jeongho Nam - https://github.com/samchon
1093
+ */
1094
+ export function isClone<T>(input: unknown): Primitive<T> | null;
1095
+
1096
+ /**
1097
+ * @internal
1098
+ */
1099
+ export function isClone(): never {
1100
+ halt("isClone");
1101
+ }
1102
+ Object.assign(isClone, Namespace.is());
1103
+ Object.assign(isClone, Namespace.clone("isClone"));
1104
+
1105
+ /**
1106
+ * Clone a data with detailed type validation.
1107
+ *
1108
+ * Clones an instance following type `T`, with detailed type validation. If the target
1109
+ * `input` value or its member variable contains a class instance that is having a
1110
+ * `toJSON()` method, its return value would be cloned.
1111
+ *
1112
+ * In such reason, when `input` value is not matched with the type `T`, it returns
1113
+ * {@link IValidation.Failure} value. Otherwise, there's no problem on the `input`
1114
+ * value, cloned data would be stored in `data` property of the output
1115
+ * {@link IValidation.Success} instance.
1116
+ *
1117
+ * @template T Type of the input value
1118
+ * @param input A value to be cloned
1119
+ * @returns Validation result with cloned value
1120
+ */
1121
+ export function validateClone<T>(input: T): IValidation<Primitive<T>>;
1122
+
1123
+ /**
1124
+ * Clone a data with detailed type validation.
1125
+ *
1126
+ * Clones an instance following type `T`, with detailed type validation. If the target
1127
+ * `input` value or its member variable contains a class instance that is having a
1128
+ * `toJSON()` method, its return value would be cloned.
1129
+ *
1130
+ * In such reason, when `input` value is not matched with the type `T`, it returns
1131
+ * {@link IValidation.Failure} value. Otherwise, there's no problem on the `input`
1132
+ * value, cloned data would be stored in `data` property of the output
1133
+ * {@link IValidation.Success} instance.
1134
+ *
1135
+ * @template T Type of the input value
1136
+ * @param input A value to be cloned
1137
+ * @returns Validation result with cloned value
1138
+ */
1139
+ export function validateClone<T>(input: unknown): IValidation<Primitive<T>>;
1140
+
1141
+ /**
1142
+ * @internal
1143
+ */
1144
+ export function validateClone(): never {
1145
+ halt("validateClone");
1146
+ }
1147
+ Object.assign(validateClone, Namespace.validate());
1148
+ Object.assign(validateClone, Namespace.clone("validateClone"));
1149
+
1150
+ /**
1151
+ * Prune, erase superfluous properties.
1152
+ *
1153
+ * Remove every superfluous properties from the `input` object, even including nested
1154
+ * objects. Note that, as every superfluous properties would be deleted, you never can
1155
+ * read those superfluous properties after calling this `prune()` function.
1156
+ *
1157
+ * For reference, this `typia.prune()` function does not validate the input value type.
1158
+ * It just believes that the input value is following the type `T`. Therefore, if you
1159
+ * can't ensure the input value type, it would better to call one of below functions
1160
+ * instead.
1161
+ *
1162
+ * - {@link assertPrune}
1163
+ * - {@link isPrune}
1164
+ * - {@link validatePrune}
1165
+ *
1166
+ * @template T Type of the input value
1167
+ * @param input Target instance to prune
1168
+ *
1169
+ * @author Jeongho Nam - https://github.com/samchon
1170
+ */
1171
+ export function prune<T extends object>(input: T): void;
1172
+
1173
+ /**
1174
+ * @internal
1175
+ */
1176
+ export function prune(): never {
1177
+ halt("prune");
1178
+ }
1179
+ Object.assign(prune, Namespace.prune("prune"));
1180
+
1181
+ /**
1182
+ * Prune, erase superfluous properties, with type assertion.
1183
+ *
1184
+ * `typia.assertPrune()` is a combination function of {@link assert} and {@link prune}.
1185
+ * Therefore, it removes every superfluous properties from the `input` object including
1186
+ * nested objects, with type assertion.
1187
+ *
1188
+ * In such reason, when `input` value is not matched with the type `T`, it throws an
1189
+ * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, its
1190
+ * every superfluous properties would be removed, including nested objects.
1191
+ *
1192
+ * @template T Type of the input value
1193
+ * @param input Target instance to assert and prune
1194
+ *
1195
+ * @author Jeongho Nam - https://github.com/samchon
1196
+ */
1197
+ export function assertPrune<T>(input: T): T;
1198
+
1199
+ /**
1200
+ * Prune, erase superfluous properties, with type assertion.
1201
+ *
1202
+ * `typia.assertPrune()` is a combination function of {@link assert} and {@link prune}.
1203
+ * Therefore, it removes every superfluous properties from the `input` object including
1204
+ * nested objects, with type assertion.
1205
+ *
1206
+ * In such reason, when `input` value is not matched with the type `T`, it throws an
1207
+ * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, its
1208
+ * every superfluous properties would be removed, including nested objects.
1209
+ *
1210
+ * @template T Type of the input value
1211
+ * @param input Target instance to assert and prune
1212
+ *
1213
+ * @author Jeongho Nam - https://github.com/samchon
1214
+ */
1215
+ export function assertPrune<T>(input: unknown): T;
1216
+
1217
+ /**
1218
+ * @internal
1219
+ */
1220
+ export function assertPrune(): unknown {
1221
+ halt("assertPrune");
1222
+ }
1223
+ Object.assign(assertPrune, Namespace.assert("assertPrune"));
1224
+ Object.assign(assertPrune, Namespace.prune("assertPrune"));
1225
+
1226
+ /**
1227
+ * Prune, erase superfluous properties, with type checking.
1228
+ *
1229
+ * `typia.assertPrune()` is a combination function of {@link is} and {@link prune}.
1230
+ * Therefore, it removes every superfluous properties from the `input` object including
1231
+ * nested objects, with type checking.
1232
+ *
1233
+ * In such reason, when `input` value is not matched with the type `T`, it returns
1234
+ * `false` value. Otherwise, there's no problem on the `input` value, it returns
1235
+ * `true` after removing every superfluous properties, including nested objects.
1236
+ *
1237
+ * @template T Type of the input value
1238
+ * @param input Target instance to check and prune
1239
+ * @returns Whether the parametric value is following the type `T` or not
1240
+ *
1241
+ * @author Jeongho Nam - https://github.com/samchon
1242
+ */
1243
+ export function isPrune<T>(input: T): input is T;
1244
+
1245
+ /**
1246
+ * Prune, erase superfluous properties, with type checking.
1247
+ *
1248
+ * `typia.assertPrune()` is a combination function of {@link is} and {@link prune}.
1249
+ * Therefore, it removes every superfluous properties from the `input` object including
1250
+ * nested objects, with type checking.
1251
+ *
1252
+ * In such reason, when `input` value is not matched with the type `T`, it returns
1253
+ * `false` value. Otherwise, there's no problem on the `input` value, it returns
1254
+ * `true` after removing every superfluous properties, including nested objects.
1255
+ *
1256
+ * @template T Type of the input value
1257
+ * @param input Target instance to check and prune
1258
+ * @returns Whether the parametric value is following the type `T` or not
1259
+ *
1260
+ * @author Jeongho Nam - https://github.com/samchon
1261
+ */
1262
+ export function isPrune<T>(input: unknown): input is T;
1263
+
1264
+ /**
1265
+ * @internal
1266
+ */
1267
+ export function isPrune(): never {
1268
+ halt("isPrune");
1269
+ }
1270
+ Object.assign(isPrune, Namespace.is());
1271
+ Object.assign(isPrune, Namespace.prune("isPrune"));
1272
+
1273
+ /**
1274
+ * Prune, erase superfluous properties, with type validation.
1275
+ *
1276
+ * `typia.validatePrune()` is a combination function of {@link validate} and {@link prune}.
1277
+ * Therefore, it removes every superfluous properties from the `input` object including
1278
+ * nested objects, with type validation.
1279
+ *
1280
+ * In such reason, when `input` value is not matched with the type `T`, it returns
1281
+ * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's
1282
+ * no problem on the `input` value, it returns {@link IValidation.ISucess} value after
1283
+ * removing every superfluous properties, including nested objects.
1284
+ *
1285
+ * @template T Type of the input value
1286
+ * @param input Target instance to validate and prune
1287
+ * @returns Validation result
1288
+ *
1289
+ * @author Jeongho Nam - https://github.com/samchon
1290
+ */
1291
+ export function validatePrune<T>(input: T): IValidation<T>;
1292
+
1293
+ /**
1294
+ * Prune, erase superfluous properties, with type validation.
1295
+ *
1296
+ * `typia.validatePrune()` is a combination function of {@link validate} and {@link prune}.
1297
+ * Therefore, it removes every superfluous properties from the `input` object including
1298
+ * nested objects, with type validation.
1299
+ *
1300
+ * In such reason, when `input` value is not matched with the type `T`, it returns
1301
+ * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's
1302
+ * no problem on the `input` value, it returns {@link IValidation.ISucess} value after
1303
+ * removing every superfluous properties, including nested objects.
1304
+ *
1305
+ * @template T Type of the input value
1306
+ * @param input Target instance to validate and prune
1307
+ * @returns Validation result
1308
+ *
1309
+ * @author Jeongho Nam - https://github.com/samchon
1310
+ */
1311
+ export function validatePrune<T>(input: unknown): IValidation<T>;
1312
+
1313
+ /**
1314
+ * @internal
1315
+ */
1316
+ export function validatePrune<T>(): IValidation<T> {
1317
+ halt("validatePrune");
1318
+ }
1319
+ Object.assign(validatePrune, Namespace.prune("validatePrune"));
1320
+ Object.assign(validatePrune, Namespace.validate());
1321
+
1322
+ /* ===========================================================
1323
+ FACTORY FUNCTIONS
1324
+ - BASIC VALIDATORS
1325
+ - STRICT VALIDATORS
1326
+ - JSON FUNCTIONS
1327
+ - MISCELLANEOUS
1328
+ ==============================================================
1329
+ BASIC VALIDATORS
1330
+ ----------------------------------------------------------- */
1331
+ /**
1332
+ * Creates a reusable {@link assert} function.
1333
+ *
1334
+ * @danger You have to specify the generic argument `T`
1335
+ * @return Nothing until specifying the generic argument `T`
1336
+ * @throws compile error
1337
+ *
1338
+ * @author Jeongho Nam - https://github.com/samchon
1339
+ */
1340
+ export function createAssert(): never;
1341
+
1342
+ /**
1343
+ * Creates a reusable {@link assert} function.
1344
+ *
1345
+ * @template T Type of the input value
1346
+ * @returns A reusable `assert` function
1347
+ *
1348
+ * @author Jeongho Nam - https://github.com/samchon
1349
+ */
1350
+ export function createAssert<T>(): (input: unknown) => T;
1351
+
1352
+ /**
1353
+ * @internal
1354
+ */
1355
+ export function createAssert<T>(): (input: unknown) => T {
1356
+ halt("createAssert");
1357
+ }
1358
+ Object.assign(createAssert, assert);
1359
+
1360
+ /**
1361
+ * Creates a reusable {@link assertType} function.
1362
+ *
1363
+ * Duplicated function of {@link createAssert} for `typescript-is` users.
1364
+ *
1365
+ * @danger You have to specify the generic argument `T`
1366
+ * @return Nothing until specifying the generic argument `T`
1367
+ * @throws compile error
1368
+ *
1369
+ * @author Jeongho Nam - https://github.com/samchon
1370
+ * @deprecated
1371
+ */
1372
+ export function createAssertType(): never;
1373
+
1374
+ /**
1375
+ * Creates a reusable {@link assertType} function.
1376
+ *
1377
+ * Duplicated function of {@link createAssert} for `typescript-is` users.
1378
+ *
1379
+ * @template T Type of the input value
1380
+ * @returns A reusable `assert` function
1381
+ *
1382
+ * @author Jeongho Nam - https://github.com/samchon
1383
+ * @deprecated
1384
+ */
1385
+ export function createAssertType<T>(): (input: unknown) => T;
1386
+
1387
+ /**
1388
+ * @internal
1389
+ */
1390
+ export function createAssertType<T>(): (input: unknown) => T {
1391
+ halt("createAssertType");
1392
+ }
1393
+ Object.assign(createAssertType, assertType);
1394
+
1395
+ /**
1396
+ * Creates a reusable {@link is} function.
1397
+ *
1398
+ * @danger You have to specify the generic argument `T`
1399
+ * @return Nothing until specifying the generic argument `T`
1400
+ * @throws compile error
1401
+ *
1402
+ * @author Jeongho Nam - https://github.com/samchon
1403
+ */
1404
+ export function createIs(): never;
1405
+
1406
+ /**
1407
+ * Creates a reusable {@link is} function.
1408
+ *
1409
+ * @template T Type of the input value
1410
+ * @returns A reusable `is` function
1411
+ *
1412
+ * @author Jeongho Nam - https://github.com/samchon
1413
+ */
1414
+ export function createIs<T>(): (input: unknown) => input is T;
1415
+
1416
+ /**
1417
+ * @internal
1418
+ */
1419
+ export function createIs<T>(): (input: unknown) => input is T {
1420
+ halt("createIs");
1421
+ }
1422
+ Object.assign(createIs, is);
1423
+
1424
+ /**
1425
+ * Creates a reusable {@link validate} function.
1426
+ *
1427
+ * @danger You have to specify the generic argument `T`
1428
+ * @return Nothing until specifying the generic argument `T`
1429
+ * @throws compile error
1430
+ *
1431
+ * @author Jeongho Nam - https://github.com/samchon
1432
+ */
1433
+ export function createValidate(): never;
1434
+
1435
+ /**
1436
+ * Creates a reusable {@link validate} function.
1437
+ *
1438
+ * @template T Type of the input value
1439
+ * @returns A reusable `validate` function
1440
+ *
1441
+ * @author Jeongho Nam - https://github.com/samchon
1442
+ */
1443
+ export function createValidate<T>(): (input: unknown) => IValidation<T>;
1444
+
1445
+ /**
1446
+ * @internal
1447
+ */
1448
+ export function createValidate(): (input: unknown) => IValidation {
1449
+ halt("createValidate");
1450
+ }
1451
+ Object.assign(createValidate, validate);
1452
+
1453
+ /* -----------------------------------------------------------
1454
+ STRICT VALIDATORS
1455
+ ----------------------------------------------------------- */
1456
+ /**
1457
+ * Creates a reusable {@link assertEquals} function.
1458
+ *
1459
+ * @danger You have to specify the generic argument `T`
1460
+ * @return Nothing until specifying the generic argument `T`
1461
+ * @throws compile error
1462
+ *
1463
+ * @author Jeongho Nam - https://github.com/samchon
1464
+ */
1465
+ export function createAssertEquals(): never;
1466
+
1467
+ /**
1468
+ * Creates a reusable {@link assertEquals} function.
1469
+ *
1470
+ * @template T Type of the input value
1471
+ * @returns A reusable `assertEquals` function
1472
+ *
1473
+ * @author Jeongho Nam - https://github.com/samchon
1474
+ */
1475
+ export function createAssertEquals<T>(): (input: unknown) => T;
1476
+
1477
+ /**
1478
+ * @internal
1479
+ */
1480
+ export function createAssertEquals<T>(): (input: unknown) => T {
1481
+ halt("createAssertEquals");
1482
+ }
1483
+ Object.assign(createAssertEquals, assertEquals);
1484
+
1485
+ /**
1486
+ * Creates a reusable {@link equals} function.
1487
+ *
1488
+ * @danger You have to specify the generic argument `T`
1489
+ * @return Nothing until specifying the generic argument `T`
1490
+ * @throws compile error
1491
+ *
1492
+ * @author Jeongho Nam - https://github.com/samchon
1493
+ */
1494
+ export function createEquals(): never;
1495
+
1496
+ /**
1497
+ * Creates a reusable {@link equals} function.
1498
+ *
1499
+ * @template T Type of the input value
1500
+ * @returns A reusable `equals` function
1501
+ *
1502
+ * @author Jeongho Nam - https://github.com/samchon
1503
+ */
1504
+ export function createEquals<T>(): (input: unknown) => input is T;
1505
+
1506
+ /**
1507
+ * @internal
1508
+ */
1509
+ export function createEquals<T>(): (input: unknown) => input is T {
1510
+ halt("createEquals");
1511
+ }
1512
+ Object.assign(createEquals, equals);
1513
+
1514
+ /**
1515
+ * Creates a reusable {@link validateEquals} function.
1516
+ *
1517
+ * @danger You have to specify the generic argument `T`
1518
+ * @return Nothing until specifying the generic argument `T`
1519
+ * @throws compile error
1520
+ *
1521
+ * @author Jeongho Nam - https://github.com/samchon
1522
+ */
1523
+ export function createValidateEquals(): never;
1524
+
1525
+ /**
1526
+ * Creates a reusable {@link validateEquals} function.
1527
+ *
1528
+ * @template T Type of the input value
1529
+ * @returns A reusable `validateEquals` function
1530
+ *
1531
+ * @author Jeongho Nam - https://github.com/samchon
1532
+ */
1533
+ export function createValidateEquals<T>(): (input: unknown) => IValidation<T>;
1534
+
1535
+ /**
1536
+ * @internal
1537
+ */
1538
+ export function createValidateEquals(): (input: unknown) => IValidation {
1539
+ halt("createValidateEquals");
1540
+ }
1541
+ Object.assign(createValidateEquals, validateEquals);
1542
+
1543
+ /* -----------------------------------------------------------
1544
+ JSON FUNCTIONS
1545
+ ----------------------------------------------------------- */
1546
+ /**
1547
+ * Creates a reusable {@link isParse} function.
1548
+ *
1549
+ * @danger You have to specify the generic argument `T`
1550
+ * @return Nothing until specifying the generic argument `T`
1551
+ * @throws compile error
1552
+ *
1553
+ * @author Jeongho Nam - https://github.com/samchon
1554
+ */
1555
+ export function createIsParse(): never;
1556
+
1557
+ /**
1558
+ * Creates a reusable {@link isParse} function.
1559
+ *
1560
+ * @template T Expected type of parsed value
1561
+ * @returns A reusable `isParse` function
1562
+ *
1563
+ * @author Jeongho Nam - https://github.com/samchon
1564
+ */
1565
+ export function createIsParse<T>(): (input: string) => Primitive<T> | null;
1566
+
1567
+ /**
1568
+ * @internal
1569
+ */
1570
+ export function createIsParse<T>(): (input: string) => Primitive<T> | null {
1571
+ halt("createIsParse");
1572
+ }
1573
+ Object.assign(createIsParse, isParse);
1574
+
1575
+ /**
1576
+ * Creates a reusable {@link assertParse} function.
1577
+ *
1578
+ * @danger You have to specify the generic argument `T`
1579
+ * @return Nothing until specifying the generic argument `T`
1580
+ * @throws compile error
1581
+ *
1582
+ * @author Jeongho Nam - https://github.com/samchon
1583
+ */
1584
+ export function createAssertParse(): never;
1585
+
1586
+ /**
1587
+ * Creates a reusable {@link assertParse} function.
1588
+ *
1589
+ * @template T Expected type of parsed value
1590
+ * @returns A reusable `assertParse` function
1591
+ *
1592
+ * @author Jeongho Nam - https://github.com/samchon
1593
+ */
1594
+ export function createAssertParse<T>(): (input: string) => Primitive<T>;
1595
+
1596
+ /**
1597
+ * @internal
1598
+ */
1599
+ export function createAssertParse<T>(): (input: string) => Primitive<T> {
1600
+ halt("createAssertParse");
1601
+ }
1602
+ Object.assign(createAssertParse, assertParse);
1603
+
1604
+ /**
1605
+ * Creates a reusable {@link validateParse} function.
1606
+ *
1607
+ * @danger You have to specify the generic argument `T`
1608
+ * @return Nothing until specifying the generic argument `T`
1609
+ * @throws compile error
1610
+ *
1611
+ * @author Jeongho Nam - https://github.com/samchon
1612
+ */
1613
+ export function createValidateParse(): never;
1614
+
1615
+ /**
1616
+ * Creates a reusable {@link validateParse} function.
1617
+ *
1618
+ * @template T Expected type of parsed value
1619
+ * @returns A reusable `validateParse` function
1620
+ *
1621
+ * @author Jeongho Nam - https://github.com/samchon
1622
+ */
1623
+ export function createValidateParse<T>(): (
1624
+ input: string,
1625
+ ) => IValidation<Primitive<T>>;
1626
+
1627
+ /**
1628
+ * @internal
1629
+ */
1630
+ export function createValidateParse<T>(): (
1631
+ input: string,
1632
+ ) => IValidation<Primitive<T>> {
1633
+ halt("createValidateParse");
1634
+ }
1635
+ Object.assign(createValidateParse, validateParse);
1636
+
1637
+ /**
1638
+ * Creates a reusable {@link stringify} function.
1639
+ *
1640
+ * @danger You have to specify the generic argument `T`
1641
+ * @return Nothing until specifying the generic argument `T`
1642
+ * @throws compile error
1643
+ *
1644
+ * @author Jeongho Nam - https://github.com/samchon
1645
+ */
1646
+ export function createStringify(): never;
1647
+
1648
+ /**
1649
+ * Creates a reusable {@link stringify} function.
1650
+ *
1651
+ * @template T Type of the input value
1652
+ * @returns A reusable `stringify` function
1653
+ *
1654
+ * @author Jeongho Nam - https://github.com/samchon
1655
+ */
1656
+ export function createStringify<T>(): (input: T) => string;
1657
+
1658
+ /**
1659
+ * @internal
1660
+ */
1661
+ export function createStringify<T>(): (input: T) => string {
1662
+ halt("createStringify");
1663
+ }
1664
+ Object.assign(createStringify, stringify);
1665
+
1666
+ /**
1667
+ * Creates a reusable {@link assertStringify} function.
1668
+ *
1669
+ * @danger You have to specify the generic argument `T`
1670
+ * @return Nothing until specifying the generic argument `T`
1671
+ * @throws compile error
1672
+ *
1673
+ * @author Jeongho Nam - https://github.com/samchon
1674
+ */
1675
+ export function createAssertStringify(): never;
1676
+
1677
+ /**
1678
+ * Creates a reusable {@link assertStringify} function.
1679
+ *
1680
+ * @template T Type of the input value
1681
+ * @returns A reusable `assertStringify` function
1682
+ *
1683
+ * @author Jeongho Nam - https://github.com/samchon
1684
+ */
1685
+ export function createAssertStringify<T>(): (input: unknown) => string;
1686
+
1687
+ /**
1688
+ * @internal
1689
+ */
1690
+ export function createAssertStringify(): (input: unknown) => string {
1691
+ halt("createAssertStringify");
1692
+ }
1693
+ Object.assign(createAssertStringify, assertStringify);
1694
+
1695
+ /**
1696
+ * Creates a reusable {@link isStringify} function.
1697
+ *
1698
+ * @danger You have to specify the generic argument `T`
1699
+ * @return Nothing until specifying the generic argument `T`
1700
+ * @throws compile error
1701
+ *
1702
+ * @author Jeongho Nam - https://github.com/samchon
1703
+ */
1704
+ export function createIsStringify(): never;
1705
+
1706
+ /**
1707
+ * Creates a reusable {@link isStringify} function.
1708
+ *
1709
+ * @template T Type of the input value
1710
+ * @returns A reusable `isStringify` function
1711
+ *
1712
+ * @author Jeongho Nam - https://github.com/samchon
1713
+ */
1714
+ export function createIsStringify<T>(): (input: unknown) => string | null;
1715
+
1716
+ /**
1717
+ * @internal
1718
+ */
1719
+ export function createIsStringify(): (input: unknown) => string | null {
1720
+ halt("createIsStringify");
1721
+ }
1722
+ Object.assign(createIsStringify, isStringify);
1723
+
1724
+ /**
1725
+ * Creates a reusable {@link validateStringify} function.
1726
+ *
1727
+ * @danger You have to specify the generic argument `T`
1728
+ * @return Nothing until specifying the generic argument `T`
1729
+ * @throws compile error
1730
+ *
1731
+ * @author Jeongho Nam - https://github.com/samchon
1732
+ */
1733
+ export function createValidateStringify(): never;
1734
+
1735
+ /**
1736
+ * Creates a reusable {@link validateStringify} function.
1737
+ *
1738
+ * @template T Type of the input value
1739
+ * @returns A reusable `validateStringify` function
1740
+
1741
+ * @author Jeongho Nam - https://github.com/samchon
1742
+ */
1743
+ export function createValidateStringify<T>(): (
1744
+ input: unknown,
1745
+ ) => IValidation<string>;
1746
+
1747
+ /**
1748
+ * @internal
1749
+ */
1750
+ export function createValidateStringify(): (
1751
+ input: unknown,
1752
+ ) => IValidation<string> {
1753
+ halt("createValidateStringify");
1754
+ }
1755
+ Object.assign(createValidateStringify, validateStringify);
1756
+
1757
+ /* -----------------------------------------------------------
1758
+ MISCELLANEOUS
1759
+ ----------------------------------------------------------- */
1760
+ /**
1761
+ * Creates a reusable {@link random} function.
1762
+ *
1763
+ * @danger You have to specify the generic argument `T`
1764
+ * @param generator Random data generator
1765
+ * @return Nothing until specifying the generic argument `T`
1766
+ * @throws compile error
1767
+ *
1768
+ * @author Jeongho Nam - https://github.com/samchon
1769
+ */
1770
+ export function createRandom(generator?: Partial<IRandomGenerator>): never;
1771
+
1772
+ /**
1773
+ * Creates a resuable {@link random} function.
1774
+ *
1775
+ * @template T Type of the input value
1776
+ * @param generator Random data generator
1777
+ * @returns A reusable `random` function
1778
+ *
1779
+ * @author Jeongho Nam - https://github.com/samchon
1780
+ */
1781
+ export function createRandom<T>(
1782
+ generator?: Partial<IRandomGenerator>,
1783
+ ): () => Primitive<T>;
1784
+
1785
+ /**
1786
+ * @internal
1787
+ */
1788
+ export function createRandom(): never {
1789
+ halt("createRandom");
1790
+ }
1791
+ Object.assign(createRandom, random);
1792
+
1793
+ /**
1794
+ * Creates a reusable {@link clone} function.
1795
+ *
1796
+ * @danger You have to specify the generic argument `T`
1797
+ * @return Nothing until specifying the generic argument `T`
1798
+ * @throws compile error
1799
+ *
1800
+ * @author Jeongho Nam - https://github.com/samchon
1801
+ */
1802
+ export function createClone(): never;
1803
+
1804
+ /**
1805
+ * Creates a resuable {@link clone} function.
1806
+ *
1807
+ * @template T Type of the input value
1808
+ * @returns A reusable `clone` function
1809
+ *
1810
+ * @author Jeongho Nam - https://github.com/samchon
1811
+ */
1812
+ export function createClone<T>(): (input: T) => Primitive<T>;
1813
+
1814
+ /**
1815
+ * @internal
1816
+ */
1817
+ export function createClone(): never {
1818
+ halt("createClone");
1819
+ }
1820
+ Object.assign(createClone, clone);
1821
+
1822
+ /**
1823
+ * Creates a reusable {@link assertClone} function.
1824
+ *
1825
+ * @danger You have to specify the generic argument `T`
1826
+ * @return Nothing until specifying the generic argument `T`
1827
+ * @throws compile error
1828
+ *
1829
+ * @author Jeongho Nam - https://github.com/samchon
1830
+ */
1831
+ export function createAssertClone(): never;
1832
+
1833
+ /**
1834
+ * Creates a resuable {@link assertClone} function.
1835
+ *
1836
+ * @template T Type of the input value
1837
+ * @returns A reusable `clone` function
1838
+ *
1839
+ * @author Jeongho Nam - https://github.com/samchon
1840
+ */
1841
+ export function createAssertClone<T>(): (input: unknown) => Primitive<T>;
1842
+
1843
+ /**
1844
+ * @internal
1845
+ */
1846
+ export function createAssertClone(): never {
1847
+ halt("createAssertClone");
1848
+ }
1849
+ Object.assign(createAssertClone, assertClone);
1850
+
1851
+ /**
1852
+ * Creates a reusable {@link isClone} function.
1853
+ *
1854
+ * @danger You have to specify the generic argument `T`
1855
+ * @return Nothing until specifying the generic argument `T`
1856
+ * @throws compile error
1857
+ *
1858
+ * @author Jeongho Nam - https://github.com/samchon
1859
+ */
1860
+ export function createIsClone(): never;
1861
+
1862
+ /**
1863
+ * Creates a resuable {@link isClone} function.
1864
+ *
1865
+ * @template T Type of the input value
1866
+ * @returns A reusable `clone` function
1867
+ *
1868
+ * @author Jeongho Nam - https://github.com/samchon
1869
+ */
1870
+ export function createIsClone<T>(): (input: unknown) => Primitive<T> | null;
1871
+
1872
+ /**
1873
+ * @internal
1874
+ */
1875
+ export function createIsClone(): never {
1876
+ halt("createIsClone");
1877
+ }
1878
+ Object.assign(createIsClone, isClone);
1879
+
1880
+ /**
1881
+ * Creates a reusable {@link validateClone} function.
1882
+ *
1883
+ * @danger You have to specify the generic argument `T`
1884
+ * @return Nothing until specifying the generic argument `T`
1885
+ * @throws compile error
1886
+ *
1887
+ * @author Jeongho Nam - https://github.com/samchon
1888
+ */
1889
+ export function createValidateClone(): never;
1890
+
1891
+ /**
1892
+ * Creates a resuable {@link validateClone} function.
1893
+ *
1894
+ * @template T Type of the input value
1895
+ * @returns A reusable `clone` function
1896
+ *
1897
+ * @author Jeongho Nam - https://github.com/samchon
1898
+ */
1899
+ export function createValidateClone<T>(): (
1900
+ input: unknown,
1901
+ ) => IValidation<Primitive<T>>;
1902
+
1903
+ /**
1904
+ * @internal
1905
+ */
1906
+ export function createValidateClone(): never {
1907
+ halt("createValidateClone");
1908
+ }
1909
+ Object.assign(createValidateClone, validateClone);
1910
+
1911
+ /**
1912
+ * Creates a reusable {@link prune} function.
1913
+ *
1914
+ * @danger You have to specify the generic argument `T`
1915
+ * @return Nothing until specifying the generic argument `T`
1916
+ * @throws compile error
1917
+ *
1918
+ * @author Jeongho Nam - https://github.com/samchon
1919
+ */
1920
+ export function createPrune(): never;
1921
+
1922
+ /**
1923
+ * Creates a resuable {@link prune} function.
1924
+ *
1925
+ * @template T Type of the input value
1926
+ * @returns A reusable `prune` function
1927
+ *
1928
+ * @author Jeongho Nam - https://github.com/samchon
1929
+ */
1930
+ export function createPrune<T extends object>(): (input: T) => void;
1931
+
1932
+ /**
1933
+ * @internal
1934
+ */
1935
+ export function createPrune<T extends object>(): (input: T) => void {
1936
+ halt("createPrune");
1937
+ }
1938
+ Object.assign(createPrune, prune);
1939
+
1940
+ /**
1941
+ * Creates a reusable {@link assertPrune} function.
1942
+ *
1943
+ * @danger You have to specify the generic argument `T`
1944
+ * @return Nothing until specifying the generic argument `T`
1945
+ * @throws compile error
1946
+ *
1947
+ * @author Jeongho Nam - https://github.com/samchon
1948
+ */
1949
+ export function createAssertPrune(): never;
1950
+
1951
+ /**
1952
+ * Creates a resuable {@link assertPrune} function.
1953
+ *
1954
+ * @template T Type of the input value
1955
+ * @returns A reusable `isPrune` function
1956
+ *
1957
+ * @author Jeongho Nam - https://github.com/samchon
1958
+ */
1959
+ export function createAssertPrune<T extends object>(): (input: T) => T;
1960
+
1961
+ /**
1962
+ * @internal
1963
+ */
1964
+ export function createAssertPrune<T extends object>(): (input: T) => T {
1965
+ halt("createAssertPrune");
1966
+ }
1967
+ Object.assign(createAssertPrune, assertPrune);
1968
+
1969
+ /**
1970
+ * Creates a reusable {@link isPrune} function.
1971
+ *
1972
+ * @danger You have to specify the generic argument `T`
1973
+ * @return Nothing until specifying the generic argument `T`
1974
+ * @throws compile error
1975
+ *
1976
+ * @author Jeongho Nam - https://github.com/samchon
1977
+ */
1978
+ export function createIsPrune(): never;
1979
+
1980
+ /**
1981
+ * Creates a resuable {@link isPrune} function.
1982
+ *
1983
+ * @template T Type of the input value
1984
+ * @returns A reusable `isPrune` function
1985
+ *
1986
+ * @author Jeongho Nam - https://github.com/samchon
1987
+ */
1988
+ export function createIsPrune<T extends object>(): (input: T) => input is T;
1989
+
1990
+ /**
1991
+ * @internal
1992
+ */
1993
+ export function createIsPrune<T extends object>(): (input: T) => input is T {
1994
+ halt("createIsPrune");
1995
+ }
1996
+ Object.assign(createIsPrune, isPrune);
1997
+
1998
+ /**
1999
+ * Creates a reusable {@link validatePrune} function.
2000
+ *
2001
+ * @danger You have to specify the generic argument `T`
2002
+ * @return Nothing until specifying the generic argument `T`
2003
+ * @throws compile error
2004
+ *
2005
+ * @author Jeongho Nam - https://github.com/samchon
2006
+ */
2007
+ export function createValidatePrune(): never;
2008
+
2009
+ /**
2010
+ * Creates a resuable {@link validatePrune} function.
2011
+ *
2012
+ * @template T Type of the input value
2013
+ * @returns A reusable `validatePrune` function
2014
+ *
2015
+ * @author Jeongho Nam - https://github.com/samchon
2016
+ */
2017
+ export function createValidatePrune<T extends object>(): (
2018
+ input: T,
2019
+ ) => IValidation<T>;
2020
+
2021
+ /**
2022
+ * @internal
2023
+ */
2024
+ export function createValidatePrune<T extends object>(): (
2025
+ input: T,
2026
+ ) => IValidation<T> {
2027
+ halt("createValidatePrune");
2028
+ }
2029
+ Object.assign(createValidatePrune, validatePrune);
2030
+
2031
+ /**
2032
+ * @internal
2033
+ */
2034
+ function halt(name: string): never {
2035
+ throw new Error(
2036
+ `Error on typia.${name}(): no transform has been configured. Run "npx typia setup" command.`,
2037
+ );
2038
+ }