typia 6.10.2 → 6.10.3-dev.20240925

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 (447) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +118 -118
  3. package/lib/index.mjs +1 -0
  4. package/lib/index.mjs.map +1 -1
  5. package/lib/programmers/llm/LlmApplicationProgrammer.js +3 -0
  6. package/lib/programmers/llm/LlmApplicationProgrammer.js.map +1 -1
  7. package/lib/tags/Example.d.ts +14 -0
  8. package/lib/tags/Example.js +3 -0
  9. package/lib/tags/Example.js.map +1 -0
  10. package/lib/tags/Examples.d.ts +10 -0
  11. package/lib/tags/Examples.js +3 -0
  12. package/lib/tags/Examples.js.map +1 -0
  13. package/lib/tags/index.d.ts +2 -0
  14. package/lib/tags/index.js +2 -0
  15. package/lib/tags/index.js.map +1 -1
  16. package/package.json +2 -2
  17. package/src/AssertionGuard.ts +1 -1
  18. package/src/CamelCase.ts +75 -75
  19. package/src/IRandomGenerator.ts +66 -66
  20. package/src/IValidation.ts +21 -21
  21. package/src/PascalCase.ts +71 -71
  22. package/src/Primitive.ts +92 -92
  23. package/src/Resolved.ts +74 -74
  24. package/src/SnakeCase.ts +126 -126
  25. package/src/TypeGuardError.ts +37 -37
  26. package/src/executable/TypiaGenerateWizard.ts +83 -83
  27. package/src/executable/TypiaPatchWizard.ts +42 -42
  28. package/src/executable/TypiaSetupWizard.ts +174 -174
  29. package/src/executable/setup/ArgumentParser.ts +43 -43
  30. package/src/executable/setup/CommandExecutor.ts +8 -8
  31. package/src/executable/setup/FileRetriever.ts +22 -22
  32. package/src/executable/setup/PackageManager.ts +86 -86
  33. package/src/executable/setup/PluginConfigurator.ts +69 -69
  34. package/src/executable/typia.ts +55 -55
  35. package/src/factories/CommentFactory.ts +79 -79
  36. package/src/factories/ExpressionFactory.ts +150 -150
  37. package/src/factories/IdentifierFactory.ts +70 -70
  38. package/src/factories/JsonMetadataFactory.ts +53 -53
  39. package/src/factories/LiteralFactory.ts +47 -47
  40. package/src/factories/MetadataCollection.ts +274 -274
  41. package/src/factories/MetadataCommentTagFactory.ts +534 -534
  42. package/src/factories/MetadataFactory.ts +314 -314
  43. package/src/factories/MetadataTypeTagFactory.ts +336 -336
  44. package/src/factories/MetadataTypeTagSchemaFactory.ts +59 -59
  45. package/src/factories/NumericRangeFactory.ts +72 -72
  46. package/src/factories/ProtobufFactory.ts +267 -267
  47. package/src/factories/StatementFactory.ts +74 -74
  48. package/src/factories/TemplateFactory.ts +56 -56
  49. package/src/factories/TypeFactory.ts +118 -118
  50. package/src/factories/ValueFactory.ts +12 -12
  51. package/src/factories/internal/metadata/MetadataHelper.ts +21 -21
  52. package/src/factories/internal/metadata/emend_metadata_atomics.ts +45 -45
  53. package/src/factories/internal/metadata/emplace_metadata_alias.ts +41 -41
  54. package/src/factories/internal/metadata/emplace_metadata_array_type.ts +42 -42
  55. package/src/factories/internal/metadata/emplace_metadata_object.ts +186 -186
  56. package/src/factories/internal/metadata/emplace_metadata_tuple.ts +57 -57
  57. package/src/factories/internal/metadata/explore_metadata.ts +28 -28
  58. package/src/factories/internal/metadata/iterate_metadata.ts +100 -100
  59. package/src/factories/internal/metadata/iterate_metadata_alias.ts +34 -34
  60. package/src/factories/internal/metadata/iterate_metadata_array.ts +63 -63
  61. package/src/factories/internal/metadata/iterate_metadata_atomic.ts +62 -62
  62. package/src/factories/internal/metadata/iterate_metadata_coalesce.ts +28 -28
  63. package/src/factories/internal/metadata/iterate_metadata_collection.ts +131 -131
  64. package/src/factories/internal/metadata/iterate_metadata_comment_tags.ts +28 -28
  65. package/src/factories/internal/metadata/iterate_metadata_constant.ts +76 -76
  66. package/src/factories/internal/metadata/iterate_metadata_escape.ts +52 -52
  67. package/src/factories/internal/metadata/iterate_metadata_function.ts +89 -89
  68. package/src/factories/internal/metadata/iterate_metadata_intersection.ts +213 -213
  69. package/src/factories/internal/metadata/iterate_metadata_map.ts +50 -50
  70. package/src/factories/internal/metadata/iterate_metadata_native.ts +220 -220
  71. package/src/factories/internal/metadata/iterate_metadata_object.ts +33 -33
  72. package/src/factories/internal/metadata/iterate_metadata_set.ts +41 -41
  73. package/src/factories/internal/metadata/iterate_metadata_sort.ts +74 -74
  74. package/src/factories/internal/metadata/iterate_metadata_template.ts +44 -44
  75. package/src/factories/internal/metadata/iterate_metadata_tuple.ts +37 -37
  76. package/src/factories/internal/metadata/iterate_metadata_union.ts +27 -27
  77. package/src/functional/$FormDataReader/$FormDataReader.ts +83 -83
  78. package/src/functional/$FormDataReader/index.ts +1 -1
  79. package/src/functional/$HeadersReader/$HeadersReader.ts +26 -26
  80. package/src/functional/$HeadersReader/index.ts +1 -1
  81. package/src/functional/$ParameterReader/$ParameterReader.ts +29 -29
  82. package/src/functional/$ParameterReader/index.ts +1 -1
  83. package/src/functional/$ProtobufReader.ts +194 -194
  84. package/src/functional/$ProtobufSizer.ts +144 -144
  85. package/src/functional/$ProtobufWriter.ts +145 -145
  86. package/src/functional/$QueryReader/$QueryReader.ts +46 -46
  87. package/src/functional/$QueryReader/index.ts +1 -1
  88. package/src/functional/$any.ts +3 -3
  89. package/src/functional/$clone.ts +48 -48
  90. package/src/functional/$convention.ts +37 -37
  91. package/src/functional/$dictionary.ts +22 -22
  92. package/src/functional/$every.ts +11 -11
  93. package/src/functional/$guard.ts +21 -21
  94. package/src/functional/$is_between.ts +2 -2
  95. package/src/functional/$join.ts +46 -46
  96. package/src/functional/$number.ts +12 -12
  97. package/src/functional/$report.ts +13 -13
  98. package/src/functional/$rest.ts +3 -3
  99. package/src/functional/$stoll.ts +8 -8
  100. package/src/functional/$string.ts +43 -43
  101. package/src/functional/$strlen.ts +7 -7
  102. package/src/functional/$tail.ts +5 -5
  103. package/src/functional/$throws.ts +10 -10
  104. package/src/functional/$varint.ts +130 -130
  105. package/src/functional/$zigzag.ts +39 -39
  106. package/src/functional/IProtobufWriter.ts +18 -18
  107. package/src/functional/Namespace/functional.ts +5 -5
  108. package/src/functional/Namespace/http.ts +9 -9
  109. package/src/functional/Namespace/index.ts +77 -77
  110. package/src/functional/Namespace/json.ts +15 -15
  111. package/src/functional/Namespace/llm.ts +20 -20
  112. package/src/functional/Namespace/misc.ts +14 -14
  113. package/src/functional/Namespace/notations.ts +23 -23
  114. package/src/functional/Namespace/protobuf.ts +20 -20
  115. package/src/functional/is.ts +10 -10
  116. package/src/functional.ts +872 -872
  117. package/src/http.ts +1266 -1266
  118. package/src/index.ts +4 -4
  119. package/src/json.ts +738 -738
  120. package/src/llm.ts +186 -186
  121. package/src/misc.ts +757 -757
  122. package/src/module.ts +1023 -1023
  123. package/src/notations.ts +1020 -1020
  124. package/src/programmers/AssertProgrammer.ts +397 -397
  125. package/src/programmers/CheckerProgrammer.ts +1138 -1138
  126. package/src/programmers/FeatureProgrammer.ts +549 -549
  127. package/src/programmers/IsProgrammer.ts +220 -220
  128. package/src/programmers/RandomProgrammer.ts +955 -955
  129. package/src/programmers/TypiaProgrammer.ts +157 -157
  130. package/src/programmers/ValidateProgrammer.ts +382 -382
  131. package/src/programmers/functional/FunctionalAssertFunctionProgrammer.ts +141 -141
  132. package/src/programmers/functional/FunctionalAssertParametersProgrammer.ts +108 -108
  133. package/src/programmers/functional/FunctionalAssertReturnProgrammer.ts +98 -98
  134. package/src/programmers/functional/FunctionalIsFunctionProgrammer.ts +72 -72
  135. package/src/programmers/functional/FunctionalIsParametersProgrammer.ts +101 -101
  136. package/src/programmers/functional/FunctionalIsReturnProgrammer.ts +106 -106
  137. package/src/programmers/functional/FunctionalValidateFunctionProgrammer.ts +123 -123
  138. package/src/programmers/functional/FunctionalValidateParametersProgrammer.ts +267 -267
  139. package/src/programmers/functional/FunctionalValidateReturnProgrammer.ts +126 -126
  140. package/src/programmers/functional/internal/FunctionalGeneralProgrammer.ts +34 -34
  141. package/src/programmers/helpers/AtomicPredicator.ts +24 -24
  142. package/src/programmers/helpers/CloneJoiner.ts +130 -130
  143. package/src/programmers/helpers/FunctionImporeter.ts +1 -1
  144. package/src/programmers/helpers/FunctionImporter.ts +97 -97
  145. package/src/programmers/helpers/HttpMetadataUtil.ts +21 -21
  146. package/src/programmers/helpers/ICheckEntry.ts +13 -13
  147. package/src/programmers/helpers/IExpressionEntry.ts +12 -12
  148. package/src/programmers/helpers/NotationJoiner.ts +132 -132
  149. package/src/programmers/helpers/OptionPredicator.ts +15 -15
  150. package/src/programmers/helpers/ProtobufUtil.ts +125 -125
  151. package/src/programmers/helpers/ProtobufWire.ts +34 -34
  152. package/src/programmers/helpers/PruneJoiner.ts +139 -139
  153. package/src/programmers/helpers/RandomJoiner.ts +145 -145
  154. package/src/programmers/helpers/RandomRanger.ts +171 -171
  155. package/src/programmers/helpers/StringifyJoinder.ts +105 -105
  156. package/src/programmers/helpers/StringifyPredicator.ts +12 -12
  157. package/src/programmers/helpers/UnionExplorer.ts +269 -269
  158. package/src/programmers/helpers/UnionPredicator.ts +77 -77
  159. package/src/programmers/helpers/disable_function_importer_declare.ts +33 -33
  160. package/src/programmers/http/HttpAssertFormDataProgrammer.ts +91 -91
  161. package/src/programmers/http/HttpAssertHeadersProgrammer.ts +91 -91
  162. package/src/programmers/http/HttpAssertQueryProgrammer.ts +93 -93
  163. package/src/programmers/http/HttpFormDataProgrammer.ts +278 -278
  164. package/src/programmers/http/HttpHeadersProgrammer.ts +347 -347
  165. package/src/programmers/http/HttpIsFormDataProgrammer.ts +102 -102
  166. package/src/programmers/http/HttpIsHeadersProgrammer.ts +102 -102
  167. package/src/programmers/http/HttpIsQueryProgrammer.ts +104 -104
  168. package/src/programmers/http/HttpParameterProgrammer.ts +97 -97
  169. package/src/programmers/http/HttpQueryProgrammer.ts +298 -298
  170. package/src/programmers/http/HttpValidateFormDataProgrammer.ts +85 -85
  171. package/src/programmers/http/HttpValidateHeadersProgrammer.ts +85 -85
  172. package/src/programmers/http/HttpValidateQueryProgrammer.ts +87 -87
  173. package/src/programmers/internal/application_array.ts +61 -61
  174. package/src/programmers/internal/application_bigint.ts +25 -25
  175. package/src/programmers/internal/application_boolean.ts +25 -25
  176. package/src/programmers/internal/application_description.ts +12 -12
  177. package/src/programmers/internal/application_escaped.ts +74 -74
  178. package/src/programmers/internal/application_number.ts +25 -25
  179. package/src/programmers/internal/application_plugin.ts +19 -19
  180. package/src/programmers/internal/application_string.ts +25 -25
  181. package/src/programmers/internal/application_templates.ts +62 -62
  182. package/src/programmers/internal/application_title.ts +20 -20
  183. package/src/programmers/internal/application_union_discriminator.ts +35 -35
  184. package/src/programmers/internal/application_v30_alias.ts +52 -52
  185. package/src/programmers/internal/application_v30_constant.ts +18 -18
  186. package/src/programmers/internal/application_v30_native.ts +28 -28
  187. package/src/programmers/internal/application_v30_object.ts +149 -149
  188. package/src/programmers/internal/application_v30_schema.ts +161 -161
  189. package/src/programmers/internal/application_v30_tuple.ts +33 -33
  190. package/src/programmers/internal/application_v31_alias.ts +41 -41
  191. package/src/programmers/internal/application_v31_constant.ts +29 -29
  192. package/src/programmers/internal/application_v31_native.ts +24 -24
  193. package/src/programmers/internal/application_v31_object.ts +130 -130
  194. package/src/programmers/internal/application_v31_schema.ts +159 -159
  195. package/src/programmers/internal/application_v31_tuple.ts +21 -21
  196. package/src/programmers/internal/check_array_length.ts +45 -45
  197. package/src/programmers/internal/check_bigint.ts +49 -49
  198. package/src/programmers/internal/check_dynamic_key.ts +174 -174
  199. package/src/programmers/internal/check_dynamic_properties.ts +211 -211
  200. package/src/programmers/internal/check_everything.ts +23 -23
  201. package/src/programmers/internal/check_native.ts +21 -21
  202. package/src/programmers/internal/check_number.ts +107 -107
  203. package/src/programmers/internal/check_object.ts +61 -61
  204. package/src/programmers/internal/check_string.ts +48 -48
  205. package/src/programmers/internal/check_template.ts +46 -46
  206. package/src/programmers/internal/check_union_array_like.ts +307 -307
  207. package/src/programmers/internal/decode_union_object.ts +99 -99
  208. package/src/programmers/internal/feature_object_entries.ts +58 -58
  209. package/src/programmers/internal/llm_schema_array.ts +22 -22
  210. package/src/programmers/internal/llm_schema_escaped.ts +61 -61
  211. package/src/programmers/internal/llm_schema_native.ts +17 -17
  212. package/src/programmers/internal/llm_schema_object.ts +129 -129
  213. package/src/programmers/internal/llm_schema_station.ts +185 -185
  214. package/src/programmers/internal/llm_schema_tuple.ts +31 -31
  215. package/src/programmers/internal/metadata_to_pattern.ts +34 -34
  216. package/src/programmers/internal/postfix_of_tuple.ts +2 -2
  217. package/src/programmers/internal/prune_object_properties.ts +60 -60
  218. package/src/programmers/internal/random_custom.ts +37 -37
  219. package/src/programmers/internal/stringify_dynamic_properties.ts +157 -157
  220. package/src/programmers/internal/stringify_native.ts +7 -7
  221. package/src/programmers/internal/stringify_regular_properties.ts +81 -81
  222. package/src/programmers/internal/template_to_pattern.ts +15 -15
  223. package/src/programmers/internal/wrap_metadata_rest_tuple.ts +20 -20
  224. package/src/programmers/json/JsonApplicationProgrammer.ts +82 -82
  225. package/src/programmers/json/JsonAssertParseProgrammer.ts +96 -96
  226. package/src/programmers/json/JsonAssertStringifyProgrammer.ts +104 -104
  227. package/src/programmers/json/JsonIsParseProgrammer.ts +110 -110
  228. package/src/programmers/json/JsonIsStringifyProgrammer.ts +102 -102
  229. package/src/programmers/json/JsonStringifyProgrammer.ts +909 -909
  230. package/src/programmers/json/JsonValidateParseProgrammer.ts +87 -87
  231. package/src/programmers/json/JsonValidateStringifyProgrammer.ts +111 -111
  232. package/src/programmers/llm/LlmApplicationProgrammer.ts +219 -216
  233. package/src/programmers/llm/LlmSchemaProgrammer.ts +49 -49
  234. package/src/programmers/misc/MiscAssertCloneProgrammer.ts +87 -87
  235. package/src/programmers/misc/MiscAssertPruneProgrammer.ts +105 -105
  236. package/src/programmers/misc/MiscCloneProgrammer.ts +781 -781
  237. package/src/programmers/misc/MiscIsCloneProgrammer.ts +93 -93
  238. package/src/programmers/misc/MiscIsPruneProgrammer.ts +91 -91
  239. package/src/programmers/misc/MiscLiteralsProgrammer.ts +70 -70
  240. package/src/programmers/misc/MiscPruneProgrammer.ts +560 -560
  241. package/src/programmers/misc/MiscValidateCloneProgrammer.ts +104 -104
  242. package/src/programmers/misc/MiscValidatePruneProgrammer.ts +101 -101
  243. package/src/programmers/notations/NotationAssertGeneralProgrammer.ts +91 -91
  244. package/src/programmers/notations/NotationGeneralProgrammer.ts +714 -714
  245. package/src/programmers/notations/NotationIsGeneralProgrammer.ts +97 -97
  246. package/src/programmers/notations/NotationValidateGeneralProgrammer.ts +110 -110
  247. package/src/programmers/protobuf/ProtobufAssertDecodeProgrammer.ts +91 -91
  248. package/src/programmers/protobuf/ProtobufAssertEncodeProgrammer.ts +95 -95
  249. package/src/programmers/protobuf/ProtobufDecodeProgrammer.ts +646 -646
  250. package/src/programmers/protobuf/ProtobufEncodeProgrammer.ts +852 -852
  251. package/src/programmers/protobuf/ProtobufIsDecodeProgrammer.ts +104 -104
  252. package/src/programmers/protobuf/ProtobufIsEncodeProgrammer.ts +93 -93
  253. package/src/programmers/protobuf/ProtobufMessageProgrammer.ts +160 -160
  254. package/src/programmers/protobuf/ProtobufValidateDecodeProgrammer.ts +85 -85
  255. package/src/programmers/protobuf/ProtobufValidateEncodeProgrammer.ts +109 -109
  256. package/src/protobuf.ts +999 -999
  257. package/src/reflect.ts +63 -63
  258. package/src/schemas/json/IJsonApplication.ts +22 -22
  259. package/src/schemas/metadata/IJsDocTagInfo.ts +10 -10
  260. package/src/schemas/metadata/IMetadata.ts +36 -36
  261. package/src/schemas/metadata/IMetadataAlias.ts +12 -12
  262. package/src/schemas/metadata/IMetadataApplication.ts +7 -7
  263. package/src/schemas/metadata/IMetadataArray.ts +7 -7
  264. package/src/schemas/metadata/IMetadataArrayType.ts +10 -10
  265. package/src/schemas/metadata/IMetadataAtomic.ts +6 -6
  266. package/src/schemas/metadata/IMetadataComponents.ts +11 -11
  267. package/src/schemas/metadata/IMetadataConstant.ts +18 -18
  268. package/src/schemas/metadata/IMetadataConstantValue.ts +11 -11
  269. package/src/schemas/metadata/IMetadataDictionary.ts +11 -11
  270. package/src/schemas/metadata/IMetadataEntry.ts +6 -6
  271. package/src/schemas/metadata/IMetadataEscaped.ts +6 -6
  272. package/src/schemas/metadata/IMetadataFunction.ts +8 -8
  273. package/src/schemas/metadata/IMetadataObject.ts +13 -13
  274. package/src/schemas/metadata/IMetadataParameter.ts +9 -9
  275. package/src/schemas/metadata/IMetadataProperty.ts +9 -9
  276. package/src/schemas/metadata/IMetadataTemplate.ts +7 -7
  277. package/src/schemas/metadata/IMetadataTuple.ts +7 -7
  278. package/src/schemas/metadata/IMetadataTupleType.ts +10 -10
  279. package/src/schemas/metadata/IMetadataTypeTag.ts +16 -16
  280. package/src/schemas/metadata/Metadata.ts +616 -616
  281. package/src/schemas/metadata/MetadataAlias.ts +61 -61
  282. package/src/schemas/metadata/MetadataApplication.ts +44 -44
  283. package/src/schemas/metadata/MetadataArray.ts +49 -49
  284. package/src/schemas/metadata/MetadataArrayType.ts +57 -57
  285. package/src/schemas/metadata/MetadataAtomic.ts +87 -87
  286. package/src/schemas/metadata/MetadataComponents.ts +98 -98
  287. package/src/schemas/metadata/MetadataConstant.ts +34 -34
  288. package/src/schemas/metadata/MetadataConstantValue.ts +62 -62
  289. package/src/schemas/metadata/MetadataEscaped.ts +51 -51
  290. package/src/schemas/metadata/MetadataFunction.ts +49 -49
  291. package/src/schemas/metadata/MetadataObject.ts +139 -139
  292. package/src/schemas/metadata/MetadataParameter.ts +50 -50
  293. package/src/schemas/metadata/MetadataProperty.ts +56 -56
  294. package/src/schemas/metadata/MetadataTemplate.ts +80 -80
  295. package/src/schemas/metadata/MetadataTuple.ts +32 -32
  296. package/src/schemas/metadata/MetadataTupleType.ts +67 -67
  297. package/src/tags/Constant.ts +15 -15
  298. package/src/tags/ContentMediaType.ts +10 -10
  299. package/src/tags/Default.ts +22 -22
  300. package/src/tags/Example.ts +17 -0
  301. package/src/tags/Examples.ts +16 -0
  302. package/src/tags/ExclusiveMaximum.ts +25 -25
  303. package/src/tags/ExclusiveMinimum.ts +25 -25
  304. package/src/tags/Format.ts +16 -16
  305. package/src/tags/JsonSchemaPlugin.ts +8 -8
  306. package/src/tags/MaxItems.ts +12 -12
  307. package/src/tags/MaxLength.ts +12 -12
  308. package/src/tags/Maximum.ts +19 -19
  309. package/src/tags/MinItems.ts +12 -12
  310. package/src/tags/MinLength.ts +12 -12
  311. package/src/tags/Minimum.ts +19 -19
  312. package/src/tags/MultipleOf.ts +21 -21
  313. package/src/tags/Pattern.ts +31 -31
  314. package/src/tags/TagBase.ts +76 -76
  315. package/src/tags/Type.ts +32 -32
  316. package/src/tags/UniqueItems.ts +14 -14
  317. package/src/tags/index.ts +20 -18
  318. package/src/tags/internal/FormatCheatSheet.ts +73 -73
  319. package/src/transform.ts +35 -35
  320. package/src/transformers/CallExpressionTransformer.ts +508 -508
  321. package/src/transformers/FileTransformer.ts +91 -91
  322. package/src/transformers/IProject.ts +15 -15
  323. package/src/transformers/ITransformOptions.ts +62 -62
  324. package/src/transformers/ImportTransformer.ts +66 -66
  325. package/src/transformers/NodeTransformer.ts +13 -13
  326. package/src/transformers/TransformerError.ts +60 -60
  327. package/src/transformers/features/AssertTransformer.ts +16 -16
  328. package/src/transformers/features/CreateAssertTransformer.ts +16 -16
  329. package/src/transformers/features/CreateIsTransformer.ts +10 -10
  330. package/src/transformers/features/CreateRandomTransformer.ts +40 -40
  331. package/src/transformers/features/CreateValidateTransformer.ts +13 -13
  332. package/src/transformers/features/IsTransformer.ts +10 -10
  333. package/src/transformers/features/RandomTransformer.ts +44 -44
  334. package/src/transformers/features/ValidateTransformer.ts +11 -11
  335. package/src/transformers/features/functional/FunctionalGenericTransformer.ts +57 -57
  336. package/src/transformers/features/http/CreateHttpAssertFormDataTransformer.ts +12 -12
  337. package/src/transformers/features/http/CreateHttpAssertHeadersTransformer.ts +11 -11
  338. package/src/transformers/features/http/CreateHttpAssertQueryTransformer.ts +9 -9
  339. package/src/transformers/features/http/CreateHttpFormDataTransformer.ts +9 -9
  340. package/src/transformers/features/http/CreateHttpHeadersTransformer.ts +9 -9
  341. package/src/transformers/features/http/CreateHttpIsFormDataTransformer.ts +9 -9
  342. package/src/transformers/features/http/CreateHttpIsHeadersTransformer.ts +9 -9
  343. package/src/transformers/features/http/CreateHttpIsQueryTransformer.ts +9 -9
  344. package/src/transformers/features/http/CreateHttpParameterTransformer.ts +9 -9
  345. package/src/transformers/features/http/CreateHttpQueryTransformer.ts +9 -9
  346. package/src/transformers/features/http/CreateHttpValidateFormDataTransformer.ts +12 -12
  347. package/src/transformers/features/http/CreateHttpValidateHeadersTransformer.ts +12 -12
  348. package/src/transformers/features/http/CreateHttpValidateQueryTransformer.ts +11 -11
  349. package/src/transformers/features/http/HttpAssertFormDataTransformer.ts +10 -10
  350. package/src/transformers/features/http/HttpAssertHeadersTransformer.ts +9 -9
  351. package/src/transformers/features/http/HttpAssertQueryTransformer.ts +9 -9
  352. package/src/transformers/features/http/HttpFormDataTransformer.ts +9 -9
  353. package/src/transformers/features/http/HttpHeadersTransformer.ts +9 -9
  354. package/src/transformers/features/http/HttpIsFormDataTransformer.ts +9 -9
  355. package/src/transformers/features/http/HttpIsHeadersTransformer.ts +9 -9
  356. package/src/transformers/features/http/HttpIsQueryTransformer.ts +9 -9
  357. package/src/transformers/features/http/HttpParameterTransformer.ts +9 -9
  358. package/src/transformers/features/http/HttpQueryTransformer.ts +9 -9
  359. package/src/transformers/features/http/HttpValidateFormDataTransformer.ts +10 -10
  360. package/src/transformers/features/http/HttpValidateHeadersTransformer.ts +10 -10
  361. package/src/transformers/features/http/HttpValidateQueryTransformer.ts +9 -9
  362. package/src/transformers/features/json/JsonApplicationTransformer.ts +124 -124
  363. package/src/transformers/features/json/JsonAssertParseTransformer.ts +9 -9
  364. package/src/transformers/features/json/JsonAssertStringifyTransformer.ts +10 -10
  365. package/src/transformers/features/json/JsonCreateAssertParseTransformer.ts +9 -9
  366. package/src/transformers/features/json/JsonCreateAssertStringifyTransformer.ts +12 -12
  367. package/src/transformers/features/json/JsonCreateIsParseTransformer.ts +9 -9
  368. package/src/transformers/features/json/JsonCreateIsStringifyTransformer.ts +9 -9
  369. package/src/transformers/features/json/JsonCreateStringifyTransformer.ts +9 -9
  370. package/src/transformers/features/json/JsonCreateValidateParseTransformer.ts +11 -11
  371. package/src/transformers/features/json/JsonCreateValidateStringifyProgrammer.ts +12 -12
  372. package/src/transformers/features/json/JsonIsParseTransformer.ts +9 -9
  373. package/src/transformers/features/json/JsonIsStringifyTransformer.ts +9 -9
  374. package/src/transformers/features/json/JsonStringifyTransformer.ts +9 -9
  375. package/src/transformers/features/json/JsonValidateParseTransformer.ts +9 -9
  376. package/src/transformers/features/json/JsonValidateStringifyTransformer.ts +10 -10
  377. package/src/transformers/features/llm/LlmApplicationTransformer.ts +83 -83
  378. package/src/transformers/features/llm/LlmSchemaTransformer.ts +53 -53
  379. package/src/transformers/features/misc/MiscAssertCloneTransformer.ts +9 -9
  380. package/src/transformers/features/misc/MiscAssertPruneTransformer.ts +9 -9
  381. package/src/transformers/features/misc/MiscCloneTransformer.ts +9 -9
  382. package/src/transformers/features/misc/MiscCreateAssertCloneTransformer.ts +9 -9
  383. package/src/transformers/features/misc/MiscCreateAssertPruneTransformer.ts +9 -9
  384. package/src/transformers/features/misc/MiscCreateCloneTransformer.ts +9 -9
  385. package/src/transformers/features/misc/MiscCreateIsCloneTransformer.ts +9 -9
  386. package/src/transformers/features/misc/MiscCreateIsPruneTransformer.ts +9 -9
  387. package/src/transformers/features/misc/MiscCreatePruneTransformer.ts +9 -9
  388. package/src/transformers/features/misc/MiscCreateValidateCloneTransformer.ts +11 -11
  389. package/src/transformers/features/misc/MiscCreateValidatePruneTransformer.ts +11 -11
  390. package/src/transformers/features/misc/MiscIsCloneTransformer.ts +9 -9
  391. package/src/transformers/features/misc/MiscIsPruneTransformer.ts +9 -9
  392. package/src/transformers/features/misc/MiscLiteralsTransformer.ts +32 -32
  393. package/src/transformers/features/misc/MiscPruneTransformer.ts +9 -9
  394. package/src/transformers/features/misc/MiscValidateCloneTransformer.ts +9 -9
  395. package/src/transformers/features/misc/MiscValidatePruneTransformer.ts +9 -9
  396. package/src/transformers/features/notations/NotationAssertGeneralTransformer.ts +15 -15
  397. package/src/transformers/features/notations/NotationCreateAssertGeneralTransformer.ts +15 -15
  398. package/src/transformers/features/notations/NotationCreateGeneralTransformer.ts +15 -15
  399. package/src/transformers/features/notations/NotationCreateIsGeneralTransformer.ts +15 -15
  400. package/src/transformers/features/notations/NotationCreateValidateGeneralTransformer.ts +15 -15
  401. package/src/transformers/features/notations/NotationGeneralTransformer.ts +11 -11
  402. package/src/transformers/features/notations/NotationIsGeneralTransformer.ts +15 -15
  403. package/src/transformers/features/notations/NotationValidateGeneralTransformer.ts +15 -15
  404. package/src/transformers/features/protobuf/ProtobufAssertDecodeTransformer.ts +10 -10
  405. package/src/transformers/features/protobuf/ProtobufAssertEncodeTransformer.ts +10 -10
  406. package/src/transformers/features/protobuf/ProtobufCreateAssertDecodeTransformer.ts +12 -12
  407. package/src/transformers/features/protobuf/ProtobufCreateAssertEncodeTransformer.ts +12 -12
  408. package/src/transformers/features/protobuf/ProtobufCreateDecodeTransformer.ts +9 -9
  409. package/src/transformers/features/protobuf/ProtobufCreateEncodeTransformer.ts +9 -9
  410. package/src/transformers/features/protobuf/ProtobufCreateIsDecodeTransformer.ts +9 -9
  411. package/src/transformers/features/protobuf/ProtobufCreateIsEncodeTransformer.ts +9 -9
  412. package/src/transformers/features/protobuf/ProtobufCreateValidateDecodeTransformer.ts +12 -12
  413. package/src/transformers/features/protobuf/ProtobufCreateValidateEncodeTransformer.ts +12 -12
  414. package/src/transformers/features/protobuf/ProtobufDecodeTransformer.ts +9 -9
  415. package/src/transformers/features/protobuf/ProtobufEncodeTransformer.ts +9 -9
  416. package/src/transformers/features/protobuf/ProtobufIsDecodeTransformer.ts +9 -9
  417. package/src/transformers/features/protobuf/ProtobufIsEncodeTransformer.ts +9 -9
  418. package/src/transformers/features/protobuf/ProtobufMessageTransformer.ts +33 -33
  419. package/src/transformers/features/protobuf/ProtobufValidateDecodeTransformer.ts +10 -10
  420. package/src/transformers/features/protobuf/ProtobufValidateEncodeTransformer.ts +10 -10
  421. package/src/transformers/features/reflect/ReflectMetadataTransformer.ts +63 -63
  422. package/src/transformers/features/reflect/ReflectNameTransformer.ts +66 -66
  423. package/src/transformers/internal/GenericTransformer.ts +104 -104
  424. package/src/typings/Atomic.ts +13 -13
  425. package/src/typings/ClassProperties.ts +5 -5
  426. package/src/typings/Customizable.ts +5 -5
  427. package/src/typings/Equal.ts +18 -18
  428. package/src/typings/IsTuple.ts +9 -9
  429. package/src/typings/NativeClass.ts +23 -23
  430. package/src/typings/OmitNever.ts +3 -3
  431. package/src/typings/ProtobufAtomic.ts +19 -19
  432. package/src/typings/SpecialFields.ts +3 -3
  433. package/src/typings/ValidationPipe.ts +9 -9
  434. package/src/typings/ValueOf.ts +20 -20
  435. package/src/typings/Writable.ts +11 -11
  436. package/src/utils/ArrayUtil.ts +41 -41
  437. package/src/utils/Escaper.ts +50 -50
  438. package/src/utils/MapUtil.ts +12 -12
  439. package/src/utils/NameEncoder.ts +32 -32
  440. package/src/utils/NamingConvention/NamingConvention.ts +89 -89
  441. package/src/utils/NamingConvention/index.ts +1 -1
  442. package/src/utils/PatternUtil.ts +29 -29
  443. package/src/utils/RandomGenerator/RandomGenerator.ts +119 -119
  444. package/src/utils/RandomGenerator/index.ts +1 -1
  445. package/src/utils/Singleton.ts +16 -16
  446. package/src/utils/StringUtil/StringUtil.ts +7 -7
  447. package/src/utils/StringUtil/index.ts +1 -1
