typia 9.7.1 → 10.0.0-dev.20251107

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 (424) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +153 -153
  3. package/lib/AssertionGuard.d.mts +27 -25
  4. package/lib/AssertionGuard.d.ts +27 -25
  5. package/lib/CamelCase.d.mts +1 -1
  6. package/lib/CamelCase.d.ts +1 -1
  7. package/lib/IRandomGenerator.d.mts +44 -42
  8. package/lib/IRandomGenerator.d.ts +44 -42
  9. package/lib/IReadableURLSearchParams.d.mts +2 -2
  10. package/lib/IReadableURLSearchParams.d.ts +2 -2
  11. package/lib/PascalCase.d.mts +1 -1
  12. package/lib/PascalCase.d.ts +1 -1
  13. package/lib/Primitive.d.mts +20 -22
  14. package/lib/Primitive.d.ts +20 -22
  15. package/lib/Resolved.d.mts +16 -18
  16. package/lib/Resolved.d.ts +16 -18
  17. package/lib/SnakeCase.d.mts +3 -2
  18. package/lib/SnakeCase.d.ts +3 -2
  19. package/lib/TypeGuardError.d.mts +88 -61
  20. package/lib/TypeGuardError.d.ts +88 -61
  21. package/lib/TypeGuardError.js +40 -29
  22. package/lib/TypeGuardError.js.map +1 -1
  23. package/lib/TypeGuardError.mjs +70 -48
  24. package/lib/factories/MetadataCollection.js +4 -12
  25. package/lib/factories/MetadataCollection.js.map +1 -1
  26. package/lib/factories/MetadataCollection.mjs +4 -12
  27. package/lib/factories/MetadataCommentTagFactory.js +5 -15
  28. package/lib/factories/MetadataCommentTagFactory.js.map +1 -1
  29. package/lib/factories/MetadataCommentTagFactory.mjs +5 -15
  30. package/lib/factories/MetadataFactory.js +1 -3
  31. package/lib/factories/MetadataFactory.js.map +1 -1
  32. package/lib/factories/MetadataFactory.mjs +1 -3
  33. package/lib/factories/ProtobufFactory.js +2 -4
  34. package/lib/factories/ProtobufFactory.js.map +1 -1
  35. package/lib/factories/ProtobufFactory.mjs +2 -4
  36. package/lib/functional.d.mts +196 -195
  37. package/lib/functional.d.ts +196 -195
  38. package/lib/functional.js +18 -54
  39. package/lib/functional.js.map +1 -1
  40. package/lib/functional.mjs +18 -54
  41. package/lib/http.d.mts +303 -319
  42. package/lib/http.d.ts +303 -319
  43. package/lib/http.js +26 -78
  44. package/lib/http.js.map +1 -1
  45. package/lib/http.mjs +26 -78
  46. package/lib/internal/_ProtobufReader.d.mts +3 -9
  47. package/lib/internal/_ProtobufReader.d.ts +3 -9
  48. package/lib/internal/_ProtobufReader.js.map +1 -1
  49. package/lib/internal/_ProtobufReader.mjs +3 -9
  50. package/lib/internal/_ProtobufSizer.d.mts +4 -12
  51. package/lib/internal/_ProtobufSizer.d.ts +4 -12
  52. package/lib/internal/_ProtobufSizer.js.map +1 -1
  53. package/lib/internal/_ProtobufSizer.mjs +4 -12
  54. package/lib/internal/_ProtobufWriter.d.mts +5 -15
  55. package/lib/internal/_ProtobufWriter.d.ts +5 -15
  56. package/lib/internal/_ProtobufWriter.js.map +1 -1
  57. package/lib/internal/_ProtobufWriter.mjs +5 -15
  58. package/lib/internal/_jsonStringifyString.d.mts +4 -4
  59. package/lib/internal/_jsonStringifyString.d.ts +4 -4
  60. package/lib/internal/_jsonStringifyString.js +4 -4
  61. package/lib/internal/_jsonStringifyString.mjs +4 -4
  62. package/lib/json.d.mts +174 -195
  63. package/lib/json.d.ts +174 -195
  64. package/lib/json.js +16 -48
  65. package/lib/json.js.map +1 -1
  66. package/lib/json.mjs +16 -48
  67. package/lib/llm.d.mts +275 -192
  68. package/lib/llm.d.ts +275 -192
  69. package/lib/llm.js +4 -12
  70. package/lib/llm.js.map +1 -1
  71. package/lib/llm.mjs +4 -12
  72. package/lib/misc.d.mts +149 -172
  73. package/lib/misc.d.ts +149 -172
  74. package/lib/misc.js +17 -51
  75. package/lib/misc.js.map +1 -1
  76. package/lib/misc.mjs +17 -51
  77. package/lib/module.d.mts +263 -275
  78. package/lib/module.d.ts +263 -275
  79. package/lib/module.js +18 -54
  80. package/lib/module.js.map +1 -1
  81. package/lib/module.mjs +18 -54
  82. package/lib/notations.d.mts +153 -174
  83. package/lib/notations.d.ts +153 -174
  84. package/lib/notations.js +24 -72
  85. package/lib/notations.js.map +1 -1
  86. package/lib/notations.mjs +24 -72
  87. package/lib/programmers/FeatureProgrammer.d.mts +19 -41
  88. package/lib/programmers/FeatureProgrammer.d.ts +19 -41
  89. package/lib/programmers/FeatureProgrammer.js.map +1 -1
  90. package/lib/programmers/ImportProgrammer.js +3 -9
  91. package/lib/programmers/ImportProgrammer.js.map +1 -1
  92. package/lib/programmers/ImportProgrammer.mjs +3 -9
  93. package/lib/programmers/RandomProgrammer.js +6 -0
  94. package/lib/programmers/RandomProgrammer.js.map +1 -1
  95. package/lib/programmers/RandomProgrammer.mjs +6 -0
  96. package/lib/programmers/helpers/ProtobufWire.d.mts +13 -13
  97. package/lib/programmers/helpers/ProtobufWire.d.ts +13 -13
  98. package/lib/programmers/internal/check_array_length.js +2 -6
  99. package/lib/programmers/internal/check_array_length.js.map +1 -1
  100. package/lib/programmers/internal/check_array_length.mjs +2 -6
  101. package/lib/programmers/internal/check_bigint.js +2 -6
  102. package/lib/programmers/internal/check_bigint.js.map +1 -1
  103. package/lib/programmers/internal/check_bigint.mjs +2 -6
  104. package/lib/programmers/internal/check_dynamic_key.js +2 -6
  105. package/lib/programmers/internal/check_dynamic_key.js.map +1 -1
  106. package/lib/programmers/internal/check_dynamic_key.mjs +2 -6
  107. package/lib/programmers/internal/check_dynamic_properties.js +3 -9
  108. package/lib/programmers/internal/check_dynamic_properties.js.map +1 -1
  109. package/lib/programmers/internal/check_dynamic_properties.mjs +3 -9
  110. package/lib/programmers/internal/check_everything.js +1 -3
  111. package/lib/programmers/internal/check_everything.js.map +1 -1
  112. package/lib/programmers/internal/check_everything.mjs +1 -3
  113. package/lib/programmers/internal/check_native.js +2 -6
  114. package/lib/programmers/internal/check_native.js.map +1 -1
  115. package/lib/programmers/internal/check_native.mjs +2 -6
  116. package/lib/programmers/internal/check_number.js +2 -6
  117. package/lib/programmers/internal/check_number.js.map +1 -1
  118. package/lib/programmers/internal/check_number.mjs +2 -6
  119. package/lib/programmers/internal/check_object.js +2 -6
  120. package/lib/programmers/internal/check_object.js.map +1 -1
  121. package/lib/programmers/internal/check_object.mjs +2 -6
  122. package/lib/programmers/internal/check_string.js +2 -6
  123. package/lib/programmers/internal/check_string.js.map +1 -1
  124. package/lib/programmers/internal/check_string.mjs +2 -6
  125. package/lib/programmers/internal/check_template.js +1 -3
  126. package/lib/programmers/internal/check_template.js.map +1 -1
  127. package/lib/programmers/internal/check_template.mjs +1 -3
  128. package/lib/programmers/internal/check_union_array_like.js +1 -3
  129. package/lib/programmers/internal/check_union_array_like.js.map +1 -1
  130. package/lib/programmers/internal/check_union_array_like.mjs +1 -3
  131. package/lib/programmers/internal/decode_union_object.js +2 -6
  132. package/lib/programmers/internal/decode_union_object.js.map +1 -1
  133. package/lib/programmers/internal/decode_union_object.mjs +2 -6
  134. package/lib/programmers/internal/feature_object_entries.js +1 -3
  135. package/lib/programmers/internal/feature_object_entries.js.map +1 -1
  136. package/lib/programmers/internal/feature_object_entries.mjs +1 -3
  137. package/lib/programmers/internal/json_schema_escaped.js +2 -6
  138. package/lib/programmers/internal/json_schema_escaped.js.map +1 -1
  139. package/lib/programmers/internal/json_schema_escaped.mjs +2 -6
  140. package/lib/programmers/internal/json_schema_object.js +3 -9
  141. package/lib/programmers/internal/json_schema_object.js.map +1 -1
  142. package/lib/programmers/internal/json_schema_object.mjs +3 -9
  143. package/lib/programmers/internal/json_schema_station.d.mts +2 -2
  144. package/lib/programmers/internal/json_schema_station.d.ts +2 -2
  145. package/lib/programmers/internal/metadata_to_pattern.js +1 -3
  146. package/lib/programmers/internal/metadata_to_pattern.js.map +1 -1
  147. package/lib/programmers/internal/metadata_to_pattern.mjs +1 -3
  148. package/lib/programmers/internal/postfix_of_tuple.js +1 -3
  149. package/lib/programmers/internal/postfix_of_tuple.js.map +1 -1
  150. package/lib/programmers/internal/postfix_of_tuple.mjs +1 -3
  151. package/lib/programmers/internal/prune_object_properties.js +1 -3
  152. package/lib/programmers/internal/prune_object_properties.js.map +1 -1
  153. package/lib/programmers/internal/prune_object_properties.mjs +1 -3
  154. package/lib/programmers/internal/stringify_dynamic_properties.js +2 -6
  155. package/lib/programmers/internal/stringify_dynamic_properties.js.map +1 -1
  156. package/lib/programmers/internal/stringify_dynamic_properties.mjs +2 -6
  157. package/lib/programmers/internal/stringify_native.js +1 -3
  158. package/lib/programmers/internal/stringify_native.js.map +1 -1
  159. package/lib/programmers/internal/stringify_native.mjs +1 -3
  160. package/lib/programmers/internal/stringify_regular_properties.js +2 -6
  161. package/lib/programmers/internal/stringify_regular_properties.js.map +1 -1
  162. package/lib/programmers/internal/stringify_regular_properties.mjs +2 -6
  163. package/lib/programmers/internal/template_to_pattern.js +1 -3
  164. package/lib/programmers/internal/template_to_pattern.js.map +1 -1
  165. package/lib/programmers/internal/template_to_pattern.mjs +1 -3
  166. package/lib/programmers/internal/wrap_metadata_rest_tuple.js +1 -3
  167. package/lib/programmers/internal/wrap_metadata_rest_tuple.js.map +1 -1
  168. package/lib/programmers/internal/wrap_metadata_rest_tuple.mjs +1 -3
  169. package/lib/programmers/json/JsonStringifyProgrammer.js +2 -2
  170. package/lib/programmers/json/JsonStringifyProgrammer.js.map +1 -1
  171. package/lib/programmers/json/JsonStringifyProgrammer.mjs +2 -2
  172. package/lib/programmers/llm/LlmApplicationProgrammer.js +5 -1
  173. package/lib/programmers/llm/LlmApplicationProgrammer.js.map +1 -1
  174. package/lib/programmers/llm/LlmApplicationProgrammer.mjs +5 -1
  175. package/lib/programmers/llm/LlmSchemaProgrammer.js +1 -4
  176. package/lib/programmers/llm/LlmSchemaProgrammer.js.map +1 -1
  177. package/lib/programmers/llm/LlmSchemaProgrammer.mjs +1 -35
  178. package/lib/protobuf.d.mts +290 -297
  179. package/lib/protobuf.d.ts +290 -297
  180. package/lib/protobuf.js +17 -51
  181. package/lib/protobuf.js.map +1 -1
  182. package/lib/protobuf.mjs +17 -51
  183. package/lib/reflect.d.mts +2 -4
  184. package/lib/reflect.d.ts +2 -4
  185. package/lib/reflect.js +1 -3
  186. package/lib/reflect.js.map +1 -1
  187. package/lib/reflect.mjs +1 -3
  188. package/lib/schemas/json/IJsonApplication.d.mts +4 -4
  189. package/lib/schemas/json/IJsonApplication.d.ts +4 -4
  190. package/lib/schemas/json/IJsonSchemaCollection.d.mts +73 -56
  191. package/lib/schemas/json/IJsonSchemaCollection.d.ts +73 -56
  192. package/lib/schemas/json/IJsonSchemaUnit.d.mts +83 -70
  193. package/lib/schemas/json/IJsonSchemaUnit.d.ts +83 -70
  194. package/lib/schemas/metadata/Metadata.d.mts +1 -3
  195. package/lib/schemas/metadata/Metadata.d.ts +1 -3
  196. package/lib/schemas/metadata/Metadata.js +9 -27
  197. package/lib/schemas/metadata/Metadata.js.map +1 -1
  198. package/lib/schemas/metadata/Metadata.mjs +9 -27
  199. package/lib/schemas/metadata/MetadataAliasType.d.mts +1 -3
  200. package/lib/schemas/metadata/MetadataAliasType.d.ts +1 -3
  201. package/lib/schemas/metadata/MetadataAliasType.js +3 -9
  202. package/lib/schemas/metadata/MetadataAliasType.js.map +1 -1
  203. package/lib/schemas/metadata/MetadataAliasType.mjs +3 -9
  204. package/lib/schemas/metadata/MetadataApplication.d.mts +1 -3
  205. package/lib/schemas/metadata/MetadataApplication.d.ts +1 -3
  206. package/lib/schemas/metadata/MetadataApplication.js +2 -6
  207. package/lib/schemas/metadata/MetadataApplication.js.map +1 -1
  208. package/lib/schemas/metadata/MetadataApplication.mjs +2 -6
  209. package/lib/schemas/metadata/MetadataArray.d.mts +1 -3
  210. package/lib/schemas/metadata/MetadataArray.d.ts +1 -3
  211. package/lib/schemas/metadata/MetadataArray.js +1 -3
  212. package/lib/schemas/metadata/MetadataArray.js.map +1 -1
  213. package/lib/schemas/metadata/MetadataArray.mjs +1 -3
  214. package/lib/schemas/metadata/MetadataArrayType.d.mts +1 -3
  215. package/lib/schemas/metadata/MetadataArrayType.d.ts +1 -3
  216. package/lib/schemas/metadata/MetadataArrayType.js +3 -9
  217. package/lib/schemas/metadata/MetadataArrayType.js.map +1 -1
  218. package/lib/schemas/metadata/MetadataArrayType.mjs +3 -9
  219. package/lib/schemas/metadata/MetadataAtomic.js +1 -3
  220. package/lib/schemas/metadata/MetadataAtomic.js.map +1 -1
  221. package/lib/schemas/metadata/MetadataAtomic.mjs +1 -3
  222. package/lib/schemas/metadata/MetadataEscaped.d.mts +1 -3
  223. package/lib/schemas/metadata/MetadataEscaped.d.ts +1 -3
  224. package/lib/schemas/metadata/MetadataEscaped.js +3 -9
  225. package/lib/schemas/metadata/MetadataEscaped.js.map +1 -1
  226. package/lib/schemas/metadata/MetadataEscaped.mjs +3 -9
  227. package/lib/schemas/metadata/MetadataFunction.d.mts +1 -3
  228. package/lib/schemas/metadata/MetadataFunction.d.ts +1 -3
  229. package/lib/schemas/metadata/MetadataFunction.js +2 -6
  230. package/lib/schemas/metadata/MetadataFunction.js.map +1 -1
  231. package/lib/schemas/metadata/MetadataFunction.mjs +2 -6
  232. package/lib/schemas/metadata/MetadataObject.d.mts +1 -3
  233. package/lib/schemas/metadata/MetadataObject.d.ts +1 -3
  234. package/lib/schemas/metadata/MetadataObject.js +1 -3
  235. package/lib/schemas/metadata/MetadataObject.js.map +1 -1
  236. package/lib/schemas/metadata/MetadataObject.mjs +1 -3
  237. package/lib/schemas/metadata/MetadataObjectType.d.mts +1 -3
  238. package/lib/schemas/metadata/MetadataObjectType.d.ts +1 -3
  239. package/lib/schemas/metadata/MetadataObjectType.js +5 -15
  240. package/lib/schemas/metadata/MetadataObjectType.js.map +1 -1
  241. package/lib/schemas/metadata/MetadataObjectType.mjs +6 -18
  242. package/lib/schemas/metadata/MetadataParameter.js +1 -3
  243. package/lib/schemas/metadata/MetadataParameter.js.map +1 -1
  244. package/lib/schemas/metadata/MetadataParameter.mjs +1 -3
  245. package/lib/schemas/metadata/MetadataProperty.d.mts +1 -3
  246. package/lib/schemas/metadata/MetadataProperty.d.ts +1 -3
  247. package/lib/schemas/metadata/MetadataProperty.js +3 -9
  248. package/lib/schemas/metadata/MetadataProperty.js.map +1 -1
  249. package/lib/schemas/metadata/MetadataProperty.mjs +3 -9
  250. package/lib/schemas/metadata/MetadataTemplate.js +1 -3
  251. package/lib/schemas/metadata/MetadataTemplate.js.map +1 -1
  252. package/lib/schemas/metadata/MetadataTemplate.mjs +1 -3
  253. package/lib/schemas/metadata/MetadataTuple.d.mts +1 -3
  254. package/lib/schemas/metadata/MetadataTuple.d.ts +1 -3
  255. package/lib/schemas/metadata/MetadataTuple.js +2 -6
  256. package/lib/schemas/metadata/MetadataTuple.js.map +1 -1
  257. package/lib/schemas/metadata/MetadataTuple.mjs +2 -6
  258. package/lib/schemas/metadata/MetadataTupleType.js +2 -6
  259. package/lib/schemas/metadata/MetadataTupleType.js.map +1 -1
  260. package/lib/schemas/metadata/MetadataTupleType.mjs +3 -9
  261. package/lib/tags/Constant.d.mts +16 -16
  262. package/lib/tags/Constant.d.ts +16 -16
  263. package/lib/tags/ContentMediaType.d.mts +7 -7
  264. package/lib/tags/ContentMediaType.d.ts +7 -7
  265. package/lib/tags/Default.d.mts +19 -19
  266. package/lib/tags/Default.d.ts +19 -19
  267. package/lib/tags/Example.d.mts +18 -18
  268. package/lib/tags/Example.d.ts +18 -18
  269. package/lib/tags/Examples.d.mts +23 -23
  270. package/lib/tags/Examples.d.ts +23 -23
  271. package/lib/tags/ExclusiveMaximum.d.mts +8 -5
  272. package/lib/tags/ExclusiveMaximum.d.ts +8 -5
  273. package/lib/tags/ExclusiveMinimum.d.mts +8 -5
  274. package/lib/tags/ExclusiveMinimum.d.ts +8 -5
  275. package/lib/tags/Format.d.mts +12 -8
  276. package/lib/tags/Format.d.ts +12 -8
  277. package/lib/tags/JsonSchemaPlugin.d.mts +20 -18
  278. package/lib/tags/JsonSchemaPlugin.d.ts +20 -18
  279. package/lib/tags/MaxItems.d.mts +9 -9
  280. package/lib/tags/MaxItems.d.ts +9 -9
  281. package/lib/tags/MaxLength.d.mts +6 -5
  282. package/lib/tags/MaxLength.d.ts +6 -5
  283. package/lib/tags/Maximum.d.mts +9 -7
  284. package/lib/tags/Maximum.d.ts +9 -7
  285. package/lib/tags/MinItems.d.mts +9 -9
  286. package/lib/tags/MinItems.d.ts +9 -9
  287. package/lib/tags/MinLength.d.mts +6 -5
  288. package/lib/tags/MinLength.d.ts +6 -5
  289. package/lib/tags/Minimum.d.mts +9 -7
  290. package/lib/tags/Minimum.d.ts +9 -7
  291. package/lib/tags/MultipleOf.d.mts +10 -7
  292. package/lib/tags/MultipleOf.d.ts +10 -7
  293. package/lib/tags/Pattern.d.mts +7 -4
  294. package/lib/tags/Pattern.d.ts +7 -4
  295. package/lib/tags/Sequence.d.mts +19 -17
  296. package/lib/tags/Sequence.d.ts +19 -17
  297. package/lib/tags/TagBase.d.mts +21 -28
  298. package/lib/tags/TagBase.d.ts +21 -28
  299. package/lib/tags/Type.d.mts +12 -11
  300. package/lib/tags/Type.d.ts +12 -11
  301. package/lib/tags/UniqueItems.d.mts +10 -9
  302. package/lib/tags/UniqueItems.d.ts +10 -9
  303. package/lib/tags/internal/FormatCheatSheet.d.mts +1 -3
  304. package/lib/tags/internal/FormatCheatSheet.d.ts +1 -3
  305. package/lib/tags/internal/FormatCheatSheet.js +1 -3
  306. package/lib/tags/internal/FormatCheatSheet.js.map +1 -1
  307. package/lib/tags/internal/FormatCheatSheet.mjs +1 -3
  308. package/lib/transformers/ITransformOptions.d.mts +27 -19
  309. package/lib/transformers/ITransformOptions.d.ts +27 -19
  310. package/lib/transformers/ImportTransformer.js +5 -10
  311. package/lib/transformers/ImportTransformer.js.map +1 -1
  312. package/lib/transformers/ImportTransformer.mjs +5 -10
  313. package/lib/transformers/NoTransformConfigurationError.js +1 -3
  314. package/lib/transformers/NoTransformConfigurationError.js.map +1 -1
  315. package/lib/transformers/NoTransformConfigurationError.mjs +1 -3
  316. package/lib/transformers/features/llm/LlmApplicationTransformer.js +1 -3
  317. package/lib/transformers/features/llm/LlmApplicationTransformer.js.map +1 -1
  318. package/lib/transformers/features/llm/LlmApplicationTransformer.mjs +1 -3
  319. package/lib/typings/Equal.d.mts +6 -6
  320. package/lib/typings/Equal.d.ts +6 -6
  321. package/package.json +121 -120
  322. package/src/AssertionGuard.ts +41 -39
  323. package/src/CamelCase.ts +75 -75
  324. package/src/IRandomGenerator.ts +337 -335
  325. package/src/IReadableURLSearchParams.ts +9 -9
  326. package/src/PascalCase.ts +71 -71
  327. package/src/Primitive.ts +90 -92
  328. package/src/Resolved.ts +72 -74
  329. package/src/SnakeCase.ts +127 -126
  330. package/src/TypeGuardError.ts +216 -179
  331. package/src/factories/MetadataCollection.ts +270 -278
  332. package/src/factories/MetadataCommentTagFactory.ts +632 -648
  333. package/src/factories/MetadataFactory.ts +402 -404
  334. package/src/factories/ProtobufFactory.ts +873 -875
  335. package/src/functional.ts +705 -740
  336. package/src/http.ts +972 -1040
  337. package/src/internal/_ProtobufReader.ts +188 -194
  338. package/src/internal/_ProtobufSizer.ts +137 -145
  339. package/src/internal/_ProtobufWriter.ts +135 -145
  340. package/src/internal/_jsonStringifyString.ts +42 -42
  341. package/src/json.ts +643 -696
  342. package/src/llm.ts +615 -540
  343. package/src/misc.ts +594 -651
  344. package/src/module.ts +889 -937
  345. package/src/notations.ts +751 -820
  346. package/src/programmers/FeatureProgrammer.ts +605 -627
  347. package/src/programmers/ImportProgrammer.ts +179 -185
  348. package/src/programmers/RandomProgrammer.ts +1195 -1190
  349. package/src/programmers/helpers/ProtobufWire.ts +34 -34
  350. package/src/programmers/internal/check_array_length.ts +43 -47
  351. package/src/programmers/internal/check_bigint.ts +46 -50
  352. package/src/programmers/internal/check_dynamic_key.ts +197 -201
  353. package/src/programmers/internal/check_dynamic_properties.ts +231 -237
  354. package/src/programmers/internal/check_everything.ts +21 -23
  355. package/src/programmers/internal/check_native.ts +23 -27
  356. package/src/programmers/internal/check_number.ts +108 -112
  357. package/src/programmers/internal/check_object.ts +72 -78
  358. package/src/programmers/internal/check_string.ts +46 -50
  359. package/src/programmers/internal/check_template.ts +46 -48
  360. package/src/programmers/internal/check_union_array_like.ts +331 -335
  361. package/src/programmers/internal/decode_union_object.ts +110 -116
  362. package/src/programmers/internal/feature_object_entries.ts +59 -61
  363. package/src/programmers/internal/json_schema_escaped.ts +78 -82
  364. package/src/programmers/internal/json_schema_object.ts +150 -158
  365. package/src/programmers/internal/json_schema_station.ts +2 -2
  366. package/src/programmers/internal/metadata_to_pattern.ts +40 -42
  367. package/src/programmers/internal/postfix_of_tuple.ts +3 -5
  368. package/src/programmers/internal/prune_object_properties.ts +69 -71
  369. package/src/programmers/internal/stringify_dynamic_properties.ts +158 -162
  370. package/src/programmers/internal/stringify_native.ts +5 -7
  371. package/src/programmers/internal/stringify_regular_properties.ts +77 -81
  372. package/src/programmers/internal/template_to_pattern.ts +21 -23
  373. package/src/programmers/internal/wrap_metadata_rest_tuple.ts +21 -23
  374. package/src/programmers/json/JsonStringifyProgrammer.ts +1124 -1124
  375. package/src/programmers/llm/LlmApplicationProgrammer.ts +10 -1
  376. package/src/programmers/llm/LlmSchemaProgrammer.ts +2 -7
  377. package/src/protobuf.ts +820 -861
  378. package/src/reflect.ts +46 -50
  379. package/src/schemas/json/IJsonApplication.ts +77 -77
  380. package/src/schemas/json/IJsonSchemaCollection.ts +212 -195
  381. package/src/schemas/json/IJsonSchemaUnit.ts +263 -250
  382. package/src/schemas/metadata/IMetadataTypeTag.ts +14 -16
  383. package/src/schemas/metadata/Metadata.ts +669 -687
  384. package/src/schemas/metadata/MetadataAliasType.ts +57 -63
  385. package/src/schemas/metadata/MetadataApplication.ts +40 -44
  386. package/src/schemas/metadata/MetadataArray.ts +47 -49
  387. package/src/schemas/metadata/MetadataArrayType.ts +51 -57
  388. package/src/schemas/metadata/MetadataAtomic.ts +85 -87
  389. package/src/schemas/metadata/MetadataEscaped.ts +45 -51
  390. package/src/schemas/metadata/MetadataFunction.ts +45 -49
  391. package/src/schemas/metadata/MetadataObject.ts +46 -48
  392. package/src/schemas/metadata/MetadataObjectType.ts +137 -149
  393. package/src/schemas/metadata/MetadataParameter.ts +52 -54
  394. package/src/schemas/metadata/MetadataProperty.ts +53 -59
  395. package/src/schemas/metadata/MetadataTemplate.ts +78 -80
  396. package/src/schemas/metadata/MetadataTuple.ts +28 -32
  397. package/src/schemas/metadata/MetadataTupleType.ts +61 -67
  398. package/src/tags/Constant.ts +47 -47
  399. package/src/tags/ContentMediaType.ts +27 -27
  400. package/src/tags/Default.ts +52 -52
  401. package/src/tags/Example.ts +56 -56
  402. package/src/tags/Examples.ts +56 -56
  403. package/src/tags/ExclusiveMaximum.ts +44 -41
  404. package/src/tags/ExclusiveMinimum.ts +44 -41
  405. package/src/tags/Format.ts +78 -74
  406. package/src/tags/JsonSchemaPlugin.ts +36 -34
  407. package/src/tags/MaxItems.ts +31 -31
  408. package/src/tags/MaxLength.ts +25 -24
  409. package/src/tags/Maximum.ts +39 -37
  410. package/src/tags/MinItems.ts +31 -31
  411. package/src/tags/MinLength.ts +25 -24
  412. package/src/tags/Minimum.ts +39 -37
  413. package/src/tags/MultipleOf.ts +42 -39
  414. package/src/tags/Pattern.ts +49 -46
  415. package/src/tags/Sequence.ts +37 -35
  416. package/src/tags/TagBase.ts +102 -109
  417. package/src/tags/Type.ts +64 -63
  418. package/src/tags/UniqueItems.ts +34 -33
  419. package/src/tags/internal/FormatCheatSheet.ts +71 -73
  420. package/src/transformers/ITransformOptions.ts +70 -62
  421. package/src/transformers/ImportTransformer.ts +253 -258
  422. package/src/transformers/NoTransformConfigurationError.ts +16 -18
  423. package/src/transformers/features/llm/LlmApplicationTransformer.ts +224 -226
  424. package/src/typings/Equal.ts +18 -18
