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
@@ -1,41 +1,44 @@
1
- import { TagBase } from "./TagBase";
2
-
3
- /**
4
- * Exclusive minimum value constraint tag.
5
- *
6
- * Enforces that a numeric value must be strictly greater than the specified minimum (not equal).
7
- * This constraint validates that the input value satisfies: input > minimum.
8
- *
9
- * Example usage:
10
- * ```typescript
11
- * type PositiveNumber = number & tags.ExclusiveMinimum<0>; // Must be > 0
12
- * type LargeCount = bigint & tags.ExclusiveMinimum<999n>; // Must be > 999
13
- * ```
14
- *
15
- * Note: This tag is mutually exclusive with Minimum. You cannot apply both
16
- * ExclusiveMinimum and Minimum constraints to the same property.
17
- *
18
- * @template Value - The exclusive minimum value constraint (number or bigint literal)
19
- * @author Jeongho Nam - https://github.com/samchon
20
- */
21
- export type ExclusiveMinimum<Value extends number | bigint> = TagBase<{
22
- target: Value extends bigint ? "bigint" : "number";
23
- kind: "exclusiveMinimum";
24
- value: Value;
25
- validate: `${Cast<Value>} < $input`;
26
- exclusive: ["exclusiveMinimum", "minimum"];
27
- schema: Value extends bigint
28
- ? {
29
- exclusiveMinimum: Numeric<Value>;
30
- }
31
- : {
32
- exclusiveMinimum: Value;
33
- };
34
- }>;
35
-
36
- type Cast<Value extends number | bigint> = Value extends number
37
- ? Value
38
- : `BigInt(${Value})`;
39
- type Numeric<T extends bigint> = `${T}` extends `${infer N extends number}`
40
- ? N
41
- : never;
1
+ import { TagBase } from "./TagBase";
2
+
3
+ /**
4
+ * Exclusive minimum value constraint tag.
5
+ *
6
+ * Enforces that a numeric value must be strictly greater than the specified
7
+ * minimum (not equal). This constraint validates that the input value
8
+ * satisfies: input > minimum.
9
+ *
10
+ * Example usage:
11
+ *
12
+ * ```typescript
13
+ * type PositiveNumber = number & tags.ExclusiveMinimum<0>; // Must be > 0
14
+ * type LargeCount = bigint & tags.ExclusiveMinimum<999n>; // Must be > 999
15
+ * ```
16
+ *
17
+ * Note: This tag is mutually exclusive with Minimum. You cannot apply both
18
+ * ExclusiveMinimum and Minimum constraints to the same property.
19
+ *
20
+ * @author Jeongho Nam - https://github.com/samchon
21
+ * @template Value - The exclusive minimum value constraint (number or bigint
22
+ * literal)
23
+ */
24
+ export type ExclusiveMinimum<Value extends number | bigint> = TagBase<{
25
+ target: Value extends bigint ? "bigint" : "number";
26
+ kind: "exclusiveMinimum";
27
+ value: Value;
28
+ validate: `${Cast<Value>} < $input`;
29
+ exclusive: ["exclusiveMinimum", "minimum"];
30
+ schema: Value extends bigint
31
+ ? {
32
+ exclusiveMinimum: Numeric<Value>;
33
+ }
34
+ : {
35
+ exclusiveMinimum: Value;
36
+ };
37
+ }>;
38
+
39
+ type Cast<Value extends number | bigint> = Value extends number
40
+ ? Value
41
+ : `BigInt(${Value})`;
42
+ type Numeric<T extends bigint> = `${T}` extends `${infer N extends number}`
43
+ ? N
44
+ : never;
@@ -1,74 +1,78 @@
1
- import type { TagBase } from "./TagBase";
2
-
3
- /**
4
- * String format constraint tag.
5
- *
6
- * Validates strings against predefined formats for common use cases.
7
- * This tag provides built-in validation for standard string formats without
8
- * needing to write custom regular expressions.
9
- *
10
- * Examples:
11
- * type Email = string & Format<"email">; // user@example.com
12
- * type WebURL = string & Format<"url">; // https://example.com
13
- * type DateTime = string & Format<"date-time">; // 2024-01-15T10:30:00Z
14
- *
15
- * Supported formats include:
16
- * - Network: email, url, hostname, ipv4, ipv6, uri
17
- * - Identifiers: uuid, byte, password
18
- * - Date/Time: date, time, date-time, duration
19
- * - Data: json-pointer, regex
20
- * - Internationalized: idn-email, idn-hostname, iri
21
- *
22
- * Note: This tag is mutually exclusive with the Pattern tag. You cannot use both
23
- * Format and Pattern on the same type.
24
- *
25
- * @author Jeongho Nam - https://github.com/samchon
26
- */
27
- export type Format<Value extends Format.Value> = TagBase<{
28
- target: "string";
29
- kind: "format";
30
- value: Value;
31
- validate: `$importInternal("isFormat${PascalizeString<Value>}")($input)`;
32
- exclusive: ["format", "pattern"];
33
- schema: {
34
- format: Value;
35
- };
36
- }>;
37
- export namespace Format {
38
- export type Value =
39
- | "byte"
40
- | "password"
41
- | "regex"
42
- | "uuid"
43
- | "email"
44
- | "hostname"
45
- | "idn-email"
46
- | "idn-hostname"
47
- | "iri"
48
- | "iri-reference"
49
- | "ipv4"
50
- | "ipv6"
51
- | "uri"
52
- | "uri-reference"
53
- | "uri-template"
54
- | "url"
55
- | "date-time"
56
- | "date"
57
- | "time"
58
- | "duration"
59
- | "json-pointer"
60
- | "relative-json-pointer";
61
- }
62
-
63
- type PascalizeString<Key extends string> = Key extends `-${infer R}`
64
- ? `${PascalizeString<R>}`
65
- : Key extends `${infer _F}-${infer _R}`
66
- ? PascalizeSnakeString<Key>
67
- : Capitalize<Key>;
68
- type PascalizeSnakeString<Key extends string> = Key extends `-${infer R}`
69
- ? PascalizeSnakeString<R>
70
- : Key extends `${infer F}${infer M}-${infer R}`
71
- ? `${Uppercase<F>}${Lowercase<M>}${PascalizeSnakeString<R>}`
72
- : Key extends `${infer F}${infer R}`
73
- ? `${Uppercase<F>}${Lowercase<R>}`
74
- : Key;
1
+ import type { TagBase } from "./TagBase";
2
+
3
+ /**
4
+ * String format constraint tag.
5
+ *
6
+ * Validates strings against predefined formats for common use cases. This tag
7
+ * provides built-in validation for standard string formats without needing to
8
+ * write custom regular expressions.
9
+ *
10
+ * Examples:
11
+ *
12
+ * ```ts
13
+ * Type Email = string & Format<"email">; // user@example.com
14
+ * Type WebURL = string & Format<"url">; // https://example.com
15
+ * Type DateTime = string & Format<"date-time">; // 2024-01-15T10:30:00Z
16
+ * ```
17
+ *
18
+ * Supported formats include:
19
+ *
20
+ * - Network: email, url, hostname, ipv4, ipv6, uri
21
+ * - Identifiers: uuid, byte, password
22
+ * - Date/Time: date, time, date-time, duration
23
+ * - Data: json-pointer, regex
24
+ * - Internationalized: idn-email, idn-hostname, iri
25
+ *
26
+ * Note: This tag is mutually exclusive with the Pattern tag. You cannot use
27
+ * both Format and Pattern on the same type.
28
+ *
29
+ * @author Jeongho Nam - https://github.com/samchon
30
+ */
31
+ export type Format<Value extends Format.Value> = TagBase<{
32
+ target: "string";
33
+ kind: "format";
34
+ value: Value;
35
+ validate: `$importInternal("isFormat${PascalizeString<Value>}")($input)`;
36
+ exclusive: ["format", "pattern"];
37
+ schema: {
38
+ format: Value;
39
+ };
40
+ }>;
41
+ export namespace Format {
42
+ export type Value =
43
+ | "byte"
44
+ | "password"
45
+ | "regex"
46
+ | "uuid"
47
+ | "email"
48
+ | "hostname"
49
+ | "idn-email"
50
+ | "idn-hostname"
51
+ | "iri"
52
+ | "iri-reference"
53
+ | "ipv4"
54
+ | "ipv6"
55
+ | "uri"
56
+ | "uri-reference"
57
+ | "uri-template"
58
+ | "url"
59
+ | "date-time"
60
+ | "date"
61
+ | "time"
62
+ | "duration"
63
+ | "json-pointer"
64
+ | "relative-json-pointer";
65
+ }
66
+
67
+ type PascalizeString<Key extends string> = Key extends `-${infer R}`
68
+ ? `${PascalizeString<R>}`
69
+ : Key extends `${infer _F}-${infer _R}`
70
+ ? PascalizeSnakeString<Key>
71
+ : Capitalize<Key>;
72
+ type PascalizeSnakeString<Key extends string> = Key extends `-${infer R}`
73
+ ? PascalizeSnakeString<R>
74
+ : Key extends `${infer F}${infer M}-${infer R}`
75
+ ? `${Uppercase<F>}${Lowercase<M>}${PascalizeSnakeString<R>}`
76
+ : Key extends `${infer F}${infer R}`
77
+ ? `${Uppercase<F>}${Lowercase<R>}`
78
+ : Key;
@@ -1,34 +1,36 @@
1
- import { TagBase } from "./TagBase";
2
-
3
- /**
4
- * Injects custom properties into generated JSON Schema.
5
- *
6
- * The JsonSchemaPlugin tag allows you to add vendor-specific extensions or custom metadata
7
- * to the generated JSON Schema output. These properties are merged at the root level of
8
- * the schema and are commonly used for documentation, tooling hints, or API-specific metadata.
9
- * The custom properties only affect schema generation and do not impact runtime validation.
10
- *
11
- * @example
12
- * ```typescript
13
- * // Add OpenAPI vendor extensions
14
- * type UserId = string & JsonSchemaPlugin<{
15
- * "x-internal-id": true,
16
- * "x-deprecated": "Use UUID instead"
17
- * }>;
18
- *
19
- * // Add custom documentation metadata
20
- * type Price = number & JsonSchemaPlugin<{
21
- * "x-format": "currency",
22
- * "x-example": 19.99
23
- * }>;
24
- * ```
25
- *
26
- * @template Schema - Object containing custom properties to add to the JSON Schema
27
- * @author Jeongho Nam - https://github.com/samchon
28
- */
29
- export type JsonSchemaPlugin<Schema extends object> = TagBase<{
30
- target: "string" | "boolean" | "bigint" | "number" | "array" | "object";
31
- kind: "jsonPlugin";
32
- value: undefined;
33
- schema: Schema;
34
- }>;
1
+ import { TagBase } from "./TagBase";
2
+
3
+ /**
4
+ * Injects custom properties into generated JSON Schema.
5
+ *
6
+ * The JsonSchemaPlugin tag allows you to add vendor-specific extensions or
7
+ * custom metadata to the generated JSON Schema output. These properties are
8
+ * merged at the root level of the schema and are commonly used for
9
+ * documentation, tooling hints, or API-specific metadata. The custom properties
10
+ * only affect schema generation and do not impact runtime validation.
11
+ *
12
+ * @author Jeongho Nam - https://github.com/samchon
13
+ * @example
14
+ * ```typescript
15
+ * // Add OpenAPI vendor extensions
16
+ * type UserId = string & JsonSchemaPlugin<{
17
+ * "x-internal-id": true,
18
+ * "x-deprecated": "Use UUID instead"
19
+ * }>;
20
+ *
21
+ * // Add custom documentation metadata
22
+ * type Price = number & JsonSchemaPlugin<{
23
+ * "x-format": "currency",
24
+ * "x-example": 19.99
25
+ * }>;
26
+ * ```
27
+ *
28
+ * @template Schema - Object containing custom properties to add to the JSON
29
+ * Schema
30
+ */
31
+ export type JsonSchemaPlugin<Schema extends object> = TagBase<{
32
+ target: "string" | "boolean" | "bigint" | "number" | "array" | "object";
33
+ kind: "jsonPlugin";
34
+ value: undefined;
35
+ schema: Schema;
36
+ }>;
@@ -1,31 +1,31 @@
1
- import { TagBase } from "./TagBase";
2
-
3
- /**
4
- * Maximum items validation tag for arrays.
5
- *
6
- * Enforces that an array contains at most the specified number of items.
7
- * This tag is useful for limiting array sizes, such as restricting the
8
- * number of uploaded files, limiting selections in a form, or capping
9
- * the size of collections to prevent performance issues.
10
- *
11
- * @example
12
- * // Allow maximum 5 file uploads
13
- * type FileList = File[] & MaxItems<5>;
14
- *
15
- * @example
16
- * // Limit tags to 10 items
17
- * type ProductTags = string[] & MaxItems<10>;
18
- *
19
- * @template Value - The maximum number of items allowed
20
- * @author Jeongho Nam - https://github.com/samchon
21
- */
22
- export type MaxItems<Value extends number> = TagBase<{
23
- target: "array";
24
- kind: "maxItems";
25
- value: Value;
26
- validate: `$input.length <= ${Value}`;
27
- exclusive: true;
28
- schema: {
29
- maxItems: Value;
30
- };
31
- }>;
1
+ import { TagBase } from "./TagBase";
2
+
3
+ /**
4
+ * Maximum items validation tag for arrays.
5
+ *
6
+ * Enforces that an array contains at most the specified number of items. This
7
+ * tag is useful for limiting array sizes, such as restricting the number of
8
+ * uploaded files, limiting selections in a form, or capping the size of
9
+ * collections to prevent performance issues.
10
+ *
11
+ * @author Jeongho Nam - https://github.com/samchon
12
+ * @example
13
+ * // Allow maximum 5 file uploads
14
+ * type FileList = File[] & MaxItems<5>;
15
+ *
16
+ * @example
17
+ * // Limit tags to 10 items
18
+ * type ProductTags = string[] & MaxItems<10>;
19
+ *
20
+ * @template Value - The maximum number of items allowed
21
+ */
22
+ export type MaxItems<Value extends number> = TagBase<{
23
+ target: "array";
24
+ kind: "maxItems";
25
+ value: Value;
26
+ validate: `$input.length <= ${Value}`;
27
+ exclusive: true;
28
+ schema: {
29
+ maxItems: Value;
30
+ };
31
+ }>;
@@ -1,24 +1,25 @@
1
- import { TagBase } from "./TagBase";
2
-
3
- /**
4
- * String maximum length constraint tag.
5
- *
6
- * Validates that a string's length is less than or equal to the specified value.
7
- * This tag enforces an upper limit on the number of characters in a string.
8
- *
9
- * Examples:
10
- * type ShortComment = string & MaxLength<200>; // Comment limited to 200 characters
11
- * type ZipCode = string & MaxLength<10>; // Zip code with max 10 characters
12
- *
13
- * @author Jeongho Nam - https://github.com/samchon
14
- */
15
- export type MaxLength<Value extends number> = TagBase<{
16
- target: "string";
17
- kind: "maxLength";
18
- value: Value;
19
- validate: `$input.length <= ${Value}`;
20
- exclusive: true;
21
- schema: {
22
- maxLength: Value;
23
- };
24
- }>;
1
+ import { TagBase } from "./TagBase";
2
+
3
+ /**
4
+ * String maximum length constraint tag.
5
+ *
6
+ * Validates that a string's length is less than or equal to the specified
7
+ * value. This tag enforces an upper limit on the number of characters in a
8
+ * string.
9
+ *
10
+ * Examples: type ShortComment = string & MaxLength<200>; // Comment limited to
11
+ * 200 characters type ZipCode = string & MaxLength<10>; // Zip code with max 10
12
+ * characters
13
+ *
14
+ * @author Jeongho Nam - https://github.com/samchon
15
+ */
16
+ export type MaxLength<Value extends number> = TagBase<{
17
+ target: "string";
18
+ kind: "maxLength";
19
+ value: Value;
20
+ validate: `$input.length <= ${Value}`;
21
+ exclusive: true;
22
+ schema: {
23
+ maxLength: Value;
24
+ };
25
+ }>;
@@ -1,37 +1,39 @@
1
- import { TagBase } from "./TagBase";
2
-
3
- /**
4
- * Maximum value constraint tag.
5
- *
6
- * Enforces that a numeric value must be less than or equal to the specified maximum.
7
- * This constraint validates that the input value satisfies: input <= maximum.
8
- *
9
- * Example usage:
10
- * ```typescript
11
- * type Percentage = number & tags.Maximum<100>; // Must be <= 100
12
- * type SmallInt = bigint & tags.Maximum<255n>; // BigInt must be <= 255
13
- * ```
14
- *
15
- * Note: This tag is mutually exclusive with ExclusiveMaximum. You cannot apply both
16
- * Maximum and ExclusiveMaximum constraints to the same property.
17
- *
18
- * @template Value - The maximum value constraint (number or bigint literal)
19
- * @author Jeongho Nam - https://github.com/samchon
20
- */
21
- export type Maximum<Value extends number | bigint> = TagBase<{
22
- target: Value extends bigint ? "bigint" : "number";
23
- kind: "maximum";
24
- value: Value;
25
- validate: `$input <= ${Cast<Value>}`;
26
- exclusive: ["maximum", "exclusiveMaximum"];
27
- schema: Value extends bigint
28
- ? { maximum: Numeric<Value> }
29
- : { maximum: Value };
30
- }>;
31
-
32
- type Cast<Value extends number | bigint> = Value extends number
33
- ? Value
34
- : `BigInt(${Value})`;
35
- type Numeric<T extends bigint> = `${T}` extends `${infer N extends number}`
36
- ? N
37
- : never;
1
+ import { TagBase } from "./TagBase";
2
+
3
+ /**
4
+ * Maximum value constraint tag.
5
+ *
6
+ * Enforces that a numeric value must be less than or equal to the specified
7
+ * maximum. This constraint validates that the input value satisfies: input <=
8
+ * maximum.
9
+ *
10
+ * Example usage:
11
+ *
12
+ * ```typescript
13
+ * type Percentage = number & tags.Maximum<100>; // Must be <= 100
14
+ * type SmallInt = bigint & tags.Maximum<255n>; // BigInt must be <= 255
15
+ * ```
16
+ *
17
+ * Note: This tag is mutually exclusive with ExclusiveMaximum. You cannot apply
18
+ * both Maximum and ExclusiveMaximum constraints to the same property.
19
+ *
20
+ * @author Jeongho Nam - https://github.com/samchon
21
+ * @template Value - The maximum value constraint (number or bigint literal)
22
+ */
23
+ export type Maximum<Value extends number | bigint> = TagBase<{
24
+ target: Value extends bigint ? "bigint" : "number";
25
+ kind: "maximum";
26
+ value: Value;
27
+ validate: `$input <= ${Cast<Value>}`;
28
+ exclusive: ["maximum", "exclusiveMaximum"];
29
+ schema: Value extends bigint
30
+ ? { maximum: Numeric<Value> }
31
+ : { maximum: Value };
32
+ }>;
33
+
34
+ type Cast<Value extends number | bigint> = Value extends number
35
+ ? Value
36
+ : `BigInt(${Value})`;
37
+ type Numeric<T extends bigint> = `${T}` extends `${infer N extends number}`
38
+ ? N
39
+ : never;
@@ -1,31 +1,31 @@
1
- import { TagBase } from "./TagBase";
2
-
3
- /**
4
- * Minimum items validation tag for arrays.
5
- *
6
- * Enforces that an array contains at least the specified number of items.
7
- * This tag is useful for ensuring arrays have a minimum length requirement,
8
- * such as requiring at least one item in a list or a minimum number of
9
- * selections in a multi-choice field.
10
- *
11
- * @example
12
- * // Require at least 1 item in the array
13
- * type Tags = string[] & MinItems<1>;
14
- *
15
- * @example
16
- * // Require at least 3 selections
17
- * type MultipleChoice = number[] & MinItems<3>;
18
- *
19
- * @template Value - The minimum number of items required
20
- * @author Jeongho Nam - https://github.com/samchon
21
- */
22
- export type MinItems<Value extends number> = TagBase<{
23
- target: "array";
24
- kind: "minItems";
25
- value: Value;
26
- validate: `${Value} <= $input.length`;
27
- exclusive: true;
28
- schema: {
29
- minItems: Value;
30
- };
31
- }>;
1
+ import { TagBase } from "./TagBase";
2
+
3
+ /**
4
+ * Minimum items validation tag for arrays.
5
+ *
6
+ * Enforces that an array contains at least the specified number of items. This
7
+ * tag is useful for ensuring arrays have a minimum length requirement, such as
8
+ * requiring at least one item in a list or a minimum number of selections in a
9
+ * multi-choice field.
10
+ *
11
+ * @author Jeongho Nam - https://github.com/samchon
12
+ * @example
13
+ * // Require at least 1 item in the array
14
+ * type Tags = string[] & MinItems<1>;
15
+ *
16
+ * @example
17
+ * // Require at least 3 selections
18
+ * type MultipleChoice = number[] & MinItems<3>;
19
+ *
20
+ * @template Value - The minimum number of items required
21
+ */
22
+ export type MinItems<Value extends number> = TagBase<{
23
+ target: "array";
24
+ kind: "minItems";
25
+ value: Value;
26
+ validate: `${Value} <= $input.length`;
27
+ exclusive: true;
28
+ schema: {
29
+ minItems: Value;
30
+ };
31
+ }>;
@@ -1,24 +1,25 @@
1
- import { TagBase } from "./TagBase";
2
-
3
- /**
4
- * String minimum length constraint tag.
5
- *
6
- * Validates that a string's length is greater than or equal to the specified value.
7
- * This tag ensures that string values meet a minimum character count requirement.
8
- *
9
- * Examples:
10
- * type Username = string & MinLength<3>; // Username must be at least 3 characters
11
- * type Password = string & MinLength<8>; // Password must be at least 8 characters
12
- *
13
- * @author Jeongho Nam - https://github.com/samchon
14
- */
15
- export type MinLength<Value extends number> = TagBase<{
16
- target: "string";
17
- kind: "minLength";
18
- value: Value;
19
- validate: `${Value} <= $input.length`;
20
- exclusive: true;
21
- schema: {
22
- minLength: Value;
23
- };
24
- }>;
1
+ import { TagBase } from "./TagBase";
2
+
3
+ /**
4
+ * String minimum length constraint tag.
5
+ *
6
+ * Validates that a string's length is greater than or equal to the specified
7
+ * value. This tag ensures that string values meet a minimum character count
8
+ * requirement.
9
+ *
10
+ * Examples: type Username = string & MinLength<3>; // Username must be at least
11
+ * 3 characters type Password = string & MinLength<8>; // Password must be at
12
+ * least 8 characters
13
+ *
14
+ * @author Jeongho Nam - https://github.com/samchon
15
+ */
16
+ export type MinLength<Value extends number> = TagBase<{
17
+ target: "string";
18
+ kind: "minLength";
19
+ value: Value;
20
+ validate: `${Value} <= $input.length`;
21
+ exclusive: true;
22
+ schema: {
23
+ minLength: Value;
24
+ };
25
+ }>;