package/src/json.ts CHANGED
@@ -1,738 +1,738 @@
1
- import * as Namespace from "./functional/Namespace";
2
-
3
- import { IJsonApplication } from "./schemas/json/IJsonApplication";
4
-
5
- import { IValidation } from "./IValidation";
6
- import { Primitive } from "./Primitive";
7
- import { TypeGuardError } from "./TypeGuardError";
8
-
9
- /* ===========================================================
10
- JSON
11
- - SCHEMA
12
- - PARSE
13
- - STRINGIFY
14
- - FACTORY FUNCTIONS
15
- ==============================================================
16
- SCHEMA
17
- ----------------------------------------------------------- */
18
- /**
19
- * > You must configure the generic argument `Types`.
20
- *
21
- * JSON Schema Application.
22
- *
23
- * Creates a JSON schema application which contains both main JSON schemas and
24
- * components. Note that, all of the named types are stored in the
25
- * {@link IJsonApplication.components} property for the `$ref` referencing.
26
- *
27
- * Also, you can specify the OpenAPI version by configuring the second generic
28
- * argument `Version`. For reference, the default version is `"3.1"`, and key
29
- * different of `"3.0"` and `"3.1"` is whether supporting the tuple type or not.
30
- *
31
- * @template Types Tuple of target types
32
- * @template Purpose Purpose of the JSON schema
33
- * @template Surplus Allow surplus properties starting with `x-typia-` or not
34
- * @return JSON schema application
35
- *
36
- * @author Jeongho Nam - https://github.com/samchon
37
- */
38
- export function application(): never;
39
-
40
- /**
41
- * JSON Schema Application.
42
- *
43
- * Creates a JSON schema application which contains both main JSON schemas and
44
- * components. Note that, all of the named types are stored in the
45
- * {@link IJsonApplication.components} property for the `$ref` referencing.
46
- *
47
- * Also, you can specify the OpenAPI version by configuring the second generic
48
- * argument `Version`. For reference, the default version is `"3.1"`, and key
49
- * different of `"3.0"` and `"3.1"` is whether supporting the tuple type or not.
50
- *
51
- * @template Types Tuple of target types
52
- * @template Version Version of OpenAPI specification. Default is 3.1
53
- * @return JSON schema application
54
- *
55
- * @author Jeongho Nam - https://github.com/samchon
56
- */
57
- export function application<
58
- Types extends unknown[],
59
- Version extends "3.0" | "3.1" = "3.1",
60
- >(): IJsonApplication<Version, Types>;
61
-
62
- /**
63
- * @internal
64
- */
65
- export function application(): never {
66
- halt("application");
67
- }
68
-
69
- /* -----------------------------------------------------------
70
- PARSE
71
- ----------------------------------------------------------- */
72
- /**
73
- * > You must configure the generic argument `T`.
74
- *
75
- * Safe `JSON.parse()` function with type assertion.
76
- *
77
- * `typia.json.assertParse()` is a combination function of `JSON.parse()` and
78
- * {@link assert}. Therefore, it convers a JSON (JavaScript Object Notation) string
79
- * to a `T` typed instance with type assertion.
80
- *
81
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
82
- * throws {@link TypeGuardError} or custom error generated by *errorFactory*. Otherwise,
83
- * there's no problem on the parsed value, the parsed value would be returned.
84
- *
85
- * @template T Expected type of parsed value
86
- * @param input JSON string
87
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
88
- * @returns Parsed value
89
- *
90
- * @author Jeongho Nam - https://github.com/samchon
91
- */
92
- function assertParse(
93
- input: string,
94
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
95
- ): never;
96
-
97
- /**
98
- * Safe `JSON.parse()` function with type assertion.
99
- *
100
- * `typia.json.assertParse()` is a combination function of `JSON.parse()` and
101
- * {@link assert}. Therefore, it convers a JSON (JavaScript Object Notation) string
102
- * to a `T` typed instance with type assertion.
103
- *
104
- * In such reason, when parsed JSON string value is not matched with the type `T`,
105
- * it throws {@link TypeGuardError} or custom error generated by *errorFactory*.
106
- * Otherwise, there's no problem on the parsed value, the parsed value would be
107
- * returned.
108
- *
109
- * @template T Expected type of parsed value
110
- * @param input JSON string
111
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
112
- * @returns Parsed value
113
- *
114
- * @author Jeongho Nam - https://github.com/samchon
115
- */
116
- function assertParse<T>(
117
- input: string,
118
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
119
- ): Primitive<T>;
120
-
121
- /**
122
- * @internal
123
- */
124
- function assertParse<T>(): Primitive<T> {
125
- halt("assertParse");
126
- }
127
- const assertParsePure = /** @__PURE__ */ Object.assign<typeof assertParse, {}>(
128
- assertParse,
129
- /** @__PURE__ */ Namespace.assert("json.assertParse"),
130
- );
131
- export { assertParsePure as assertParse };
132
-
133
- /**
134
- * > You must configure the generic argument `T`.
135
- *
136
- * Safe `JSON.parse()` function with type checking.
137
- *
138
- * `typia.json.isParse()` is a combination function of `JSON.parse()` and {@link is}.
139
- * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
140
- * instance with type checking.
141
- *
142
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
143
- * returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
144
- * value would be returned.
145
- *
146
- * @template T Expected type of parsed value
147
- * @param input JSON string
148
- * @returns Parsed value when exact type, otherwise `null`
149
- *
150
- * @author Jeongho Nam - https://github.com/samchon
151
- */
152
- function isParse(input: string): never;
153
-
154
- /**
155
- * Safe `JSON.parse()` function with type checking.
156
- *
157
- * `typia.json.isParse()` is a combination function of `JSON.parse()` and {@link is}.
158
- * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
159
- * instance with type checking.
160
- *
161
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
162
- * returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
163
- * value would be returned.
164
- *
165
- * @template T Expected type of parsed value
166
- * @param input JSON string
167
- * @returns Parsed value when exact type, otherwise `null`
168
- *
169
- * @author Jeongho Nam - https://github.com/samchon
170
- */
171
- function isParse<T>(input: string): Primitive<T> | null;
172
-
173
- /**
174
- * @internal
175
- */
176
- function isParse<T>(): Primitive<T> | null {
177
- halt("isParse");
178
- }
179
- const isParsePure = /** @__PURE__ */ Object.assign<typeof isParse, {}>(
180
- isParse,
181
- /** @__PURE__ */ Namespace.is(),
182
- );
183
- export { isParsePure as isParse };
184
-
185
- /**
186
- * > You must configure the generic argument `T`.
187
- *
188
- * Safe `JSON.parse()` function with detailed type validation.
189
- *
190
- * `typia.json.validateParse()` is a combination function of `JSON.parse()` and
191
- * {@link validate}. Therefore, it convers a JSON (JavaScript Object Notation) string
192
- * to a `T` typed instance with detailed type validation.
193
- *
194
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
195
- * returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
196
- * there's no problem on the parsed value, the parsed value would be stored in `data`
197
- * property of the output {@link IValidation.ISuccess} instance.
198
- *
199
- * @template T Expected type of parsed value
200
- * @param input JSON string
201
- * @returns Validation result with JSON parsed value
202
- *
203
- * @author Jeongho Nam - https://github.com/samchon
204
- */
205
- function validateParse(input: string): never;
206
-
207
- /**
208
- * Safe `JSON.parse()` function with detailed type validation.
209
- *
210
- * `typia.json.validateParse()` is a combination function of `JSON.parse()` and
211
- * {@link validate}. Therefore, it convers a JSON (JavaScript Object Notation) string
212
- * to a `T` typed instance with detailed type validation.
213
- *
214
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
215
- * returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
216
- * there's no problem on the parsed value, the parsed value would be stored in `data`
217
- * property of the output {@link IValidation.ISuccess} instance.
218
- *
219
- * @template T Expected type of parsed value
220
- * @param input JSON string
221
- * @returns Validation result with JSON parsed value
222
- *
223
- * @author Jeongho Nam - https://github.com/samchon
224
- */
225
- function validateParse<T>(input: string): IValidation<Primitive<T>>;
226
-
227
- /**
228
- * @internal
229
- */
230
- function validateParse<T>(): IValidation<Primitive<T>> {
231
- halt("validateParse");
232
- }
233
- const validateParsePure = /** @__PURE__ */ Object.assign<
234
- typeof validateParse,
235
- {}
236
- >(validateParse, /** @__PURE__ */ Namespace.validate());
237
- export { validateParsePure as validateParse };
238
-
239
- /* -----------------------------------------------------------
240
- STRINGIFY
241
- ----------------------------------------------------------- */
242
- /**
243
- * 8x faster `JSON.stringify()` function.
244
- *
245
- * Converts an input value to a JSON (JavaScript Object Notation) string, about 8x
246
- * faster than the native `JSON.stringify()` function. The 5x faster principle is
247
- * because it writes an optimized JSON conversion plan, only for the type `T`.
248
- *
249
- * For reference, this `typia.json.stringify()` does not validate the input value type.
250
- * It just believes that the input value is following the type `T`. Therefore, if you
251
- * can't ensure the input value type, it would be better to call one of below
252
- * functions instead.
253
- *
254
- * - {@link assertStringify}
255
- * - {@link isStringify}
256
- * - {@link validateStringify}
257
- *
258
- * @template T Type of the input value
259
- * @param input A value to be converted
260
- * @return JSON string value
261
- *
262
- * @author Jeongho Nam - https://github.com/samchon
263
- */
264
- function stringify<T>(input: T): string;
265
-
266
- /**
267
- * @internal
268
- */
269
- function stringify(): never {
270
- halt("stringify");
271
- }
272
- const stringifyPure = /** @__PURE__ */ Object.assign<typeof stringify, {}>(
273
- stringify,
274
- /** @__PURE__ */ Namespace.json.stringify("stringify"),
275
- );
276
- export { stringifyPure as stringify };
277
-
278
- /**
279
- * 5x faster `JSON.stringify()` function with type assertion.
280
- *
281
- * `typia.json.assertStringify()` is a combination function of {@link assert} and
282
- * {@link stringify}. Therefore, it converts an input value to
283
- * JSON (JavaScript Object Notation) string, with type assertion.
284
- *
285
- * In such reason, when `input` value is not matched with the type `T`, it throws an
286
- * {@link TypeGuardError} or custom error generated by *errorFactory*. Otherwise,
287
- * there's no problem on the `input` value, JSON string would be returned.
288
- *
289
- * For reference, with type assertion, it is even 5x times faster than the native
290
- * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
291
- * with confidence.
292
- *
293
- * @template T Type of the input value
294
- * @param input A value to be asserted and converted
295
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
296
- * @return JSON string value
297
- *
298
- * @author Jeongho Nam - https://github.com/samchon
299
- */
300
- function assertStringify<T>(
301
- input: T,
302
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
303
- ): string;
304
-
305
- /**
306
- * 5x faster `JSON.stringify()` function with type assertion.
307
- *
308
- * `typia.json.assertStringify()` is a combination function of {@link assert} and
309
- * {@link stringify}. Therefore, it converts an input value to
310
- * JSON (JavaScript Object Notation) string, with type assertion.
311
- *
312
- * In such reason, when `input` value is not matched with the type `T`, it throws an
313
- * {@link TypeGuardError} or custom error generated by *errorFactory*. Otherwise,
314
- * there's no problem on the `input` value, JSON string would be returned.
315
- *
316
- * For reference, with type assertion, it is even 5x times faster than the native
317
- * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
318
- * with confidence.
319
- *
320
- * @template T Type of the input value
321
- * @param input A value to be asserted and converted
322
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
323
- * @return JSON string value
324
- *
325
- * @author Jeongho Nam - https://github.com/samchon
326
- */
327
- function assertStringify<T>(
328
- input: T,
329
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
330
- ): unknown;
331
-
332
- /**
333
- * @internal
334
- */
335
- function assertStringify(): string {
336
- halt("assertStringify");
337
- }
338
- const assertStringifyPure = /** @__PURE__ */ Object.assign<
339
- typeof assertStringify,
340
- {},
341
- {}
342
- >(
343
- assertStringify,
344
- /** @__PURE__ */ Namespace.assert("json.assertStringify"),
345
- /** @__PURE__ */ Namespace.json.stringify("assertStringify"),
346
- );
347
- export { assertStringifyPure as assertStringify };
348
-
349
- /**
350
- * 7x faster `JSON.stringify()` function with type checking.
351
- *
352
- * `typia.json.stringify()` is a combination function of {@link is} and
353
- * {@link stringify}. Therefore, it converts an input value to JSON
354
- * (JavaScript Object Notation) string, with type checking.
355
- *
356
- * In such reason, when `input` value is not matched with the type `T`, it returns
357
- * `null` value. Otherwise, there's no problem on the `input` value, JSON string
358
- * would be returned.
359
- *
360
- * For reference, with type checking, it is even 7x times faster than the native
361
- * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
362
- * with confidence.
363
- *
364
- * @template T Type of the input value
365
- * @param input A value to be checked and converted
366
- * @return JSON string value when exact type, otherwise null
367
- *
368
- * @author Jeongho Nam - https://github.com/samchon
369
- */
370
- function isStringify<T>(input: T): string | null;
371
-
372
- /**
373
- * 7x faster `JSON.stringify()` function with type checking.
374
- *
375
- * `typia.json.isStringify()` is a combination function of {@link is} and
376
- * {@link stringify}. Therefore, it converts an input value to JSON
377
- * (JavaScript Object Notation) string, with type checking.
378
- *
379
- * In such reason, when `input` value is not matched with the type `T`, it returns
380
- * `null` value. Otherwise, there's no problem on the `input` value, JSON string
381
- * would be returned.
382
- *
383
- * For reference, with type checking, it is even 7x times faster than the native
384
- * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
385
- * with confidence.
386
- *
387
- * @template T Type of the input value
388
- * @param input A value to be checked and converted
389
- * @return JSON string value when exact type, otherwise null
390
- *
391
- * @author Jeongho Nam - https://github.com/samchon
392
- */
393
- function isStringify<T>(input: unknown): string | null;
394
-
395
- /**
396
- * @internal
397
- */
398
- function isStringify(): string | null {
399
- halt("isStringify");
400
- }
401
-
402
- const isStringifyPure = /** @__PURE__ */ Object.assign<
403
- typeof isStringify,
404
- {},
405
- {}
406
- >(
407
- isStringify,
408
- /** @__PURE__ */ Namespace.is(),
409
- /** @__PURE__ */ Namespace.json.stringify("isStringify"),
410
- );
411
- export { isStringifyPure as isStringify };
412
-
413
- /**
414
- * 5x faster `JSON.stringify()` function with detailed type validation.
415
- *
416
- * `typia.json.validateStringify()` is a combination function of {@link validate} and
417
- * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
418
- * Notation) string, with detailed type validation.
419
- *
420
- * In such reason, when `input` value is not matched with the type `T`, it returns
421
- * {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
422
- * there's no problem on the `input` value, JSON string would be stored in `data`
423
- * property of the output {@link IValidation.ISuccess} instance.
424
- *
425
- * For reference, with detailed type validation, it is even 5x times faster than the
426
- * native `JSON.stringify()` function. So, just enjoy the safe and fast JSON
427
- * conversion with confidence.
428
- *
429
- * @template T Type of the input value
430
- * @param input A value to be checked and converted
431
- * @returns Validation result with JSON string value
432
- *
433
- * @author Jeongho Nam - https://github.com/samchon
434
- */
435
- function validateStringify<T>(input: T): IValidation<string>;
436
-
437
- /**
438
- * 5x faster `JSON.stringify()` function with detailed type validation.
439
- *
440
- * `typia.json.validateStringify()` is a combination function of {@link validate} and
441
- * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
442
- * Notation) string, with detailed type validation.
443
- *
444
- * In such reason, when `input` value is not matched with the type `T`, it returns
445
- * {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
446
- * there's no problem on the `input` value, JSON string would be stored in `data`
447
- * property of the output {@link IValidation.ISuccess} instance.
448
- *
449
- * For reference, with detailed type validation, it is even 5x times faster than the
450
- * native `JSON.stringify()` function. So, just enjoy the safe and fast JSON
451
- * conversion with confidence.
452
- *
453
- * @template T Type of the input value
454
- * @param input A value to be checked and converted
455
- * @returns Validation result with JSON string value
456
- *
457
- * @author Jeongho Nam - https://github.com/samchon
458
- */
459
- function validateStringify<T>(input: unknown): IValidation<string>;
460
-
461
- /**
462
- * @internal
463
- */
464
- function validateStringify(): IValidation<string> {
465
- halt("validateStringify");
466
- }
467
- const validateStringifyPure = /** @__PURE__ */ Object.assign<
468
- typeof validateStringify,
469
- {},
470
- {}
471
- >(
472
- validateStringify,
473
- /** @__PURE__ */ Namespace.validate(),
474
- /** @__PURE__ */ Namespace.json.stringify("validateStringify"),
475
- );
476
- export { validateStringifyPure as validateStringify };
477
-
478
- /* -----------------------------------------------------------
479
- FACTORY FUNCTIONS
480
- ----------------------------------------------------------- */
481
- /**
482
- * Creates a reusable {@link isParse} function.
483
- *
484
- * @danger You must configure the generic argument `T`
485
- * @returns Nothing until you configure the generic argument `T`
486
- * @throws compile error
487
- *
488
- * @author Jeongho Nam - https://github.com/samchon
489
- */
490
- function createIsParse(): never;
491
-
492
- /**
493
- * Creates a reusable {@link isParse} function.
494
- *
495
- * @template T Expected type of parsed value
496
- * @returns A reusable `isParse` function
497
- *
498
- * @author Jeongho Nam - https://github.com/samchon
499
- */
500
- function createIsParse<T>(): (input: string) => Primitive<T> | null;
501
-
502
- /**
503
- * @internal
504
- */
505
- function createIsParse<T>(): (input: string) => Primitive<T> | null {
506
- halt("createIsParse");
507
- }
508
- const createIsParsePure = /** @__PURE__ */ Object.assign<
509
- typeof createIsParse,
510
- {}
511
- >(createIsParse, isParsePure);
512
- export { createIsParsePure as createIsParse };
513
-
514
- /**
515
- * Creates a reusable {@link assertParse} function.
516
- *
517
- * @danger You must configure the generic argument `T`
518
- * @returns Nothing until you configure the generic argument `T`
519
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
520
- * @throws compile error
521
- *
522
- * @author Jeongho Nam - https://github.com/samchon
523
- */
524
- function createAssertParse(
525
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
526
- ): never;
527
-
528
- /**
529
- * Creates a reusable {@link assertParse} function.
530
- *
531
- * @template T Expected type of parsed value
532
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
533
- * @returns A reusable `assertParse` function
534
- *
535
- * @author Jeongho Nam - https://github.com/samchon
536
- */
537
- function createAssertParse<T>(
538
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
539
- ): (input: string) => Primitive<T>;
540
-
541
- /**
542
- * @internal
543
- */
544
- function createAssertParse<T>(): (input: string) => Primitive<T> {
545
- halt("createAssertParse");
546
- }
547
- const createAssertParsePure = /** @__PURE__ */ Object.assign<
548
- typeof createAssertParse,
549
- {}
550
- >(createAssertParse, assertParsePure);
551
- export { createAssertParsePure as createAssertParse };
552
-
553
- /**
554
- * Creates a reusable {@link validateParse} function.
555
- *
556
- * @danger You must configure the generic argument `T`
557
- * @returns Nothing until you configure the generic argument `T`
558
- * @throws compile error
559
- *
560
- * @author Jeongho Nam - https://github.com/samchon
561
- */
562
- function createValidateParse(): never;
563
-
564
- /**
565
- * Creates a reusable {@link validateParse} function.
566
- *
567
- * @template T Expected type of parsed value
568
- * @returns A reusable `validateParse` function
569
- *
570
- * @author Jeongho Nam - https://github.com/samchon
571
- */
572
- function createValidateParse<T>(): (input: string) => IValidation<Primitive<T>>;
573
-
574
- /**
575
- * @internal
576
- */
577
- function createValidateParse<T>(): (
578
- input: string,
579
- ) => IValidation<Primitive<T>> {
580
- halt("createValidateParse");
581
- }
582
-
583
- const createValidateParsePure = /** @__PURE__ */ Object.assign<
584
- typeof createValidateParse,
585
- {}
586
- >(createValidateParse, validateParsePure);
587
- export { createValidateParsePure as createValidateParse };
588
-
589
- /**
590
- * Creates a reusable {@link stringify} function.
591
- *
592
- * @danger You must configure the generic argument `T`
593
- * @returns Nothing until you configure the generic argument `T`
594
- * @throws compile error
595
- *
596
- * @author Jeongho Nam - https://github.com/samchon
597
- */
598
- function createStringify(): never;
599
-
600
- /**
601
- * Creates a reusable {@link stringify} function.
602
- *
603
- * @template T Type of the input value
604
- * @returns A reusable `stringify` function
605
- *
606
- * @author Jeongho Nam - https://github.com/samchon
607
- */
608
- function createStringify<T>(): (input: T) => string;
609
-
610
- /**
611
- * @internal
612
- */
613
- function createStringify<T>(): (input: T) => string {
614
- halt("createStringify");
615
- }
616
-
617
- const createStringifyPure = /** @__PURE__ */ Object.assign<
618
- typeof createStringify,
619
- {}
620
- >(createStringify, stringifyPure);
621
- export { createStringifyPure as createStringify };
622
-
623
- /**
624
- * Creates a reusable {@link assertStringify} function.
625
- *
626
- * @danger You must configure the generic argument `T`
627
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
628
- * @returns Nothing until you configure the generic argument `T`
629
- * @throws compile error
630
- *
631
- * @author Jeongho Nam - https://github.com/samchon
632
- */
633
- function createAssertStringify(
634
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
635
- ): never;
636
-
637
- /**
638
- * Creates a reusable {@link assertStringify} function.
639
- *
640
- * @template T Type of the input value
641
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
642
- * @returns A reusable `assertStringify` function
643
- *
644
- * @author Jeongho Nam - https://github.com/samchon
645
- */
646
- function createAssertStringify<T>(
647
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
648
- ): (input: unknown) => string;
649
-
650
- /**
651
- * @internal
652
- */
653
- function createAssertStringify(): (input: unknown) => string {
654
- halt("createAssertStringify");
655
- }
656
-
657
- const createAssertStringifyPure = /** @__PURE__ */ Object.assign<
658
- typeof createAssertStringify,
659
- {}
660
- >(createAssertStringify, assertStringifyPure);
661
- export { createAssertStringifyPure as createAssertStringify };
662
-
663
- /**
664
- * Creates a reusable {@link isStringify} function.
665
- *
666
- * @danger You must configure the generic argument `T`
667
- * @returns Nothing until you configure the generic argument `T`
668
- * @throws compile error
669
- *
670
- * @author Jeongho Nam - https://github.com/samchon
671
- */
672
- function createIsStringify(): never;
673
-
674
- /**
675
- * Creates a reusable {@link isStringify} function.
676
- *
677
- * @template T Type of the input value
678
- * @returns A reusable `isStringify` function
679
- *
680
- * @author Jeongho Nam - https://github.com/samchon
681
- */
682
- function createIsStringify<T>(): (input: unknown) => string | null;
683
-
684
- /**
685
- * @internal
686
- */
687
- function createIsStringify(): (input: unknown) => string | null {
688
- halt("createIsStringify");
689
- }
690
-
691
- const createIsStringifyPure = /** @__PURE__ */ Object.assign<
692
- typeof createIsStringify,
693
- {}
694
- >(createIsStringify, isStringifyPure);
695
- export { createIsStringifyPure as createIsStringify };
696
-
697
- /**
698
- * Creates a reusable {@link validateStringify} function.
699
- *
700
- * @danger You must configure the generic argument `T`
701
- * @returns Nothing until you configure the generic argument `T`
702
- * @throws compile error
703
- *
704
- * @author Jeongho Nam - https://github.com/samchon
705
- */
706
- function createValidateStringify(): never;
707
-
708
- /**
709
- * Creates a reusable {@link validateStringify} function.
710
- *
711
- * @template T Type of the input value
712
- * @returns A reusable `validateStringify` function
713
-
714
- * @author Jeongho Nam - https://github.com/samchon
715
- */
716
- function createValidateStringify<T>(): (input: unknown) => IValidation<string>;
717
-
718
- /**
719
- * @internal
720
- */
721
- function createValidateStringify(): (input: unknown) => IValidation<string> {
722
- halt("createValidateStringify");
723
- }
724
-
725
- const createValidateStringifyPure = /** @__PURE__ */ Object.assign<
726
- typeof createValidateStringify,
727
- {}
728
- >(createValidateStringify, validateStringifyPure);
729
- export { createValidateStringifyPure as createValidateStringify };
730
-
731
- /**
732
- * @internal
733
- */
734
- function halt(name: string): never {
735
- throw new Error(
736
- `Error on typia.json.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`,
737
- );
738
- }
1
+ import * as Namespace from "./functional/Namespace";
2
+
3
+ import { IJsonApplication } from "./schemas/json/IJsonApplication";
4
+
5
+ import { IValidation } from "./IValidation";
6
+ import { Primitive } from "./Primitive";
7
+ import { TypeGuardError } from "./TypeGuardError";
8
+
9
+ /* ===========================================================
10
+ JSON
11
+ - SCHEMA
12
+ - PARSE
13
+ - STRINGIFY
14
+ - FACTORY FUNCTIONS
15
+ ==============================================================
16
+ SCHEMA
17
+ ----------------------------------------------------------- */
18
+ /**
19
+ * > You must configure the generic argument `Types`.
20
+ *
21
+ * JSON Schema Application.
22
+ *
23
+ * Creates a JSON schema application which contains both main JSON schemas and
24
+ * components. Note that, all of the named types are stored in the
25
+ * {@link IJsonApplication.components} property for the `$ref` referencing.
26
+ *
27
+ * Also, you can specify the OpenAPI version by configuring the second generic
28
+ * argument `Version`. For reference, the default version is `"3.1"`, and key
29
+ * different of `"3.0"` and `"3.1"` is whether supporting the tuple type or not.
30
+ *
31
+ * @template Types Tuple of target types
32
+ * @template Purpose Purpose of the JSON schema
33
+ * @template Surplus Allow surplus properties starting with `x-typia-` or not
34
+ * @return JSON schema application
35
+ *
36
+ * @author Jeongho Nam - https://github.com/samchon
37
+ */
38
+ export function application(): never;
39
+
40
+ /**
41
+ * JSON Schema Application.
42
+ *
43
+ * Creates a JSON schema application which contains both main JSON schemas and
44
+ * components. Note that, all of the named types are stored in the
45
+ * {@link IJsonApplication.components} property for the `$ref` referencing.
46
+ *
47
+ * Also, you can specify the OpenAPI version by configuring the second generic
48
+ * argument `Version`. For reference, the default version is `"3.1"`, and key
49
+ * different of `"3.0"` and `"3.1"` is whether supporting the tuple type or not.
50
+ *
51
+ * @template Types Tuple of target types
52
+ * @template Version Version of OpenAPI specification. Default is 3.1
53
+ * @return JSON schema application
54
+ *
55
+ * @author Jeongho Nam - https://github.com/samchon
56
+ */
57
+ export function application<
58
+ Types extends unknown[],
59
+ Version extends "3.0" | "3.1" = "3.1",
60
+ >(): IJsonApplication<Version, Types>;
61
+
62
+ /**
63
+ * @internal
64
+ */
65
+ export function application(): never {
66
+ halt("application");
67
+ }
68
+
69
+ /* -----------------------------------------------------------
70
+ PARSE
71
+ ----------------------------------------------------------- */
72
+ /**
73
+ * > You must configure the generic argument `T`.
74
+ *
75
+ * Safe `JSON.parse()` function with type assertion.
76
+ *
77
+ * `typia.json.assertParse()` is a combination function of `JSON.parse()` and
78
+ * {@link assert}. Therefore, it convers a JSON (JavaScript Object Notation) string
79
+ * to a `T` typed instance with type assertion.
80
+ *
81
+ * In such reason, when parsed JSON string value is not matched with the type `T`, it
82
+ * throws {@link TypeGuardError} or custom error generated by *errorFactory*. Otherwise,
83
+ * there's no problem on the parsed value, the parsed value would be returned.
84
+ *
85
+ * @template T Expected type of parsed value
86
+ * @param input JSON string
87
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
88
+ * @returns Parsed value
89
+ *
90
+ * @author Jeongho Nam - https://github.com/samchon
91
+ */
92
+ function assertParse(
93
+ input: string,
94
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
95
+ ): never;
96
+
97
+ /**
98
+ * Safe `JSON.parse()` function with type assertion.
99
+ *
100
+ * `typia.json.assertParse()` is a combination function of `JSON.parse()` and
101
+ * {@link assert}. Therefore, it convers a JSON (JavaScript Object Notation) string
102
+ * to a `T` typed instance with type assertion.
103
+ *
104
+ * In such reason, when parsed JSON string value is not matched with the type `T`,
105
+ * it throws {@link TypeGuardError} or custom error generated by *errorFactory*.
106
+ * Otherwise, there's no problem on the parsed value, the parsed value would be
107
+ * returned.
108
+ *
109
+ * @template T Expected type of parsed value
110
+ * @param input JSON string
111
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
112
+ * @returns Parsed value
113
+ *
114
+ * @author Jeongho Nam - https://github.com/samchon
115
+ */
116
+ function assertParse<T>(
117
+ input: string,
118
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
119
+ ): Primitive<T>;
120
+
121
+ /**
122
+ * @internal
123
+ */
124
+ function assertParse<T>(): Primitive<T> {
125
+ halt("assertParse");
126
+ }
127
+ const assertParsePure = /** @__PURE__ */ Object.assign<typeof assertParse, {}>(
128
+ assertParse,
129
+ /** @__PURE__ */ Namespace.assert("json.assertParse"),
130
+ );
131
+ export { assertParsePure as assertParse };
132
+
133
+ /**
134
+ * > You must configure the generic argument `T`.
135
+ *
136
+ * Safe `JSON.parse()` function with type checking.
137
+ *
138
+ * `typia.json.isParse()` is a combination function of `JSON.parse()` and {@link is}.
139
+ * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
140
+ * instance with type checking.
141
+ *
142
+ * In such reason, when parsed JSON string value is not matched with the type `T`, it
143
+ * returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
144
+ * value would be returned.
145
+ *
146
+ * @template T Expected type of parsed value
147
+ * @param input JSON string
148
+ * @returns Parsed value when exact type, otherwise `null`
149
+ *
150
+ * @author Jeongho Nam - https://github.com/samchon
151
+ */
152
+ function isParse(input: string): never;
153
+
154
+ /**
155
+ * Safe `JSON.parse()` function with type checking.
156
+ *
157
+ * `typia.json.isParse()` is a combination function of `JSON.parse()` and {@link is}.
158
+ * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
159
+ * instance with type checking.
160
+ *
161
+ * In such reason, when parsed JSON string value is not matched with the type `T`, it
162
+ * returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
163
+ * value would be returned.
164
+ *
165
+ * @template T Expected type of parsed value
166
+ * @param input JSON string
167
+ * @returns Parsed value when exact type, otherwise `null`
168
+ *
169
+ * @author Jeongho Nam - https://github.com/samchon
170
+ */
171
+ function isParse<T>(input: string): Primitive<T> | null;
172
+
173
+ /**
174
+ * @internal
175
+ */
176
+ function isParse<T>(): Primitive<T> | null {
177
+ halt("isParse");
178
+ }
179
+ const isParsePure = /** @__PURE__ */ Object.assign<typeof isParse, {}>(
180
+ isParse,
181
+ /** @__PURE__ */ Namespace.is(),
182
+ );
183
+ export { isParsePure as isParse };
184
+
185
+ /**
186
+ * > You must configure the generic argument `T`.
187
+ *
188
+ * Safe `JSON.parse()` function with detailed type validation.
189
+ *
190
+ * `typia.json.validateParse()` is a combination function of `JSON.parse()` and
191
+ * {@link validate}. Therefore, it convers a JSON (JavaScript Object Notation) string
192
+ * to a `T` typed instance with detailed type validation.
193
+ *
194
+ * In such reason, when parsed JSON string value is not matched with the type `T`, it
195
+ * returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
196
+ * there's no problem on the parsed value, the parsed value would be stored in `data`
197
+ * property of the output {@link IValidation.ISuccess} instance.
198
+ *
199
+ * @template T Expected type of parsed value
200
+ * @param input JSON string
201
+ * @returns Validation result with JSON parsed value
202
+ *
203
+ * @author Jeongho Nam - https://github.com/samchon
204
+ */
205
+ function validateParse(input: string): never;
206
+
207
+ /**
208
+ * Safe `JSON.parse()` function with detailed type validation.
209
+ *
210
+ * `typia.json.validateParse()` is a combination function of `JSON.parse()` and
211
+ * {@link validate}. Therefore, it convers a JSON (JavaScript Object Notation) string
212
+ * to a `T` typed instance with detailed type validation.
213
+ *
214
+ * In such reason, when parsed JSON string value is not matched with the type `T`, it
215
+ * returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
216
+ * there's no problem on the parsed value, the parsed value would be stored in `data`
217
+ * property of the output {@link IValidation.ISuccess} instance.
218
+ *
219
+ * @template T Expected type of parsed value
220
+ * @param input JSON string
221
+ * @returns Validation result with JSON parsed value
222
+ *
223
+ * @author Jeongho Nam - https://github.com/samchon
224
+ */
225
+ function validateParse<T>(input: string): IValidation<Primitive<T>>;
226
+
227
+ /**
228
+ * @internal
229
+ */
230
+ function validateParse<T>(): IValidation<Primitive<T>> {
231
+ halt("validateParse");
232
+ }
233
+ const validateParsePure = /** @__PURE__ */ Object.assign<
234
+ typeof validateParse,
235
+ {}
236
+ >(validateParse, /** @__PURE__ */ Namespace.validate());
237
+ export { validateParsePure as validateParse };
238
+
239
+ /* -----------------------------------------------------------
240
+ STRINGIFY
241
+ ----------------------------------------------------------- */
242
+ /**
243
+ * 8x faster `JSON.stringify()` function.
244
+ *
245
+ * Converts an input value to a JSON (JavaScript Object Notation) string, about 8x
246
+ * faster than the native `JSON.stringify()` function. The 5x faster principle is
247
+ * because it writes an optimized JSON conversion plan, only for the type `T`.
248
+ *
249
+ * For reference, this `typia.json.stringify()` does not validate the input value type.
250
+ * It just believes that the input value is following the type `T`. Therefore, if you
251
+ * can't ensure the input value type, it would be better to call one of below
252
+ * functions instead.
253
+ *
254
+ * - {@link assertStringify}
255
+ * - {@link isStringify}
256
+ * - {@link validateStringify}
257
+ *
258
+ * @template T Type of the input value
259
+ * @param input A value to be converted
260
+ * @return JSON string value
261
+ *
262
+ * @author Jeongho Nam - https://github.com/samchon
263
+ */
264
+ function stringify<T>(input: T): string;
265
+
266
+ /**
267
+ * @internal
268
+ */
269
+ function stringify(): never {
270
+ halt("stringify");
271
+ }
272
+ const stringifyPure = /** @__PURE__ */ Object.assign<typeof stringify, {}>(
273
+ stringify,
274
+ /** @__PURE__ */ Namespace.json.stringify("stringify"),
275
+ );
276
+ export { stringifyPure as stringify };
277
+
278
+ /**
279
+ * 5x faster `JSON.stringify()` function with type assertion.
280
+ *
281
+ * `typia.json.assertStringify()` is a combination function of {@link assert} and
282
+ * {@link stringify}. Therefore, it converts an input value to
283
+ * JSON (JavaScript Object Notation) string, with type assertion.
284
+ *
285
+ * In such reason, when `input` value is not matched with the type `T`, it throws an
286
+ * {@link TypeGuardError} or custom error generated by *errorFactory*. Otherwise,
287
+ * there's no problem on the `input` value, JSON string would be returned.
288
+ *
289
+ * For reference, with type assertion, it is even 5x times faster than the native
290
+ * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
291
+ * with confidence.
292
+ *
293
+ * @template T Type of the input value
294
+ * @param input A value to be asserted and converted
295
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
296
+ * @return JSON string value
297
+ *
298
+ * @author Jeongho Nam - https://github.com/samchon
299
+ */
300
+ function assertStringify<T>(
301
+ input: T,
302
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
303
+ ): string;
304
+
305
+ /**
306
+ * 5x faster `JSON.stringify()` function with type assertion.
307
+ *
308
+ * `typia.json.assertStringify()` is a combination function of {@link assert} and
309
+ * {@link stringify}. Therefore, it converts an input value to
310
+ * JSON (JavaScript Object Notation) string, with type assertion.
311
+ *
312
+ * In such reason, when `input` value is not matched with the type `T`, it throws an
313
+ * {@link TypeGuardError} or custom error generated by *errorFactory*. Otherwise,
314
+ * there's no problem on the `input` value, JSON string would be returned.
315
+ *
316
+ * For reference, with type assertion, it is even 5x times faster than the native
317
+ * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
318
+ * with confidence.
319
+ *
320
+ * @template T Type of the input value
321
+ * @param input A value to be asserted and converted
322
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
323
+ * @return JSON string value
324
+ *
325
+ * @author Jeongho Nam - https://github.com/samchon
326
+ */
327
+ function assertStringify<T>(
328
+ input: T,
329
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
330
+ ): unknown;
331
+
332
+ /**
333
+ * @internal
334
+ */
335
+ function assertStringify(): string {
336
+ halt("assertStringify");
337
+ }
338
+ const assertStringifyPure = /** @__PURE__ */ Object.assign<
339
+ typeof assertStringify,
340
+ {},
341
+ {}
342
+ >(
343
+ assertStringify,
344
+ /** @__PURE__ */ Namespace.assert("json.assertStringify"),
345
+ /** @__PURE__ */ Namespace.json.stringify("assertStringify"),
346
+ );
347
+ export { assertStringifyPure as assertStringify };
348
+
349
+ /**
350
+ * 7x faster `JSON.stringify()` function with type checking.
351
+ *
352
+ * `typia.json.stringify()` is a combination function of {@link is} and
353
+ * {@link stringify}. Therefore, it converts an input value to JSON
354
+ * (JavaScript Object Notation) string, with type checking.
355
+ *
356
+ * In such reason, when `input` value is not matched with the type `T`, it returns
357
+ * `null` value. Otherwise, there's no problem on the `input` value, JSON string
358
+ * would be returned.
359
+ *
360
+ * For reference, with type checking, it is even 7x times faster than the native
361
+ * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
362
+ * with confidence.
363
+ *
364
+ * @template T Type of the input value
365
+ * @param input A value to be checked and converted
366
+ * @return JSON string value when exact type, otherwise null
367
+ *
368
+ * @author Jeongho Nam - https://github.com/samchon
369
+ */
370
+ function isStringify<T>(input: T): string | null;
371
+
372
+ /**
373
+ * 7x faster `JSON.stringify()` function with type checking.
374
+ *
375
+ * `typia.json.isStringify()` is a combination function of {@link is} and
376
+ * {@link stringify}. Therefore, it converts an input value to JSON
377
+ * (JavaScript Object Notation) string, with type checking.
378
+ *
379
+ * In such reason, when `input` value is not matched with the type `T`, it returns
380
+ * `null` value. Otherwise, there's no problem on the `input` value, JSON string
381
+ * would be returned.
382
+ *
383
+ * For reference, with type checking, it is even 7x times faster than the native
384
+ * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
385
+ * with confidence.
386
+ *
387
+ * @template T Type of the input value
388
+ * @param input A value to be checked and converted
389
+ * @return JSON string value when exact type, otherwise null
390
+ *
391
+ * @author Jeongho Nam - https://github.com/samchon
392
+ */
393
+ function isStringify<T>(input: unknown): string | null;
394
+
395
+ /**
396
+ * @internal
397
+ */
398
+ function isStringify(): string | null {
399
+ halt("isStringify");
400
+ }
401
+
402
+ const isStringifyPure = /** @__PURE__ */ Object.assign<
403
+ typeof isStringify,
404
+ {},
405
+ {}
406
+ >(
407
+ isStringify,
408
+ /** @__PURE__ */ Namespace.is(),
409
+ /** @__PURE__ */ Namespace.json.stringify("isStringify"),
410
+ );
411
+ export { isStringifyPure as isStringify };
412
+
413
+ /**
414
+ * 5x faster `JSON.stringify()` function with detailed type validation.
415
+ *
416
+ * `typia.json.validateStringify()` is a combination function of {@link validate} and
417
+ * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
418
+ * Notation) string, with detailed type validation.
419
+ *
420
+ * In such reason, when `input` value is not matched with the type `T`, it returns
421
+ * {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
422
+ * there's no problem on the `input` value, JSON string would be stored in `data`
423
+ * property of the output {@link IValidation.ISuccess} instance.
424
+ *
425
+ * For reference, with detailed type validation, it is even 5x times faster than the
426
+ * native `JSON.stringify()` function. So, just enjoy the safe and fast JSON
427
+ * conversion with confidence.
428
+ *
429
+ * @template T Type of the input value
430
+ * @param input A value to be checked and converted
431
+ * @returns Validation result with JSON string value
432
+ *
433
+ * @author Jeongho Nam - https://github.com/samchon
434
+ */
435
+ function validateStringify<T>(input: T): IValidation<string>;
436
+
437
+ /**
438
+ * 5x faster `JSON.stringify()` function with detailed type validation.
439
+ *
440
+ * `typia.json.validateStringify()` is a combination function of {@link validate} and
441
+ * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
442
+ * Notation) string, with detailed type validation.
443
+ *
444
+ * In such reason, when `input` value is not matched with the type `T`, it returns
445
+ * {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
446
+ * there's no problem on the `input` value, JSON string would be stored in `data`
447
+ * property of the output {@link IValidation.ISuccess} instance.
448
+ *
449
+ * For reference, with detailed type validation, it is even 5x times faster than the
450
+ * native `JSON.stringify()` function. So, just enjoy the safe and fast JSON
451
+ * conversion with confidence.
452
+ *
453
+ * @template T Type of the input value
454
+ * @param input A value to be checked and converted
455
+ * @returns Validation result with JSON string value
456
+ *
457
+ * @author Jeongho Nam - https://github.com/samchon
458
+ */
459
+ function validateStringify<T>(input: unknown): IValidation<string>;
460
+
461
+ /**
462
+ * @internal
463
+ */
464
+ function validateStringify(): IValidation<string> {
465
+ halt("validateStringify");
466
+ }
467
+ const validateStringifyPure = /** @__PURE__ */ Object.assign<
468
+ typeof validateStringify,
469
+ {},
470
+ {}
471
+ >(
472
+ validateStringify,
473
+ /** @__PURE__ */ Namespace.validate(),
474
+ /** @__PURE__ */ Namespace.json.stringify("validateStringify"),
475
+ );
476
+ export { validateStringifyPure as validateStringify };
477
+
478
+ /* -----------------------------------------------------------
479
+ FACTORY FUNCTIONS
480
+ ----------------------------------------------------------- */
481
+ /**
482
+ * Creates a reusable {@link isParse} function.
483
+ *
484
+ * @danger You must configure the generic argument `T`
485
+ * @returns Nothing until you configure the generic argument `T`
486
+ * @throws compile error
487
+ *
488
+ * @author Jeongho Nam - https://github.com/samchon
489
+ */
490
+ function createIsParse(): never;
491
+
492
+ /**
493
+ * Creates a reusable {@link isParse} function.
494
+ *
495
+ * @template T Expected type of parsed value
496
+ * @returns A reusable `isParse` function
497
+ *
498
+ * @author Jeongho Nam - https://github.com/samchon
499
+ */
500
+ function createIsParse<T>(): (input: string) => Primitive<T> | null;
501
+
502
+ /**
503
+ * @internal
504
+ */
505
+ function createIsParse<T>(): (input: string) => Primitive<T> | null {
506
+ halt("createIsParse");
507
+ }
508
+ const createIsParsePure = /** @__PURE__ */ Object.assign<
509
+ typeof createIsParse,
510
+ {}
511
+ >(createIsParse, isParsePure);
512
+ export { createIsParsePure as createIsParse };
513
+
514
+ /**
515
+ * Creates a reusable {@link assertParse} function.
516
+ *
517
+ * @danger You must configure the generic argument `T`
518
+ * @returns Nothing until you configure the generic argument `T`
519
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
520
+ * @throws compile error
521
+ *
522
+ * @author Jeongho Nam - https://github.com/samchon
523
+ */
524
+ function createAssertParse(
525
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
526
+ ): never;
527
+
528
+ /**
529
+ * Creates a reusable {@link assertParse} function.
530
+ *
531
+ * @template T Expected type of parsed value
532
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
533
+ * @returns A reusable `assertParse` function
534
+ *
535
+ * @author Jeongho Nam - https://github.com/samchon
536
+ */
537
+ function createAssertParse<T>(
538
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
539
+ ): (input: string) => Primitive<T>;
540
+
541
+ /**
542
+ * @internal
543
+ */
544
+ function createAssertParse<T>(): (input: string) => Primitive<T> {
545
+ halt("createAssertParse");
546
+ }
547
+ const createAssertParsePure = /** @__PURE__ */ Object.assign<
548
+ typeof createAssertParse,
549
+ {}
550
+ >(createAssertParse, assertParsePure);
551
+ export { createAssertParsePure as createAssertParse };
552
+
553
+ /**
554
+ * Creates a reusable {@link validateParse} function.
555
+ *
556
+ * @danger You must configure the generic argument `T`
557
+ * @returns Nothing until you configure the generic argument `T`
558
+ * @throws compile error
559
+ *
560
+ * @author Jeongho Nam - https://github.com/samchon
561
+ */
562
+ function createValidateParse(): never;
563
+
564
+ /**
565
+ * Creates a reusable {@link validateParse} function.
566
+ *
567
+ * @template T Expected type of parsed value
568
+ * @returns A reusable `validateParse` function
569
+ *
570
+ * @author Jeongho Nam - https://github.com/samchon
571
+ */
572
+ function createValidateParse<T>(): (input: string) => IValidation<Primitive<T>>;
573
+
574
+ /**
575
+ * @internal
576
+ */
577
+ function createValidateParse<T>(): (
578
+ input: string,
579
+ ) => IValidation<Primitive<T>> {
580
+ halt("createValidateParse");
581
+ }
582
+
583
+ const createValidateParsePure = /** @__PURE__ */ Object.assign<
584
+ typeof createValidateParse,
585
+ {}
586
+ >(createValidateParse, validateParsePure);
587
+ export { createValidateParsePure as createValidateParse };
588
+
589
+ /**
590
+ * Creates a reusable {@link stringify} function.
591
+ *
592
+ * @danger You must configure the generic argument `T`
593
+ * @returns Nothing until you configure the generic argument `T`
594
+ * @throws compile error
595
+ *
596
+ * @author Jeongho Nam - https://github.com/samchon
597
+ */
598
+ function createStringify(): never;
599
+
600
+ /**
601
+ * Creates a reusable {@link stringify} function.
602
+ *
603
+ * @template T Type of the input value
604
+ * @returns A reusable `stringify` function
605
+ *
606
+ * @author Jeongho Nam - https://github.com/samchon
607
+ */
608
+ function createStringify<T>(): (input: T) => string;
609
+
610
+ /**
611
+ * @internal
612
+ */
613
+ function createStringify<T>(): (input: T) => string {
614
+ halt("createStringify");
615
+ }
616
+
617
+ const createStringifyPure = /** @__PURE__ */ Object.assign<
618
+ typeof createStringify,
619
+ {}
620
+ >(createStringify, stringifyPure);
621
+ export { createStringifyPure as createStringify };
622
+
623
+ /**
624
+ * Creates a reusable {@link assertStringify} function.
625
+ *
626
+ * @danger You must configure the generic argument `T`
627
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
628
+ * @returns Nothing until you configure the generic argument `T`
629
+ * @throws compile error
630
+ *
631
+ * @author Jeongho Nam - https://github.com/samchon
632
+ */
633
+ function createAssertStringify(
634
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
635
+ ): never;
636
+
637
+ /**
638
+ * Creates a reusable {@link assertStringify} function.
639
+ *
640
+ * @template T Type of the input value
641
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
642
+ * @returns A reusable `assertStringify` function
643
+ *
644
+ * @author Jeongho Nam - https://github.com/samchon
645
+ */
646
+ function createAssertStringify<T>(
647
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
648
+ ): (input: unknown) => string;
649
+
650
+ /**
651
+ * @internal
652
+ */
653
+ function createAssertStringify(): (input: unknown) => string {
654
+ halt("createAssertStringify");
655
+ }
656
+
657
+ const createAssertStringifyPure = /** @__PURE__ */ Object.assign<
658
+ typeof createAssertStringify,
659
+ {}
660
+ >(createAssertStringify, assertStringifyPure);
661
+ export { createAssertStringifyPure as createAssertStringify };
662
+
663
+ /**
664
+ * Creates a reusable {@link isStringify} function.
665
+ *
666
+ * @danger You must configure the generic argument `T`
667
+ * @returns Nothing until you configure the generic argument `T`
668
+ * @throws compile error
669
+ *
670
+ * @author Jeongho Nam - https://github.com/samchon
671
+ */
672
+ function createIsStringify(): never;
673
+
674
+ /**
675
+ * Creates a reusable {@link isStringify} function.
676
+ *
677
+ * @template T Type of the input value
678
+ * @returns A reusable `isStringify` function
679
+ *
680
+ * @author Jeongho Nam - https://github.com/samchon
681
+ */
682
+ function createIsStringify<T>(): (input: unknown) => string | null;
683
+
684
+ /**
685
+ * @internal
686
+ */
687
+ function createIsStringify(): (input: unknown) => string | null {
688
+ halt("createIsStringify");
689
+ }
690
+
691
+ const createIsStringifyPure = /** @__PURE__ */ Object.assign<
692
+ typeof createIsStringify,
693
+ {}
694
+ >(createIsStringify, isStringifyPure);
695
+ export { createIsStringifyPure as createIsStringify };
696
+
697
+ /**
698
+ * Creates a reusable {@link validateStringify} function.
699
+ *
700
+ * @danger You must configure the generic argument `T`
701
+ * @returns Nothing until you configure the generic argument `T`
702
+ * @throws compile error
703
+ *
704
+ * @author Jeongho Nam - https://github.com/samchon
705
+ */
706
+ function createValidateStringify(): never;
707
+
708
+ /**
709
+ * Creates a reusable {@link validateStringify} function.
710
+ *
711
+ * @template T Type of the input value
712
+ * @returns A reusable `validateStringify` function
713
+
714
+ * @author Jeongho Nam - https://github.com/samchon
715
+ */
716
+ function createValidateStringify<T>(): (input: unknown) => IValidation<string>;
717
+
718
+ /**
719
+ * @internal
720
+ */
721
+ function createValidateStringify(): (input: unknown) => IValidation<string> {
722
+ halt("createValidateStringify");
723
+ }
724
+
725
+ const createValidateStringifyPure = /** @__PURE__ */ Object.assign<
726
+ typeof createValidateStringify,
727
+ {}
728
+ >(createValidateStringify, validateStringifyPure);
729
+ export { createValidateStringifyPure as createValidateStringify };
730
+
731
+ /**
732
+ * @internal
733
+ */
734
+ function halt(name: string): never {
735
+ throw new Error(
736
+ `Error on typia.json.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`,
737
+ );
738
+ }