typia 5.3.12-dev.20240118 → 5.3.12-dev.20240121

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (404) hide show
  1. package/lib/functional/$HeadersReader/$HeadersReader.js.map +1 -1
  2. package/lib/functional/$ParameterReader/$ParameterReader.js.map +1 -1
  3. package/lib/functional/$ProtobufSizer.js.map +1 -1
  4. package/lib/functional/$QueryReader/$QueryReader.js +2 -10
  5. package/lib/functional/$QueryReader/$QueryReader.js.map +1 -1
  6. package/lib/functional/$throws.js.map +1 -1
  7. package/lib/functional/Namespace/index.js +1 -1
  8. package/lib/functional/Namespace/index.js.map +1 -1
  9. package/lib/functional/Namespace/notations.js.map +1 -1
  10. package/lib/http.d.ts +18 -96
  11. package/lib/http.js +1 -2
  12. package/lib/http.js.map +1 -1
  13. package/lib/json.d.ts +14 -78
  14. package/lib/json.js +9 -8
  15. package/lib/json.js.map +1 -1
  16. package/lib/misc.d.ts +16 -84
  17. package/lib/misc.js +10 -9
  18. package/lib/misc.js.map +1 -1
  19. package/lib/module.d.ts +18 -71
  20. package/lib/module.js +21 -15
  21. package/lib/module.js.map +1 -1
  22. package/lib/notations.d.ts +24 -240
  23. package/lib/notations.js +5 -4
  24. package/lib/notations.js.map +1 -1
  25. package/lib/programmers/notations/NotationGeneralProgrammer.js.map +1 -1
  26. package/lib/protobuf.d.ts +16 -176
  27. package/lib/protobuf.js +4 -2
  28. package/lib/protobuf.js.map +1 -1
  29. package/lib/reflect.d.ts +1 -3
  30. package/lib/reflect.js.map +1 -1
  31. package/lib/schemas/metadata/MetadataObject.js +1 -2
  32. package/lib/schemas/metadata/MetadataObject.js.map +1 -1
  33. package/lib/transformers/CallExpressionTransformer.js.map +1 -1
  34. package/lib/utils/NamingConvention/NamingConvention.js +2 -6
  35. package/lib/utils/NamingConvention/NamingConvention.js.map +1 -1
  36. package/lib/utils/RandomGenerator/RandomGenerator.js +1 -3
  37. package/lib/utils/RandomGenerator/RandomGenerator.js.map +1 -1
  38. package/package.json +1 -1
  39. package/src/AssertionGuard.ts +1 -1
  40. package/src/CamelCase.ts +114 -114
  41. package/src/IRandomGenerator.ts +35 -35
  42. package/src/IValidation.ts +21 -21
  43. package/src/PascalCase.ts +114 -114
  44. package/src/Primitive.ts +135 -135
  45. package/src/Resolved.ts +116 -116
  46. package/src/SnakeCase.ts +156 -156
  47. package/src/TypeGuardError.ts +36 -36
  48. package/src/executable/TypiaGenerateWizard.ts +83 -83
  49. package/src/executable/TypiaPatchWizard.ts +42 -42
  50. package/src/executable/TypiaSetupWizard.ts +151 -151
  51. package/src/executable/setup/ArgumentParser.ts +43 -43
  52. package/src/executable/setup/CommandExecutor.ts +8 -8
  53. package/src/executable/setup/FileRetriever.ts +22 -22
  54. package/src/executable/setup/PackageManager.ts +71 -71
  55. package/src/executable/setup/PluginConfigurator.ts +69 -69
  56. package/src/executable/typia.ts +55 -55
  57. package/src/factories/CommentFactory.ts +79 -79
  58. package/src/factories/ExpressionFactory.ts +150 -150
  59. package/src/factories/IdentifierFactory.ts +70 -70
  60. package/src/factories/JsonMetadataFactory.ts +53 -53
  61. package/src/factories/LiteralFactory.ts +47 -47
  62. package/src/factories/MetadataCollection.ts +260 -260
  63. package/src/factories/MetadataCommentTagFactory.ts +601 -601
  64. package/src/factories/MetadataFactory.ts +267 -267
  65. package/src/factories/MetadataTypeTagFactory.ts +313 -313
  66. package/src/factories/NumericRangeFactory.ts +72 -72
  67. package/src/factories/ProtobufFactory.ts +259 -259
  68. package/src/factories/StatementFactory.ts +72 -72
  69. package/src/factories/TemplateFactory.ts +56 -56
  70. package/src/factories/TypeFactory.ts +118 -118
  71. package/src/factories/ValueFactory.ts +12 -12
  72. package/src/factories/internal/metadata/MetadataHelper.ts +15 -15
  73. package/src/factories/internal/metadata/emend_metadata_atomics.ts +37 -37
  74. package/src/factories/internal/metadata/emplace_metadata_alias.ts +41 -41
  75. package/src/factories/internal/metadata/emplace_metadata_array_type.ts +38 -38
  76. package/src/factories/internal/metadata/emplace_metadata_object.ts +175 -175
  77. package/src/factories/internal/metadata/emplace_metadata_tuple.ts +57 -57
  78. package/src/factories/internal/metadata/explore_metadata.ts +28 -28
  79. package/src/factories/internal/metadata/iterate_metadata.ts +94 -94
  80. package/src/factories/internal/metadata/iterate_metadata_alias.ts +34 -34
  81. package/src/factories/internal/metadata/iterate_metadata_array.ts +37 -37
  82. package/src/factories/internal/metadata/iterate_metadata_atomic.ts +62 -62
  83. package/src/factories/internal/metadata/iterate_metadata_coalesce.ts +33 -33
  84. package/src/factories/internal/metadata/iterate_metadata_collection.ts +131 -131
  85. package/src/factories/internal/metadata/iterate_metadata_comment_tags.ts +26 -26
  86. package/src/factories/internal/metadata/iterate_metadata_constant.ts +48 -48
  87. package/src/factories/internal/metadata/iterate_metadata_intersection.ts +230 -230
  88. package/src/factories/internal/metadata/iterate_metadata_map.ts +50 -50
  89. package/src/factories/internal/metadata/iterate_metadata_native.ts +208 -208
  90. package/src/factories/internal/metadata/iterate_metadata_object.ts +43 -43
  91. package/src/factories/internal/metadata/iterate_metadata_resolve.ts +52 -52
  92. package/src/factories/internal/metadata/iterate_metadata_set.ts +41 -41
  93. package/src/factories/internal/metadata/iterate_metadata_sort.ts +61 -61
  94. package/src/factories/internal/metadata/iterate_metadata_template.ts +44 -44
  95. package/src/factories/internal/metadata/iterate_metadata_tuple.ts +37 -37
  96. package/src/factories/internal/metadata/iterate_metadata_union.ts +27 -27
  97. package/src/functional/$HeadersReader/$HeadersReader.ts +26 -26
  98. package/src/functional/$HeadersReader/index.ts +1 -1
  99. package/src/functional/$ParameterReader/$ParameterReader.ts +29 -29
  100. package/src/functional/$ParameterReader/index.ts +1 -1
  101. package/src/functional/$ProtobufReader.ts +195 -195
  102. package/src/functional/$ProtobufSizer.ts +147 -147
  103. package/src/functional/$ProtobufWriter.ts +150 -150
  104. package/src/functional/$QueryReader/$QueryReader.ts +46 -54
  105. package/src/functional/$QueryReader/index.ts +1 -1
  106. package/src/functional/$any.ts +4 -4
  107. package/src/functional/$clone.ts +4 -4
  108. package/src/functional/$convention.ts +37 -37
  109. package/src/functional/$dictionary.ts +22 -22
  110. package/src/functional/$every.ts +11 -11
  111. package/src/functional/$guard.ts +35 -35
  112. package/src/functional/$is_between.ts +2 -2
  113. package/src/functional/$join.ts +46 -46
  114. package/src/functional/$number.ts +12 -12
  115. package/src/functional/$report.ts +13 -13
  116. package/src/functional/$rest.ts +3 -3
  117. package/src/functional/$stoll.ts +8 -8
  118. package/src/functional/$string.ts +50 -50
  119. package/src/functional/$strlen.ts +7 -7
  120. package/src/functional/$tail.ts +5 -5
  121. package/src/functional/$throws.ts +10 -10
  122. package/src/functional/$varint.ts +130 -130
  123. package/src/functional/$zigzag.ts +39 -39
  124. package/src/functional/IProtobufWriter.ts +18 -18
  125. package/src/functional/Namespace/http.ts +7 -7
  126. package/src/functional/Namespace/index.ts +75 -75
  127. package/src/functional/Namespace/json.ts +15 -15
  128. package/src/functional/Namespace/misc.ts +14 -14
  129. package/src/functional/Namespace/notations.ts +23 -22
  130. package/src/functional/Namespace/protobuf.ts +20 -20
  131. package/src/functional/is.ts +10 -10
  132. package/src/http.ts +1267 -1233
  133. package/src/index.ts +4 -4
  134. package/src/json.ts +60 -27
  135. package/src/misc.ts +69 -32
  136. package/src/module.ts +74 -24
  137. package/src/notations.ts +977 -917
  138. package/src/programmers/AssertProgrammer.ts +293 -293
  139. package/src/programmers/CheckerProgrammer.ts +1025 -1025
  140. package/src/programmers/FeatureProgrammer.ts +460 -460
  141. package/src/programmers/IsProgrammer.ts +232 -232
  142. package/src/programmers/RandomProgrammer.ts +825 -825
  143. package/src/programmers/TypiaProgrammer.ts +167 -167
  144. package/src/programmers/ValidateProgrammer.ts +307 -307
  145. package/src/programmers/helpers/AtomicPredicator.ts +25 -25
  146. package/src/programmers/helpers/CloneJoiner.ts +130 -130
  147. package/src/programmers/helpers/FunctionImporeter.ts +87 -87
  148. package/src/programmers/helpers/HttpMetadataUtil.ts +21 -21
  149. package/src/programmers/helpers/ICheckEntry.ts +13 -13
  150. package/src/programmers/helpers/IExpressionEntry.ts +12 -12
  151. package/src/programmers/helpers/NotationJoiner.ts +132 -132
  152. package/src/programmers/helpers/OptionPredicator.ts +15 -15
  153. package/src/programmers/helpers/ProtobufUtil.ts +125 -125
  154. package/src/programmers/helpers/ProtobufWire.ts +34 -34
  155. package/src/programmers/helpers/PruneJoiner.ts +141 -141
  156. package/src/programmers/helpers/RandomJoiner.ts +140 -140
  157. package/src/programmers/helpers/RandomRanger.ts +171 -171
  158. package/src/programmers/helpers/StringifyJoinder.ts +105 -105
  159. package/src/programmers/helpers/StringifyPredicator.ts +12 -12
  160. package/src/programmers/helpers/UnionExplorer.ts +269 -269
  161. package/src/programmers/helpers/UnionPredicator.ts +77 -77
  162. package/src/programmers/helpers/disable_function_importer_declare.ts +32 -32
  163. package/src/programmers/http/HttpAssertHeadersProgrammer.ts +77 -77
  164. package/src/programmers/http/HttpAssertQueryProgrammer.ts +75 -75
  165. package/src/programmers/http/HttpHeadersProgrammer.ts +314 -314
  166. package/src/programmers/http/HttpIsHeadersProgrammer.ts +84 -84
  167. package/src/programmers/http/HttpIsQueryProgrammer.ts +82 -82
  168. package/src/programmers/http/HttpParameterProgrammer.ts +97 -97
  169. package/src/programmers/http/HttpQueryProgrammer.ts +252 -252
  170. package/src/programmers/http/HttpValidateHeadersProgrammer.ts +77 -77
  171. package/src/programmers/http/HttpValidateQueryProgrammer.ts +75 -75
  172. package/src/programmers/internal/JSON_SCHEMA_PREFIX.ts +1 -1
  173. package/src/programmers/internal/application_alias.ts +74 -74
  174. package/src/programmers/internal/application_array.ts +59 -59
  175. package/src/programmers/internal/application_boolean.ts +35 -35
  176. package/src/programmers/internal/application_constant.ts +25 -25
  177. package/src/programmers/internal/application_default.ts +17 -17
  178. package/src/programmers/internal/application_default_string.ts +33 -33
  179. package/src/programmers/internal/application_escaped.ts +52 -52
  180. package/src/programmers/internal/application_native.ts +34 -34
  181. package/src/programmers/internal/application_number.ts +97 -97
  182. package/src/programmers/internal/application_object.ts +183 -183
  183. package/src/programmers/internal/application_schema.ts +165 -165
  184. package/src/programmers/internal/application_string.ts +61 -61
  185. package/src/programmers/internal/application_templates.ts +24 -24
  186. package/src/programmers/internal/application_tuple.ts +54 -54
  187. package/src/programmers/internal/check_array_length.ts +45 -45
  188. package/src/programmers/internal/check_bigint.ts +49 -49
  189. package/src/programmers/internal/check_dynamic_key.ts +175 -175
  190. package/src/programmers/internal/check_dynamic_properties.ts +198 -198
  191. package/src/programmers/internal/check_everything.ts +23 -23
  192. package/src/programmers/internal/check_native.ts +21 -21
  193. package/src/programmers/internal/check_number.ts +106 -106
  194. package/src/programmers/internal/check_object.ts +60 -60
  195. package/src/programmers/internal/check_string.ts +48 -48
  196. package/src/programmers/internal/check_template.ts +61 -61
  197. package/src/programmers/internal/check_union_array_like.ts +307 -307
  198. package/src/programmers/internal/decode_union_object.ts +78 -78
  199. package/src/programmers/internal/feature_object_entries.ts +58 -58
  200. package/src/programmers/internal/metadata_to_pattern.ts +33 -33
  201. package/src/programmers/internal/prune_object_properties.ts +60 -60
  202. package/src/programmers/internal/random_custom.ts +37 -37
  203. package/src/programmers/internal/stringify_dynamic_properties.ts +157 -157
  204. package/src/programmers/internal/stringify_native.ts +7 -7
  205. package/src/programmers/internal/stringify_regular_properties.ts +81 -81
  206. package/src/programmers/internal/template_to_pattern.ts +15 -15
  207. package/src/programmers/internal/wrap_metadata_rest_tuple.ts +20 -20
  208. package/src/programmers/json/JsonApplicationProgrammer.ts +49 -49
  209. package/src/programmers/json/JsonAssertParseProgrammer.ts +67 -67
  210. package/src/programmers/json/JsonAssertStringifyProgrammer.ts +61 -61
  211. package/src/programmers/json/JsonIsParseProgrammer.ts +73 -73
  212. package/src/programmers/json/JsonIsStringifyProgrammer.ts +75 -75
  213. package/src/programmers/json/JsonStringifyProgrammer.ts +893 -893
  214. package/src/programmers/json/JsonValidateParseProgrammer.ts +64 -64
  215. package/src/programmers/json/JsonValidateStringifyProgrammer.ts +83 -83
  216. package/src/programmers/misc/MiscAssertCloneProgrammer.ts +63 -63
  217. package/src/programmers/misc/MiscAssertPruneProgrammer.ts +60 -60
  218. package/src/programmers/misc/MiscCloneProgrammer.ts +713 -713
  219. package/src/programmers/misc/MiscIsCloneProgrammer.ts +70 -70
  220. package/src/programmers/misc/MiscIsPruneProgrammer.ts +66 -66
  221. package/src/programmers/misc/MiscLiteralsProgrammer.ts +72 -72
  222. package/src/programmers/misc/MiscPruneProgrammer.ts +523 -523
  223. package/src/programmers/misc/MiscValidateCloneProgrammer.ts +80 -80
  224. package/src/programmers/misc/MiscValidatePruneProgrammer.ts +73 -73
  225. package/src/programmers/notations/NotationAssertGeneralProgrammer.ts +64 -64
  226. package/src/programmers/notations/NotationGeneralProgrammer.ts +647 -647
  227. package/src/programmers/notations/NotationIsGeneralProgrammer.ts +71 -71
  228. package/src/programmers/notations/NotationValidateGeneralProgrammer.ts +81 -81
  229. package/src/programmers/protobuf/ProtobufAssertDecodeProgrammer.ts +75 -75
  230. package/src/programmers/protobuf/ProtobufAssertEncodeProgrammer.ts +61 -61
  231. package/src/programmers/protobuf/ProtobufDecodeProgrammer.ts +607 -607
  232. package/src/programmers/protobuf/ProtobufEncodeProgrammer.ts +819 -819
  233. package/src/programmers/protobuf/ProtobufIsDecodeProgrammer.ts +82 -82
  234. package/src/programmers/protobuf/ProtobufIsEncodeProgrammer.ts +75 -75
  235. package/src/programmers/protobuf/ProtobufMessageProgrammer.ts +160 -160
  236. package/src/programmers/protobuf/ProtobufValidateDecodeProgrammer.ts +75 -75
  237. package/src/programmers/protobuf/ProtobufValidateEncodeProgrammer.ts +83 -83
  238. package/src/protobuf.ts +970 -922
  239. package/src/reflect.ts +57 -54
  240. package/src/schemas/json/IJsonApplication.ts +9 -9
  241. package/src/schemas/json/IJsonComponents.ts +19 -19
  242. package/src/schemas/json/IJsonSchema.ts +122 -122
  243. package/src/schemas/metadata/IJsDocTagInfo.ts +10 -10
  244. package/src/schemas/metadata/IMetadata.ts +34 -34
  245. package/src/schemas/metadata/IMetadataAlias.ts +12 -12
  246. package/src/schemas/metadata/IMetadataApplication.ts +7 -7
  247. package/src/schemas/metadata/IMetadataArray.ts +7 -7
  248. package/src/schemas/metadata/IMetadataArrayType.ts +10 -10
  249. package/src/schemas/metadata/IMetadataAtomic.ts +6 -6
  250. package/src/schemas/metadata/IMetadataComponents.ts +11 -11
  251. package/src/schemas/metadata/IMetadataConstant.ts +23 -23
  252. package/src/schemas/metadata/IMetadataDictionary.ts +11 -11
  253. package/src/schemas/metadata/IMetadataEntry.ts +6 -6
  254. package/src/schemas/metadata/IMetadataEscaped.ts +6 -6
  255. package/src/schemas/metadata/IMetadataObject.ts +13 -18
  256. package/src/schemas/metadata/IMetadataProperty.ts +9 -9
  257. package/src/schemas/metadata/IMetadataTuple.ts +7 -7
  258. package/src/schemas/metadata/IMetadataTupleType.ts +10 -10
  259. package/src/schemas/metadata/IMetadataTypeTag.ts +15 -15
  260. package/src/schemas/metadata/Metadata.ts +612 -612
  261. package/src/schemas/metadata/MetadataAlias.ts +61 -61
  262. package/src/schemas/metadata/MetadataApplication.ts +44 -44
  263. package/src/schemas/metadata/MetadataArray.ts +49 -49
  264. package/src/schemas/metadata/MetadataArrayType.ts +57 -57
  265. package/src/schemas/metadata/MetadataAtomic.ts +84 -84
  266. package/src/schemas/metadata/MetadataComponents.ts +98 -98
  267. package/src/schemas/metadata/MetadataConstant.ts +46 -46
  268. package/src/schemas/metadata/MetadataEscaped.ts +51 -51
  269. package/src/schemas/metadata/MetadataObject.ts +154 -155
  270. package/src/schemas/metadata/MetadataProperty.ts +56 -56
  271. package/src/schemas/metadata/MetadataTuple.ts +32 -32
  272. package/src/schemas/metadata/MetadataTupleType.ts +67 -67
  273. package/src/tags/Default.ts +15 -15
  274. package/src/tags/ExclusiveMaximum.ts +13 -13
  275. package/src/tags/ExclusiveMinimum.ts +13 -13
  276. package/src/tags/Format.ts +30 -30
  277. package/src/tags/MaxItems.ts +9 -9
  278. package/src/tags/MaxLength.ts +9 -9
  279. package/src/tags/Maximum.ts +13 -13
  280. package/src/tags/MinItems.ts +9 -9
  281. package/src/tags/MinLength.ts +9 -9
  282. package/src/tags/Minimum.ts +13 -13
  283. package/src/tags/MultipleOf.ts +15 -15
  284. package/src/tags/Pattern.ts +9 -9
  285. package/src/tags/TagBase.ts +68 -68
  286. package/src/tags/Type.ts +27 -27
  287. package/src/tags/index.ts +14 -14
  288. package/src/transform.ts +35 -35
  289. package/src/transformers/CallExpressionTransformer.ts +351 -351
  290. package/src/transformers/FileTransformer.ts +91 -91
  291. package/src/transformers/IProject.ts +15 -15
  292. package/src/transformers/ITransformOptions.ts +62 -62
  293. package/src/transformers/ImportTransformer.ts +66 -66
  294. package/src/transformers/NodeTransformer.ts +13 -13
  295. package/src/transformers/TransformerError.ts +55 -55
  296. package/src/transformers/features/AssertTransformer.ts +16 -16
  297. package/src/transformers/features/CreateAssertTransformer.ts +16 -16
  298. package/src/transformers/features/CreateIsTransformer.ts +10 -10
  299. package/src/transformers/features/CreateRandomTransformer.ts +40 -40
  300. package/src/transformers/features/CreateValidateTransformer.ts +13 -13
  301. package/src/transformers/features/IsTransformer.ts +10 -10
  302. package/src/transformers/features/RandomTransformer.ts +44 -44
  303. package/src/transformers/features/ValidateTransformer.ts +11 -11
  304. package/src/transformers/features/http/CreateHttpAssertHeadersTransformer.ts +11 -11
  305. package/src/transformers/features/http/CreateHttpAssertQueryTransformer.ts +9 -9
  306. package/src/transformers/features/http/CreateHttpHeadersTransformer.ts +9 -9
  307. package/src/transformers/features/http/CreateHttpIsHeadersTransformer.ts +9 -9
  308. package/src/transformers/features/http/CreateHttpIsQueryTransformer.ts +9 -9
  309. package/src/transformers/features/http/CreateHttpParameterTransformer.ts +9 -9
  310. package/src/transformers/features/http/CreateHttpQueryTransformer.ts +9 -9
  311. package/src/transformers/features/http/CreateHttpValidateHeadersTransformer.ts +12 -12
  312. package/src/transformers/features/http/CreateHttpValidateQueryTransformer.ts +11 -11
  313. package/src/transformers/features/http/HttpAssertHeadersTransformer.ts +9 -9
  314. package/src/transformers/features/http/HttpAssertQueryTransformer.ts +9 -9
  315. package/src/transformers/features/http/HttpHeadersTransformer.ts +9 -9
  316. package/src/transformers/features/http/HttpIsHeadersTransformer.ts +9 -9
  317. package/src/transformers/features/http/HttpIsQueryTransformer.ts +9 -9
  318. package/src/transformers/features/http/HttpParameterTransformer.ts +9 -9
  319. package/src/transformers/features/http/HttpQueryTransformer.ts +9 -9
  320. package/src/transformers/features/http/HttpValidateHeadersTransformer.ts +10 -10
  321. package/src/transformers/features/http/HttpValidateQueryTransformer.ts +9 -9
  322. package/src/transformers/features/json/JsonApplicationTransformer.ts +134 -134
  323. package/src/transformers/features/json/JsonAssertParseTransformer.ts +9 -9
  324. package/src/transformers/features/json/JsonAssertStringifyTransformer.ts +10 -10
  325. package/src/transformers/features/json/JsonCreateAssertParseTransformer.ts +9 -9
  326. package/src/transformers/features/json/JsonCreateAssertStringifyTransformer.ts +12 -12
  327. package/src/transformers/features/json/JsonCreateIsParseTransformer.ts +9 -9
  328. package/src/transformers/features/json/JsonCreateIsStringifyTransformer.ts +9 -9
  329. package/src/transformers/features/json/JsonCreateStringifyTransformer.ts +9 -9
  330. package/src/transformers/features/json/JsonCreateValidateParseTransformer.ts +11 -11
  331. package/src/transformers/features/json/JsonCreateValidateStringifyProgrammer.ts +12 -12
  332. package/src/transformers/features/json/JsonIsParseTransformer.ts +9 -9
  333. package/src/transformers/features/json/JsonIsStringifyTransformer.ts +9 -9
  334. package/src/transformers/features/json/JsonStringifyTransformer.ts +9 -9
  335. package/src/transformers/features/json/JsonValidateParseTransformer.ts +9 -9
  336. package/src/transformers/features/json/JsonValidateStringifyTransformer.ts +10 -10
  337. package/src/transformers/features/misc/MiscAssertCloneTransformer.ts +9 -9
  338. package/src/transformers/features/misc/MiscAssertPruneTransformer.ts +9 -9
  339. package/src/transformers/features/misc/MiscCloneTransformer.ts +9 -9
  340. package/src/transformers/features/misc/MiscCreateAssertCloneTransformer.ts +9 -9
  341. package/src/transformers/features/misc/MiscCreateAssertPruneTransformer.ts +9 -9
  342. package/src/transformers/features/misc/MiscCreateCloneTransformer.ts +9 -9
  343. package/src/transformers/features/misc/MiscCreateIsCloneTransformer.ts +9 -9
  344. package/src/transformers/features/misc/MiscCreateIsPruneTransformer.ts +9 -9
  345. package/src/transformers/features/misc/MiscCreatePruneTransformer.ts +9 -9
  346. package/src/transformers/features/misc/MiscCreateValidateCloneTransformer.ts +11 -11
  347. package/src/transformers/features/misc/MiscCreateValidatePruneTransformer.ts +11 -11
  348. package/src/transformers/features/misc/MiscIsCloneTransformer.ts +9 -9
  349. package/src/transformers/features/misc/MiscIsPruneTransformer.ts +9 -9
  350. package/src/transformers/features/misc/MiscLiteralsTransformer.ts +32 -32
  351. package/src/transformers/features/misc/MiscPruneTransformer.ts +9 -9
  352. package/src/transformers/features/misc/MiscValidateCloneTransformer.ts +9 -9
  353. package/src/transformers/features/misc/MiscValidatePruneTransformer.ts +9 -9
  354. package/src/transformers/features/notations/NotationAssertGeneralTransformer.ts +15 -15
  355. package/src/transformers/features/notations/NotationCreateAssertGeneralTransformer.ts +15 -15
  356. package/src/transformers/features/notations/NotationCreateGeneralTransformer.ts +15 -15
  357. package/src/transformers/features/notations/NotationCreateIsGeneralTransformer.ts +15 -15
  358. package/src/transformers/features/notations/NotationCreateValidateGeneralTransformer.ts +15 -15
  359. package/src/transformers/features/notations/NotationGeneralTransformer.ts +11 -11
  360. package/src/transformers/features/notations/NotationIsGeneralTransformer.ts +15 -15
  361. package/src/transformers/features/notations/NotationValidateGeneralTransformer.ts +15 -15
  362. package/src/transformers/features/protobuf/ProtobufAssertDecodeTransformer.ts +10 -10
  363. package/src/transformers/features/protobuf/ProtobufAssertEncodeTransformer.ts +10 -10
  364. package/src/transformers/features/protobuf/ProtobufCreateAssertDecodeTransformer.ts +12 -12
  365. package/src/transformers/features/protobuf/ProtobufCreateAssertEncodeTransformer.ts +12 -12
  366. package/src/transformers/features/protobuf/ProtobufCreateDecodeTransformer.ts +9 -9
  367. package/src/transformers/features/protobuf/ProtobufCreateEncodeTransformer.ts +9 -9
  368. package/src/transformers/features/protobuf/ProtobufCreateIsDecodeTransformer.ts +9 -9
  369. package/src/transformers/features/protobuf/ProtobufCreateIsEncodeTransformer.ts +9 -9
  370. package/src/transformers/features/protobuf/ProtobufCreateValidateDecodeTransformer.ts +12 -12
  371. package/src/transformers/features/protobuf/ProtobufCreateValidateEncodeTransformer.ts +12 -12
  372. package/src/transformers/features/protobuf/ProtobufDecodeTransformer.ts +9 -9
  373. package/src/transformers/features/protobuf/ProtobufEncodeTransformer.ts +9 -9
  374. package/src/transformers/features/protobuf/ProtobufIsDecodeTransformer.ts +9 -9
  375. package/src/transformers/features/protobuf/ProtobufIsEncodeTransformer.ts +9 -9
  376. package/src/transformers/features/protobuf/ProtobufMessageTransformer.ts +33 -33
  377. package/src/transformers/features/protobuf/ProtobufValidateDecodeTransformer.ts +10 -10
  378. package/src/transformers/features/protobuf/ProtobufValidateEncodeTransformer.ts +10 -10
  379. package/src/transformers/features/reflect/ReflectMetadataTransformer.ts +63 -63
  380. package/src/transformers/internal/GenericTransformer.ts +96 -96
  381. package/src/typings/Atomic.ts +13 -13
  382. package/src/typings/ClassProperties.ts +5 -5
  383. package/src/typings/Customizable.ts +5 -5
  384. package/src/typings/OmitNever.ts +3 -3
  385. package/src/typings/ProtobufAtomic.ts +19 -19
  386. package/src/typings/SpecialFields.ts +3 -3
  387. package/src/typings/ValidationPipe.ts +9 -9
  388. package/src/typings/Writable.ts +11 -11
  389. package/src/utils/ArrayUtil.ts +43 -43
  390. package/src/utils/Escaper.ts +46 -46
  391. package/src/utils/MapUtil.ts +12 -12
  392. package/src/utils/NameEncoder.ts +32 -32
  393. package/src/utils/NamingConvention/NamingConvention.ts +77 -85
  394. package/src/utils/NamingConvention/index.ts +1 -1
  395. package/src/utils/PatternUtil.ts +29 -29
  396. package/src/utils/RandomGenerator/RandomGenerator.ts +74 -78
  397. package/src/utils/RandomGenerator/index.ts +1 -1
  398. package/src/utils/Singleton.ts +16 -16
  399. package/src/utils/StringUtil/StringUtil.ts +2 -2
  400. package/src/utils/StringUtil/index.ts +1 -1
  401. package/lib/reflect/index.d.ts +0 -0
  402. package/lib/reflect/index.js +0 -2
  403. package/lib/reflect/index.js.map +0 -1
  404. package/src/reflect/index.ts +0 -0
