typia 5.3.11 → 5.3.12-dev.20240119

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