package/src/json.ts CHANGED
@@ -1,696 +1,643 @@
1
- import { IJsonSchemaCollection } from "./schemas/json/IJsonSchemaCollection";
2
- import { IJsonSchemaUnit } from "./schemas/json/IJsonSchemaUnit";
3
-
4
- import { NoTransformConfigurationError } from "./transformers/NoTransformConfigurationError";
5
-
6
- import { IValidation } from "./IValidation";
7
- import { Primitive } from "./Primitive";
8
- import { TypeGuardError } from "./TypeGuardError";
9
-
10
- /* ===========================================================
11
- JSON
12
- - METADATA
13
- - PARSE
14
- - STRINGIFY
15
- - FACTORY FUNCTIONS
16
- ==============================================================
17
- METADATA
18
- ----------------------------------------------------------- */
19
- /**
20
- * > You must configure the generic argument `Types`.
21
- *
22
- * JSON Schemas Generator.
23
- *
24
- * Creates a JSON schema list which contains both main JSON schemas
25
- * and components. Note that, all of the named types are stored in the
26
- * {@link IJsonSchemaCollection.components} property for the `$ref` referencing.
27
- *
28
- * Also, you can specify the OpenAPI version by configuring the second generic
29
- * argument `Version`. For reference, the default version is `"3.1"`, and the key
30
- * difference between `"3.0"` and `"3.1"` is whether supporting the tuple type or not.
31
- *
32
- * @template Types Tuple of target types
33
- * @template Version Version of OpenAPI specification. Default is 3.1
34
- * @return JSON schema collection
35
- *
36
- * @author Jeongho Nam - https://github.com/samchon
37
- */
38
- export function schemas(): never;
39
-
40
- /**
41
- * JSON Schemas Generator.
42
- *
43
- * Creates a JSON schema list which contains both main JSON schemas
44
- * and components. Note that, all of the named types are stored in the
45
- * {@link IJsonSchemaCollection.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 the key
49
- * difference between `"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 collection
54
- *
55
- * @author Jeongho Nam - https://github.com/samchon
56
- */
57
- export function schemas<
58
- Types extends unknown[],
59
- Version extends "3.0" | "3.1" = "3.1",
60
- >(): IJsonSchemaCollection<Version, Types>;
61
-
62
- /**
63
- * @internal
64
- */
65
- export function schemas(): never {
66
- NoTransformConfigurationError("json.schemas");
67
- }
68
-
69
- /**
70
- * > You must configure the generic argument `Type`.
71
- *
72
- * JSON schema generator.
73
- *
74
- * Creates a JSON schema unit which contains a main JSON schema and
75
- * its components. Note that, all of the named types are stored in the
76
- * {@link IJsonSchemaUnit.components} property for the `$ref` referencing.
77
- *
78
- * Also, you can specify the OpenAPI version by configuring the second
79
- * generic argument `Version`. For reference, the default version is `"3.1"`,
80
- * and key different of `"3.0"` and `"3.1"` is whether supporting the
81
- * tuple type or not.
82
- *
83
- * @template Type Target type
84
- * @template Version Version of OpenAPI specification. Default is 3.1
85
- * @return JSON schema unit
86
- *
87
- * @author Jeongho Nam - https://github.com/samchon
88
- */
89
- export function schema(): never;
90
-
91
- /**
92
- * JSON schema generator.
93
- *
94
- * Creates a JSON schema unit which contains a main JSON schema and
95
- * its components. Note that, all of the named types are stored in the
96
- * {@link IJsonSchemaUnit.components} property for the `$ref` referencing.
97
- *
98
- * Also, you can specify the OpenAPI version by configuring the second
99
- * generic argument `Version`. For reference, the default version is `"3.1"`,
100
- * and key different of `"3.0"` and `"3.1"` is whether supporting the
101
- * tuple type or not.
102
- *
103
- * @template Type Target type
104
- * @template Version Version of OpenAPI specification. Default is 3.1
105
- * @return JSON schema unit
106
- *
107
- * @author Jeongho Nam - https://github.com/samchon
108
- */
109
- export function schema<
110
- Type extends unknown,
111
- Version extends "3.0" | "3.1" = "3.1",
112
- >(): IJsonSchemaUnit<Version, Type>;
113
-
114
- /**
115
- * @internal
116
- */
117
- export function schema(): never {
118
- NoTransformConfigurationError("json.schema");
119
- }
120
-
121
- /* -----------------------------------------------------------
122
- PARSE
123
- ----------------------------------------------------------- */
124
- /**
125
- * > You must configure the generic argument `T`.
126
- *
127
- * Safe `JSON.parse()` function with type assertion.
128
- *
129
- * `typia.json.assertParse()` is a combination function of `JSON.parse()` and
130
- * {@link assert}. Therefore, it converts a JSON (JavaScript Object Notation) string
131
- * to a `T` typed instance with type assertion.
132
- *
133
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
134
- * throws {@link TypeGuardError} or custom error generated by *errorFactory*. Otherwise,
135
- * if there's no problem with the parsed value, the parsed value will be returned.
136
- *
137
- * @template T Expected type of parsed value
138
- * @param input JSON string
139
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
140
- * @returns Parsed value
141
- *
142
- * @author Jeongho Nam - https://github.com/samchon
143
- */
144
- export function assertParse(
145
- input: string,
146
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
147
- ): never;
148
-
149
- /**
150
- * Safe `JSON.parse()` function with type assertion.
151
- *
152
- * `typia.json.assertParse()` is a combination function of `JSON.parse()` and
153
- * {@link assert}. Therefore, it converts a JSON (JavaScript Object Notation) string
154
- * to a `T` typed instance with type assertion.
155
- *
156
- * In such reason, when parsed JSON string value is not matched with the type `T`,
157
- * it throws {@link TypeGuardError} or custom error generated by *errorFactory*.
158
- * Otherwise, there's no problem on the parsed value, the parsed value would be
159
- * returned.
160
- *
161
- * @template T Expected type of parsed value
162
- * @param input JSON string
163
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
164
- * @returns Parsed value
165
- *
166
- * @author Jeongho Nam - https://github.com/samchon
167
- */
168
- export function assertParse<T>(
169
- input: string,
170
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
171
- ): Primitive<T>;
172
-
173
- /**
174
- * @internal
175
- */
176
- export function assertParse<T>(): Primitive<T> {
177
- NoTransformConfigurationError("json.assertParse");
178
- }
179
-
180
- /**
181
- * > You must configure the generic argument `T`.
182
- *
183
- * Safe `JSON.parse()` function with type checking.
184
- *
185
- * `typia.json.isParse()` is a combination function of `JSON.parse()` and {@link is}.
186
- * Therefore, it converts a JSON (JavaScript Object Notation) string to a `T` typed
187
- * instance with type checking.
188
- *
189
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
190
- * returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
191
- * value will be returned.
192
- *
193
- * @template T Expected type of parsed value
194
- * @param input JSON string
195
- * @returns Parsed value when exact type, otherwise `null`
196
- *
197
- * @author Jeongho Nam - https://github.com/samchon
198
- */
199
- export function isParse(input: string): never;
200
-
201
- /**
202
- * Safe `JSON.parse()` function with type checking.
203
- *
204
- * `typia.json.isParse()` is a combination function of `JSON.parse()` and {@link is}.
205
- * Therefore, it converts a JSON (JavaScript Object Notation) string to a `T` typed
206
- * instance with type checking.
207
- *
208
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
209
- * returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
210
- * value will be returned.
211
- *
212
- * @template T Expected type of parsed value
213
- * @param input JSON string
214
- * @returns Parsed value when exact type, otherwise `null`
215
- *
216
- * @author Jeongho Nam - https://github.com/samchon
217
- */
218
- export function isParse<T>(input: string): Primitive<T> | null;
219
-
220
- /**
221
- * @internal
222
- */
223
- export function isParse<T>(): Primitive<T> | null {
224
- NoTransformConfigurationError("json.isParse");
225
- }
226
-
227
- /**
228
- * > You must configure the generic argument `T`.
229
- *
230
- * Safe `JSON.parse()` function with detailed type validation.
231
- *
232
- * `typia.json.validateParse()` is a combination function of `JSON.parse()` and
233
- * {@link validate}. Therefore, it converts a JSON (JavaScript Object Notation) string
234
- * to a `T` typed instance with detailed type validation.
235
- *
236
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
237
- * returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
238
- * there's no problem on the parsed value, the parsed value will be stored in `data`
239
- * property of the output {@link IValidation.ISuccess} instance.
240
- *
241
- * @template T Expected type of parsed value
242
- * @param input JSON string
243
- * @returns Validation result with JSON parsed value
244
- *
245
- * @author Jeongho Nam - https://github.com/samchon
246
- */
247
- export function validateParse(input: string): never;
248
-
249
- /**
250
- * Safe `JSON.parse()` function with detailed type validation.
251
- *
252
- * `typia.json.validateParse()` is a combination function of `JSON.parse()` and
253
- * {@link validate}. Therefore, it converts a JSON (JavaScript Object Notation) string
254
- * to a `T` typed instance with detailed type validation.
255
- *
256
- * In such reason, when parsed JSON string value is not matched with the type `T`, it
257
- * returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
258
- * there's no problem on the parsed value, the parsed value will be stored in `data`
259
- * property of the output {@link IValidation.ISuccess} instance.
260
- *
261
- * @template T Expected type of parsed value
262
- * @param input JSON string
263
- * @returns Validation result with JSON parsed value
264
- *
265
- * @author Jeongho Nam - https://github.com/samchon
266
- */
267
- export function validateParse<T>(input: string): IValidation<Primitive<T>>;
268
-
269
- /**
270
- * @internal
271
- */
272
- export function validateParse<T>(): IValidation<Primitive<T>> {
273
- NoTransformConfigurationError("json.validateParse");
274
- }
275
-
276
- /* -----------------------------------------------------------
277
- STRINGIFY
278
- ----------------------------------------------------------- */
279
- /**
280
- * 8x faster `JSON.stringify()` function.
281
- *
282
- * Converts an input value to a JSON (JavaScript Object Notation) string, about 8x
283
- * faster than the native `JSON.stringify()` function. The 5x faster principle is
284
- * because it writes an optimized JSON conversion plan, only for the type `T`.
285
- *
286
- * For reference, this `typia.json.stringify()` does not validate the input value type.
287
- * It just believes that the input value is following the type `T`. Therefore, if you
288
- * can't ensure the input value type, it will be better to call one of below
289
- * functions instead.
290
- *
291
- * - {@link assertStringify}
292
- * - {@link isStringify}
293
- * - {@link validateStringify}
294
- *
295
- * @template T Type of the input value
296
- * @param input A value to be converted
297
- * @return JSON string value
298
- *
299
- * @author Jeongho Nam - https://github.com/samchon
300
- */
301
- export function stringify<T>(input: T): string;
302
-
303
- /**
304
- * @internal
305
- */
306
- export function stringify(): never {
307
- NoTransformConfigurationError("json.stringify");
308
- }
309
-
310
- /**
311
- * 5x faster `JSON.stringify()` function with type assertion.
312
- *
313
- * `typia.json.assertStringify()` is a combination function of {@link assert} and
314
- * {@link stringify}. Therefore, it converts an input value to
315
- * JSON (JavaScript Object Notation) string, with type assertion.
316
- *
317
- * In such reason, when `input` value is not matched with the type `T`, it throws an
318
- * {@link TypeGuardError} or custom error generated by *errorFactory*. Otherwise,
319
- * there's no problem on the `input` value, JSON string will be returned.
320
- *
321
- * For reference, with type assertion, it is even 5x times faster than the native
322
- * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
323
- * with confidence.
324
- *
325
- * @template T Type of the input value
326
- * @param input A value to be asserted and converted
327
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
328
- * @return JSON string value
329
- *
330
- * @author Jeongho Nam - https://github.com/samchon
331
- */
332
- export function assertStringify<T>(
333
- input: T,
334
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
335
- ): string;
336
-
337
- /**
338
- * 5x faster `JSON.stringify()` function with type assertion.
339
- *
340
- * `typia.json.assertStringify()` is a combination function of {@link assert} and
341
- * {@link stringify}. Therefore, it converts an input value to
342
- * JSON (JavaScript Object Notation) string, with type assertion.
343
- *
344
- * In such reason, when `input` value is not matched with the type `T`, it throws an
345
- * {@link TypeGuardError} or custom error generated by *errorFactory*. Otherwise,
346
- * there's no problem on the `input` value, JSON string will be returned.
347
- *
348
- * For reference, with type assertion, it is even 5x times faster than the native
349
- * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
350
- * with confidence.
351
- *
352
- * @template T Type of the input value
353
- * @param input A value to be asserted and converted
354
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
355
- * @return JSON string value
356
- *
357
- * @author Jeongho Nam - https://github.com/samchon
358
- */
359
- export function assertStringify<T>(
360
- input: T,
361
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
362
- ): unknown;
363
-
364
- /**
365
- * @internal
366
- */
367
- export function assertStringify(): string {
368
- NoTransformConfigurationError("json.assertStringify");
369
- }
370
-
371
- /**
372
- * 7x faster `JSON.stringify()` function with type checking.
373
- *
374
- * `typia.json.stringify()` is a combination function of {@link is} and
375
- * {@link stringify}. Therefore, it converts an input value to JSON
376
- * (JavaScript Object Notation) string, with type checking.
377
- *
378
- * In such reason, when `input` value is not matched with the type `T`, it returns
379
- * `null` value. Otherwise, there's no problem on the `input` value, JSON string
380
- * will be returned.
381
- *
382
- * For reference, with type checking, it is even 7x times faster than the native
383
- * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
384
- * with confidence.
385
- *
386
- * @template T Type of the input value
387
- * @param input A value to be checked and converted
388
- * @return JSON string value when exact type, otherwise null
389
- *
390
- * @author Jeongho Nam - https://github.com/samchon
391
- */
392
- export function isStringify<T>(input: T): string | null;
393
-
394
- /**
395
- * 7x faster `JSON.stringify()` function with type checking.
396
- *
397
- * `typia.json.isStringify()` is a combination function of {@link is} and
398
- * {@link stringify}. Therefore, it converts an input value to JSON
399
- * (JavaScript Object Notation) string, with type checking.
400
- *
401
- * In such reason, when `input` value is not matched with the type `T`, it returns
402
- * `null` value. Otherwise, there's no problem on the `input` value, JSON string
403
- * will be returned.
404
- *
405
- * For reference, with type checking, it is even 7x times faster than the native
406
- * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
407
- * with confidence.
408
- *
409
- * @template T Type of the input value
410
- * @param input A value to be checked and converted
411
- * @return JSON string value when exact type, otherwise null
412
- *
413
- * @author Jeongho Nam - https://github.com/samchon
414
- */
415
- export function isStringify<T>(input: unknown): string | null;
416
-
417
- /**
418
- * @internal
419
- */
420
- export function isStringify(): string | null {
421
- NoTransformConfigurationError("json.isStringify");
422
- }
423
-
424
- /**
425
- * 5x faster `JSON.stringify()` function with detailed type validation.
426
- *
427
- * `typia.json.validateStringify()` is a combination function of {@link validate} and
428
- * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
429
- * Notation) string, with detailed type validation.
430
- *
431
- * In such reason, when `input` value is not matched with the type `T`, it returns
432
- * {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
433
- * there's no problem on the `input` value, JSON string will be stored in `data`
434
- * property of the output {@link IValidation.ISuccess} instance.
435
- *
436
- * For reference, with detailed type validation, it is even 5x times faster than the
437
- * native `JSON.stringify()` function. So, just enjoy the safe and fast JSON
438
- * conversion with confidence.
439
- *
440
- * @template T Type of the input value
441
- * @param input A value to be checked and converted
442
- * @returns Validation result with JSON string value
443
- *
444
- * @author Jeongho Nam - https://github.com/samchon
445
- */
446
- export function validateStringify<T>(input: T): IValidation<string>;
447
-
448
- /**
449
- * 5x faster `JSON.stringify()` function with detailed type validation.
450
- *
451
- * `typia.json.validateStringify()` is a combination function of {@link validate} and
452
- * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
453
- * Notation) string, with detailed type validation.
454
- *
455
- * In such reason, when `input` value is not matched with the type `T`, it returns
456
- * {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
457
- * there's no problem on the `input` value, JSON string will be stored in `data`
458
- * property of the output {@link IValidation.ISuccess} instance.
459
- *
460
- * For reference, with detailed type validation, it is even 5x times faster than the
461
- * native `JSON.stringify()` function. So, just enjoy the safe and fast JSON
462
- * conversion with confidence.
463
- *
464
- * @template T Type of the input value
465
- * @param input A value to be checked and converted
466
- * @returns Validation result with JSON string value
467
- *
468
- * @author Jeongho Nam - https://github.com/samchon
469
- */
470
- export function validateStringify<T>(input: unknown): IValidation<string>;
471
-
472
- /**
473
- * @internal
474
- */
475
- export function validateStringify(): IValidation<string> {
476
- NoTransformConfigurationError("json.validateStringify");
477
- }
478
-
479
- /* -----------------------------------------------------------
480
- FACTORY FUNCTIONS
481
- ----------------------------------------------------------- */
482
- /**
483
- * Creates a reusable {@link isParse} function.
484
- *
485
- * @danger You must configure the generic argument `T`
486
- * @returns Nothing until you configure the generic argument `T`
487
- * @throws compile error
488
- *
489
- * @author Jeongho Nam - https://github.com/samchon
490
- */
491
- export function createIsParse(): never;
492
-
493
- /**
494
- * Creates a reusable {@link isParse} function.
495
- *
496
- * @template T Expected type of parsed value
497
- * @returns A reusable `isParse` function
498
- *
499
- * @author Jeongho Nam - https://github.com/samchon
500
- */
501
- export function createIsParse<T>(): (input: string) => Primitive<T> | null;
502
-
503
- /**
504
- * @internal
505
- */
506
- export function createIsParse<T>(): (input: string) => Primitive<T> | null {
507
- NoTransformConfigurationError("json.createIsParse");
508
- }
509
-
510
- /**
511
- * Creates a reusable {@link assertParse} function.
512
- *
513
- * @danger You must configure the generic argument `T`
514
- * @returns Nothing until you configure the generic argument `T`
515
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
516
- * @throws compile error
517
- *
518
- * @author Jeongho Nam - https://github.com/samchon
519
- */
520
- export function createAssertParse(
521
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
522
- ): never;
523
-
524
- /**
525
- * Creates a reusable {@link assertParse} function.
526
- *
527
- * @template T Expected type of parsed value
528
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
529
- * @returns A reusable `assertParse` function
530
- *
531
- * @author Jeongho Nam - https://github.com/samchon
532
- */
533
- export function createAssertParse<T>(
534
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
535
- ): (input: string) => Primitive<T>;
536
-
537
- /**
538
- * @internal
539
- */
540
- export function createAssertParse<T>(): (input: string) => Primitive<T> {
541
- NoTransformConfigurationError("json.createAssertParse");
542
- }
543
-
544
- /**
545
- * Creates a reusable {@link validateParse} function.
546
- *
547
- * @danger You must configure the generic argument `T`
548
- * @returns Nothing until you configure the generic argument `T`
549
- * @throws compile error
550
- *
551
- * @author Jeongho Nam - https://github.com/samchon
552
- */
553
- export function createValidateParse(): never;
554
-
555
- /**
556
- * Creates a reusable {@link validateParse} function.
557
- *
558
- * @template T Expected type of parsed value
559
- * @returns A reusable `validateParse` function
560
- *
561
- * @author Jeongho Nam - https://github.com/samchon
562
- */
563
- export function createValidateParse<T>(): (
564
- input: string,
565
- ) => IValidation<Primitive<T>>;
566
-
567
- /**
568
- * @internal
569
- */
570
- export function createValidateParse<T>(): (
571
- input: string,
572
- ) => IValidation<Primitive<T>> {
573
- NoTransformConfigurationError("json.createValidateParse");
574
- }
575
-
576
- /**
577
- * Creates a reusable {@link stringify} function.
578
- *
579
- * @danger You must configure the generic argument `T`
580
- * @returns Nothing until you configure the generic argument `T`
581
- * @throws compile error
582
- *
583
- * @author Jeongho Nam - https://github.com/samchon
584
- */
585
- export function createStringify(): never;
586
-
587
- /**
588
- * Creates a reusable {@link stringify} function.
589
- *
590
- * @template T Type of the input value
591
- * @returns A reusable `stringify` function
592
- *
593
- * @author Jeongho Nam - https://github.com/samchon
594
- */
595
- export function createStringify<T>(): (input: T) => string;
596
-
597
- /**
598
- * @internal
599
- */
600
- export function createStringify<T>(): (input: T) => string {
601
- NoTransformConfigurationError("json.createStringify");
602
- }
603
-
604
- /**
605
- * Creates a reusable {@link assertStringify} function.
606
- *
607
- * @danger You must configure the generic argument `T`
608
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
609
- * @returns Nothing until you configure the generic argument `T`
610
- * @throws compile error
611
- *
612
- * @author Jeongho Nam - https://github.com/samchon
613
- */
614
- export function createAssertStringify(
615
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
616
- ): never;
617
-
618
- /**
619
- * Creates a reusable {@link assertStringify} function.
620
- *
621
- * @template T Type of the input value
622
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
623
- * @returns A reusable `assertStringify` function
624
- *
625
- * @author Jeongho Nam - https://github.com/samchon
626
- */
627
- export function createAssertStringify<T>(
628
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
629
- ): (input: unknown) => string;
630
-
631
- /**
632
- * @internal
633
- */
634
- export function createAssertStringify(): (input: unknown) => string {
635
- NoTransformConfigurationError("json.createAssertStringify");
636
- }
637
-
638
- /**
639
- * Creates a reusable {@link isStringify} function.
640
- *
641
- * @danger You must configure the generic argument `T`
642
- * @returns Nothing until you configure the generic argument `T`
643
- * @throws compile error
644
- *
645
- * @author Jeongho Nam - https://github.com/samchon
646
- */
647
- export function createIsStringify(): never;
648
-
649
- /**
650
- * Creates a reusable {@link isStringify} function.
651
- *
652
- * @template T Type of the input value
653
- * @returns A reusable `isStringify` function
654
- *
655
- * @author Jeongho Nam - https://github.com/samchon
656
- */
657
- export function createIsStringify<T>(): (input: unknown) => string | null;
658
-
659
- /**
660
- * @internal
661
- */
662
- export function createIsStringify(): (input: unknown) => string | null {
663
- NoTransformConfigurationError("json.createIsStringify");
664
- }
665
-
666
- /**
667
- * Creates a reusable {@link validateStringify} function.
668
- *
669
- * @danger You must configure the generic argument `T`
670
- * @returns Nothing until you configure the generic argument `T`
671
- * @throws compile error
672
- *
673
- * @author Jeongho Nam - https://github.com/samchon
674
- */
675
- export function createValidateStringify(): never;
676
-
677
- /**
678
- * Creates a reusable {@link validateStringify} function.
679
- *
680
- * @template T Type of the input value
681
- * @returns A reusable `validateStringify` function
682
-
683
- * @author Jeongho Nam - https://github.com/samchon
684
- */
685
- export function createValidateStringify<T>(): (
686
- input: unknown,
687
- ) => IValidation<string>;
688
-
689
- /**
690
- * @internal
691
- */
692
- export function createValidateStringify(): (
693
- input: unknown,
694
- ) => IValidation<string> {
695
- NoTransformConfigurationError("json.createValidateStringify");
696
- }
1
+ import { IJsonSchemaCollection } from "./schemas/json/IJsonSchemaCollection";
2
+ import { IJsonSchemaUnit } from "./schemas/json/IJsonSchemaUnit";
3
+
4
+ import { NoTransformConfigurationError } from "./transformers/NoTransformConfigurationError";
5
+
6
+ import { IValidation } from "./IValidation";
7
+ import { Primitive } from "./Primitive";
8
+ import { TypeGuardError } from "./TypeGuardError";
9
+
10
+ /* ===========================================================
11
+ JSON
12
+ - METADATA
13
+ - PARSE
14
+ - STRINGIFY
15
+ - FACTORY FUNCTIONS
16
+ ==============================================================
17
+ METADATA
18
+ ----------------------------------------------------------- */
19
+ /**
20
+ * > You must configure the generic argument `Types`.
21
+ *
22
+ * JSON Schemas Generator.
23
+ *
24
+ * Creates a JSON schema list which contains both main JSON schemas and
25
+ * components. Note that, all of the named types are stored in the
26
+ * {@link IJsonSchemaCollection.components} property for the `$ref` referencing.
27
+ *
28
+ * Also, you can specify the OpenAPI version by configuring the second generic
29
+ * argument `Version`. For reference, the default version is `"3.1"`, and the
30
+ * key difference between `"3.0"` and `"3.1"` is whether supporting the tuple
31
+ * type or not.
32
+ *
33
+ * @author Jeongho Nam - https://github.com/samchon
34
+ * @template Types Tuple of target types
35
+ * @template Version Version of OpenAPI specification. Default is 3.1
36
+ * @returns JSON schema collection
37
+ */
38
+ export function schemas(): never;
39
+
40
+ /**
41
+ * JSON Schemas Generator.
42
+ *
43
+ * Creates a JSON schema list which contains both main JSON schemas and
44
+ * components. Note that, all of the named types are stored in the
45
+ * {@link IJsonSchemaCollection.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 the
49
+ * key difference between `"3.0"` and `"3.1"` is whether supporting the tuple
50
+ * type or not.
51
+ *
52
+ * @author Jeongho Nam - https://github.com/samchon
53
+ * @template Types Tuple of target types
54
+ * @template Version Version of OpenAPI specification. Default is 3.1
55
+ * @returns JSON schema collection
56
+ */
57
+ export function schemas<
58
+ Types extends unknown[],
59
+ Version extends "3.0" | "3.1" = "3.1",
60
+ >(): IJsonSchemaCollection<Version, Types>;
61
+
62
+ /** @internal */
63
+ export function schemas(): never {
64
+ NoTransformConfigurationError("json.schemas");
65
+ }
66
+
67
+ /**
68
+ * > You must configure the generic argument `Type`.
69
+ *
70
+ * JSON schema generator.
71
+ *
72
+ * Creates a JSON schema unit which contains a main JSON schema and its
73
+ * components. Note that, all of the named types are stored in the
74
+ * {@link IJsonSchemaUnit.components} property for the `$ref` referencing.
75
+ *
76
+ * Also, you can specify the OpenAPI version by configuring the second generic
77
+ * argument `Version`. For reference, the default version is `"3.1"`, and key
78
+ * different of `"3.0"` and `"3.1"` is whether supporting the tuple type or
79
+ * not.
80
+ *
81
+ * @author Jeongho Nam - https://github.com/samchon
82
+ * @template Type Target type
83
+ * @template Version Version of OpenAPI specification. Default is 3.1
84
+ * @returns JSON schema unit
85
+ */
86
+ export function schema(): never;
87
+
88
+ /**
89
+ * JSON schema generator.
90
+ *
91
+ * Creates a JSON schema unit which contains a main JSON schema and its
92
+ * components. Note that, all of the named types are stored in the
93
+ * {@link IJsonSchemaUnit.components} property for the `$ref` referencing.
94
+ *
95
+ * Also, you can specify the OpenAPI version by configuring the second generic
96
+ * argument `Version`. For reference, the default version is `"3.1"`, and key
97
+ * different of `"3.0"` and `"3.1"` is whether supporting the tuple type or
98
+ * not.
99
+ *
100
+ * @author Jeongho Nam - https://github.com/samchon
101
+ * @template Type Target type
102
+ * @template Version Version of OpenAPI specification. Default is 3.1
103
+ * @returns JSON schema unit
104
+ */
105
+ export function schema<
106
+ Type extends unknown,
107
+ Version extends "3.0" | "3.1" = "3.1",
108
+ >(): IJsonSchemaUnit<Version, Type>;
109
+
110
+ /** @internal */
111
+ export function schema(): never {
112
+ NoTransformConfigurationError("json.schema");
113
+ }
114
+
115
+ /* -----------------------------------------------------------
116
+ PARSE
117
+ ----------------------------------------------------------- */
118
+ /**
119
+ * > You must configure the generic argument `T`.
120
+ *
121
+ * Safe `JSON.parse()` function with type assertion.
122
+ *
123
+ * `typia.json.assertParse()` is a combination function of `JSON.parse()` and
124
+ * {@link assert}. Therefore, it converts a JSON (JavaScript Object Notation)
125
+ * string to a `T` typed instance with type assertion.
126
+ *
127
+ * In such reason, when parsed JSON string value is not matched with the type
128
+ * `T`, it throws {@link TypeGuardError} or custom error generated by
129
+ * _errorFactory_. Otherwise, if there's no problem with the parsed value, the
130
+ * parsed value will be returned.
131
+ *
132
+ * @author Jeongho Nam - https://github.com/samchon
133
+ * @template T Expected type of parsed value
134
+ * @param input JSON string
135
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
136
+ * @returns Parsed value
137
+ */
138
+ export function assertParse(
139
+ input: string,
140
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
141
+ ): never;
142
+
143
+ /**
144
+ * Safe `JSON.parse()` function with type assertion.
145
+ *
146
+ * `typia.json.assertParse()` is a combination function of `JSON.parse()` and
147
+ * {@link assert}. Therefore, it converts a JSON (JavaScript Object Notation)
148
+ * string to a `T` typed instance with type assertion.
149
+ *
150
+ * In such reason, when parsed JSON string value is not matched with the type
151
+ * `T`, it throws {@link TypeGuardError} or custom error generated by
152
+ * _errorFactory_. Otherwise, there's no problem on the parsed value, the parsed
153
+ * value would be returned.
154
+ *
155
+ * @author Jeongho Nam - https://github.com/samchon
156
+ * @template T Expected type of parsed value
157
+ * @param input JSON string
158
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
159
+ * @returns Parsed value
160
+ */
161
+ export function assertParse<T>(
162
+ input: string,
163
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
164
+ ): Primitive<T>;
165
+
166
+ /** @internal */
167
+ export function assertParse<T>(): Primitive<T> {
168
+ NoTransformConfigurationError("json.assertParse");
169
+ }
170
+
171
+ /**
172
+ * > You must configure the generic argument `T`.
173
+ *
174
+ * Safe `JSON.parse()` function with type checking.
175
+ *
176
+ * `typia.json.isParse()` is a combination function of `JSON.parse()` and
177
+ * {@link is}. Therefore, it converts a JSON (JavaScript Object Notation) string
178
+ * to a `T` typed instance with type checking.
179
+ *
180
+ * In such reason, when parsed JSON string value is not matched with the type
181
+ * `T`, it returns `null` value. Otherwise, there's no problem on the parsed
182
+ * value, the parsed value will be returned.
183
+ *
184
+ * @author Jeongho Nam - https://github.com/samchon
185
+ * @template T Expected type of parsed value
186
+ * @param input JSON string
187
+ * @returns Parsed value when exact type, otherwise `null`
188
+ */
189
+ export function isParse(input: string): never;
190
+
191
+ /**
192
+ * Safe `JSON.parse()` function with type checking.
193
+ *
194
+ * `typia.json.isParse()` is a combination function of `JSON.parse()` and
195
+ * {@link is}. Therefore, it converts a JSON (JavaScript Object Notation) string
196
+ * to a `T` typed instance with type checking.
197
+ *
198
+ * In such reason, when parsed JSON string value is not matched with the type
199
+ * `T`, it returns `null` value. Otherwise, there's no problem on the parsed
200
+ * value, the parsed value will be returned.
201
+ *
202
+ * @author Jeongho Nam - https://github.com/samchon
203
+ * @template T Expected type of parsed value
204
+ * @param input JSON string
205
+ * @returns Parsed value when exact type, otherwise `null`
206
+ */
207
+ export function isParse<T>(input: string): Primitive<T> | null;
208
+
209
+ /** @internal */
210
+ export function isParse<T>(): Primitive<T> | null {
211
+ NoTransformConfigurationError("json.isParse");
212
+ }
213
+
214
+ /**
215
+ * > You must configure the generic argument `T`.
216
+ *
217
+ * Safe `JSON.parse()` function with detailed type validation.
218
+ *
219
+ * `typia.json.validateParse()` is a combination function of `JSON.parse()` and
220
+ * {@link validate}. Therefore, it converts a JSON (JavaScript Object Notation)
221
+ * string to a `T` typed instance with detailed type validation.
222
+ *
223
+ * In such reason, when parsed JSON string value is not matched with the type
224
+ * `T`, it returns {@link IValidation.IFailure} value with detailed error
225
+ * reasons. Otherwise, there's no problem on the parsed value, the parsed value
226
+ * will be stored in `data` property of the output {@link IValidation.ISuccess}
227
+ * instance.
228
+ *
229
+ * @author Jeongho Nam - https://github.com/samchon
230
+ * @template T Expected type of parsed value
231
+ * @param input JSON string
232
+ * @returns Validation result with JSON parsed value
233
+ */
234
+ export function validateParse(input: string): never;
235
+
236
+ /**
237
+ * Safe `JSON.parse()` function with detailed type validation.
238
+ *
239
+ * `typia.json.validateParse()` is a combination function of `JSON.parse()` and
240
+ * {@link validate}. Therefore, it converts a JSON (JavaScript Object Notation)
241
+ * string to a `T` typed instance with detailed type validation.
242
+ *
243
+ * In such reason, when parsed JSON string value is not matched with the type
244
+ * `T`, it returns {@link IValidation.IFailure} value with detailed error
245
+ * reasons. Otherwise, there's no problem on the parsed value, the parsed value
246
+ * will be stored in `data` property of the output {@link IValidation.ISuccess}
247
+ * instance.
248
+ *
249
+ * @author Jeongho Nam - https://github.com/samchon
250
+ * @template T Expected type of parsed value
251
+ * @param input JSON string
252
+ * @returns Validation result with JSON parsed value
253
+ */
254
+ export function validateParse<T>(input: string): IValidation<Primitive<T>>;
255
+
256
+ /** @internal */
257
+ export function validateParse<T>(): IValidation<Primitive<T>> {
258
+ NoTransformConfigurationError("json.validateParse");
259
+ }
260
+
261
+ /* -----------------------------------------------------------
262
+ STRINGIFY
263
+ ----------------------------------------------------------- */
264
+ /**
265
+ * 8x faster `JSON.stringify()` function.
266
+ *
267
+ * Converts an input value to a JSON (JavaScript Object Notation) string, about
268
+ * 8x faster than the native `JSON.stringify()` function. The 5x faster
269
+ * principle is because it writes an optimized JSON conversion plan, only for
270
+ * the type `T`.
271
+ *
272
+ * For reference, this `typia.json.stringify()` does not validate the input
273
+ * value type. It just believes that the input value is following the type `T`.
274
+ * Therefore, if you can't ensure the input value type, it will be better to
275
+ * call one of below functions instead.
276
+ *
277
+ * - {@link assertStringify}
278
+ * - {@link isStringify}
279
+ * - {@link validateStringify}
280
+ *
281
+ * @author Jeongho Nam - https://github.com/samchon
282
+ * @template T Type of the input value
283
+ * @param input A value to be converted
284
+ * @returns JSON string value
285
+ */
286
+ export function stringify<T>(input: T): string;
287
+
288
+ /** @internal */
289
+ export function stringify(): never {
290
+ NoTransformConfigurationError("json.stringify");
291
+ }
292
+
293
+ /**
294
+ * 5x faster `JSON.stringify()` function with type assertion.
295
+ *
296
+ * `typia.json.assertStringify()` is a combination function of {@link assert} and
297
+ * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript
298
+ * Object Notation) string, with type assertion.
299
+ *
300
+ * In such reason, when `input` value is not matched with the type `T`, it
301
+ * throws an {@link TypeGuardError} or custom error generated by _errorFactory_.
302
+ * Otherwise, there's no problem on the `input` value, JSON string will be
303
+ * returned.
304
+ *
305
+ * For reference, with type assertion, it is even 5x times faster than the
306
+ * native `JSON.stringify()` function. So, just enjoy the safe and fast JSON
307
+ * conversion with confidence.
308
+ *
309
+ * @author Jeongho Nam - https://github.com/samchon
310
+ * @template T Type of the input value
311
+ * @param input A value to be asserted and converted
312
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
313
+ * @returns JSON string value
314
+ */
315
+ export function assertStringify<T>(
316
+ input: T,
317
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
318
+ ): string;
319
+
320
+ /**
321
+ * 5x faster `JSON.stringify()` function with type assertion.
322
+ *
323
+ * `typia.json.assertStringify()` is a combination function of {@link assert} and
324
+ * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript
325
+ * Object Notation) string, with type assertion.
326
+ *
327
+ * In such reason, when `input` value is not matched with the type `T`, it
328
+ * throws an {@link TypeGuardError} or custom error generated by _errorFactory_.
329
+ * Otherwise, there's no problem on the `input` value, JSON string will be
330
+ * returned.
331
+ *
332
+ * For reference, with type assertion, it is even 5x times faster than the
333
+ * native `JSON.stringify()` function. So, just enjoy the safe and fast JSON
334
+ * conversion with confidence.
335
+ *
336
+ * @author Jeongho Nam - https://github.com/samchon
337
+ * @template T Type of the input value
338
+ * @param input A value to be asserted and converted
339
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
340
+ * @returns JSON string value
341
+ */
342
+ export function assertStringify<T>(
343
+ input: T,
344
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
345
+ ): unknown;
346
+
347
+ /** @internal */
348
+ export function assertStringify(): string {
349
+ NoTransformConfigurationError("json.assertStringify");
350
+ }
351
+
352
+ /**
353
+ * 7x faster `JSON.stringify()` function with type checking.
354
+ *
355
+ * `typia.json.stringify()` is a combination function of {@link is} and
356
+ * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript
357
+ * Object Notation) string, with type checking.
358
+ *
359
+ * In such reason, when `input` value is not matched with the type `T`, it
360
+ * returns `null` value. Otherwise, there's no problem on the `input` value,
361
+ * JSON string will be returned.
362
+ *
363
+ * For reference, with type checking, it is even 7x times faster than the native
364
+ * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
365
+ * with confidence.
366
+ *
367
+ * @author Jeongho Nam - https://github.com/samchon
368
+ * @template T Type of the input value
369
+ * @param input A value to be checked and converted
370
+ * @returns JSON string value when exact type, otherwise null
371
+ */
372
+ export function isStringify<T>(input: T): string | null;
373
+
374
+ /**
375
+ * 7x faster `JSON.stringify()` function with type checking.
376
+ *
377
+ * `typia.json.isStringify()` is a combination function of {@link is} and
378
+ * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript
379
+ * Object Notation) string, with type checking.
380
+ *
381
+ * In such reason, when `input` value is not matched with the type `T`, it
382
+ * returns `null` value. Otherwise, there's no problem on the `input` value,
383
+ * JSON string will be returned.
384
+ *
385
+ * For reference, with type checking, it is even 7x times faster than the native
386
+ * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
387
+ * with confidence.
388
+ *
389
+ * @author Jeongho Nam - https://github.com/samchon
390
+ * @template T Type of the input value
391
+ * @param input A value to be checked and converted
392
+ * @returns JSON string value when exact type, otherwise null
393
+ */
394
+ export function isStringify<T>(input: unknown): string | null;
395
+
396
+ /** @internal */
397
+ export function isStringify(): string | null {
398
+ NoTransformConfigurationError("json.isStringify");
399
+ }
400
+
401
+ /**
402
+ * 5x faster `JSON.stringify()` function with detailed type validation.
403
+ *
404
+ * `typia.json.validateStringify()` is a combination function of {@link validate}
405
+ * and {@link stringify}. Therefore, it converts an input value to JSON
406
+ * (JavaScript Object Notation) string, with detailed type validation.
407
+ *
408
+ * In such reason, when `input` value is not matched with the type `T`, it
409
+ * returns {@link IValidation.IFailure} value with detailed error reasons.
410
+ * Otherwise, there's no problem on the `input` value, JSON string will be
411
+ * stored in `data` property of the output {@link IValidation.ISuccess}
412
+ * instance.
413
+ *
414
+ * For reference, with detailed type validation, it is even 5x times faster than
415
+ * the native `JSON.stringify()` function. So, just enjoy the safe and fast JSON
416
+ * conversion with confidence.
417
+ *
418
+ * @author Jeongho Nam - https://github.com/samchon
419
+ * @template T Type of the input value
420
+ * @param input A value to be checked and converted
421
+ * @returns Validation result with JSON string value
422
+ */
423
+ export function validateStringify<T>(input: T): IValidation<string>;
424
+
425
+ /**
426
+ * 5x faster `JSON.stringify()` function with detailed type validation.
427
+ *
428
+ * `typia.json.validateStringify()` is a combination function of {@link validate}
429
+ * and {@link stringify}. Therefore, it converts an input value to JSON
430
+ * (JavaScript Object Notation) string, with detailed type validation.
431
+ *
432
+ * In such reason, when `input` value is not matched with the type `T`, it
433
+ * returns {@link IValidation.IFailure} value with detailed error reasons.
434
+ * Otherwise, there's no problem on the `input` value, JSON string will be
435
+ * stored in `data` property of the output {@link IValidation.ISuccess}
436
+ * instance.
437
+ *
438
+ * For reference, with detailed type validation, it is even 5x times faster than
439
+ * the native `JSON.stringify()` function. So, just enjoy the safe and fast JSON
440
+ * conversion with confidence.
441
+ *
442
+ * @author Jeongho Nam - https://github.com/samchon
443
+ * @template T Type of the input value
444
+ * @param input A value to be checked and converted
445
+ * @returns Validation result with JSON string value
446
+ */
447
+ export function validateStringify<T>(input: unknown): IValidation<string>;
448
+
449
+ /** @internal */
450
+ export function validateStringify(): IValidation<string> {
451
+ NoTransformConfigurationError("json.validateStringify");
452
+ }
453
+
454
+ /* -----------------------------------------------------------
455
+ FACTORY FUNCTIONS
456
+ ----------------------------------------------------------- */
457
+ /**
458
+ * Creates a reusable {@link isParse} function.
459
+ *
460
+ * @author Jeongho Nam - https://github.com/samchon
461
+ * @returns Nothing until you configure the generic argument `T`
462
+ * @throws Compile error
463
+ * @danger You must configure the generic argument `T`
464
+ */
465
+ export function createIsParse(): never;
466
+
467
+ /**
468
+ * Creates a reusable {@link isParse} function.
469
+ *
470
+ * @author Jeongho Nam - https://github.com/samchon
471
+ * @template T Expected type of parsed value
472
+ * @returns A reusable `isParse` function
473
+ */
474
+ export function createIsParse<T>(): (input: string) => Primitive<T> | null;
475
+
476
+ /** @internal */
477
+ export function createIsParse<T>(): (input: string) => Primitive<T> | null {
478
+ NoTransformConfigurationError("json.createIsParse");
479
+ }
480
+
481
+ /**
482
+ * Creates a reusable {@link assertParse} function.
483
+ *
484
+ * @author Jeongho Nam - https://github.com/samchon
485
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
486
+ * @returns Nothing until you configure the generic argument `T`
487
+ * @throws Compile error
488
+ * @danger You must configure the generic argument `T`
489
+ */
490
+ export function createAssertParse(
491
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
492
+ ): never;
493
+
494
+ /**
495
+ * Creates a reusable {@link assertParse} function.
496
+ *
497
+ * @author Jeongho Nam - https://github.com/samchon
498
+ * @template T Expected type of parsed value
499
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
500
+ * @returns A reusable `assertParse` function
501
+ */
502
+ export function createAssertParse<T>(
503
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
504
+ ): (input: string) => Primitive<T>;
505
+
506
+ /** @internal */
507
+ export function createAssertParse<T>(): (input: string) => Primitive<T> {
508
+ NoTransformConfigurationError("json.createAssertParse");
509
+ }
510
+
511
+ /**
512
+ * Creates a reusable {@link validateParse} function.
513
+ *
514
+ * @author Jeongho Nam - https://github.com/samchon
515
+ * @returns Nothing until you configure the generic argument `T`
516
+ * @throws Compile error
517
+ * @danger You must configure the generic argument `T`
518
+ */
519
+ export function createValidateParse(): never;
520
+
521
+ /**
522
+ * Creates a reusable {@link validateParse} function.
523
+ *
524
+ * @author Jeongho Nam - https://github.com/samchon
525
+ * @template T Expected type of parsed value
526
+ * @returns A reusable `validateParse` function
527
+ */
528
+ export function createValidateParse<T>(): (
529
+ input: string,
530
+ ) => IValidation<Primitive<T>>;
531
+
532
+ /** @internal */
533
+ export function createValidateParse<T>(): (
534
+ input: string,
535
+ ) => IValidation<Primitive<T>> {
536
+ NoTransformConfigurationError("json.createValidateParse");
537
+ }
538
+
539
+ /**
540
+ * Creates a reusable {@link stringify} function.
541
+ *
542
+ * @author Jeongho Nam - https://github.com/samchon
543
+ * @returns Nothing until you configure the generic argument `T`
544
+ * @throws Compile error
545
+ * @danger You must configure the generic argument `T`
546
+ */
547
+ export function createStringify(): never;
548
+
549
+ /**
550
+ * Creates a reusable {@link stringify} function.
551
+ *
552
+ * @author Jeongho Nam - https://github.com/samchon
553
+ * @template T Type of the input value
554
+ * @returns A reusable `stringify` function
555
+ */
556
+ export function createStringify<T>(): (input: T) => string;
557
+
558
+ /** @internal */
559
+ export function createStringify<T>(): (input: T) => string {
560
+ NoTransformConfigurationError("json.createStringify");
561
+ }
562
+
563
+ /**
564
+ * Creates a reusable {@link assertStringify} function.
565
+ *
566
+ * @author Jeongho Nam - https://github.com/samchon
567
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
568
+ * @returns Nothing until you configure the generic argument `T`
569
+ * @throws Compile error
570
+ * @danger You must configure the generic argument `T`
571
+ */
572
+ export function createAssertStringify(
573
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
574
+ ): never;
575
+
576
+ /**
577
+ * Creates a reusable {@link assertStringify} function.
578
+ *
579
+ * @author Jeongho Nam - https://github.com/samchon
580
+ * @template T Type of the input value
581
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
582
+ * @returns A reusable `assertStringify` function
583
+ */
584
+ export function createAssertStringify<T>(
585
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
586
+ ): (input: unknown) => string;
587
+
588
+ /** @internal */
589
+ export function createAssertStringify(): (input: unknown) => string {
590
+ NoTransformConfigurationError("json.createAssertStringify");
591
+ }
592
+
593
+ /**
594
+ * Creates a reusable {@link isStringify} function.
595
+ *
596
+ * @author Jeongho Nam - https://github.com/samchon
597
+ * @returns Nothing until you configure the generic argument `T`
598
+ * @throws Compile error
599
+ * @danger You must configure the generic argument `T`
600
+ */
601
+ export function createIsStringify(): never;
602
+
603
+ /**
604
+ * Creates a reusable {@link isStringify} function.
605
+ *
606
+ * @author Jeongho Nam - https://github.com/samchon
607
+ * @template T Type of the input value
608
+ * @returns A reusable `isStringify` function
609
+ */
610
+ export function createIsStringify<T>(): (input: unknown) => string | null;
611
+
612
+ /** @internal */
613
+ export function createIsStringify(): (input: unknown) => string | null {
614
+ NoTransformConfigurationError("json.createIsStringify");
615
+ }
616
+
617
+ /**
618
+ * Creates a reusable {@link validateStringify} function.
619
+ *
620
+ * @author Jeongho Nam - https://github.com/samchon
621
+ * @returns Nothing until you configure the generic argument `T`
622
+ * @throws Compile error
623
+ * @danger You must configure the generic argument `T`
624
+ */
625
+ export function createValidateStringify(): never;
626
+
627
+ /**
628
+ * Creates a reusable {@link validateStringify} function.
629
+ *
630
+ * @author Jeongho Nam - https://github.com/samchon
631
+ * @template T Type of the input value
632
+ * @returns A reusable `validateStringify` function
633
+ */
634
+ export function createValidateStringify<T>(): (
635
+ input: unknown,
636
+ ) => IValidation<string>;
637
+
638
+ /** @internal */
639
+ export function createValidateStringify(): (
640
+ input: unknown,
641
+ ) => IValidation<string> {
642
+ NoTransformConfigurationError("json.createValidateStringify");
643
+ }