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/http.ts CHANGED
@@ -1,1149 +1,1267 @@
1
- import { Namespace } from "./functional/Namespace";
2
-
3
- import { Atomic } from "./typings/Atomic";
4
-
5
- import { IValidation } from "./IValidation";
6
- import { Resolved } from "./Resolved";
7
-
8
- /* ===========================================================
9
- HTTP
10
- - QUERY
11
- - HEADERS
12
- - PARAMETER
13
- - FACTORY FUNCTIONS
14
- ==============================================================
15
- QUERY
16
- ----------------------------------------------------------- */
17
- /**
18
- * > You must configure the generic argument `T`.
19
- *
20
- * URL query decoder.
21
- *
22
- * `typia.http.query()` is a function decoding a query string or an `URLSearchParams`
23
- * instance, with automatic type casting to the expected type. When property type be
24
- * defined as `boolean` or `number` type, `typia.http.query()` will cast the value to
25
- * the expected type when decoding.
26
- *
27
- * By the way, as URL query is not enough to express complex data structures,
28
- * `typia.http.query()` function has some limitations. If target type `T` is not
29
- * following those restrictions, compilation errors would be occured.
30
- *
31
- * 1. Type `T` must be an object type
32
- * 2. Do not allow dynamic property
33
- * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
34
- * 4. By the way, union type never be not allowed
35
- *
36
- * Also, `typia.http.query()` function does not perform validation about the decoded
37
- * value. Therefore, if you can't sure that input data is following the `T` type,
38
- * it would better to call one of below functions intead.
39
- *
40
- * - {@link assertQuery}
41
- * - {@link isQuery}
42
- * - {@link validateQuery}
43
- *
44
- * @template T Expected type of decoded value
45
- * @param input Query string or URLSearchParams instance
46
- * @returns Decoded query object
47
- *
48
- * @author Jeongho Nam - https://github.com/samchon
49
- */
50
- export function query(): never;
51
-
52
- /**
53
- * URL query decoder.
54
- *
55
- * `typia.http.query()` is a function decoding a query string or an `URLSearchParams`
56
- * instance, with automatic type casting to the expected type. When property type be
57
- * defined as `boolean` or `number` type, `typia.http.query()` will cast the value to
58
- * the expected type when decoding.
59
- *
60
- * By the way, as URL query is not enough to express complex data structures,
61
- * `typia.http.query()` function has some limitations. If target type `T` is not
62
- * following those restrictions, compilation errors would be occured.
63
- *
64
- * 1. Type `T` must be an object type
65
- * 2. Do not allow dynamic property
66
- * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
67
- * 4. By the way, union type never be not allowed
68
- *
69
- * Also, `typia.http.query()` function does not perform validation about the decoded
70
- * value. Therefore, if you can't sure that input data is following the `T` type,
71
- * it would better to call one of below functions intead.
72
- *
73
- * - {@link assertQuery}
74
- * - {@link isQuery}
75
- * - {@link validateQuery}
76
- *
77
- * @template T Expected type of decoded value
78
- * @param input Query string or URLSearchParams instance
79
- * @returns Decoded query object
80
- *
81
- * @author Jeongho Nam - https://github.com/samchon
82
- */
83
- export function query<T extends object>(
84
- input: string | URLSearchParams,
85
- ): Resolved<T>;
86
-
87
- /**
88
- * @internal
89
- */
90
- export function query(): never {
91
- halt("query");
92
- }
93
- Object.assign(query, Namespace.http.query());
94
-
95
- /**
96
- * > You must configure the generic argument `T`.
97
- *
98
- * URL query decoder with type assertion.
99
- *
100
- * `typia.http.assertQuery()` is a function decoding a query string or an
101
- * `URLSearchParams` instance, with automatic type casting to the expected type.
102
- * When property type be defined as `boolean` or `number` type,
103
- * `typia.http.assertQuery()` will cast the value to the expected type when decoding.
104
- *
105
- * Also, after decoding, `typia.http.assertQuery()` performs type assertion to the
106
- * decoded value by combining with {@link assert} function. Therefore, when the
107
- * decoded value is not following the `T` type, {@link TypeGuardError} would be
108
- * thrown.
109
- *
110
- * By the way, as URL query is not enough to express complex data structures,
111
- * `typia.http.assertQuery()` function has some limitations. If target type `T` is
112
- * notfollowing those restrictions, compilation errors would be occured.
113
- *
114
- * 1. Type `T` must be an object type
115
- * 2. Do not allow dynamic property
116
- * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
117
- * 4. By the way, union type never be not allowed
118
- *
119
- * @template T Expected type of decoded value
120
- * @param input Query string or URLSearchParams instance
121
- * @returns Decoded query object
122
- *
123
- * @author Jeongho Nam - https://github.com/samchon
124
- */
125
- export function assertQuery(): never;
126
-
127
- /**
128
- * URL query decoder with type assertion.
129
- *
130
- * `typia.http.assertQuery()` is a function decoding a query string or an
131
- * `URLSearchParams` instance, with automatic type casting to the expected type.
132
- * When property type be defined as `boolean` or `number` type,
133
- * `typia.http.assertQuery()` will cast the value to the expected type when decoding.
134
- *
135
- * Also, after decoding, `typia.http.assertQuery()` performs type assertion to the
136
- * decoded value by combining with {@link assert} function. Therefore, when the
137
- * decoded value is not following the `T` type, {@link TypeGuardError} would be
138
- * thrown.
139
- *
140
- * By the way, as URL query is not enough to express complex data structures,
141
- * `typia.http.assertQuery()` function has some limitations. If target type `T` is
142
- * notfollowing those restrictions, compilation errors would be occured.
143
- *
144
- * 1. Type `T` must be an object type
145
- * 2. Do not allow dynamic property
146
- * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
147
- * 4. By the way, union type never be not allowed
148
- *
149
- * @template T Expected type of decoded value
150
- * @param input Query string or URLSearchParams instance
151
- * @returns Decoded query object
152
- *
153
- * @author Jeongho Nam - https://github.com/samchon
154
- */
155
- export function assertQuery<T extends object>(
156
- input: string | URLSearchParams,
157
- ): Resolved<T>;
158
-
159
- /**
160
- * @internal
161
- */
162
- export function assertQuery(): never {
163
- halt("assertQuery");
164
- }
165
- Object.assign(assertQuery, Namespace.http.query());
166
- Object.assign(assertQuery, Namespace.assert("http.assertQuery"));
167
-
168
- /**
169
- * > You must configure the generic argument `T`.
170
- *
171
- * URL query decoder with type checking.
172
- *
173
- * `typia.http.isQuery()` is a function decoding a query string or an
174
- * `URLSearchParams` instance, with automatic type casting to the expected type.
175
- * When property type be defined as `boolean` or `number` type,
176
- * `typia.http.isQuery()` will cast the value to the expected type when decoding.
177
- *
178
- * Also, after decoding, `typia.http.isQuery()` performs type checking to the
179
- * decoded value by combining with {@link is} function. Therefore, when the
180
- * decoded value is not following the `T` type, `null` value would be returned.
181
- *
182
- * By the way, as URL query is not enough to express complex data structures,
183
- * `typia.http.isQuery()` function has some limitations. If target type `T` is
184
- * notfollowing those restrictions, compilation errors would be occured.
185
- *
186
- * 1. Type `T` must be an object type
187
- * 2. Do not allow dynamic property
188
- * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
189
- * 4. By the way, union type never be not allowed
190
- *
191
- * @template T Expected type of decoded value
192
- * @param input Query string or URLSearchParams instance
193
- * @returns Decoded query object or `null` value
194
- *
195
- * @author Jeongho Nam - https://github.com/samchon
196
- */
197
- export function isQuery(): never;
198
-
199
- /**
200
- * URL query decoder with type checking.
201
- *
202
- * `typia.http.isQuery()` is a function decoding a query string or an
203
- * `URLSearchParams` instance, with automatic type casting to the expected type.
204
- * When property type be defined as `boolean` or `number` type,
205
- * `typia.http.isQuery()` will cast the value to the expected type when decoding.
206
- *
207
- * Also, after decoding, `typia.http.isQuery()` performs type checking to the
208
- * decoded value by combining with {@link is} function. Therefore, when the
209
- * decoded value is not following the `T` type, `null` value would be returned.
210
- *
211
- * By the way, as URL query is not enough to express complex data structures,
212
- * `typia.http.isQuery()` function has some limitations. If target type `T` is
213
- * notfollowing those restrictions, compilation errors would be occured.
214
- *
215
- * 1. Type `T` must be an object type
216
- * 2. Do not allow dynamic property
217
- * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
218
- * 4. By the way, union type never be not allowed
219
- *
220
- * @template T Expected type of decoded value
221
- * @param input Query string or URLSearchParams instance
222
- * @returns Decoded query object or `null` value
223
- *
224
- * @author Jeongho Nam - https://github.com/samchon
225
- */
226
- export function isQuery<T extends object>(
227
- input: string | URLSearchParams,
228
- ): Resolved<T> | null;
229
-
230
- /**
231
- * @internal
232
- */
233
- export function isQuery(): never {
234
- halt("isQuery");
235
- }
236
- Object.assign(isQuery, Namespace.http.query());
237
- Object.assign(isQuery, Namespace.is());
238
-
239
- /**
240
- * > You must configure the generic argument `T`.
241
- *
242
- * URL query decoder with type validation.
243
- *
244
- * `typia.http.validateQuery()` is a function decoding a query string or an
245
- * `URLSearchParams` instance, with automatic type casting to the expected type.
246
- * When property type be defined as `boolean` or `number` type,
247
- * `typia.http.validateQuery()` will cast the value to the expected type when decoding.
248
- *
249
- * Also, after decoding, `typia.http.validateQuery()` performs type validation to the
250
- * decoded value by combining with {@link validate} function. Therefore, when the
251
- * decoded value is not following the `T` type, {@link IValidation.IFailure} would
252
- * be returned. Otherwise, {@link IValidation.ISuccess} would be returned.
253
- *
254
- * By the way, as URL query is not enough to express complex data structures,
255
- * `typia.http.validateQuery()` function has some limitations. If target type `T` is
256
- * notfollowing those restrictions, compilation errors would be occured.
257
- *
258
- * 1. Type `T` must be an object type
259
- * 2. Do not allow dynamic property
260
- * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
261
- * 4. By the way, union type never be not allowed
262
- *
263
- * @template T Expected type of decoded value
264
- * @param input Query string or URLSearchParams instance
265
- * @returns Validation result with decoded query object
266
- *
267
- * @author Jeongho Nam - https://github.com/samchon
268
- */
269
- export function validateQuery(): never;
270
-
271
- /**
272
- * URL query decoder with type validation.
273
- *
274
- * `typia.http.validateQuery()` is a function decoding a query string or an
275
- * `URLSearchParams` instance, with automatic type casting to the expected type.
276
- * When property type be defined as `boolean` or `number` type,
277
- * `typia.http.validateQuery()` will cast the value to the expected type when decoding.
278
- *
279
- * Also, after decoding, `typia.http.validateQuery()` performs type validation to the
280
- * decoded value by combining with {@link validate} function. Therefore, when the
281
- * decoded value is not following the `T` type, {@link IValidation.IFailure} would
282
- * be returned. Otherwise, {@link IValidation.ISuccess} would be returned.
283
- *
284
- * By the way, as URL query is not enough to express complex data structures,
285
- * `typia.http.validateQuery()` function has some limitations. If target type `T` is
286
- * notfollowing those restrictions, compilation errors would be occured.
287
- *
288
- * 1. Type `T` must be an object type
289
- * 2. Do not allow dynamic property
290
- * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
291
- * 4. By the way, union type never be not allowed
292
- *
293
- * @template T Expected type of decoded value
294
- * @param input Query string or URLSearchParams instance
295
- * @returns Validation result with decoded query object
296
- *
297
- * @author Jeongho Nam - https://github.com/samchon
298
- */
299
- export function validateQuery<T extends object>(
300
- input: string | URLSearchParams,
301
- ): IValidation<Resolved<T>>;
302
-
303
- /**
304
- * @internal
305
- */
306
- export function validateQuery(): never {
307
- halt("validateQuery");
308
- }
309
- Object.assign(validateQuery, Namespace.http.query());
310
- Object.assign(validateQuery, Namespace.validate());
311
-
312
- /* -----------------------------------------------------------
313
- HEADERS
314
- ----------------------------------------------------------- */
315
- /**
316
- * > You must configure the generic argument `T`.
317
- *
318
- * Headers decoder (for express and fastify).
319
- *
320
- * `typia.http.headers()` is a function decoding an header instance, with automatic
321
- * type casting to the expected type. When property type be defined as `boolean` or
322
- * `number` type, `typia.http.headers()` will cast the value to the expected type.
323
- *
324
- * By the way, as HTTP headers are not enough to express complex data structures,
325
- * `typia.http.headers()` function has some limitations. If target type `T` is not
326
- * following those restrictions, compilation errors would be occured.
327
- *
328
- * 1. Type `T` must be an object type
329
- * 2. Do not allow dynamic property
330
- * 3. Property key must be lower case
331
- * 4. Property value cannot be `null`, but `undefined` is possible
332
- * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
333
- * 6. By the way, union type never be not allowed
334
- * 7. Property `set-cookie` must be array type
335
- * 8. Those properties cannot be array type
336
- * - age
337
- * - authorization
338
- * - content-length
339
- * - content-type
340
- * - etag
341
- * - expires
342
- * - from
343
- * - host
344
- * - if-modified-since
345
- * - if-unmodified-since
346
- * - last-modified
347
- * - location
348
- * - max-forwards
349
- * - proxy-authorization
350
- * - referer
351
- * - retry-after
352
- * - server
353
- * - user-agent
354
- *
355
- * Also, `typia.http.headers()` function does not perform validation about the decoded
356
- * value. Therefore, if you can't sure that input data is following the `T` type,
357
- * it would better to call one of below functions intead.
358
- *
359
- * - {@link assertHeaders}
360
- * - {@link isHeaders}
361
- * - {@link validateHeaders}
362
- *
363
- * @template T Expected type of decoded value
364
- * @param input Query string or URLSearchParams instance
365
- * @returns Decoded headers object
366
- *
367
- * @author Jeongho Nam - https://github.com/samchon
368
- */
369
- export function headers(): never;
370
-
371
- /**
372
- * Headers decoder (for express and fastify).
373
- *
374
- * `typia.http.headers()` is a function decoding an header instance, with automatic
375
- * type casting to the expected type. When property type be defined as `boolean` or
376
- * `number` type, `typia.http.headers()` will cast the value to the expected type.
377
- *
378
- * By the way, as HTTP headers are not enough to express complex data structures,
379
- * `typia.http.headers()` function has some limitations. If target type `T` is not
380
- * following those restrictions, compilation errors would be occured.
381
- *
382
- * 1. Type `T` must be an object type
383
- * 2. Do not allow dynamic property
384
- * 3. Property key must be lower case
385
- * 4. Property value cannot be `null`, but `undefined` is possible
386
- * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
387
- * 6. By the way, union type never be not allowed
388
- * 7. Property `set-cookie` must be array type
389
- * 8. Those properties cannot be array type
390
- * - age
391
- * - authorization
392
- * - content-length
393
- * - content-type
394
- * - etag
395
- * - expires
396
- * - from
397
- * - host
398
- * - if-modified-since
399
- * - if-unmodified-since
400
- * - last-modified
401
- * - location
402
- * - max-forwards
403
- * - proxy-authorization
404
- * - referer
405
- * - retry-after
406
- * - server
407
- * - user-agent
408
- *
409
- * Also, `typia.http.headers()` function does not perform validation about the decoded
410
- * value. Therefore, if you can't sure that input data is following the `T` type,
411
- * it would better to call one of below functions intead.
412
- *
413
- * - {@link assertHeaders}
414
- * - {@link isHeaders}
415
- * - {@link validateHeaders}
416
- *
417
- * @template T Expected type of decoded value
418
- * @param input Query string or URLSearchParams instance
419
- * @returns Decoded headers object
420
- *
421
- * @author Jeongho Nam - https://github.com/samchon
422
- */
423
- export function headers<T extends object>(
424
- input: Record<string, string | string[] | undefined>,
425
- ): Resolved<T>;
426
-
427
- /**
428
- * @internal
429
- */
430
- export function headers(): never {
431
- halt("headers");
432
- }
433
- Object.assign(headers, Namespace.http.headers());
434
-
435
- /**
436
- * > You must configure the generic argument `T`.
437
- *
438
- * Headers decoder with type assertion (for express and fastify).
439
- *
440
- * `typia.http.assertHeaders()` is a function decoding an header instance, with
441
- * automatic type casting to the expected type. When property type be defined as
442
- * `boolean` or `number` type, `typia.http.headers()` will cast the value to the
443
- * expected type.
444
- *
445
- * Also, after decoding, `typia.http.assertHeaders()` performs type assertion to the
446
- * decoded value by combining with {@link assert} function. Therefore, when the
447
- * decoded value is not following the `T` type, {@link TypeGuardError} would be
448
- * thrown.
449
- *
450
- * By the way, as HTTP headers are not enough to express complex data structures,
451
- * `typia.http.headers()` function has some limitations. If target type `T` is not
452
- * following those restrictions, compilation errors would be occured.
453
- *
454
- * 1. Type `T` must be an object type
455
- * 2. Do not allow dynamic property
456
- * 3. Property key must be lower case
457
- * 4. Property value cannot be `null`, but `undefined` is possible
458
- * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
459
- * 6. By the way, union type never be not allowed
460
- * 7. Property `set-cookie` must be array type
461
- * 8. Those properties cannot be array type
462
- * - age
463
- * - authorization
464
- * - content-length
465
- * - content-type
466
- * - etag
467
- * - expires
468
- * - from
469
- * - host
470
- * - if-modified-since
471
- * - if-unmodified-since
472
- * - last-modified
473
- * - location
474
- * - max-forwards
475
- * - proxy-authorization
476
- * - referer
477
- * - retry-after
478
- * - server
479
- * - user-agent
480
- *
481
- * @template T Expected type of decoded value
482
- * @param input Query string or URLSearchParams instance
483
- * @returns Decoded headers object
484
- *
485
- * @author Jeongho Nam - https://github.com/samchon
486
- */
487
- export function assertHeaders(): never;
488
-
489
- /**
490
- * Headers decoder with type assertion (for express and fastify).
491
- *
492
- * `typia.http.assertHeaders()` is a function decoding an header instance, with
493
- * automatic type casting to the expected type. When property type be defined as
494
- * `boolean` or `number` type, `typia.http.headers()` will cast the value to the
495
- * expected type.
496
- *
497
- * Also, after decoding, `typia.http.assertHeaders()` performs type assertion to the
498
- * decoded value by combining with {@link assert} function. Therefore, when the
499
- * decoded value is not following the `T` type, {@link TypeGuardError} would be
500
- * thrown.
501
- *
502
- * By the way, as HTTP headers are not enough to express complex data structures,
503
- * `typia.http.headers()` function has some limitations. If target type `T` is not
504
- * following those restrictions, compilation errors would be occured.
505
- *
506
- * 1. Type `T` must be an object type
507
- * 2. Do not allow dynamic property
508
- * 3. Property key must be lower case
509
- * 4. Property value cannot be `null`, but `undefined` is possible
510
- * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
511
- * 6. By the way, union type never be not allowed
512
- * 7. Property `set-cookie` must be array type
513
- * 8. Those properties cannot be array type
514
- * - age
515
- * - authorization
516
- * - content-length
517
- * - content-type
518
- * - etag
519
- * - expires
520
- * - from
521
- * - host
522
- * - if-modified-since
523
- * - if-unmodified-since
524
- * - last-modified
525
- * - location
526
- * - max-forwards
527
- * - proxy-authorization
528
- * - referer
529
- * - retry-after
530
- * - server
531
- * - user-agent
532
- *
533
- * @template T Expected type of decoded value
534
- * @param input Query string or URLSearchParams instance
535
- * @returns Decoded headers object
536
- *
537
- * @author Jeongho Nam - https://github.com/samchon
538
- */
539
- export function assertHeaders<T extends object>(
540
- input: Record<string, string | string[] | undefined>,
541
- ): Resolved<T>;
542
-
543
- /**
544
- * @internal
545
- */
546
- export function assertHeaders(): never {
547
- halt("assertHeaders");
548
- }
549
- Object.assign(assertHeaders, Namespace.http.headers());
550
- Object.assign(assertHeaders, Namespace.assert("http.assertHeaders"));
551
-
552
- /**
553
- * > You must configure the generic argument `T`.
554
- *
555
- * Headers decoder with type checking (for express and fastify).
556
- *
557
- * `typia.http.isHeaders()` is a function decoding an header instance, with
558
- * automatic type casting to the expected type. When property type be defined as
559
- * `boolean` or `number` type, `typia.http.headers()` will cast the value to the
560
- * expected type.
561
- *
562
- * Also, after decoding, `typia.http.isHeaders()` performs type checking to the
563
- * decoded value by combining with {@link is} function. Therefore, when the
564
- * decoded value is not following the `T` type, `null` value would be returned.
565
- *
566
- * By the way, as HTTP headers are not enough to express complex data structures,
567
- * `typia.http.headers()` function has some limitations. If target type `T` is not
568
- * following those restrictions, compilation errors would be occured.
569
- *
570
- * 1. Type `T` must be an object type
571
- * 2. Do not allow dynamic property
572
- * 3. Property key must be lower case
573
- * 4. Property value cannot be `null`, but `undefined` is possible
574
- * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
575
- * 6. By the way, union type never be not allowed
576
- * 7. Property `set-cookie` must be array type
577
- * 8. Those properties cannot be array type
578
- * - age
579
- * - authorization
580
- * - content-length
581
- * - content-type
582
- * - etag
583
- * - expires
584
- * - from
585
- * - host
586
- * - if-modified-since
587
- * - if-unmodified-since
588
- * - last-modified
589
- * - location
590
- * - max-forwards
591
- * - proxy-authorization
592
- * - referer
593
- * - retry-after
594
- * - server
595
- * - user-agent
596
- *
597
- * @template T Expected type of decoded value
598
- * @param input Query string or URLSearchParams instance
599
- * @returns Decoded headers object or `null` value
600
- *
601
- * @author Jeongho Nam - https://github.com/samchon
602
- */
603
- export function isHeaders(): never;
604
-
605
- /**
606
- * > You must configure the generic argument `T`.
607
- *
608
- * Headers decoder with type checking (for express and fastify).
609
- *
610
- * `typia.http.isHeaders()` is a function decoding an header instance, with
611
- * automatic type casting to the expected type. When property type be defined as
612
- * `boolean` or `number` type, `typia.http.headers()` will cast the value to the
613
- * expected type.
614
- *
615
- * Also, after decoding, `typia.http.isHeaders()` performs type checking to the
616
- * decoded value by combining with {@link is} function. Therefore, when the
617
- * decoded value is not following the `T` type, `null` value would be returned.
618
- *
619
- * By the way, as HTTP headers are not enough to express complex data structures,
620
- * `typia.http.headers()` function has some limitations. If target type `T` is not
621
- * following those restrictions, compilation errors would be occured.
622
- *
623
- * 1. Type `T` must be an object type
624
- * 2. Do not allow dynamic property
625
- * 3. Property key must be lower case
626
- * 4. Property value cannot be `null`, but `undefined` is possible
627
- * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
628
- * 6. By the way, union type never be not allowed
629
- * 7. Property `set-cookie` must be array type
630
- * 8. Those properties cannot be array type
631
- * - age
632
- * - authorization
633
- * - content-length
634
- * - content-type
635
- * - etag
636
- * - expires
637
- * - from
638
- * - host
639
- * - if-modified-since
640
- * - if-unmodified-since
641
- * - last-modified
642
- * - location
643
- * - max-forwards
644
- * - proxy-authorization
645
- * - referer
646
- * - retry-after
647
- * - server
648
- * - user-agent
649
- *
650
- * @template T Expected type of decoded value
651
- * @param input Query string or URLSearchParams instance
652
- * @returns Decoded headers object or `null` value
653
- *
654
- * @author Jeongho Nam - https://github.com/samchon
655
- */
656
- export function isHeaders<T extends object>(
657
- input: Record<string, string | string[] | undefined>,
658
- ): Resolved<T> | null;
659
-
660
- /**
661
- * @internal
662
- */
663
- export function isHeaders(): never {
664
- halt("isHeaders");
665
- }
666
- Object.assign(isHeaders, Namespace.http.headers());
667
- Object.assign(isHeaders, Namespace.is());
668
-
669
- /**
670
- * > You must configure the generic argument `T`.
671
- *
672
- * Headers decoder with type validation (for express and fastify).
673
- *
674
- * `typia.http.validateHeaders()` is a function decoding an header instance, with
675
- * automatic type casting to the expected type. When property type be defined as
676
- * `boolean` or `number` type, `typia.http.headers()` will cast the value to the
677
- * expected type.
678
- *
679
- * Also, after decoding, `typia.http.validateHeaders()` performs type assertion to the
680
- * decoded value by combining with {@link validate} function. Therefore, when the
681
- * decoded value is not following the `T` type, {@link IValidation.IError} would be
682
- * returned. Otherwise, {@link IValidation.ISuccess} be returned.
683
- *
684
- * By the way, as HTTP headers are not enough to express complex data structures,
685
- * `typia.http.headers()` function has some limitations. If target type `T` is not
686
- * following those restrictions, compilation errors would be occured.
687
- *
688
- * 1. Type `T` must be an object type
689
- * 2. Do not allow dynamic property
690
- * 3. Property key must be lower case
691
- * 4. Property value cannot be `null`, but `undefined` is possible
692
- * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
693
- * 6. By the way, union type never be not allowed
694
- * 7. Property `set-cookie` must be array type
695
- * 8. Those properties cannot be array type
696
- * - age
697
- * - authorization
698
- * - content-length
699
- * - content-type
700
- * - etag
701
- * - expires
702
- * - from
703
- * - host
704
- * - if-modified-since
705
- * - if-unmodified-since
706
- * - last-modified
707
- * - location
708
- * - max-forwards
709
- * - proxy-authorization
710
- * - referer
711
- * - retry-after
712
- * - server
713
- * - user-agent
714
- *
715
- * @template T Expected type of decoded value
716
- * @param input Query string or URLSearchParams instance
717
- * @returns Decoded headers object
718
- *
719
- * @author Jeongho Nam - https://github.com/samchon
720
- */
721
- export function validateHeaders(): never;
722
-
723
- /**
724
- * Headers decoder with type validation (for express and fastify).
725
- *
726
- * `typia.http.validateHeaders()` is a function decoding an header instance, with
727
- * automatic type casting to the expected type. When property type be defined as
728
- * `boolean` or `number` type, `typia.http.headers()` will cast the value to the
729
- * expected type.
730
- *
731
- * Also, after decoding, `typia.http.validateHeaders()` performs type assertion to the
732
- * decoded value by combining with {@link validate} function. Therefore, when the
733
- * decoded value is not following the `T` type, {@link IValidation.IError} would be
734
- * returned. Otherwise, {@link IValidation.ISuccess} be returned.
735
- *
736
- * By the way, as HTTP headers are not enough to express complex data structures,
737
- * `typia.http.headers()` function has some limitations. If target type `T` is not
738
- * following those restrictions, compilation errors would be occured.
739
- *
740
- * 1. Type `T` must be an object type
741
- * 2. Do not allow dynamic property
742
- * 3. Property key must be lower case
743
- * 4. Property value cannot be `null`, but `undefined` is possible
744
- * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
745
- * 6. By the way, union type never be not allowed
746
- * 7. Property `set-cookie` must be array type
747
- * 8. Those properties cannot be array type
748
- * - age
749
- * - authorization
750
- * - content-length
751
- * - content-type
752
- * - etag
753
- * - expires
754
- * - from
755
- * - host
756
- * - if-modified-since
757
- * - if-unmodified-since
758
- * - last-modified
759
- * - location
760
- * - max-forwards
761
- * - proxy-authorization
762
- * - referer
763
- * - retry-after
764
- * - server
765
- * - user-agent
766
- *
767
- * @template T Expected type of decoded value
768
- * @param input Query string or URLSearchParams instance
769
- * @returns Decoded headers object
770
- *
771
- * @author Jeongho Nam - https://github.com/samchon
772
- */
773
- export function validateHeaders<T extends object>(
774
- input: Record<string, string | string[] | undefined>,
775
- ): IValidation<Resolved<T>>;
776
-
777
- /**
778
- * @internal
779
- */
780
- export function validateHeaders(): never {
781
- halt("validateHeaders");
782
- }
783
- Object.assign(validateHeaders, Namespace.http.headers());
784
- Object.assign(validateHeaders, Namespace.validate());
785
-
786
- /* -----------------------------------------------------------
787
- PARAMETER
788
- ----------------------------------------------------------- */
789
- /**
790
- * > You must configure the generic argument `T`.
791
- *
792
- * URL path parameter decoder.
793
- *
794
- * `typia.http.parameter()` is a function decoding a path parameter, with automatic
795
- * type casting to the expected type. When type `T` has beeen defined as `boolean` or
796
- * `number` type, `typia.http.parameter()` will cast the value to the expected type.
797
- *
798
- * Also, `typia.http.parameter()` performs type assertion to the decoded value by
799
- * combining with {@link assert} function. Therefore, when the decoded value is not
800
- * following the `T` type, {@link TypeGuardError} would be thrown.
801
- *
802
- * @template T Expected type of decoded value
803
- * @param input Path parameter string
804
- * @returns Decoded path parameter value
805
- */
806
- export function parameter(): never;
807
-
808
- /**
809
- * URL path parameter decoder.
810
- *
811
- * `typia.http.parameter()` is a function decoding a path parameter, with automatic
812
- * type casting to the expected type. When type `T` has beeen defined as `boolean` or
813
- * `number` type, `typia.http.parameter()` will cast the value to the expected type.
814
- *
815
- * Also, `typia.http.parameter()` performs type assertion to the decoded value by
816
- * combining with {@link assert} function. Therefore, when the decoded value is not
817
- * following the `T` type, {@link TypeGuardError} would be thrown.
818
- *
819
- * @template T Expected type of decoded value
820
- * @param input Path parameter string
821
- * @returns Decoded path parameter value
822
- */
823
- export function parameter<T extends Atomic.Type | null>(
824
- input: string,
825
- ): Resolved<T>;
826
-
827
- /**
828
- * @internal
829
- */
830
- export function parameter(): never {
831
- halt("parameter");
832
- }
833
- Object.assign(parameter, Namespace.http.parameter());
834
- Object.assign(parameter, Namespace.assert("http.parameter"));
835
-
836
- /* -----------------------------------------------------------
837
- FACTORY FUNCTIONS
838
- ----------------------------------------------------------- */
839
- /**
840
- * Creates a reusable {@link query} function.
841
- *
842
- * @danger You must configure the generic argument `T`
843
- * @template T The type of the query object
844
- * @throws compile error
845
- *
846
- * @author Jeongho Nam - https://github.com/samchon
847
- */
848
- export function createQuery(): never;
849
-
850
- /**
851
- * Creates a reusable {@link query} function.
852
- *
853
- * @template T The type of the query object
854
- * @returns A reusable `query` function
855
- *
856
- * @author Jeongho Nam - https://github.com/samchon
857
- */
858
- export function createQuery<T extends object>(): (
859
- input: string | URLSearchParams,
860
- ) => T;
861
-
862
- /**
863
- * @internal
864
- */
865
- export function createQuery<T>(): (input: string | URLSearchParams) => T {
866
- halt("createQuery");
867
- }
868
- Object.assign(createQuery, Namespace.http.query());
869
-
870
- /**
871
- * Creates a reusable {@link assertQuery} function.
872
- *
873
- * @danger You must configure the generic argument `T`
874
- * @template T The type of the query object
875
- * @throws compile error
876
- *
877
- * @author Jeongho Nam - https://github.com/samchon
878
- */
879
- export function createAssertQuery(): never;
880
-
881
- /**
882
- * Creates a reusable {@link assertQuery} function.
883
- *
884
- * @template T The type of the query object
885
- * @returns A reusable `assertQuery` function
886
- *
887
- * @author Jeongho Nam - https://github.com/samchon
888
- */
889
- export function createAssertQuery<T extends object>(): (
890
- input: string | URLSearchParams,
891
- ) => T;
892
-
893
- /**
894
- * @internal
895
- */
896
- export function createAssertQuery<T>(): (input: string | URLSearchParams) => T {
897
- halt("createAssertQuery");
898
- }
899
- Object.assign(createAssertQuery, Namespace.http.query());
900
- Object.assign(createAssertQuery, Namespace.assert("http.createAssertQuery"));
901
-
902
- /**
903
- * Creates a reusable {@link isQuery} function.
904
- *
905
- * @danger You must configure the generic argument `T`
906
- * @template T The type of the query object
907
- * @throws compile error
908
- *
909
- * @author Jeongho Nam - https://github.com/samchon
910
- */
911
- export function createIsQuery(): never;
912
-
913
- /**
914
- * Creates a reusable {@link isQuery} function.
915
- *
916
- * @template T The type of the query object
917
- * @returns A reusable `isQuery` function
918
- *
919
- * @author Jeongho Nam - https://github.com/samchon
920
- */
921
- export function createIsQuery<T extends object>(): (
922
- input: string | URLSearchParams,
923
- ) => T | null;
924
-
925
- /**
926
- * @internal
927
- */
928
- export function createIsQuery<T>(): (
929
- input: string | URLSearchParams,
930
- ) => T | null {
931
- halt("createIsQuery");
932
- }
933
- Object.assign(createIsQuery, Namespace.http.query());
934
- Object.assign(createIsQuery, Namespace.is());
935
-
936
- /**
937
- * Creates a reusable {@link validateQuery} function.
938
- *
939
- * @danger You must configure the generic argument `T`
940
- * @template T The type of the query object
941
- * @throws compile error
942
- *
943
- * @author Jeongho Nam - https://github.com/samchon
944
- */
945
- export function createValidateQuery(): never;
946
-
947
- /**
948
- * Creates a reusable {@link validateQuery} function.
949
- *
950
- * @template T The type of the query object
951
- * @returns A reusable `validateQuery` function
952
- *
953
- * @author Jeongho Nam - https://github.com/samchon
954
- */
955
- export function createValidateQuery<T extends object>(): (
956
- input: string | URLSearchParams,
957
- ) => IValidation<Resolved<T>>;
958
-
959
- /**
960
- * @internal
961
- */
962
- export function createValidateQuery<T>(): (
963
- input: string | URLSearchParams,
964
- ) => IValidation<Resolved<T>> {
965
- halt("createValidateQuery");
966
- }
967
- Object.assign(createValidateQuery, Namespace.http.query());
968
- Object.assign(createValidateQuery, Namespace.validate());
969
-
970
- /**
971
- * Creates a reusable {@link headers} function.
972
- *
973
- * @danger You must configure the generic argument `T`
974
- * @template T The type of the headers object
975
- * @throws compile error
976
- *
977
- * @author Jeongho Nam - https://github.com/samchon
978
- */
979
- export function createHeaders(): never;
980
-
981
- /**
982
- * Creates a reusable {@link headers} function.
983
- *
984
- * @template T The type of the headers object
985
- * @returns A reusable `headers` function
986
- *
987
- * @author Jeongho Nam - https://github.com/samchon
988
- */
989
- export function createHeaders<T extends object>(): (
990
- input: Record<string, string | string[] | undefined>,
991
- ) => T;
992
-
993
- /**
994
- * @internal
995
- */
996
- export function createHeaders<T>(): (
997
- input: Record<string, string | string[] | undefined>,
998
- ) => T {
999
- halt("createHeaders");
1000
- }
1001
- Object.assign(createHeaders, Namespace.http.headers());
1002
-
1003
- /**
1004
- * Creates a reusable {@link assertHeaders} function.
1005
- *
1006
- * @danger You must configure the generic argument `T`
1007
- * @template T The type of the headers object
1008
- * @throws compile error
1009
- *
1010
- * @author Jeongho Nam - https://github.com/samchon
1011
- */
1012
- export function createAssertHeaders(): never;
1013
-
1014
- /**
1015
- * Creates a reusable {@link assertHeaders} function.
1016
- *
1017
- * @template T The type of the headers object
1018
- * @returns A reusable `assertHeaders` function
1019
- *
1020
- * @author Jeongho Nam - https://github.com/samchon
1021
- */
1022
- export function createAssertHeaders<T extends object>(): (
1023
- input: Record<string, string | string[] | undefined>,
1024
- ) => T;
1025
-
1026
- /**
1027
- * @internal
1028
- */
1029
- export function createAssertHeaders<T>(): (
1030
- input: Record<string, string | string[] | undefined>,
1031
- ) => T {
1032
- halt("createAssertHeaders");
1033
- }
1034
- Object.assign(createAssertHeaders, Namespace.http.headers());
1035
- Object.assign(
1036
- createAssertHeaders,
1037
- Namespace.assert("http.createAssertHeaders"),
1038
- );
1039
-
1040
- /**
1041
- * Creates a reusable {@link isHeaders} function.
1042
- *
1043
- * @danger You must configure the generic argument `T`
1044
- * @template T The type of the headers object
1045
- * @throws compile error
1046
- *
1047
- * @author Jeongho Nam - https://github.com/samchon
1048
- */
1049
- export function createIsHeaders(): never;
1050
-
1051
- /**
1052
- * Creates a reusable {@link isHeaders} function.
1053
- *
1054
- * @template T The type of the headers object
1055
- * @returns A reusable `isHeaders` function
1056
- *
1057
- * @author Jeongho Nam - https://github.com/samchon
1058
- */
1059
- export function createIsHeaders<T extends object>(): (
1060
- input: Record<string, string | string[] | undefined>,
1061
- ) => T | null;
1062
-
1063
- /**
1064
- * @internal
1065
- */
1066
- export function createIsHeaders<T>(): (
1067
- input: Record<string, string | string[] | undefined>,
1068
- ) => T | null {
1069
- halt("createIsHeaders");
1070
- }
1071
- Object.assign(createIsHeaders, Namespace.http.headers());
1072
- Object.assign(createIsHeaders, Namespace.is());
1073
-
1074
- /**
1075
- * Creates a reusable {@link validateHeaders} function.
1076
- *
1077
- * @danger You must configure the generic argument `T`
1078
- * @template T The type of the headers object
1079
- * @throws compile error
1080
- *
1081
- * @author Jeongho Nam - https://github.com/samchon
1082
- */
1083
- export function createValidateHeaders(): never;
1084
-
1085
- /**
1086
- * Creates a reusable {@link validateHeaders} function.
1087
- *
1088
- * @template T The type of the headers object
1089
- * @returns A reusable `validateHeaders` function
1090
- *
1091
- * @author Jeongho Nam - https://github.com/samchon
1092
- */
1093
- export function createValidateHeaders<T extends object>(): (
1094
- input: Record<string, string | string[] | undefined>,
1095
- ) => IValidation<Resolved<T>>;
1096
-
1097
- /**
1098
- * @internal
1099
- */
1100
- export function createValidateHeaders<T>(): (
1101
- input: Record<string, string | string[] | undefined>,
1102
- ) => IValidation<Resolved<T>> {
1103
- halt("createValidateHeaders");
1104
- }
1105
- Object.assign(createValidateHeaders, Namespace.http.headers());
1106
- Object.assign(createValidateHeaders, Namespace.validate());
1107
-
1108
- /**
1109
- * Creates a reusable {@link parameter} function.
1110
- *
1111
- * @danger You must configure the generic argument `T`
1112
- * @template T The type of the parameter value
1113
- * @throws compile error
1114
- *
1115
- * @author Jeongho Nam - https://github.com/samchon
1116
- */
1117
- export function createParameter(): never;
1118
-
1119
- /**
1120
- * Creates a reusable {@link parameter} function.
1121
- *
1122
- * @template T The type of the parameter value
1123
- * @returns A reusable `parameter` function
1124
- *
1125
- * @author Jeongho Nam - https://github.com/samchon
1126
- */
1127
- export function createParameter<T extends Atomic.Type | null>(): (
1128
- input: string,
1129
- ) => T;
1130
-
1131
- /**
1132
- * @internal
1133
- */
1134
- export function createParameter<T extends Atomic.Type | null>(): (
1135
- input: string,
1136
- ) => T {
1137
- halt("createParameter");
1138
- }
1139
- Object.assign(createParameter, Namespace.http.parameter());
1140
- Object.assign(createParameter, Namespace.assert("http.createParameter"));
1141
-
1142
- /**
1143
- * @internal
1144
- */
1145
- function halt(name: string): never {
1146
- throw new Error(
1147
- `Error on typia.http.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`,
1148
- );
1149
- }
1
+ import * as Namespace from "./functional/Namespace";
2
+
3
+ import { Atomic } from "./typings/Atomic";
4
+
5
+ import { IValidation } from "./IValidation";
6
+ import { Resolved } from "./Resolved";
7
+
8
+ /* ===========================================================
9
+ HTTP
10
+ - QUERY
11
+ - HEADERS
12
+ - PARAMETER
13
+ - FACTORY FUNCTIONS
14
+ ==============================================================
15
+ QUERY
16
+ ----------------------------------------------------------- */
17
+ /**
18
+ * > You must configure the generic argument `T`.
19
+ *
20
+ * URL query decoder.
21
+ *
22
+ * `typia.http.query()` is a function decoding a query string or an `URLSearchParams`
23
+ * instance, with automatic type casting to the expected type. When property type be
24
+ * defined as `boolean` or `number` type, `typia.http.query()` will cast the value to
25
+ * the expected type when decoding.
26
+ *
27
+ * By the way, as URL query is not enough to express complex data structures,
28
+ * `typia.http.query()` function has some limitations. If target type `T` is not
29
+ * following those restrictions, compilation errors would be occured.
30
+ *
31
+ * 1. Type `T` must be an object type
32
+ * 2. Do not allow dynamic property
33
+ * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
34
+ * 4. By the way, union type never be not allowed
35
+ *
36
+ * Also, `typia.http.query()` function does not perform validation about the decoded
37
+ * value. Therefore, if you can't sure that input data is following the `T` type,
38
+ * it would better to call one of below functions intead.
39
+ *
40
+ * - {@link assertQuery}
41
+ * - {@link isQuery}
42
+ * - {@link validateQuery}
43
+ *
44
+ * @template T Expected type of decoded value
45
+ * @param input Query string or URLSearchParams instance
46
+ * @returns Decoded query object
47
+ *
48
+ * @author Jeongho Nam - https://github.com/samchon
49
+ */
50
+ function query(): never;
51
+
52
+ /**
53
+ * URL query decoder.
54
+ *
55
+ * `typia.http.query()` is a function decoding a query string or an `URLSearchParams`
56
+ * instance, with automatic type casting to the expected type. When property type be
57
+ * defined as `boolean` or `number` type, `typia.http.query()` will cast the value to
58
+ * the expected type when decoding.
59
+ *
60
+ * By the way, as URL query is not enough to express complex data structures,
61
+ * `typia.http.query()` function has some limitations. If target type `T` is not
62
+ * following those restrictions, compilation errors would be occured.
63
+ *
64
+ * 1. Type `T` must be an object type
65
+ * 2. Do not allow dynamic property
66
+ * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
67
+ * 4. By the way, union type never be not allowed
68
+ *
69
+ * Also, `typia.http.query()` function does not perform validation about the decoded
70
+ * value. Therefore, if you can't sure that input data is following the `T` type,
71
+ * it would better to call one of below functions intead.
72
+ *
73
+ * - {@link assertQuery}
74
+ * - {@link isQuery}
75
+ * - {@link validateQuery}
76
+ *
77
+ * @template T Expected type of decoded value
78
+ * @param input Query string or URLSearchParams instance
79
+ * @returns Decoded query object
80
+ *
81
+ * @author Jeongho Nam - https://github.com/samchon
82
+ */
83
+ function query<T extends object>(input: string | URLSearchParams): Resolved<T>;
84
+
85
+ /**
86
+ * @internal
87
+ */
88
+ function query(): never {
89
+ halt("query");
90
+ }
91
+ const queryPure = /** @__PURE__ */ Object.assign<typeof query, {}>(
92
+ query,
93
+ /** @__PURE__ */ Namespace.http.query(),
94
+ );
95
+ export { queryPure as query };
96
+
97
+ /**
98
+ * > You must configure the generic argument `T`.
99
+ *
100
+ * URL query decoder with type assertion.
101
+ *
102
+ * `typia.http.assertQuery()` is a function decoding a query string or an
103
+ * `URLSearchParams` instance, with automatic type casting to the expected type.
104
+ * When property type be defined as `boolean` or `number` type,
105
+ * `typia.http.assertQuery()` will cast the value to the expected type when decoding.
106
+ *
107
+ * Also, after decoding, `typia.http.assertQuery()` performs type assertion to the
108
+ * decoded value by combining with {@link assert} function. Therefore, when the
109
+ * decoded value is not following the `T` type, {@link TypeGuardError} would be
110
+ * thrown.
111
+ *
112
+ * By the way, as URL query is not enough to express complex data structures,
113
+ * `typia.http.assertQuery()` function has some limitations. If target type `T` is
114
+ * notfollowing those restrictions, compilation errors would be occured.
115
+ *
116
+ * 1. Type `T` must be an object type
117
+ * 2. Do not allow dynamic property
118
+ * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
119
+ * 4. By the way, union type never be not allowed
120
+ *
121
+ * @template T Expected type of decoded value
122
+ * @param input Query string or URLSearchParams instance
123
+ * @returns Decoded query object
124
+ *
125
+ * @author Jeongho Nam - https://github.com/samchon
126
+ */
127
+ function assertQuery(): never;
128
+
129
+ /**
130
+ * URL query decoder with type assertion.
131
+ *
132
+ * `typia.http.assertQuery()` is a function decoding a query string or an
133
+ * `URLSearchParams` instance, with automatic type casting to the expected type.
134
+ * When property type be defined as `boolean` or `number` type,
135
+ * `typia.http.assertQuery()` will cast the value to the expected type when decoding.
136
+ *
137
+ * Also, after decoding, `typia.http.assertQuery()` performs type assertion to the
138
+ * decoded value by combining with {@link assert} function. Therefore, when the
139
+ * decoded value is not following the `T` type, {@link TypeGuardError} would be
140
+ * thrown.
141
+ *
142
+ * By the way, as URL query is not enough to express complex data structures,
143
+ * `typia.http.assertQuery()` function has some limitations. If target type `T` is
144
+ * notfollowing those restrictions, compilation errors would be occured.
145
+ *
146
+ * 1. Type `T` must be an object type
147
+ * 2. Do not allow dynamic property
148
+ * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
149
+ * 4. By the way, union type never be not allowed
150
+ *
151
+ * @template T Expected type of decoded value
152
+ * @param input Query string or URLSearchParams instance
153
+ * @returns Decoded query object
154
+ *
155
+ * @author Jeongho Nam - https://github.com/samchon
156
+ */
157
+ function assertQuery<T extends object>(
158
+ input: string | URLSearchParams,
159
+ ): Resolved<T>;
160
+
161
+ /**
162
+ * @internal
163
+ */
164
+ function assertQuery(): never {
165
+ halt("assertQuery");
166
+ }
167
+
168
+ const assertQueryPure = /** @__PURE__ */ Object.assign<
169
+ typeof assertQuery,
170
+ {},
171
+ {}
172
+ >(
173
+ assertQuery,
174
+ /** @__PURE__ */ Namespace.http.query(),
175
+ /** @__PURE__ */ Namespace.assert("http.assertQuery"),
176
+ );
177
+ export { assertQueryPure as assertQuery };
178
+
179
+ /**
180
+ * > You must configure the generic argument `T`.
181
+ *
182
+ * URL query decoder with type checking.
183
+ *
184
+ * `typia.http.isQuery()` is a function decoding a query string or an
185
+ * `URLSearchParams` instance, with automatic type casting to the expected type.
186
+ * When property type be defined as `boolean` or `number` type,
187
+ * `typia.http.isQuery()` will cast the value to the expected type when decoding.
188
+ *
189
+ * Also, after decoding, `typia.http.isQuery()` performs type checking to the
190
+ * decoded value by combining with {@link is} function. Therefore, when the
191
+ * decoded value is not following the `T` type, `null` value would be returned.
192
+ *
193
+ * By the way, as URL query is not enough to express complex data structures,
194
+ * `typia.http.isQuery()` function has some limitations. If target type `T` is
195
+ * notfollowing those restrictions, compilation errors would be occured.
196
+ *
197
+ * 1. Type `T` must be an object type
198
+ * 2. Do not allow dynamic property
199
+ * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
200
+ * 4. By the way, union type never be not allowed
201
+ *
202
+ * @template T Expected type of decoded value
203
+ * @param input Query string or URLSearchParams instance
204
+ * @returns Decoded query object or `null` value
205
+ *
206
+ * @author Jeongho Nam - https://github.com/samchon
207
+ */
208
+ function isQuery(): never;
209
+
210
+ /**
211
+ * URL query decoder with type checking.
212
+ *
213
+ * `typia.http.isQuery()` is a function decoding a query string or an
214
+ * `URLSearchParams` instance, with automatic type casting to the expected type.
215
+ * When property type be defined as `boolean` or `number` type,
216
+ * `typia.http.isQuery()` will cast the value to the expected type when decoding.
217
+ *
218
+ * Also, after decoding, `typia.http.isQuery()` performs type checking to the
219
+ * decoded value by combining with {@link is} function. Therefore, when the
220
+ * decoded value is not following the `T` type, `null` value would be returned.
221
+ *
222
+ * By the way, as URL query is not enough to express complex data structures,
223
+ * `typia.http.isQuery()` function has some limitations. If target type `T` is
224
+ * notfollowing those restrictions, compilation errors would be occured.
225
+ *
226
+ * 1. Type `T` must be an object type
227
+ * 2. Do not allow dynamic property
228
+ * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
229
+ * 4. By the way, union type never be not allowed
230
+ *
231
+ * @template T Expected type of decoded value
232
+ * @param input Query string or URLSearchParams instance
233
+ * @returns Decoded query object or `null` value
234
+ *
235
+ * @author Jeongho Nam - https://github.com/samchon
236
+ */
237
+ function isQuery<T extends object>(
238
+ input: string | URLSearchParams,
239
+ ): Resolved<T> | null;
240
+
241
+ /**
242
+ * @internal
243
+ */
244
+ function isQuery(): never {
245
+ halt("isQuery");
246
+ }
247
+
248
+ const isQueryPure = /** @__PURE__ */ Object.assign<typeof isQuery, {}, {}>(
249
+ isQuery,
250
+ /** @__PURE__ */ Namespace.http.query(),
251
+ /** @__PURE__ */ Namespace.is(),
252
+ );
253
+ export { isQueryPure as isQuery };
254
+
255
+ /**
256
+ * > You must configure the generic argument `T`.
257
+ *
258
+ * URL query decoder with type validation.
259
+ *
260
+ * `typia.http.validateQuery()` is a function decoding a query string or an
261
+ * `URLSearchParams` instance, with automatic type casting to the expected type.
262
+ * When property type be defined as `boolean` or `number` type,
263
+ * `typia.http.validateQuery()` will cast the value to the expected type when decoding.
264
+ *
265
+ * Also, after decoding, `typia.http.validateQuery()` performs type validation to the
266
+ * decoded value by combining with {@link validate} function. Therefore, when the
267
+ * decoded value is not following the `T` type, {@link IValidation.IFailure} would
268
+ * be returned. Otherwise, {@link IValidation.ISuccess} would be returned.
269
+ *
270
+ * By the way, as URL query is not enough to express complex data structures,
271
+ * `typia.http.validateQuery()` function has some limitations. If target type `T` is
272
+ * notfollowing those restrictions, compilation errors would be occured.
273
+ *
274
+ * 1. Type `T` must be an object type
275
+ * 2. Do not allow dynamic property
276
+ * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
277
+ * 4. By the way, union type never be not allowed
278
+ *
279
+ * @template T Expected type of decoded value
280
+ * @param input Query string or URLSearchParams instance
281
+ * @returns Validation result with decoded query object
282
+ *
283
+ * @author Jeongho Nam - https://github.com/samchon
284
+ */
285
+ function validateQuery(): never;
286
+
287
+ /**
288
+ * URL query decoder with type validation.
289
+ *
290
+ * `typia.http.validateQuery()` is a function decoding a query string or an
291
+ * `URLSearchParams` instance, with automatic type casting to the expected type.
292
+ * When property type be defined as `boolean` or `number` type,
293
+ * `typia.http.validateQuery()` will cast the value to the expected type when decoding.
294
+ *
295
+ * Also, after decoding, `typia.http.validateQuery()` performs type validation to the
296
+ * decoded value by combining with {@link validate} function. Therefore, when the
297
+ * decoded value is not following the `T` type, {@link IValidation.IFailure} would
298
+ * be returned. Otherwise, {@link IValidation.ISuccess} would be returned.
299
+ *
300
+ * By the way, as URL query is not enough to express complex data structures,
301
+ * `typia.http.validateQuery()` function has some limitations. If target type `T` is
302
+ * notfollowing those restrictions, compilation errors would be occured.
303
+ *
304
+ * 1. Type `T` must be an object type
305
+ * 2. Do not allow dynamic property
306
+ * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
307
+ * 4. By the way, union type never be not allowed
308
+ *
309
+ * @template T Expected type of decoded value
310
+ * @param input Query string or URLSearchParams instance
311
+ * @returns Validation result with decoded query object
312
+ *
313
+ * @author Jeongho Nam - https://github.com/samchon
314
+ */
315
+ function validateQuery<T extends object>(
316
+ input: string | URLSearchParams,
317
+ ): IValidation<Resolved<T>>;
318
+
319
+ /**
320
+ * @internal
321
+ */
322
+ function validateQuery(): never {
323
+ halt("validateQuery");
324
+ }
325
+ const validateQueryPure = /** @__PURE__ */ Object.assign<
326
+ typeof validateQuery,
327
+ {},
328
+ {}
329
+ >(
330
+ validateQuery,
331
+ /** @__PURE__ */ Namespace.http.query(),
332
+ /** @__PURE__ */ Namespace.validate(),
333
+ );
334
+ export { validateQueryPure as validateQuery };
335
+
336
+ /* -----------------------------------------------------------
337
+ HEADERS
338
+ ----------------------------------------------------------- */
339
+ /**
340
+ * > You must configure the generic argument `T`.
341
+ *
342
+ * Headers decoder (for express and fastify).
343
+ *
344
+ * `typia.http.headers()` is a function decoding an header instance, with automatic
345
+ * type casting to the expected type. When property type be defined as `boolean` or
346
+ * `number` type, `typia.http.headers()` will cast the value to the expected type.
347
+ *
348
+ * By the way, as HTTP headers are not enough to express complex data structures,
349
+ * `typia.http.headers()` function has some limitations. If target type `T` is not
350
+ * following those restrictions, compilation errors would be occured.
351
+ *
352
+ * 1. Type `T` must be an object type
353
+ * 2. Do not allow dynamic property
354
+ * 3. Property key must be lower case
355
+ * 4. Property value cannot be `null`, but `undefined` is possible
356
+ * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
357
+ * 6. By the way, union type never be not allowed
358
+ * 7. Property `set-cookie` must be array type
359
+ * 8. Those properties cannot be array type
360
+ * - age
361
+ * - authorization
362
+ * - content-length
363
+ * - content-type
364
+ * - etag
365
+ * - expires
366
+ * - from
367
+ * - host
368
+ * - if-modified-since
369
+ * - if-unmodified-since
370
+ * - last-modified
371
+ * - location
372
+ * - max-forwards
373
+ * - proxy-authorization
374
+ * - referer
375
+ * - retry-after
376
+ * - server
377
+ * - user-agent
378
+ *
379
+ * Also, `typia.http.headers()` function does not perform validation about the decoded
380
+ * value. Therefore, if you can't sure that input data is following the `T` type,
381
+ * it would better to call one of below functions intead.
382
+ *
383
+ * - {@link assertHeaders}
384
+ * - {@link isHeaders}
385
+ * - {@link validateHeaders}
386
+ *
387
+ * @template T Expected type of decoded value
388
+ * @param input Query string or URLSearchParams instance
389
+ * @returns Decoded headers object
390
+ *
391
+ * @author Jeongho Nam - https://github.com/samchon
392
+ */
393
+ function headers(): never;
394
+
395
+ /**
396
+ * Headers decoder (for express and fastify).
397
+ *
398
+ * `typia.http.headers()` is a function decoding an header instance, with automatic
399
+ * type casting to the expected type. When property type be defined as `boolean` or
400
+ * `number` type, `typia.http.headers()` will cast the value to the expected type.
401
+ *
402
+ * By the way, as HTTP headers are not enough to express complex data structures,
403
+ * `typia.http.headers()` function has some limitations. If target type `T` is not
404
+ * following those restrictions, compilation errors would be occured.
405
+ *
406
+ * 1. Type `T` must be an object type
407
+ * 2. Do not allow dynamic property
408
+ * 3. Property key must be lower case
409
+ * 4. Property value cannot be `null`, but `undefined` is possible
410
+ * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
411
+ * 6. By the way, union type never be not allowed
412
+ * 7. Property `set-cookie` must be array type
413
+ * 8. Those properties cannot be array type
414
+ * - age
415
+ * - authorization
416
+ * - content-length
417
+ * - content-type
418
+ * - etag
419
+ * - expires
420
+ * - from
421
+ * - host
422
+ * - if-modified-since
423
+ * - if-unmodified-since
424
+ * - last-modified
425
+ * - location
426
+ * - max-forwards
427
+ * - proxy-authorization
428
+ * - referer
429
+ * - retry-after
430
+ * - server
431
+ * - user-agent
432
+ *
433
+ * Also, `typia.http.headers()` function does not perform validation about the decoded
434
+ * value. Therefore, if you can't sure that input data is following the `T` type,
435
+ * it would better to call one of below functions intead.
436
+ *
437
+ * - {@link assertHeaders}
438
+ * - {@link isHeaders}
439
+ * - {@link validateHeaders}
440
+ *
441
+ * @template T Expected type of decoded value
442
+ * @param input Query string or URLSearchParams instance
443
+ * @returns Decoded headers object
444
+ *
445
+ * @author Jeongho Nam - https://github.com/samchon
446
+ */
447
+ function headers<T extends object>(
448
+ input: Record<string, string | string[] | undefined>,
449
+ ): Resolved<T>;
450
+
451
+ /**
452
+ * @internal
453
+ */
454
+ function headers(): never {
455
+ halt("headers");
456
+ }
457
+
458
+ const headersPure = /** @__PURE__ */ Object.assign<typeof headers, {}>(
459
+ headers,
460
+ /** @__PURE__ */ Namespace.http.headers(),
461
+ );
462
+ export { headersPure as headers };
463
+
464
+ /**
465
+ * > You must configure the generic argument `T`.
466
+ *
467
+ * Headers decoder with type assertion (for express and fastify).
468
+ *
469
+ * `typia.http.assertHeaders()` is a function decoding an header instance, with
470
+ * automatic type casting to the expected type. When property type be defined as
471
+ * `boolean` or `number` type, `typia.http.headers()` will cast the value to the
472
+ * expected type.
473
+ *
474
+ * Also, after decoding, `typia.http.assertHeaders()` performs type assertion to the
475
+ * decoded value by combining with {@link assert} function. Therefore, when the
476
+ * decoded value is not following the `T` type, {@link TypeGuardError} would be
477
+ * thrown.
478
+ *
479
+ * By the way, as HTTP headers are not enough to express complex data structures,
480
+ * `typia.http.headers()` function has some limitations. If target type `T` is not
481
+ * following those restrictions, compilation errors would be occured.
482
+ *
483
+ * 1. Type `T` must be an object type
484
+ * 2. Do not allow dynamic property
485
+ * 3. Property key must be lower case
486
+ * 4. Property value cannot be `null`, but `undefined` is possible
487
+ * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
488
+ * 6. By the way, union type never be not allowed
489
+ * 7. Property `set-cookie` must be array type
490
+ * 8. Those properties cannot be array type
491
+ * - age
492
+ * - authorization
493
+ * - content-length
494
+ * - content-type
495
+ * - etag
496
+ * - expires
497
+ * - from
498
+ * - host
499
+ * - if-modified-since
500
+ * - if-unmodified-since
501
+ * - last-modified
502
+ * - location
503
+ * - max-forwards
504
+ * - proxy-authorization
505
+ * - referer
506
+ * - retry-after
507
+ * - server
508
+ * - user-agent
509
+ *
510
+ * @template T Expected type of decoded value
511
+ * @param input Query string or URLSearchParams instance
512
+ * @returns Decoded headers object
513
+ *
514
+ * @author Jeongho Nam - https://github.com/samchon
515
+ */
516
+ function assertHeaders(): never;
517
+
518
+ /**
519
+ * Headers decoder with type assertion (for express and fastify).
520
+ *
521
+ * `typia.http.assertHeaders()` is a function decoding an header instance, with
522
+ * automatic type casting to the expected type. When property type be defined as
523
+ * `boolean` or `number` type, `typia.http.headers()` will cast the value to the
524
+ * expected type.
525
+ *
526
+ * Also, after decoding, `typia.http.assertHeaders()` performs type assertion to the
527
+ * decoded value by combining with {@link assert} function. Therefore, when the
528
+ * decoded value is not following the `T` type, {@link TypeGuardError} would be
529
+ * thrown.
530
+ *
531
+ * By the way, as HTTP headers are not enough to express complex data structures,
532
+ * `typia.http.headers()` function has some limitations. If target type `T` is not
533
+ * following those restrictions, compilation errors would be occured.
534
+ *
535
+ * 1. Type `T` must be an object type
536
+ * 2. Do not allow dynamic property
537
+ * 3. Property key must be lower case
538
+ * 4. Property value cannot be `null`, but `undefined` is possible
539
+ * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
540
+ * 6. By the way, union type never be not allowed
541
+ * 7. Property `set-cookie` must be array type
542
+ * 8. Those properties cannot be array type
543
+ * - age
544
+ * - authorization
545
+ * - content-length
546
+ * - content-type
547
+ * - etag
548
+ * - expires
549
+ * - from
550
+ * - host
551
+ * - if-modified-since
552
+ * - if-unmodified-since
553
+ * - last-modified
554
+ * - location
555
+ * - max-forwards
556
+ * - proxy-authorization
557
+ * - referer
558
+ * - retry-after
559
+ * - server
560
+ * - user-agent
561
+ *
562
+ * @template T Expected type of decoded value
563
+ * @param input Query string or URLSearchParams instance
564
+ * @returns Decoded headers object
565
+ *
566
+ * @author Jeongho Nam - https://github.com/samchon
567
+ */
568
+ function assertHeaders<T extends object>(
569
+ input: Record<string, string | string[] | undefined>,
570
+ ): Resolved<T>;
571
+
572
+ /**
573
+ * @internal
574
+ */
575
+ function assertHeaders(): never {
576
+ halt("assertHeaders");
577
+ }
578
+
579
+ const assertHeadersPure = /** @__PURE__ */ Object.assign<
580
+ typeof assertHeaders,
581
+ {},
582
+ {}
583
+ >(
584
+ assertHeaders,
585
+ /** @__PURE__ */ Namespace.http.headers(),
586
+ /** @__PURE__ */ Namespace.assert("http.assertHeaders"),
587
+ );
588
+ export { assertHeadersPure as assertHeaders };
589
+
590
+ /**
591
+ * > You must configure the generic argument `T`.
592
+ *
593
+ * Headers decoder with type checking (for express and fastify).
594
+ *
595
+ * `typia.http.isHeaders()` is a function decoding an header instance, with
596
+ * automatic type casting to the expected type. When property type be defined as
597
+ * `boolean` or `number` type, `typia.http.headers()` will cast the value to the
598
+ * expected type.
599
+ *
600
+ * Also, after decoding, `typia.http.isHeaders()` performs type checking to the
601
+ * decoded value by combining with {@link is} function. Therefore, when the
602
+ * decoded value is not following the `T` type, `null` value would be returned.
603
+ *
604
+ * By the way, as HTTP headers are not enough to express complex data structures,
605
+ * `typia.http.headers()` function has some limitations. If target type `T` is not
606
+ * following those restrictions, compilation errors would be occured.
607
+ *
608
+ * 1. Type `T` must be an object type
609
+ * 2. Do not allow dynamic property
610
+ * 3. Property key must be lower case
611
+ * 4. Property value cannot be `null`, but `undefined` is possible
612
+ * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
613
+ * 6. By the way, union type never be not allowed
614
+ * 7. Property `set-cookie` must be array type
615
+ * 8. Those properties cannot be array type
616
+ * - age
617
+ * - authorization
618
+ * - content-length
619
+ * - content-type
620
+ * - etag
621
+ * - expires
622
+ * - from
623
+ * - host
624
+ * - if-modified-since
625
+ * - if-unmodified-since
626
+ * - last-modified
627
+ * - location
628
+ * - max-forwards
629
+ * - proxy-authorization
630
+ * - referer
631
+ * - retry-after
632
+ * - server
633
+ * - user-agent
634
+ *
635
+ * @template T Expected type of decoded value
636
+ * @param input Query string or URLSearchParams instance
637
+ * @returns Decoded headers object or `null` value
638
+ *
639
+ * @author Jeongho Nam - https://github.com/samchon
640
+ */
641
+ function isHeaders(): never;
642
+
643
+ /**
644
+ * > You must configure the generic argument `T`.
645
+ *
646
+ * Headers decoder with type checking (for express and fastify).
647
+ *
648
+ * `typia.http.isHeaders()` is a function decoding an header instance, with
649
+ * automatic type casting to the expected type. When property type be defined as
650
+ * `boolean` or `number` type, `typia.http.headers()` will cast the value to the
651
+ * expected type.
652
+ *
653
+ * Also, after decoding, `typia.http.isHeaders()` performs type checking to the
654
+ * decoded value by combining with {@link is} function. Therefore, when the
655
+ * decoded value is not following the `T` type, `null` value would be returned.
656
+ *
657
+ * By the way, as HTTP headers are not enough to express complex data structures,
658
+ * `typia.http.headers()` function has some limitations. If target type `T` is not
659
+ * following those restrictions, compilation errors would be occured.
660
+ *
661
+ * 1. Type `T` must be an object type
662
+ * 2. Do not allow dynamic property
663
+ * 3. Property key must be lower case
664
+ * 4. Property value cannot be `null`, but `undefined` is possible
665
+ * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
666
+ * 6. By the way, union type never be not allowed
667
+ * 7. Property `set-cookie` must be array type
668
+ * 8. Those properties cannot be array type
669
+ * - age
670
+ * - authorization
671
+ * - content-length
672
+ * - content-type
673
+ * - etag
674
+ * - expires
675
+ * - from
676
+ * - host
677
+ * - if-modified-since
678
+ * - if-unmodified-since
679
+ * - last-modified
680
+ * - location
681
+ * - max-forwards
682
+ * - proxy-authorization
683
+ * - referer
684
+ * - retry-after
685
+ * - server
686
+ * - user-agent
687
+ *
688
+ * @template T Expected type of decoded value
689
+ * @param input Query string or URLSearchParams instance
690
+ * @returns Decoded headers object or `null` value
691
+ *
692
+ * @author Jeongho Nam - https://github.com/samchon
693
+ */
694
+ function isHeaders<T extends object>(
695
+ input: Record<string, string | string[] | undefined>,
696
+ ): Resolved<T> | null;
697
+
698
+ /**
699
+ * @internal
700
+ */
701
+ function isHeaders(): never {
702
+ halt("isHeaders");
703
+ }
704
+ const isHeadersPure = /** @__PURE__ */ Object.assign<typeof isHeaders, {}, {}>(
705
+ isHeaders,
706
+ /** @__PURE__ */ Namespace.http.headers(),
707
+ /** @__PURE__ */ Namespace.is(),
708
+ );
709
+ export { isHeadersPure as isHeaders };
710
+
711
+ /**
712
+ * > You must configure the generic argument `T`.
713
+ *
714
+ * Headers decoder with type validation (for express and fastify).
715
+ *
716
+ * `typia.http.validateHeaders()` is a function decoding an header instance, with
717
+ * automatic type casting to the expected type. When property type be defined as
718
+ * `boolean` or `number` type, `typia.http.headers()` will cast the value to the
719
+ * expected type.
720
+ *
721
+ * Also, after decoding, `typia.http.validateHeaders()` performs type assertion to the
722
+ * decoded value by combining with {@link validate} function. Therefore, when the
723
+ * decoded value is not following the `T` type, {@link IValidation.IError} would be
724
+ * returned. Otherwise, {@link IValidation.ISuccess} be returned.
725
+ *
726
+ * By the way, as HTTP headers are not enough to express complex data structures,
727
+ * `typia.http.headers()` function has some limitations. If target type `T` is not
728
+ * following those restrictions, compilation errors would be occured.
729
+ *
730
+ * 1. Type `T` must be an object type
731
+ * 2. Do not allow dynamic property
732
+ * 3. Property key must be lower case
733
+ * 4. Property value cannot be `null`, but `undefined` is possible
734
+ * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
735
+ * 6. By the way, union type never be not allowed
736
+ * 7. Property `set-cookie` must be array type
737
+ * 8. Those properties cannot be array type
738
+ * - age
739
+ * - authorization
740
+ * - content-length
741
+ * - content-type
742
+ * - etag
743
+ * - expires
744
+ * - from
745
+ * - host
746
+ * - if-modified-since
747
+ * - if-unmodified-since
748
+ * - last-modified
749
+ * - location
750
+ * - max-forwards
751
+ * - proxy-authorization
752
+ * - referer
753
+ * - retry-after
754
+ * - server
755
+ * - user-agent
756
+ *
757
+ * @template T Expected type of decoded value
758
+ * @param input Query string or URLSearchParams instance
759
+ * @returns Decoded headers object
760
+ *
761
+ * @author Jeongho Nam - https://github.com/samchon
762
+ */
763
+ function validateHeaders(): never;
764
+
765
+ /**
766
+ * Headers decoder with type validation (for express and fastify).
767
+ *
768
+ * `typia.http.validateHeaders()` is a function decoding an header instance, with
769
+ * automatic type casting to the expected type. When property type be defined as
770
+ * `boolean` or `number` type, `typia.http.headers()` will cast the value to the
771
+ * expected type.
772
+ *
773
+ * Also, after decoding, `typia.http.validateHeaders()` performs type assertion to the
774
+ * decoded value by combining with {@link validate} function. Therefore, when the
775
+ * decoded value is not following the `T` type, {@link IValidation.IError} would be
776
+ * returned. Otherwise, {@link IValidation.ISuccess} be returned.
777
+ *
778
+ * By the way, as HTTP headers are not enough to express complex data structures,
779
+ * `typia.http.headers()` function has some limitations. If target type `T` is not
780
+ * following those restrictions, compilation errors would be occured.
781
+ *
782
+ * 1. Type `T` must be an object type
783
+ * 2. Do not allow dynamic property
784
+ * 3. Property key must be lower case
785
+ * 4. Property value cannot be `null`, but `undefined` is possible
786
+ * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
787
+ * 6. By the way, union type never be not allowed
788
+ * 7. Property `set-cookie` must be array type
789
+ * 8. Those properties cannot be array type
790
+ * - age
791
+ * - authorization
792
+ * - content-length
793
+ * - content-type
794
+ * - etag
795
+ * - expires
796
+ * - from
797
+ * - host
798
+ * - if-modified-since
799
+ * - if-unmodified-since
800
+ * - last-modified
801
+ * - location
802
+ * - max-forwards
803
+ * - proxy-authorization
804
+ * - referer
805
+ * - retry-after
806
+ * - server
807
+ * - user-agent
808
+ *
809
+ * @template T Expected type of decoded value
810
+ * @param input Query string or URLSearchParams instance
811
+ * @returns Decoded headers object
812
+ *
813
+ * @author Jeongho Nam - https://github.com/samchon
814
+ */
815
+ function validateHeaders<T extends object>(
816
+ input: Record<string, string | string[] | undefined>,
817
+ ): IValidation<Resolved<T>>;
818
+
819
+ /**
820
+ * @internal
821
+ */
822
+ function validateHeaders(): never {
823
+ halt("validateHeaders");
824
+ }
825
+
826
+ const validateHeadersPure = /** @__PURE__ */ Object.assign<
827
+ typeof validateHeaders,
828
+ {},
829
+ {}
830
+ >(
831
+ validateHeaders,
832
+ /** @__PURE__ */ Namespace.http.headers(),
833
+ /** @__PURE__ */ Namespace.validate(),
834
+ );
835
+ export { validateHeadersPure as validateHeaders };
836
+
837
+ /* -----------------------------------------------------------
838
+ PARAMETER
839
+ ----------------------------------------------------------- */
840
+ /**
841
+ * > You must configure the generic argument `T`.
842
+ *
843
+ * URL path parameter decoder.
844
+ *
845
+ * `typia.http.parameter()` is a function decoding a path parameter, with automatic
846
+ * type casting to the expected type. When type `T` has beeen defined as `boolean` or
847
+ * `number` type, `typia.http.parameter()` will cast the value to the expected type.
848
+ *
849
+ * Also, `typia.http.parameter()` performs type assertion to the decoded value by
850
+ * combining with {@link assert} function. Therefore, when the decoded value is not
851
+ * following the `T` type, {@link TypeGuardError} would be thrown.
852
+ *
853
+ * @template T Expected type of decoded value
854
+ * @param input Path parameter string
855
+ * @returns Decoded path parameter value
856
+ */
857
+ function parameter(): never;
858
+
859
+ /**
860
+ * URL path parameter decoder.
861
+ *
862
+ * `typia.http.parameter()` is a function decoding a path parameter, with automatic
863
+ * type casting to the expected type. When type `T` has beeen defined as `boolean` or
864
+ * `number` type, `typia.http.parameter()` will cast the value to the expected type.
865
+ *
866
+ * Also, `typia.http.parameter()` performs type assertion to the decoded value by
867
+ * combining with {@link assert} function. Therefore, when the decoded value is not
868
+ * following the `T` type, {@link TypeGuardError} would be thrown.
869
+ *
870
+ * @template T Expected type of decoded value
871
+ * @param input Path parameter string
872
+ * @returns Decoded path parameter value
873
+ */
874
+ function parameter<T extends Atomic.Type | null>(input: string): Resolved<T>;
875
+
876
+ /**
877
+ * @internal
878
+ */
879
+ function parameter(): never {
880
+ halt("parameter");
881
+ }
882
+
883
+ const parameterPure = /** @__PURE__ */ Object.assign<typeof parameter, {}, {}>(
884
+ parameter,
885
+ /** @__PURE__ */ Namespace.http.parameter(),
886
+ /** @__PURE__ */ Namespace.assert("http.parameter"),
887
+ );
888
+ export { parameterPure as parameter };
889
+
890
+ /* -----------------------------------------------------------
891
+ FACTORY FUNCTIONS
892
+ ----------------------------------------------------------- */
893
+ /**
894
+ * Creates a reusable {@link query} function.
895
+ *
896
+ * @danger You must configure the generic argument `T`
897
+ * @template T The type of the query object
898
+ * @throws compile error
899
+ *
900
+ * @author Jeongho Nam - https://github.com/samchon
901
+ */
902
+ function createQuery(): never;
903
+
904
+ /**
905
+ * Creates a reusable {@link query} function.
906
+ *
907
+ * @template T The type of the query object
908
+ * @returns A reusable `query` function
909
+ *
910
+ * @author Jeongho Nam - https://github.com/samchon
911
+ */
912
+ function createQuery<T extends object>(): (
913
+ input: string | URLSearchParams,
914
+ ) => T;
915
+
916
+ /**
917
+ * @internal
918
+ */
919
+ function createQuery<T>(): (input: string | URLSearchParams) => T {
920
+ halt("createQuery");
921
+ }
922
+
923
+ const createQueryPure = /** @__PURE__ */ Object.assign<typeof createQuery, {}>(
924
+ createQuery,
925
+ /** @__PURE__ */ Namespace.http.query(),
926
+ );
927
+ export { createQueryPure as createQuery };
928
+
929
+ /**
930
+ * Creates a reusable {@link assertQuery} function.
931
+ *
932
+ * @danger You must configure the generic argument `T`
933
+ * @template T The type of the query object
934
+ * @throws compile error
935
+ *
936
+ * @author Jeongho Nam - https://github.com/samchon
937
+ */
938
+ function createAssertQuery(): never;
939
+
940
+ /**
941
+ * Creates a reusable {@link assertQuery} function.
942
+ *
943
+ * @template T The type of the query object
944
+ * @returns A reusable `assertQuery` function
945
+ *
946
+ * @author Jeongho Nam - https://github.com/samchon
947
+ */
948
+ function createAssertQuery<T extends object>(): (
949
+ input: string | URLSearchParams,
950
+ ) => T;
951
+
952
+ /**
953
+ * @internal
954
+ */
955
+ function createAssertQuery<T>(): (input: string | URLSearchParams) => T {
956
+ halt("createAssertQuery");
957
+ }
958
+
959
+ const createAssertQueryPure = /** @__PURE__ */ Object.assign<
960
+ typeof createAssertQuery,
961
+ {},
962
+ {}
963
+ >(
964
+ createAssertQuery,
965
+ /** @__PURE__ */ Namespace.http.query(),
966
+ /** @__PURE__ */ Namespace.assert("http.createAssertQuery"),
967
+ );
968
+ export { createAssertQueryPure as createAssertQuery };
969
+
970
+ /**
971
+ * Creates a reusable {@link isQuery} function.
972
+ *
973
+ * @danger You must configure the generic argument `T`
974
+ * @template T The type of the query object
975
+ * @throws compile error
976
+ *
977
+ * @author Jeongho Nam - https://github.com/samchon
978
+ */
979
+ function createIsQuery(): never;
980
+
981
+ /**
982
+ * Creates a reusable {@link isQuery} function.
983
+ *
984
+ * @template T The type of the query object
985
+ * @returns A reusable `isQuery` function
986
+ *
987
+ * @author Jeongho Nam - https://github.com/samchon
988
+ */
989
+ function createIsQuery<T extends object>(): (
990
+ input: string | URLSearchParams,
991
+ ) => T | null;
992
+
993
+ /**
994
+ * @internal
995
+ */
996
+ function createIsQuery<T>(): (input: string | URLSearchParams) => T | null {
997
+ halt("createIsQuery");
998
+ }
999
+
1000
+ const createIsQueryPure = /** @__PURE__ */ Object.assign<
1001
+ typeof createIsQuery,
1002
+ {},
1003
+ {}
1004
+ >(
1005
+ createIsQuery,
1006
+ /** @__PURE__ */ Namespace.http.query(),
1007
+ /** @__PURE__ */ Namespace.is(),
1008
+ );
1009
+ export { createIsQueryPure as createIsQuery };
1010
+
1011
+ /**
1012
+ * Creates a reusable {@link validateQuery} function.
1013
+ *
1014
+ * @danger You must configure the generic argument `T`
1015
+ * @template T The type of the query object
1016
+ * @throws compile error
1017
+ *
1018
+ * @author Jeongho Nam - https://github.com/samchon
1019
+ */
1020
+ function createValidateQuery(): never;
1021
+
1022
+ /**
1023
+ * Creates a reusable {@link validateQuery} function.
1024
+ *
1025
+ * @template T The type of the query object
1026
+ * @returns A reusable `validateQuery` function
1027
+ *
1028
+ * @author Jeongho Nam - https://github.com/samchon
1029
+ */
1030
+ function createValidateQuery<T extends object>(): (
1031
+ input: string | URLSearchParams,
1032
+ ) => IValidation<Resolved<T>>;
1033
+
1034
+ /**
1035
+ * @internal
1036
+ */
1037
+ function createValidateQuery<T>(): (
1038
+ input: string | URLSearchParams,
1039
+ ) => IValidation<Resolved<T>> {
1040
+ halt("createValidateQuery");
1041
+ }
1042
+
1043
+ const createValidateQueryPure = /** @__PURE__ */ Object.assign<
1044
+ typeof createValidateQuery,
1045
+ {},
1046
+ {}
1047
+ >(
1048
+ createValidateQuery,
1049
+ /** @__PURE__ */ Namespace.http.query(),
1050
+ /** @__PURE__ */ Namespace.validate(),
1051
+ );
1052
+ export { createValidateQueryPure as createValidateQuery };
1053
+
1054
+ /**
1055
+ * Creates a reusable {@link headers} function.
1056
+ *
1057
+ * @danger You must configure the generic argument `T`
1058
+ * @template T The type of the headers object
1059
+ * @throws compile error
1060
+ *
1061
+ * @author Jeongho Nam - https://github.com/samchon
1062
+ */
1063
+ function createHeaders(): never;
1064
+
1065
+ /**
1066
+ * Creates a reusable {@link headers} function.
1067
+ *
1068
+ * @template T The type of the headers object
1069
+ * @returns A reusable `headers` function
1070
+ *
1071
+ * @author Jeongho Nam - https://github.com/samchon
1072
+ */
1073
+ function createHeaders<T extends object>(): (
1074
+ input: Record<string, string | string[] | undefined>,
1075
+ ) => T;
1076
+
1077
+ /**
1078
+ * @internal
1079
+ */
1080
+ function createHeaders<T>(): (
1081
+ input: Record<string, string | string[] | undefined>,
1082
+ ) => T {
1083
+ halt("createHeaders");
1084
+ }
1085
+
1086
+ const createHeadersPure = /** @__PURE__ */ Object.assign<
1087
+ typeof createHeaders,
1088
+ {}
1089
+ >(createHeaders, /** @__PURE__ */ Namespace.http.headers());
1090
+ export { createHeadersPure as createHeaders };
1091
+
1092
+ /**
1093
+ * Creates a reusable {@link assertHeaders} function.
1094
+ *
1095
+ * @danger You must configure the generic argument `T`
1096
+ * @template T The type of the headers object
1097
+ * @throws compile error
1098
+ *
1099
+ * @author Jeongho Nam - https://github.com/samchon
1100
+ */
1101
+ function createAssertHeaders(): never;
1102
+
1103
+ /**
1104
+ * Creates a reusable {@link assertHeaders} function.
1105
+ *
1106
+ * @template T The type of the headers object
1107
+ * @returns A reusable `assertHeaders` function
1108
+ *
1109
+ * @author Jeongho Nam - https://github.com/samchon
1110
+ */
1111
+ function createAssertHeaders<T extends object>(): (
1112
+ input: Record<string, string | string[] | undefined>,
1113
+ ) => T;
1114
+
1115
+ /**
1116
+ * @internal
1117
+ */
1118
+ function createAssertHeaders<T>(): (
1119
+ input: Record<string, string | string[] | undefined>,
1120
+ ) => T {
1121
+ halt("createAssertHeaders");
1122
+ }
1123
+
1124
+ const createAssertHeadersPure = /** @__PURE__ */ Object.assign<
1125
+ typeof createAssertHeaders,
1126
+ {},
1127
+ {}
1128
+ >(
1129
+ createAssertHeaders,
1130
+ /** @__PURE__ */ Namespace.http.headers(),
1131
+ /** @__PURE__ */ Namespace.assert("http.createAssertHeaders"),
1132
+ );
1133
+ export { createAssertHeadersPure as createAssertHeaders };
1134
+
1135
+ /**
1136
+ * Creates a reusable {@link isHeaders} function.
1137
+ *
1138
+ * @danger You must configure the generic argument `T`
1139
+ * @template T The type of the headers object
1140
+ * @throws compile error
1141
+ *
1142
+ * @author Jeongho Nam - https://github.com/samchon
1143
+ */
1144
+ function createIsHeaders(): never;
1145
+
1146
+ /**
1147
+ * Creates a reusable {@link isHeaders} function.
1148
+ *
1149
+ * @template T The type of the headers object
1150
+ * @returns A reusable `isHeaders` function
1151
+ *
1152
+ * @author Jeongho Nam - https://github.com/samchon
1153
+ */
1154
+ function createIsHeaders<T extends object>(): (
1155
+ input: Record<string, string | string[] | undefined>,
1156
+ ) => T | null;
1157
+
1158
+ /**
1159
+ * @internal
1160
+ */
1161
+ function createIsHeaders<T>(): (
1162
+ input: Record<string, string | string[] | undefined>,
1163
+ ) => T | null {
1164
+ halt("createIsHeaders");
1165
+ }
1166
+
1167
+ const createIsHeadersPure = /** @__PURE__ */ Object.assign<
1168
+ typeof createIsHeaders,
1169
+ {},
1170
+ {}
1171
+ >(
1172
+ createIsHeaders,
1173
+ /** @__PURE__ */ Namespace.http.headers(),
1174
+ /** @__PURE__ */ Namespace.is(),
1175
+ );
1176
+ export { createIsHeadersPure as createIsHeaders };
1177
+
1178
+ /**
1179
+ * Creates a reusable {@link validateHeaders} function.
1180
+ *
1181
+ * @danger You must configure the generic argument `T`
1182
+ * @template T The type of the headers object
1183
+ * @throws compile error
1184
+ *
1185
+ * @author Jeongho Nam - https://github.com/samchon
1186
+ */
1187
+ function createValidateHeaders(): never;
1188
+
1189
+ /**
1190
+ * Creates a reusable {@link validateHeaders} function.
1191
+ *
1192
+ * @template T The type of the headers object
1193
+ * @returns A reusable `validateHeaders` function
1194
+ *
1195
+ * @author Jeongho Nam - https://github.com/samchon
1196
+ */
1197
+ function createValidateHeaders<T extends object>(): (
1198
+ input: Record<string, string | string[] | undefined>,
1199
+ ) => IValidation<Resolved<T>>;
1200
+
1201
+ /**
1202
+ * @internal
1203
+ */
1204
+ function createValidateHeaders<T>(): (
1205
+ input: Record<string, string | string[] | undefined>,
1206
+ ) => IValidation<Resolved<T>> {
1207
+ halt("createValidateHeaders");
1208
+ }
1209
+
1210
+ const createValidateHeadersPure = /** @__PURE__ */ Object.assign<
1211
+ typeof createValidateHeaders,
1212
+ {},
1213
+ {}
1214
+ >(
1215
+ createValidateHeaders,
1216
+ /** @__PURE__ */ Namespace.http.headers(),
1217
+ /** @__PURE__ */ Namespace.validate(),
1218
+ );
1219
+ export { createValidateHeadersPure as createValidateHeaders };
1220
+
1221
+ /**
1222
+ * Creates a reusable {@link parameter} function.
1223
+ *
1224
+ * @danger You must configure the generic argument `T`
1225
+ * @template T The type of the parameter value
1226
+ * @throws compile error
1227
+ *
1228
+ * @author Jeongho Nam - https://github.com/samchon
1229
+ */
1230
+ function createParameter(): never;
1231
+
1232
+ /**
1233
+ * Creates a reusable {@link parameter} function.
1234
+ *
1235
+ * @template T The type of the parameter value
1236
+ * @returns A reusable `parameter` function
1237
+ *
1238
+ * @author Jeongho Nam - https://github.com/samchon
1239
+ */
1240
+ function createParameter<T extends Atomic.Type | null>(): (input: string) => T;
1241
+
1242
+ /**
1243
+ * @internal
1244
+ */
1245
+ function createParameter<T extends Atomic.Type | null>(): (input: string) => T {
1246
+ halt("createParameter");
1247
+ }
1248
+
1249
+ const createParameterPure = /** @__PURE__ */ Object.assign<
1250
+ typeof createParameter,
1251
+ {},
1252
+ {}
1253
+ >(
1254
+ createParameter,
1255
+ /** @__PURE__ */ Namespace.http.parameter(),
1256
+ /** @__PURE__ */ Namespace.assert("http.createParameter"),
1257
+ );
1258
+ export { createParameterPure as createParameter };
1259
+
1260
+ /**
1261
+ * @internal
1262
+ */
1263
+ function halt(name: string): never {
1264
+ throw new Error(
1265
+ `Error on typia.http.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`,
1266
+ );
1267
+ }