package/src/http.ts CHANGED
@@ -1,1233 +1,1267 @@
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>(
84
- input: string | URLSearchParams,
85
- ): Resolved<T>;
86
-
87
- /**
88
- * @internal
89
- */
90
- function query(): never {
91
- halt("query");
92
- }
93
- const queryPure = /** @__PURE__ */ Object.assign(
94
- query,
95
- /** @__PURE__ */ Namespace.http.query()
96
- );
97
- export { queryPure as query };
98
-
99
- /**
100
- * > You must configure the generic argument `T`.
101
- *
102
- * URL query decoder with type assertion.
103
- *
104
- * `typia.http.assertQuery()` is a function decoding a query string or an
105
- * `URLSearchParams` instance, with automatic type casting to the expected type.
106
- * When property type be defined as `boolean` or `number` type,
107
- * `typia.http.assertQuery()` will cast the value to the expected type when decoding.
108
- *
109
- * Also, after decoding, `typia.http.assertQuery()` performs type assertion to the
110
- * decoded value by combining with {@link assert} function. Therefore, when the
111
- * decoded value is not following the `T` type, {@link TypeGuardError} would be
112
- * thrown.
113
- *
114
- * By the way, as URL query is not enough to express complex data structures,
115
- * `typia.http.assertQuery()` function has some limitations. If target type `T` is
116
- * notfollowing those restrictions, compilation errors would be occured.
117
- *
118
- * 1. Type `T` must be an object type
119
- * 2. Do not allow dynamic property
120
- * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
121
- * 4. By the way, union type never be not allowed
122
- *
123
- * @template T Expected type of decoded value
124
- * @param input Query string or URLSearchParams instance
125
- * @returns Decoded query object
126
- *
127
- * @author Jeongho Nam - https://github.com/samchon
128
- */
129
- function assertQuery(): never;
130
-
131
- /**
132
- * URL query decoder with type assertion.
133
- *
134
- * `typia.http.assertQuery()` is a function decoding a query string or an
135
- * `URLSearchParams` instance, with automatic type casting to the expected type.
136
- * When property type be defined as `boolean` or `number` type,
137
- * `typia.http.assertQuery()` will cast the value to the expected type when decoding.
138
- *
139
- * Also, after decoding, `typia.http.assertQuery()` performs type assertion to the
140
- * decoded value by combining with {@link assert} function. Therefore, when the
141
- * decoded value is not following the `T` type, {@link TypeGuardError} would be
142
- * thrown.
143
- *
144
- * By the way, as URL query is not enough to express complex data structures,
145
- * `typia.http.assertQuery()` function has some limitations. If target type `T` is
146
- * notfollowing those restrictions, compilation errors would be occured.
147
- *
148
- * 1. Type `T` must be an object type
149
- * 2. Do not allow dynamic property
150
- * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
151
- * 4. By the way, union type never be not allowed
152
- *
153
- * @template T Expected type of decoded value
154
- * @param input Query string or URLSearchParams instance
155
- * @returns Decoded query object
156
- *
157
- * @author Jeongho Nam - https://github.com/samchon
158
- */
159
- function assertQuery<T extends object>(
160
- input: string | URLSearchParams,
161
- ): Resolved<T>;
162
-
163
- /**
164
- * @internal
165
- */
166
- function assertQuery(): never {
167
- halt("assertQuery");
168
- }
169
-
170
- const assertQueryPure = /** @__PURE__ */ Object.assign(
171
- assertQuery,
172
- /** @__PURE__ */ Namespace.http.query(),
173
- /** @__PURE__ */ Namespace.assert("http.assertQuery")
174
- );
175
- export { assertQueryPure as assertQuery };
176
-
177
- /**
178
- * > You must configure the generic argument `T`.
179
- *
180
- * URL query decoder with type checking.
181
- *
182
- * `typia.http.isQuery()` is a function decoding a query string or an
183
- * `URLSearchParams` instance, with automatic type casting to the expected type.
184
- * When property type be defined as `boolean` or `number` type,
185
- * `typia.http.isQuery()` will cast the value to the expected type when decoding.
186
- *
187
- * Also, after decoding, `typia.http.isQuery()` performs type checking to the
188
- * decoded value by combining with {@link is} function. Therefore, when the
189
- * decoded value is not following the `T` type, `null` value would be returned.
190
- *
191
- * By the way, as URL query is not enough to express complex data structures,
192
- * `typia.http.isQuery()` function has some limitations. If target type `T` is
193
- * notfollowing those restrictions, compilation errors would be occured.
194
- *
195
- * 1. Type `T` must be an object type
196
- * 2. Do not allow dynamic property
197
- * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
198
- * 4. By the way, union type never be not allowed
199
- *
200
- * @template T Expected type of decoded value
201
- * @param input Query string or URLSearchParams instance
202
- * @returns Decoded query object or `null` value
203
- *
204
- * @author Jeongho Nam - https://github.com/samchon
205
- */
206
- function isQuery(): never;
207
-
208
- /**
209
- * URL query decoder with type checking.
210
- *
211
- * `typia.http.isQuery()` is a function decoding a query string or an
212
- * `URLSearchParams` instance, with automatic type casting to the expected type.
213
- * When property type be defined as `boolean` or `number` type,
214
- * `typia.http.isQuery()` will cast the value to the expected type when decoding.
215
- *
216
- * Also, after decoding, `typia.http.isQuery()` performs type checking to the
217
- * decoded value by combining with {@link is} function. Therefore, when the
218
- * decoded value is not following the `T` type, `null` value would be returned.
219
- *
220
- * By the way, as URL query is not enough to express complex data structures,
221
- * `typia.http.isQuery()` function has some limitations. If target type `T` is
222
- * notfollowing those restrictions, compilation errors would be occured.
223
- *
224
- * 1. Type `T` must be an object type
225
- * 2. Do not allow dynamic property
226
- * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
227
- * 4. By the way, union type never be not allowed
228
- *
229
- * @template T Expected type of decoded value
230
- * @param input Query string or URLSearchParams instance
231
- * @returns Decoded query object or `null` value
232
- *
233
- * @author Jeongho Nam - https://github.com/samchon
234
- */
235
- function isQuery<T extends object>(
236
- input: string | URLSearchParams,
237
- ): Resolved<T> | null;
238
-
239
- /**
240
- * @internal
241
- */
242
- function isQuery(): never {
243
- halt("isQuery");
244
- }
245
-
246
- const isQueryPure = /** @__PURE__ */ Object.assign(
247
- isQuery,
248
- /** @__PURE__ */ Namespace.http.query(),
249
- /** @__PURE__ */ Namespace.is()
250
- );
251
- export { isQueryPure as isQuery };
252
-
253
- /**
254
- * > You must configure the generic argument `T`.
255
- *
256
- * URL query decoder with type validation.
257
- *
258
- * `typia.http.validateQuery()` is a function decoding a query string or an
259
- * `URLSearchParams` instance, with automatic type casting to the expected type.
260
- * When property type be defined as `boolean` or `number` type,
261
- * `typia.http.validateQuery()` will cast the value to the expected type when decoding.
262
- *
263
- * Also, after decoding, `typia.http.validateQuery()` performs type validation to the
264
- * decoded value by combining with {@link validate} function. Therefore, when the
265
- * decoded value is not following the `T` type, {@link IValidation.IFailure} would
266
- * be returned. Otherwise, {@link IValidation.ISuccess} would be returned.
267
- *
268
- * By the way, as URL query is not enough to express complex data structures,
269
- * `typia.http.validateQuery()` function has some limitations. If target type `T` is
270
- * notfollowing those restrictions, compilation errors would be occured.
271
- *
272
- * 1. Type `T` must be an object type
273
- * 2. Do not allow dynamic property
274
- * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
275
- * 4. By the way, union type never be not allowed
276
- *
277
- * @template T Expected type of decoded value
278
- * @param input Query string or URLSearchParams instance
279
- * @returns Validation result with decoded query object
280
- *
281
- * @author Jeongho Nam - https://github.com/samchon
282
- */
283
- function validateQuery(): never;
284
-
285
- /**
286
- * URL query decoder with type validation.
287
- *
288
- * `typia.http.validateQuery()` is a function decoding a query string or an
289
- * `URLSearchParams` instance, with automatic type casting to the expected type.
290
- * When property type be defined as `boolean` or `number` type,
291
- * `typia.http.validateQuery()` will cast the value to the expected type when decoding.
292
- *
293
- * Also, after decoding, `typia.http.validateQuery()` performs type validation to the
294
- * decoded value by combining with {@link validate} function. Therefore, when the
295
- * decoded value is not following the `T` type, {@link IValidation.IFailure} would
296
- * be returned. Otherwise, {@link IValidation.ISuccess} would be returned.
297
- *
298
- * By the way, as URL query is not enough to express complex data structures,
299
- * `typia.http.validateQuery()` function has some limitations. If target type `T` is
300
- * notfollowing those restrictions, compilation errors would be occured.
301
- *
302
- * 1. Type `T` must be an object type
303
- * 2. Do not allow dynamic property
304
- * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
305
- * 4. By the way, union type never be not allowed
306
- *
307
- * @template T Expected type of decoded value
308
- * @param input Query string or URLSearchParams instance
309
- * @returns Validation result with decoded query object
310
- *
311
- * @author Jeongho Nam - https://github.com/samchon
312
- */
313
- function validateQuery<T extends object>(
314
- input: string | URLSearchParams,
315
- ): IValidation<Resolved<T>>;
316
-
317
- /**
318
- * @internal
319
- */
320
- function validateQuery(): never {
321
- halt("validateQuery");
322
- }
323
- const validateQueryPure = /** @__PURE__ */ Object.assign(
324
- validateQuery,
325
- /** @__PURE__ */ Namespace.http.query(),
326
- /** @__PURE__ */ Namespace.validate()
327
- );
328
- export { validateQueryPure as validateQuery };
329
-
330
- /* -----------------------------------------------------------
331
- HEADERS
332
- ----------------------------------------------------------- */
333
- /**
334
- * > You must configure the generic argument `T`.
335
- *
336
- * Headers decoder (for express and fastify).
337
- *
338
- * `typia.http.headers()` is a function decoding an header instance, with automatic
339
- * type casting to the expected type. When property type be defined as `boolean` or
340
- * `number` type, `typia.http.headers()` will cast the value to the expected type.
341
- *
342
- * By the way, as HTTP headers are not enough to express complex data structures,
343
- * `typia.http.headers()` function has some limitations. If target type `T` is not
344
- * following those restrictions, compilation errors would be occured.
345
- *
346
- * 1. Type `T` must be an object type
347
- * 2. Do not allow dynamic property
348
- * 3. Property key must be lower case
349
- * 4. Property value cannot be `null`, but `undefined` is possible
350
- * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
351
- * 6. By the way, union type never be not allowed
352
- * 7. Property `set-cookie` must be array type
353
- * 8. Those properties cannot be array type
354
- * - age
355
- * - authorization
356
- * - content-length
357
- * - content-type
358
- * - etag
359
- * - expires
360
- * - from
361
- * - host
362
- * - if-modified-since
363
- * - if-unmodified-since
364
- * - last-modified
365
- * - location
366
- * - max-forwards
367
- * - proxy-authorization
368
- * - referer
369
- * - retry-after
370
- * - server
371
- * - user-agent
372
- *
373
- * Also, `typia.http.headers()` function does not perform validation about the decoded
374
- * value. Therefore, if you can't sure that input data is following the `T` type,
375
- * it would better to call one of below functions intead.
376
- *
377
- * - {@link assertHeaders}
378
- * - {@link isHeaders}
379
- * - {@link validateHeaders}
380
- *
381
- * @template T Expected type of decoded value
382
- * @param input Query string or URLSearchParams instance
383
- * @returns Decoded headers object
384
- *
385
- * @author Jeongho Nam - https://github.com/samchon
386
- */
387
- function headers(): never;
388
-
389
- /**
390
- * Headers decoder (for express and fastify).
391
- *
392
- * `typia.http.headers()` is a function decoding an header instance, with automatic
393
- * type casting to the expected type. When property type be defined as `boolean` or
394
- * `number` type, `typia.http.headers()` will cast the value to the expected type.
395
- *
396
- * By the way, as HTTP headers are not enough to express complex data structures,
397
- * `typia.http.headers()` function has some limitations. If target type `T` is not
398
- * following those restrictions, compilation errors would be occured.
399
- *
400
- * 1. Type `T` must be an object type
401
- * 2. Do not allow dynamic property
402
- * 3. Property key must be lower case
403
- * 4. Property value cannot be `null`, but `undefined` is possible
404
- * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
405
- * 6. By the way, union type never be not allowed
406
- * 7. Property `set-cookie` must be array type
407
- * 8. Those properties cannot be array type
408
- * - age
409
- * - authorization
410
- * - content-length
411
- * - content-type
412
- * - etag
413
- * - expires
414
- * - from
415
- * - host
416
- * - if-modified-since
417
- * - if-unmodified-since
418
- * - last-modified
419
- * - location
420
- * - max-forwards
421
- * - proxy-authorization
422
- * - referer
423
- * - retry-after
424
- * - server
425
- * - user-agent
426
- *
427
- * Also, `typia.http.headers()` function does not perform validation about the decoded
428
- * value. Therefore, if you can't sure that input data is following the `T` type,
429
- * it would better to call one of below functions intead.
430
- *
431
- * - {@link assertHeaders}
432
- * - {@link isHeaders}
433
- * - {@link validateHeaders}
434
- *
435
- * @template T Expected type of decoded value
436
- * @param input Query string or URLSearchParams instance
437
- * @returns Decoded headers object
438
- *
439
- * @author Jeongho Nam - https://github.com/samchon
440
- */
441
- function headers<T extends object>(
442
- input: Record<string, string | string[] | undefined>,
443
- ): Resolved<T>;
444
-
445
- /**
446
- * @internal
447
- */
448
- function headers(): never {
449
- halt("headers");
450
- }
451
-
452
- const headersPure = /** @__PURE__ */ Object.assign(
453
- headers,
454
- /** @__PURE__ */ Namespace.http.headers()
455
- );
456
- export { headersPure as headers };
457
-
458
- /**
459
- * > You must configure the generic argument `T`.
460
- *
461
- * Headers decoder with type assertion (for express and fastify).
462
- *
463
- * `typia.http.assertHeaders()` is a function decoding an header instance, with
464
- * automatic type casting to the expected type. When property type be defined as
465
- * `boolean` or `number` type, `typia.http.headers()` will cast the value to the
466
- * expected type.
467
- *
468
- * Also, after decoding, `typia.http.assertHeaders()` performs type assertion to the
469
- * decoded value by combining with {@link assert} function. Therefore, when the
470
- * decoded value is not following the `T` type, {@link TypeGuardError} would be
471
- * thrown.
472
- *
473
- * By the way, as HTTP headers are not enough to express complex data structures,
474
- * `typia.http.headers()` function has some limitations. If target type `T` is not
475
- * following those restrictions, compilation errors would be occured.
476
- *
477
- * 1. Type `T` must be an object type
478
- * 2. Do not allow dynamic property
479
- * 3. Property key must be lower case
480
- * 4. Property value cannot be `null`, but `undefined` is possible
481
- * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
482
- * 6. By the way, union type never be not allowed
483
- * 7. Property `set-cookie` must be array type
484
- * 8. Those properties cannot be array type
485
- * - age
486
- * - authorization
487
- * - content-length
488
- * - content-type
489
- * - etag
490
- * - expires
491
- * - from
492
- * - host
493
- * - if-modified-since
494
- * - if-unmodified-since
495
- * - last-modified
496
- * - location
497
- * - max-forwards
498
- * - proxy-authorization
499
- * - referer
500
- * - retry-after
501
- * - server
502
- * - user-agent
503
- *
504
- * @template T Expected type of decoded value
505
- * @param input Query string or URLSearchParams instance
506
- * @returns Decoded headers object
507
- *
508
- * @author Jeongho Nam - https://github.com/samchon
509
- */
510
- function assertHeaders(): never;
511
-
512
- /**
513
- * Headers decoder with type assertion (for express and fastify).
514
- *
515
- * `typia.http.assertHeaders()` is a function decoding an header instance, with
516
- * automatic type casting to the expected type. When property type be defined as
517
- * `boolean` or `number` type, `typia.http.headers()` will cast the value to the
518
- * expected type.
519
- *
520
- * Also, after decoding, `typia.http.assertHeaders()` performs type assertion to the
521
- * decoded value by combining with {@link assert} function. Therefore, when the
522
- * decoded value is not following the `T` type, {@link TypeGuardError} would be
523
- * thrown.
524
- *
525
- * By the way, as HTTP headers are not enough to express complex data structures,
526
- * `typia.http.headers()` function has some limitations. If target type `T` is not
527
- * following those restrictions, compilation errors would be occured.
528
- *
529
- * 1. Type `T` must be an object type
530
- * 2. Do not allow dynamic property
531
- * 3. Property key must be lower case
532
- * 4. Property value cannot be `null`, but `undefined` is possible
533
- * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
534
- * 6. By the way, union type never be not allowed
535
- * 7. Property `set-cookie` must be array type
536
- * 8. Those properties cannot be array type
537
- * - age
538
- * - authorization
539
- * - content-length
540
- * - content-type
541
- * - etag
542
- * - expires
543
- * - from
544
- * - host
545
- * - if-modified-since
546
- * - if-unmodified-since
547
- * - last-modified
548
- * - location
549
- * - max-forwards
550
- * - proxy-authorization
551
- * - referer
552
- * - retry-after
553
- * - server
554
- * - user-agent
555
- *
556
- * @template T Expected type of decoded value
557
- * @param input Query string or URLSearchParams instance
558
- * @returns Decoded headers object
559
- *
560
- * @author Jeongho Nam - https://github.com/samchon
561
- */
562
- function assertHeaders<T extends object>(
563
- input: Record<string, string | string[] | undefined>,
564
- ): Resolved<T>;
565
-
566
- /**
567
- * @internal
568
- */
569
- function assertHeaders(): never {
570
- halt("assertHeaders");
571
- }
572
-
573
- const assertHeadersPure = /** @__PURE__ */ Object.assign(
574
- assertHeaders,
575
- /** @__PURE__ */ Namespace.http.headers(),
576
- /** @__PURE__ */ Namespace.assert("http.assertHeaders")
577
- );
578
- export { assertHeadersPure as assertHeaders };
579
-
580
- /**
581
- * > You must configure the generic argument `T`.
582
- *
583
- * Headers decoder with type checking (for express and fastify).
584
- *
585
- * `typia.http.isHeaders()` is a function decoding an header instance, with
586
- * automatic type casting to the expected type. When property type be defined as
587
- * `boolean` or `number` type, `typia.http.headers()` will cast the value to the
588
- * expected type.
589
- *
590
- * Also, after decoding, `typia.http.isHeaders()` performs type checking to the
591
- * decoded value by combining with {@link is} function. Therefore, when the
592
- * decoded value is not following the `T` type, `null` value would be returned.
593
- *
594
- * By the way, as HTTP headers are not enough to express complex data structures,
595
- * `typia.http.headers()` function has some limitations. If target type `T` is not
596
- * following those restrictions, compilation errors would be occured.
597
- *
598
- * 1. Type `T` must be an object type
599
- * 2. Do not allow dynamic property
600
- * 3. Property key must be lower case
601
- * 4. Property value cannot be `null`, but `undefined` is possible
602
- * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
603
- * 6. By the way, union type never be not allowed
604
- * 7. Property `set-cookie` must be array type
605
- * 8. Those properties cannot be array type
606
- * - age
607
- * - authorization
608
- * - content-length
609
- * - content-type
610
- * - etag
611
- * - expires
612
- * - from
613
- * - host
614
- * - if-modified-since
615
- * - if-unmodified-since
616
- * - last-modified
617
- * - location
618
- * - max-forwards
619
- * - proxy-authorization
620
- * - referer
621
- * - retry-after
622
- * - server
623
- * - user-agent
624
- *
625
- * @template T Expected type of decoded value
626
- * @param input Query string or URLSearchParams instance
627
- * @returns Decoded headers object or `null` value
628
- *
629
- * @author Jeongho Nam - https://github.com/samchon
630
- */
631
- function isHeaders(): never;
632
-
633
- /**
634
- * > You must configure the generic argument `T`.
635
- *
636
- * Headers decoder with type checking (for express and fastify).
637
- *
638
- * `typia.http.isHeaders()` is a function decoding an header instance, with
639
- * automatic type casting to the expected type. When property type be defined as
640
- * `boolean` or `number` type, `typia.http.headers()` will cast the value to the
641
- * expected type.
642
- *
643
- * Also, after decoding, `typia.http.isHeaders()` performs type checking to the
644
- * decoded value by combining with {@link is} function. Therefore, when the
645
- * decoded value is not following the `T` type, `null` value would be returned.
646
- *
647
- * By the way, as HTTP headers are not enough to express complex data structures,
648
- * `typia.http.headers()` function has some limitations. If target type `T` is not
649
- * following those restrictions, compilation errors would be occured.
650
- *
651
- * 1. Type `T` must be an object type
652
- * 2. Do not allow dynamic property
653
- * 3. Property key must be lower case
654
- * 4. Property value cannot be `null`, but `undefined` is possible
655
- * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
656
- * 6. By the way, union type never be not allowed
657
- * 7. Property `set-cookie` must be array type
658
- * 8. Those properties cannot be array type
659
- * - age
660
- * - authorization
661
- * - content-length
662
- * - content-type
663
- * - etag
664
- * - expires
665
- * - from
666
- * - host
667
- * - if-modified-since
668
- * - if-unmodified-since
669
- * - last-modified
670
- * - location
671
- * - max-forwards
672
- * - proxy-authorization
673
- * - referer
674
- * - retry-after
675
- * - server
676
- * - user-agent
677
- *
678
- * @template T Expected type of decoded value
679
- * @param input Query string or URLSearchParams instance
680
- * @returns Decoded headers object or `null` value
681
- *
682
- * @author Jeongho Nam - https://github.com/samchon
683
- */
684
- function isHeaders<T extends object>(
685
- input: Record<string, string | string[] | undefined>,
686
- ): Resolved<T> | null;
687
-
688
- /**
689
- * @internal
690
- */
691
- function isHeaders(): never {
692
- halt("isHeaders");
693
- }
694
- const isHeadersPure = /** @__PURE__ */ Object.assign(
695
- isHeaders,
696
- /** @__PURE__ */ Namespace.http.headers(),
697
- /** @__PURE__ */ Namespace.is()
698
- );
699
- export { isHeadersPure as isHeaders };
700
-
701
- /**
702
- * > You must configure the generic argument `T`.
703
- *
704
- * Headers decoder with type validation (for express and fastify).
705
- *
706
- * `typia.http.validateHeaders()` is a function decoding an header instance, with
707
- * automatic type casting to the expected type. When property type be defined as
708
- * `boolean` or `number` type, `typia.http.headers()` will cast the value to the
709
- * expected type.
710
- *
711
- * Also, after decoding, `typia.http.validateHeaders()` performs type assertion to the
712
- * decoded value by combining with {@link validate} function. Therefore, when the
713
- * decoded value is not following the `T` type, {@link IValidation.IError} would be
714
- * returned. Otherwise, {@link IValidation.ISuccess} be returned.
715
- *
716
- * By the way, as HTTP headers are not enough to express complex data structures,
717
- * `typia.http.headers()` function has some limitations. If target type `T` is not
718
- * following those restrictions, compilation errors would be occured.
719
- *
720
- * 1. Type `T` must be an object type
721
- * 2. Do not allow dynamic property
722
- * 3. Property key must be lower case
723
- * 4. Property value cannot be `null`, but `undefined` is possible
724
- * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
725
- * 6. By the way, union type never be not allowed
726
- * 7. Property `set-cookie` must be array type
727
- * 8. Those properties cannot be array type
728
- * - age
729
- * - authorization
730
- * - content-length
731
- * - content-type
732
- * - etag
733
- * - expires
734
- * - from
735
- * - host
736
- * - if-modified-since
737
- * - if-unmodified-since
738
- * - last-modified
739
- * - location
740
- * - max-forwards
741
- * - proxy-authorization
742
- * - referer
743
- * - retry-after
744
- * - server
745
- * - user-agent
746
- *
747
- * @template T Expected type of decoded value
748
- * @param input Query string or URLSearchParams instance
749
- * @returns Decoded headers object
750
- *
751
- * @author Jeongho Nam - https://github.com/samchon
752
- */
753
- function validateHeaders(): never;
754
-
755
- /**
756
- * Headers decoder with type validation (for express and fastify).
757
- *
758
- * `typia.http.validateHeaders()` is a function decoding an header instance, with
759
- * automatic type casting to the expected type. When property type be defined as
760
- * `boolean` or `number` type, `typia.http.headers()` will cast the value to the
761
- * expected type.
762
- *
763
- * Also, after decoding, `typia.http.validateHeaders()` performs type assertion to the
764
- * decoded value by combining with {@link validate} function. Therefore, when the
765
- * decoded value is not following the `T` type, {@link IValidation.IError} would be
766
- * returned. Otherwise, {@link IValidation.ISuccess} be returned.
767
- *
768
- * By the way, as HTTP headers are not enough to express complex data structures,
769
- * `typia.http.headers()` function has some limitations. If target type `T` is not
770
- * following those restrictions, compilation errors would be occured.
771
- *
772
- * 1. Type `T` must be an object type
773
- * 2. Do not allow dynamic property
774
- * 3. Property key must be lower case
775
- * 4. Property value cannot be `null`, but `undefined` is possible
776
- * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
777
- * 6. By the way, union type never be not allowed
778
- * 7. Property `set-cookie` must be array type
779
- * 8. Those properties cannot be array type
780
- * - age
781
- * - authorization
782
- * - content-length
783
- * - content-type
784
- * - etag
785
- * - expires
786
- * - from
787
- * - host
788
- * - if-modified-since
789
- * - if-unmodified-since
790
- * - last-modified
791
- * - location
792
- * - max-forwards
793
- * - proxy-authorization
794
- * - referer
795
- * - retry-after
796
- * - server
797
- * - user-agent
798
- *
799
- * @template T Expected type of decoded value
800
- * @param input Query string or URLSearchParams instance
801
- * @returns Decoded headers object
802
- *
803
- * @author Jeongho Nam - https://github.com/samchon
804
- */
805
- function validateHeaders<T extends object>(
806
- input: Record<string, string | string[] | undefined>,
807
- ): IValidation<Resolved<T>>;
808
-
809
- /**
810
- * @internal
811
- */
812
- function validateHeaders(): never {
813
- halt("validateHeaders");
814
- }
815
-
816
- const validateHeadersPure = /** @__PURE__ */ Object.assign(
817
- validateHeaders,
818
- /** @__PURE__ */ Namespace.http.headers(),
819
- /** @__PURE__ */Namespace.validate()
820
- );
821
- export { validateHeadersPure as validateHeaders };
822
-
823
- /* -----------------------------------------------------------
824
- PARAMETER
825
- ----------------------------------------------------------- */
826
- /**
827
- * > You must configure the generic argument `T`.
828
- *
829
- * URL path parameter decoder.
830
- *
831
- * `typia.http.parameter()` is a function decoding a path parameter, with automatic
832
- * type casting to the expected type. When type `T` has beeen defined as `boolean` or
833
- * `number` type, `typia.http.parameter()` will cast the value to the expected type.
834
- *
835
- * Also, `typia.http.parameter()` performs type assertion to the decoded value by
836
- * combining with {@link assert} function. Therefore, when the decoded value is not
837
- * following the `T` type, {@link TypeGuardError} would be thrown.
838
- *
839
- * @template T Expected type of decoded value
840
- * @param input Path parameter string
841
- * @returns Decoded path parameter value
842
- */
843
- function parameter(): never;
844
-
845
- /**
846
- * URL path parameter decoder.
847
- *
848
- * `typia.http.parameter()` is a function decoding a path parameter, with automatic
849
- * type casting to the expected type. When type `T` has beeen defined as `boolean` or
850
- * `number` type, `typia.http.parameter()` will cast the value to the expected type.
851
- *
852
- * Also, `typia.http.parameter()` performs type assertion to the decoded value by
853
- * combining with {@link assert} function. Therefore, when the decoded value is not
854
- * following the `T` type, {@link TypeGuardError} would be thrown.
855
- *
856
- * @template T Expected type of decoded value
857
- * @param input Path parameter string
858
- * @returns Decoded path parameter value
859
- */
860
- function parameter<T extends Atomic.Type | null>(
861
- input: string,
862
- ): Resolved<T>;
863
-
864
- /**
865
- * @internal
866
- */
867
- function parameter(): never {
868
- halt("parameter");
869
- }
870
-
871
- const parameterPure = /** @__PURE__ */ Object.assign(
872
- parameter,
873
- /** @__PURE__ */ Namespace.http.parameter(),
874
- /** @__PURE__ */ Namespace.assert("http.parameter")
875
- );
876
- export { parameterPure as parameter };
877
-
878
- /* -----------------------------------------------------------
879
- FACTORY FUNCTIONS
880
- ----------------------------------------------------------- */
881
- /**
882
- * Creates a reusable {@link query} function.
883
- *
884
- * @danger You must configure the generic argument `T`
885
- * @template T The type of the query object
886
- * @throws compile error
887
- *
888
- * @author Jeongho Nam - https://github.com/samchon
889
- */
890
- function createQuery(): never;
891
-
892
- /**
893
- * Creates a reusable {@link query} function.
894
- *
895
- * @template T The type of the query object
896
- * @returns A reusable `query` function
897
- *
898
- * @author Jeongho Nam - https://github.com/samchon
899
- */
900
- function createQuery<T extends object>(): (
901
- input: string | URLSearchParams,
902
- ) => T;
903
-
904
- /**
905
- * @internal
906
- */
907
- function createQuery<T>(): (input: string | URLSearchParams) => T {
908
- halt("createQuery");
909
- }
910
-
911
- const createQueryPure = /** @__PURE__ */ Object.assign(
912
- createQuery,
913
- /** @__PURE__ */ Namespace.http.query()
914
- );
915
- export { createQueryPure as createQuery };
916
-
917
- /**
918
- * Creates a reusable {@link assertQuery} function.
919
- *
920
- * @danger You must configure the generic argument `T`
921
- * @template T The type of the query object
922
- * @throws compile error
923
- *
924
- * @author Jeongho Nam - https://github.com/samchon
925
- */
926
- function createAssertQuery(): never;
927
-
928
- /**
929
- * Creates a reusable {@link assertQuery} function.
930
- *
931
- * @template T The type of the query object
932
- * @returns A reusable `assertQuery` function
933
- *
934
- * @author Jeongho Nam - https://github.com/samchon
935
- */
936
- function createAssertQuery<T extends object>(): (
937
- input: string | URLSearchParams,
938
- ) => T;
939
-
940
- /**
941
- * @internal
942
- */
943
- function createAssertQuery<T>(): (input: string | URLSearchParams) => T {
944
- halt("createAssertQuery");
945
- }
946
-
947
- const createAssertQueryPure = /** @__PURE__ */ Object.assign(
948
- createAssertQuery,
949
- /** @__PURE__ */ Namespace.http.query(),
950
- /** @__PURE__ */ Namespace.assert("http.createAssertQuery")
951
- );
952
- export { createAssertQueryPure as createAssertQuery };
953
-
954
- /**
955
- * Creates a reusable {@link isQuery} function.
956
- *
957
- * @danger You must configure the generic argument `T`
958
- * @template T The type of the query object
959
- * @throws compile error
960
- *
961
- * @author Jeongho Nam - https://github.com/samchon
962
- */
963
- function createIsQuery(): never;
964
-
965
- /**
966
- * Creates a reusable {@link isQuery} function.
967
- *
968
- * @template T The type of the query object
969
- * @returns A reusable `isQuery` function
970
- *
971
- * @author Jeongho Nam - https://github.com/samchon
972
- */
973
- function createIsQuery<T extends object>(): (
974
- input: string | URLSearchParams,
975
- ) => T | null;
976
-
977
- /**
978
- * @internal
979
- */
980
- function createIsQuery<T>(): (
981
- input: string | URLSearchParams,
982
- ) => T | null {
983
- halt("createIsQuery");
984
- }
985
-
986
- const createIsQueryPure = /** @__PURE__ */ Object.assign(
987
- createIsQuery,
988
- /** @__PURE__ */ Namespace.http.query(),
989
- /** @__PURE__ */ Namespace.is()
990
- );
991
- export { createIsQueryPure as createIsQuery };
992
-
993
- /**
994
- * Creates a reusable {@link validateQuery} function.
995
- *
996
- * @danger You must configure the generic argument `T`
997
- * @template T The type of the query object
998
- * @throws compile error
999
- *
1000
- * @author Jeongho Nam - https://github.com/samchon
1001
- */
1002
- function createValidateQuery(): never;
1003
-
1004
- /**
1005
- * Creates a reusable {@link validateQuery} function.
1006
- *
1007
- * @template T The type of the query object
1008
- * @returns A reusable `validateQuery` function
1009
- *
1010
- * @author Jeongho Nam - https://github.com/samchon
1011
- */
1012
- function createValidateQuery<T extends object>(): (
1013
- input: string | URLSearchParams,
1014
- ) => IValidation<Resolved<T>>;
1015
-
1016
- /**
1017
- * @internal
1018
- */
1019
- function createValidateQuery<T>(): (
1020
- input: string | URLSearchParams,
1021
- ) => IValidation<Resolved<T>> {
1022
- halt("createValidateQuery");
1023
- }
1024
-
1025
- const createValidateQueryPure = /** @__PURE__ */ Object.assign(
1026
- createValidateQuery,
1027
- /** @__PURE__ */ Namespace.http.query(),
1028
- /** @__PURE__ */ Namespace.validate()
1029
- );
1030
- export { createValidateQueryPure as createValidateQuery };
1031
-
1032
- /**
1033
- * Creates a reusable {@link headers} function.
1034
- *
1035
- * @danger You must configure the generic argument `T`
1036
- * @template T The type of the headers object
1037
- * @throws compile error
1038
- *
1039
- * @author Jeongho Nam - https://github.com/samchon
1040
- */
1041
- function createHeaders(): never;
1042
-
1043
- /**
1044
- * Creates a reusable {@link headers} function.
1045
- *
1046
- * @template T The type of the headers object
1047
- * @returns A reusable `headers` function
1048
- *
1049
- * @author Jeongho Nam - https://github.com/samchon
1050
- */
1051
- function createHeaders<T extends object>(): (
1052
- input: Record<string, string | string[] | undefined>,
1053
- ) => T;
1054
-
1055
- /**
1056
- * @internal
1057
- */
1058
- function createHeaders<T>(): (
1059
- input: Record<string, string | string[] | undefined>,
1060
- ) => T {
1061
- halt("createHeaders");
1062
- }
1063
-
1064
- const createHeadersPure = /** @__PURE__ */Object.assign(
1065
- createHeaders,
1066
- /** @__PURE__ */ Namespace.http.headers()
1067
- );
1068
- export { createHeadersPure as createHeaders };
1069
-
1070
- /**
1071
- * Creates a reusable {@link assertHeaders} function.
1072
- *
1073
- * @danger You must configure the generic argument `T`
1074
- * @template T The type of the headers object
1075
- * @throws compile error
1076
- *
1077
- * @author Jeongho Nam - https://github.com/samchon
1078
- */
1079
- function createAssertHeaders(): never;
1080
-
1081
- /**
1082
- * Creates a reusable {@link assertHeaders} function.
1083
- *
1084
- * @template T The type of the headers object
1085
- * @returns A reusable `assertHeaders` function
1086
- *
1087
- * @author Jeongho Nam - https://github.com/samchon
1088
- */
1089
- function createAssertHeaders<T extends object>(): (
1090
- input: Record<string, string | string[] | undefined>,
1091
- ) => T;
1092
-
1093
- /**
1094
- * @internal
1095
- */
1096
- function createAssertHeaders<T>(): (
1097
- input: Record<string, string | string[] | undefined>,
1098
- ) => T {
1099
- halt("createAssertHeaders");
1100
- }
1101
-
1102
- const createAssertHeadersPure = /** @__PURE__ */ Object.assign(
1103
- createAssertHeaders,
1104
- /** @__PURE__ */ Namespace.http.headers(),
1105
- /** @__PURE__ */ Namespace.assert("http.createAssertHeaders")
1106
- );
1107
- export { createAssertHeadersPure as createAssertHeaders };
1108
-
1109
- /**
1110
- * Creates a reusable {@link isHeaders} function.
1111
- *
1112
- * @danger You must configure the generic argument `T`
1113
- * @template T The type of the headers object
1114
- * @throws compile error
1115
- *
1116
- * @author Jeongho Nam - https://github.com/samchon
1117
- */
1118
- function createIsHeaders(): never;
1119
-
1120
- /**
1121
- * Creates a reusable {@link isHeaders} function.
1122
- *
1123
- * @template T The type of the headers object
1124
- * @returns A reusable `isHeaders` function
1125
- *
1126
- * @author Jeongho Nam - https://github.com/samchon
1127
- */
1128
- function createIsHeaders<T extends object>(): (
1129
- input: Record<string, string | string[] | undefined>,
1130
- ) => T | null;
1131
-
1132
- /**
1133
- * @internal
1134
- */
1135
- function createIsHeaders<T>(): (
1136
- input: Record<string, string | string[] | undefined>,
1137
- ) => T | null {
1138
- halt("createIsHeaders");
1139
- }
1140
-
1141
- const createIsHeadersPure = /** @__PURE__ */ Object.assign(
1142
- createIsHeaders,
1143
- /** @__PURE__ */ Namespace.http.headers(),
1144
- /** @__PURE__ */ Namespace.is()
1145
- );
1146
- export { createIsHeadersPure as createIsHeaders };
1147
-
1148
- /**
1149
- * Creates a reusable {@link validateHeaders} function.
1150
- *
1151
- * @danger You must configure the generic argument `T`
1152
- * @template T The type of the headers object
1153
- * @throws compile error
1154
- *
1155
- * @author Jeongho Nam - https://github.com/samchon
1156
- */
1157
- function createValidateHeaders(): never;
1158
-
1159
- /**
1160
- * Creates a reusable {@link validateHeaders} function.
1161
- *
1162
- * @template T The type of the headers object
1163
- * @returns A reusable `validateHeaders` function
1164
- *
1165
- * @author Jeongho Nam - https://github.com/samchon
1166
- */
1167
- function createValidateHeaders<T extends object>(): (
1168
- input: Record<string, string | string[] | undefined>,
1169
- ) => IValidation<Resolved<T>>;
1170
-
1171
- /**
1172
- * @internal
1173
- */
1174
- function createValidateHeaders<T>(): (
1175
- input: Record<string, string | string[] | undefined>,
1176
- ) => IValidation<Resolved<T>> {
1177
- halt("createValidateHeaders");
1178
- }
1179
-
1180
- const createValidateHeadersPure = /** @__PURE__ */ Object.assign(
1181
- createValidateHeaders,
1182
- /** @__PURE__ */ Namespace.http.headers(),
1183
- /** @__PURE__ */ Namespace.validate()
1184
- );
1185
- export { createValidateHeadersPure as createValidateHeaders };
1186
-
1187
- /**
1188
- * Creates a reusable {@link parameter} function.
1189
- *
1190
- * @danger You must configure the generic argument `T`
1191
- * @template T The type of the parameter value
1192
- * @throws compile error
1193
- *
1194
- * @author Jeongho Nam - https://github.com/samchon
1195
- */
1196
- function createParameter(): never;
1197
-
1198
- /**
1199
- * Creates a reusable {@link parameter} function.
1200
- *
1201
- * @template T The type of the parameter value
1202
- * @returns A reusable `parameter` function
1203
- *
1204
- * @author Jeongho Nam - https://github.com/samchon
1205
- */
1206
- function createParameter<T extends Atomic.Type | null>(): (
1207
- input: string,
1208
- ) => T;
1209
-
1210
- /**
1211
- * @internal
1212
- */
1213
- function createParameter<T extends Atomic.Type | null>(): (
1214
- input: string,
1215
- ) => T {
1216
- halt("createParameter");
1217
- }
1218
-
1219
- const createParameterPure = /** @__PURE__ */ Object.assign(
1220
- createParameter,
1221
- /** @__PURE__ */ Namespace.http.parameter(),
1222
- /** @__PURE__ */ Namespace.assert("http.createParameter")
1223
- );
1224
- export { createParameterPure as createParameter };
1225
-
1226
- /**
1227
- * @internal
1228
- */
1229
- function halt(name: string): never {
1230
- throw new Error(
1231
- `Error on typia.http.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`,
1232
- );
1233
- }
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
+ }