@typia/interface 12.0.0-dev.20260225

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 (311) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +23 -0
  3. package/lib/http/IHttpConnection.d.ts +163 -0
  4. package/lib/http/IHttpConnection.js +4 -0
  5. package/lib/http/IHttpConnection.js.map +1 -0
  6. package/lib/http/IHttpLlmApplication.d.ts +73 -0
  7. package/lib/http/IHttpLlmApplication.js +3 -0
  8. package/lib/http/IHttpLlmApplication.js.map +1 -0
  9. package/lib/http/IHttpLlmController.d.ts +86 -0
  10. package/lib/http/IHttpLlmController.js +3 -0
  11. package/lib/http/IHttpLlmController.js.map +1 -0
  12. package/lib/http/IHttpLlmFunction.d.ts +79 -0
  13. package/lib/http/IHttpLlmFunction.js +3 -0
  14. package/lib/http/IHttpLlmFunction.js.map +1 -0
  15. package/lib/http/IHttpMigrateApplication.d.ts +42 -0
  16. package/lib/http/IHttpMigrateApplication.js +3 -0
  17. package/lib/http/IHttpMigrateApplication.js.map +1 -0
  18. package/lib/http/IHttpMigrateRoute.d.ts +121 -0
  19. package/lib/http/IHttpMigrateRoute.js +3 -0
  20. package/lib/http/IHttpMigrateRoute.js.map +1 -0
  21. package/lib/http/IHttpResponse.d.ts +40 -0
  22. package/lib/http/IHttpResponse.js +3 -0
  23. package/lib/http/IHttpResponse.js.map +1 -0
  24. package/lib/http/index.d.ts +7 -0
  25. package/lib/http/index.js +24 -0
  26. package/lib/http/index.js.map +1 -0
  27. package/lib/index.d.ts +8 -0
  28. package/lib/index.js +48 -0
  29. package/lib/index.js.map +1 -0
  30. package/lib/metadata/IJsDocTagInfo.d.ts +23 -0
  31. package/lib/metadata/IJsDocTagInfo.js +3 -0
  32. package/lib/metadata/IJsDocTagInfo.js.map +1 -0
  33. package/lib/metadata/IMetadataComponents.d.ts +20 -0
  34. package/lib/metadata/IMetadataComponents.js +3 -0
  35. package/lib/metadata/IMetadataComponents.js.map +1 -0
  36. package/lib/metadata/IMetadataSchema.d.ts +219 -0
  37. package/lib/metadata/IMetadataSchema.js +3 -0
  38. package/lib/metadata/IMetadataSchema.js.map +1 -0
  39. package/lib/metadata/IMetadataSchemaCollection.d.ts +18 -0
  40. package/lib/metadata/IMetadataSchemaCollection.js +3 -0
  41. package/lib/metadata/IMetadataSchemaCollection.js.map +1 -0
  42. package/lib/metadata/IMetadataSchemaUnit.d.ts +18 -0
  43. package/lib/metadata/IMetadataSchemaUnit.js +3 -0
  44. package/lib/metadata/IMetadataSchemaUnit.js.map +1 -0
  45. package/lib/metadata/IMetadataTypeTag.d.ts +28 -0
  46. package/lib/metadata/IMetadataTypeTag.js +3 -0
  47. package/lib/metadata/IMetadataTypeTag.js.map +1 -0
  48. package/lib/metadata/index.d.ts +6 -0
  49. package/lib/metadata/index.js +23 -0
  50. package/lib/metadata/index.js.map +1 -0
  51. package/lib/openapi/OpenApi.d.ts +454 -0
  52. package/lib/openapi/OpenApi.js +3 -0
  53. package/lib/openapi/OpenApi.js.map +1 -0
  54. package/lib/openapi/OpenApiV3.d.ts +420 -0
  55. package/lib/openapi/OpenApiV3.js +3 -0
  56. package/lib/openapi/OpenApiV3.js.map +1 -0
  57. package/lib/openapi/OpenApiV3_1.d.ts +463 -0
  58. package/lib/openapi/OpenApiV3_1.js +3 -0
  59. package/lib/openapi/OpenApiV3_1.js.map +1 -0
  60. package/lib/openapi/SwaggerV2.d.ts +343 -0
  61. package/lib/openapi/SwaggerV2.js +3 -0
  62. package/lib/openapi/SwaggerV2.js.map +1 -0
  63. package/lib/openapi/index.d.ts +4 -0
  64. package/lib/openapi/index.js +21 -0
  65. package/lib/openapi/index.js.map +1 -0
  66. package/lib/protobuf/ProtobufWire.d.ts +46 -0
  67. package/lib/protobuf/ProtobufWire.js +3 -0
  68. package/lib/protobuf/ProtobufWire.js.map +1 -0
  69. package/lib/protobuf/index.d.ts +1 -0
  70. package/lib/protobuf/index.js +18 -0
  71. package/lib/protobuf/index.js.map +1 -0
  72. package/lib/schema/IJsonSchemaApplication.d.ts +232 -0
  73. package/lib/schema/IJsonSchemaApplication.js +3 -0
  74. package/lib/schema/IJsonSchemaApplication.js.map +1 -0
  75. package/lib/schema/IJsonSchemaAttribute.d.ts +152 -0
  76. package/lib/schema/IJsonSchemaAttribute.js +3 -0
  77. package/lib/schema/IJsonSchemaAttribute.js.map +1 -0
  78. package/lib/schema/IJsonSchemaCollection.d.ts +109 -0
  79. package/lib/schema/IJsonSchemaCollection.js +3 -0
  80. package/lib/schema/IJsonSchemaCollection.js.map +1 -0
  81. package/lib/schema/IJsonSchemaTransformError.d.ts +81 -0
  82. package/lib/schema/IJsonSchemaTransformError.js +3 -0
  83. package/lib/schema/IJsonSchemaTransformError.js.map +1 -0
  84. package/lib/schema/IJsonSchemaUnit.d.ts +106 -0
  85. package/lib/schema/IJsonSchemaUnit.js +3 -0
  86. package/lib/schema/IJsonSchemaUnit.js.map +1 -0
  87. package/lib/schema/ILlmApplication.d.ts +95 -0
  88. package/lib/schema/ILlmApplication.js +3 -0
  89. package/lib/schema/ILlmApplication.js.map +1 -0
  90. package/lib/schema/ILlmController.d.ts +53 -0
  91. package/lib/schema/ILlmController.js +3 -0
  92. package/lib/schema/ILlmController.js.map +1 -0
  93. package/lib/schema/ILlmFunction.d.ts +134 -0
  94. package/lib/schema/ILlmFunction.js +3 -0
  95. package/lib/schema/ILlmFunction.js.map +1 -0
  96. package/lib/schema/ILlmSchema.d.ts +412 -0
  97. package/lib/schema/ILlmSchema.js +3 -0
  98. package/lib/schema/ILlmSchema.js.map +1 -0
  99. package/lib/schema/IResult.d.ts +81 -0
  100. package/lib/schema/IResult.js +3 -0
  101. package/lib/schema/IResult.js.map +1 -0
  102. package/lib/schema/IValidation.d.ts +123 -0
  103. package/lib/schema/IValidation.js +3 -0
  104. package/lib/schema/IValidation.js.map +1 -0
  105. package/lib/schema/index.d.ts +11 -0
  106. package/lib/schema/index.js +28 -0
  107. package/lib/schema/index.js.map +1 -0
  108. package/lib/tags/Constant.d.ts +44 -0
  109. package/lib/tags/Constant.js +3 -0
  110. package/lib/tags/Constant.js.map +1 -0
  111. package/lib/tags/ContentMediaType.d.ts +39 -0
  112. package/lib/tags/ContentMediaType.js +3 -0
  113. package/lib/tags/ContentMediaType.js.map +1 -0
  114. package/lib/tags/Default.d.ts +42 -0
  115. package/lib/tags/Default.js +3 -0
  116. package/lib/tags/Default.js.map +1 -0
  117. package/lib/tags/Example.d.ts +38 -0
  118. package/lib/tags/Example.js +3 -0
  119. package/lib/tags/Example.js.map +1 -0
  120. package/lib/tags/Examples.d.ts +44 -0
  121. package/lib/tags/Examples.js +3 -0
  122. package/lib/tags/Examples.js.map +1 -0
  123. package/lib/tags/ExclusiveMaximum.d.ts +39 -0
  124. package/lib/tags/ExclusiveMaximum.js +3 -0
  125. package/lib/tags/ExclusiveMaximum.js.map +1 -0
  126. package/lib/tags/ExclusiveMinimum.d.ts +39 -0
  127. package/lib/tags/ExclusiveMinimum.js +3 -0
  128. package/lib/tags/ExclusiveMinimum.js.map +1 -0
  129. package/lib/tags/Format.d.ts +43 -0
  130. package/lib/tags/Format.js +3 -0
  131. package/lib/tags/Format.js.map +1 -0
  132. package/lib/tags/JsonSchemaPlugin.d.ts +44 -0
  133. package/lib/tags/JsonSchemaPlugin.js +3 -0
  134. package/lib/tags/JsonSchemaPlugin.js.map +1 -0
  135. package/lib/tags/MaxItems.d.ts +38 -0
  136. package/lib/tags/MaxItems.js +3 -0
  137. package/lib/tags/MaxItems.js.map +1 -0
  138. package/lib/tags/MaxLength.d.ts +36 -0
  139. package/lib/tags/MaxLength.js +3 -0
  140. package/lib/tags/MaxLength.js.map +1 -0
  141. package/lib/tags/Maximum.d.ts +41 -0
  142. package/lib/tags/Maximum.js +3 -0
  143. package/lib/tags/Maximum.js.map +1 -0
  144. package/lib/tags/MinItems.d.ts +38 -0
  145. package/lib/tags/MinItems.js +3 -0
  146. package/lib/tags/MinItems.js.map +1 -0
  147. package/lib/tags/MinLength.d.ts +36 -0
  148. package/lib/tags/MinLength.js +3 -0
  149. package/lib/tags/MinLength.js.map +1 -0
  150. package/lib/tags/Minimum.d.ts +41 -0
  151. package/lib/tags/Minimum.js +3 -0
  152. package/lib/tags/Minimum.js.map +1 -0
  153. package/lib/tags/MultipleOf.d.ts +49 -0
  154. package/lib/tags/MultipleOf.js +3 -0
  155. package/lib/tags/MultipleOf.js.map +1 -0
  156. package/lib/tags/Pattern.d.ts +51 -0
  157. package/lib/tags/Pattern.js +3 -0
  158. package/lib/tags/Pattern.js.map +1 -0
  159. package/lib/tags/Sequence.d.ts +42 -0
  160. package/lib/tags/Sequence.js +3 -0
  161. package/lib/tags/Sequence.js.map +1 -0
  162. package/lib/tags/TagBase.d.ts +109 -0
  163. package/lib/tags/TagBase.js +3 -0
  164. package/lib/tags/TagBase.js.map +1 -0
  165. package/lib/tags/Type.d.ts +53 -0
  166. package/lib/tags/Type.js +3 -0
  167. package/lib/tags/Type.js.map +1 -0
  168. package/lib/tags/UniqueItems.d.ts +41 -0
  169. package/lib/tags/UniqueItems.js +3 -0
  170. package/lib/tags/UniqueItems.js.map +1 -0
  171. package/lib/tags/index.d.ts +21 -0
  172. package/lib/tags/index.js +38 -0
  173. package/lib/tags/index.js.map +1 -0
  174. package/lib/typings/AssertionGuard.d.ts +12 -0
  175. package/lib/typings/AssertionGuard.js +3 -0
  176. package/lib/typings/AssertionGuard.js.map +1 -0
  177. package/lib/typings/Atomic.d.ts +19 -0
  178. package/lib/typings/Atomic.js +3 -0
  179. package/lib/typings/Atomic.js.map +1 -0
  180. package/lib/typings/CamelCase.d.ts +26 -0
  181. package/lib/typings/CamelCase.js +3 -0
  182. package/lib/typings/CamelCase.js.map +1 -0
  183. package/lib/typings/ClassProperties.d.ts +14 -0
  184. package/lib/typings/ClassProperties.js +3 -0
  185. package/lib/typings/ClassProperties.js.map +1 -0
  186. package/lib/typings/OmitNever.d.ts +11 -0
  187. package/lib/typings/OmitNever.js +3 -0
  188. package/lib/typings/OmitNever.js.map +1 -0
  189. package/lib/typings/PascalCase.d.ts +25 -0
  190. package/lib/typings/PascalCase.js +3 -0
  191. package/lib/typings/PascalCase.js.map +1 -0
  192. package/lib/typings/Primitive.d.ts +29 -0
  193. package/lib/typings/Primitive.js +3 -0
  194. package/lib/typings/Primitive.js.map +1 -0
  195. package/lib/typings/ProtobufAtomic.d.ts +15 -0
  196. package/lib/typings/ProtobufAtomic.js +3 -0
  197. package/lib/typings/ProtobufAtomic.js.map +1 -0
  198. package/lib/typings/Resolved.d.ts +23 -0
  199. package/lib/typings/Resolved.js +3 -0
  200. package/lib/typings/Resolved.js.map +1 -0
  201. package/lib/typings/SnakeCase.d.ts +31 -0
  202. package/lib/typings/SnakeCase.js +3 -0
  203. package/lib/typings/SnakeCase.js.map +1 -0
  204. package/lib/typings/SpecialFields.d.ts +13 -0
  205. package/lib/typings/SpecialFields.js +3 -0
  206. package/lib/typings/SpecialFields.js.map +1 -0
  207. package/lib/typings/ValidationPipe.d.ts +18 -0
  208. package/lib/typings/ValidationPipe.js +3 -0
  209. package/lib/typings/ValidationPipe.js.map +1 -0
  210. package/lib/typings/index.d.ts +12 -0
  211. package/lib/typings/index.js +29 -0
  212. package/lib/typings/index.js.map +1 -0
  213. package/lib/typings/internal/Equal.d.ts +11 -0
  214. package/lib/typings/internal/Equal.js +3 -0
  215. package/lib/typings/internal/Equal.js.map +1 -0
  216. package/lib/typings/internal/IsTuple.d.ts +13 -0
  217. package/lib/typings/internal/IsTuple.js +3 -0
  218. package/lib/typings/internal/IsTuple.js.map +1 -0
  219. package/lib/typings/internal/NativeClass.d.ts +9 -0
  220. package/lib/typings/internal/NativeClass.js +3 -0
  221. package/lib/typings/internal/NativeClass.js.map +1 -0
  222. package/lib/typings/internal/ValueOf.d.ts +15 -0
  223. package/lib/typings/internal/ValueOf.js +3 -0
  224. package/lib/typings/internal/ValueOf.js.map +1 -0
  225. package/lib/utils/IRandomGenerator.d.ts +68 -0
  226. package/lib/utils/IRandomGenerator.js +3 -0
  227. package/lib/utils/IRandomGenerator.js.map +1 -0
  228. package/lib/utils/IReadableURLSearchParams.d.ts +22 -0
  229. package/lib/utils/IReadableURLSearchParams.js +3 -0
  230. package/lib/utils/IReadableURLSearchParams.js.map +1 -0
  231. package/lib/utils/index.d.ts +2 -0
  232. package/lib/utils/index.js +19 -0
  233. package/lib/utils/index.js.map +1 -0
  234. package/package.json +79 -0
  235. package/src/http/IHttpConnection.ts +200 -0
  236. package/src/http/IHttpLlmApplication.ts +83 -0
  237. package/src/http/IHttpLlmController.ts +96 -0
  238. package/src/http/IHttpLlmFunction.ts +93 -0
  239. package/src/http/IHttpMigrateApplication.ts +48 -0
  240. package/src/http/IHttpMigrateRoute.ts +165 -0
  241. package/src/http/IHttpResponse.ts +42 -0
  242. package/src/http/index.ts +7 -0
  243. package/src/index.ts +9 -0
  244. package/src/metadata/IJsDocTagInfo.ts +25 -0
  245. package/src/metadata/IMetadataComponents.ts +24 -0
  246. package/src/metadata/IMetadataSchema.ts +293 -0
  247. package/src/metadata/IMetadataSchemaCollection.ts +20 -0
  248. package/src/metadata/IMetadataSchemaUnit.ts +20 -0
  249. package/src/metadata/IMetadataTypeTag.ts +39 -0
  250. package/src/metadata/index.ts +6 -0
  251. package/src/openapi/OpenApi.ts +643 -0
  252. package/src/openapi/OpenApiV3.ts +655 -0
  253. package/src/openapi/OpenApiV3_1.ts +735 -0
  254. package/src/openapi/SwaggerV2.ts +559 -0
  255. package/src/openapi/index.ts +4 -0
  256. package/src/protobuf/ProtobufWire.ts +51 -0
  257. package/src/protobuf/index.ts +1 -0
  258. package/src/schema/IJsonSchemaApplication.ts +274 -0
  259. package/src/schema/IJsonSchemaAttribute.ts +158 -0
  260. package/src/schema/IJsonSchemaCollection.ts +123 -0
  261. package/src/schema/IJsonSchemaTransformError.ts +86 -0
  262. package/src/schema/IJsonSchemaUnit.ts +120 -0
  263. package/src/schema/ILlmApplication.ts +103 -0
  264. package/src/schema/ILlmController.ts +57 -0
  265. package/src/schema/ILlmFunction.ts +144 -0
  266. package/src/schema/ILlmSchema.ts +484 -0
  267. package/src/schema/IResult.ts +84 -0
  268. package/src/schema/IValidation.ts +134 -0
  269. package/src/schema/index.ts +13 -0
  270. package/src/tags/Constant.ts +49 -0
  271. package/src/tags/ContentMediaType.ts +40 -0
  272. package/src/tags/Default.ts +50 -0
  273. package/src/tags/Example.ts +48 -0
  274. package/src/tags/Examples.ts +50 -0
  275. package/src/tags/ExclusiveMaximum.ts +46 -0
  276. package/src/tags/ExclusiveMinimum.ts +46 -0
  277. package/src/tags/Format.ts +76 -0
  278. package/src/tags/JsonSchemaPlugin.ts +45 -0
  279. package/src/tags/MaxItems.ts +39 -0
  280. package/src/tags/MaxLength.ts +37 -0
  281. package/src/tags/Maximum.ts +44 -0
  282. package/src/tags/MinItems.ts +39 -0
  283. package/src/tags/MinLength.ts +37 -0
  284. package/src/tags/Minimum.ts +44 -0
  285. package/src/tags/MultipleOf.ts +54 -0
  286. package/src/tags/Pattern.ts +59 -0
  287. package/src/tags/Sequence.ts +43 -0
  288. package/src/tags/TagBase.ts +131 -0
  289. package/src/tags/Type.ts +70 -0
  290. package/src/tags/UniqueItems.ts +44 -0
  291. package/src/tags/index.ts +21 -0
  292. package/src/typings/AssertionGuard.ts +12 -0
  293. package/src/typings/Atomic.ts +21 -0
  294. package/src/typings/CamelCase.ts +75 -0
  295. package/src/typings/ClassProperties.ts +15 -0
  296. package/src/typings/OmitNever.ts +12 -0
  297. package/src/typings/PascalCase.ts +71 -0
  298. package/src/typings/Primitive.ts +71 -0
  299. package/src/typings/ProtobufAtomic.ts +30 -0
  300. package/src/typings/Resolved.ts +58 -0
  301. package/src/typings/SnakeCase.ts +126 -0
  302. package/src/typings/SpecialFields.ts +13 -0
  303. package/src/typings/ValidationPipe.ts +20 -0
  304. package/src/typings/index.ts +13 -0
  305. package/src/typings/internal/Equal.ts +14 -0
  306. package/src/typings/internal/IsTuple.ts +17 -0
  307. package/src/typings/internal/NativeClass.ts +31 -0
  308. package/src/typings/internal/ValueOf.ts +29 -0
  309. package/src/utils/IRandomGenerator.ts +105 -0
  310. package/src/utils/IReadableURLSearchParams.ts +25 -0
  311. package/src/utils/index.ts +2 -0
@@ -0,0 +1,36 @@
1
+ import { TagBase } from "./TagBase";
2
+ /**
3
+ * String minimum length constraint.
4
+ *
5
+ * `MinLength<N>` is a type tag that validates string values have at least the
6
+ * specified number of characters. Apply it to `string` properties using
7
+ * TypeScript intersection types.
8
+ *
9
+ * This constraint is commonly combined with {@link MaxLength} to define a valid
10
+ * length range. Multiple length constraints can be applied to the same property
11
+ * (all must pass).
12
+ *
13
+ * The constraint is enforced at runtime by `typia.is()`, `typia.assert()`, and
14
+ * `typia.validate()`. It generates `minLength` in JSON Schema output.
15
+ *
16
+ * @author Jeongho Nam - https://github.com/samchon
17
+ * @example
18
+ * interface User {
19
+ * // Username must be at least 3 characters
20
+ * username: string & MinLength<3> & MaxLength<20>;
21
+ * // Password must be at least 8 characters
22
+ * password: string & MinLength<8>;
23
+ * }
24
+ *
25
+ * @template Value Minimum number of characters required
26
+ */
27
+ export type MinLength<Value extends number> = TagBase<{
28
+ target: "string";
29
+ kind: "minLength";
30
+ value: Value;
31
+ validate: `${Value} <= $input.length`;
32
+ exclusive: true;
33
+ schema: {
34
+ minLength: Value;
35
+ };
36
+ }>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=MinLength.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MinLength.js","sourceRoot":"","sources":["../../src/tags/MinLength.ts"],"names":[],"mappings":""}
@@ -0,0 +1,41 @@
1
+ import { TagBase } from "./TagBase";
2
+ /**
3
+ * Inclusive minimum value constraint (value >= min).
4
+ *
5
+ * `Minimum<N>` is a type tag that validates numeric values are greater than or
6
+ * equal to the specified bound. Apply it to `number` or `bigint` properties
7
+ * using TypeScript intersection types.
8
+ *
9
+ * This constraint is **mutually exclusive** with {@link ExclusiveMinimum} - you
10
+ * cannot use both on the same property. Use `Minimum` for inclusive bounds (>=)
11
+ * and `ExclusiveMinimum` for exclusive bounds (>).
12
+ *
13
+ * The constraint is enforced at runtime by `typia.is()`, `typia.assert()`, and
14
+ * `typia.validate()`. It also generates `minimum` in JSON Schema output.
15
+ *
16
+ * @author Jeongho Nam - https://github.com/samchon
17
+ * @example
18
+ * interface Product {
19
+ * // Price must be 0 or greater
20
+ * price: number & Minimum<0>;
21
+ * // Quantity must be at least 1
22
+ * quantity: number & Minimum<1>;
23
+ * }
24
+ *
25
+ * @template Value The minimum allowed value (inclusive)
26
+ */
27
+ export type Minimum<Value extends number | bigint> = TagBase<{
28
+ target: Value extends bigint ? "bigint" : "number";
29
+ kind: "minimum";
30
+ value: Value;
31
+ validate: `${Cast<Value>} <= $input`;
32
+ exclusive: ["minimum", "exclusiveMinimum"];
33
+ schema: Value extends bigint ? {
34
+ minimum: Numeric<Value>;
35
+ } : {
36
+ minimum: Value;
37
+ };
38
+ }>;
39
+ type Cast<Value extends number | bigint> = Value extends number ? Value : `BigInt(${Value})`;
40
+ type Numeric<T extends bigint> = `${T}` extends `${infer N extends number}` ? N : never;
41
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Minimum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Minimum.js","sourceRoot":"","sources":["../../src/tags/Minimum.ts"],"names":[],"mappings":""}
@@ -0,0 +1,49 @@
1
+ import { TagBase } from "./TagBase";
2
+ /**
3
+ * Divisibility constraint (value % divisor === 0).
4
+ *
5
+ * `MultipleOf<N>` is a type tag that validates numeric values are exactly
6
+ * divisible by the specified divisor with no remainder. Apply it to `number` or
7
+ * `bigint` properties using TypeScript intersection types.
8
+ *
9
+ * Common use cases:
10
+ *
11
+ * - `MultipleOf<2>` for even numbers
12
+ * - `MultipleOf<0.01>` for currency with 2 decimal places
13
+ * - `MultipleOf<100>` for values in hundreds
14
+ *
15
+ * This constraint can be combined with other numeric constraints like
16
+ * {@link Minimum} and {@link Maximum}. Multiple `MultipleOf` constraints on the
17
+ * same property are allowed (all must pass).
18
+ *
19
+ * The constraint is enforced at runtime by `typia.is()`, `typia.assert()`, and
20
+ * `typia.validate()`. It generates `multipleOf` in JSON Schema output.
21
+ *
22
+ * @author Jeongho Nam - https://github.com/samchon
23
+ * @example
24
+ * interface Currency {
25
+ * // Must be exact cents (0.01, 0.02, ..., 1.00, 1.01, ...)
26
+ * amount: number & MultipleOf<0.01>;
27
+ * }
28
+ * interface Pagination {
29
+ * // Page size must be multiple of 10
30
+ * pageSize: number & MultipleOf<10>;
31
+ * }
32
+ *
33
+ * @template Value The divisor (value must be evenly divisible by this)
34
+ */
35
+ export type MultipleOf<Value extends number | bigint> = TagBase<{
36
+ target: Value extends bigint ? "bigint" : "number";
37
+ kind: "multipleOf";
38
+ value: Value;
39
+ validate: `$input % ${Cast<Value>} === ${Value extends bigint ? Cast<0n> : 0}`;
40
+ exclusive: true;
41
+ schema: Value extends bigint ? {
42
+ multipleOf: Numeric<Value>;
43
+ } : {
44
+ multipleOf: Value;
45
+ };
46
+ }>;
47
+ type Cast<Value extends number | bigint> = Value extends number ? Value : `BigInt(${Value})`;
48
+ type Numeric<T extends bigint> = `${T}` extends `${infer N extends number}` ? N : never;
49
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=MultipleOf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultipleOf.js","sourceRoot":"","sources":["../../src/tags/MultipleOf.ts"],"names":[],"mappings":""}
@@ -0,0 +1,51 @@
1
+ import { TagBase } from "./TagBase";
2
+ /**
3
+ * Regular expression pattern constraint for strings.
4
+ *
5
+ * `Pattern<Regex>` is a type tag that validates string values match the
6
+ * specified regular expression pattern. Apply it to `string` properties using
7
+ * TypeScript intersection types.
8
+ *
9
+ * This constraint is **mutually exclusive** with {@link Format} - you cannot use
10
+ * both on the same property. Use `Pattern` for custom regex validation, or
11
+ * `Format` for standard formats (email, uuid, etc.).
12
+ *
13
+ * The pattern should be a valid JavaScript regular expression string without
14
+ * the surrounding slashes. The entire string must match (implicit `^` and `$`
15
+ * anchors).
16
+ *
17
+ * The constraint is enforced at runtime by `typia.is()`, `typia.assert()`, and
18
+ * `typia.validate()`. It generates `pattern` in JSON Schema output.
19
+ *
20
+ * @author Jeongho Nam - https://github.com/samchon
21
+ * @example
22
+ * interface Product {
23
+ * // SKU format: 3 letters, dash, 4 digits
24
+ * sku: string & Pattern<"^[A-Z]{3}-[0-9]{4}$">;
25
+ * // Phone number: digits and optional dashes
26
+ * phone: string & Pattern<"^[0-9-]+$">;
27
+ * }
28
+ *
29
+ * @template Value Regular expression pattern as a string literal
30
+ */
31
+ export type Pattern<Value extends string> = TagBase<{
32
+ target: "string";
33
+ kind: "pattern";
34
+ value: Value;
35
+ validate: `RegExp("${Serialize<Value>}").test($input)`;
36
+ exclusive: ["format", "pattern"];
37
+ schema: {
38
+ pattern: Value;
39
+ };
40
+ }>;
41
+ type Serialize<T extends string, Output extends string = ""> = string extends T ? never : T extends "" ? Output : T extends `${infer P}${infer R}` ? Serialize<R, `${Output}${P extends keyof Escaper ? Escaper[P] : P}`> : never;
42
+ type Escaper = {
43
+ '"': '\\"';
44
+ "\\": "\\\\";
45
+ "\b": "\\b";
46
+ "\f": "\\f";
47
+ "\n": "\\n";
48
+ "\r": "\\r";
49
+ "\t": "\\t";
50
+ };
51
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Pattern.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pattern.js","sourceRoot":"","sources":["../../src/tags/Pattern.ts"],"names":[],"mappings":""}
@@ -0,0 +1,42 @@
1
+ import { TagBase } from "./TagBase";
2
+ /**
3
+ * Protocol Buffer field number assignment.
4
+ *
5
+ * `Sequence<N>` is a type tag that assigns a unique field number for Protocol
6
+ * Buffer serialization. In protobuf, each field in a message must have a unique
7
+ * numeric identifier that's used in the binary encoding.
8
+ *
9
+ * Field number guidelines:
10
+ *
11
+ * - **1-15**: Use one byte in encoding (ideal for frequently-used fields)
12
+ * - **16-2047**: Use two bytes
13
+ * - **2048-536,870,911**: Use more bytes (avoid for efficiency)
14
+ * - **19000-19999**: Reserved by Protocol Buffers (cannot use)
15
+ *
16
+ * If not specified, typia auto-assigns field numbers. Use `Sequence` when you
17
+ * need stable field numbers for backward compatibility or when integrating with
18
+ * existing protobuf schemas.
19
+ *
20
+ * This tag is used by `typia.protobuf.encode()` and `typia.protobuf.decode()`.
21
+ * The field number also appears in JSON Schema as `x-protobuf-sequence`.
22
+ *
23
+ * @author Jeongho Nam - https://github.com/samchon
24
+ * @example
25
+ * interface Message {
26
+ * // Frequently accessed fields use low numbers
27
+ * id: (number & Sequence<1>) & Type<"uint32">;
28
+ * name: string & Sequence<2>;
29
+ * // Less common fields use higher numbers
30
+ * metadata: (Record<string, string> & Sequence<100>) | undefined;
31
+ * }
32
+ *
33
+ * @template N Field number (1 to 536,870,911, excluding 19000-19999)
34
+ */
35
+ export type Sequence<N extends number> = TagBase<{
36
+ target: "boolean" | "bigint" | "number" | "string" | "array" | "object";
37
+ kind: "sequence";
38
+ value: N;
39
+ schema: {
40
+ "x-protobuf-sequence": N;
41
+ };
42
+ }>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Sequence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sequence.js","sourceRoot":"","sources":["../../src/tags/Sequence.ts"],"names":[],"mappings":""}
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Base type for all typia validation tags.
3
+ *
4
+ * `TagBase` is the foundation for all typia type tags (constraints like
5
+ * `Minimum`, `MaxLength`, `Format`, etc.). It attaches compile-time metadata to
6
+ * TypeScript types using a phantom property pattern.
7
+ *
8
+ * The typia transformer reads these tags at compile time and generates
9
+ * appropriate runtime validation code. The tags themselves have no runtime
10
+ * presence - they exist only in the type system.
11
+ *
12
+ * This is an internal implementation detail. Use the specific tag types (e.g.,
13
+ * {@link Minimum}, {@link Format}, {@link Pattern}) rather than `TagBase`
14
+ * directly.
15
+ *
16
+ * @author Jeongho Nam - https://github.com/samchon
17
+ * @template Props Tag properties defining validation behavior and schema output
18
+ */
19
+ export type TagBase<Props extends TagBase.IProps<any, any, any, any, any, any>> = {
20
+ /**
21
+ * Compile-time marker property for typia transformer.
22
+ *
23
+ * This phantom property carries tag metadata in the type system. It is never
24
+ * assigned at runtime - it exists only for the transformer to read during
25
+ * compilation.
26
+ */
27
+ "typia.tag"?: Props;
28
+ };
29
+ export declare namespace TagBase {
30
+ /**
31
+ * Configuration interface for validation tag properties.
32
+ *
33
+ * Defines all the metadata a validation tag can specify, including what types
34
+ * it applies to, how to validate values, and what to output in JSON Schema.
35
+ *
36
+ * @template Target Which primitive type(s) this tag can be applied to
37
+ * @template Kind Unique identifier for this tag type
38
+ * @template Value The constraint value specified by the user
39
+ * @template Validate The validation expression to generate
40
+ * @template Exclusive Whether this tag conflicts with others
41
+ * @template Schema Additional JSON Schema properties to output
42
+ */
43
+ interface IProps<Target extends "boolean" | "bigint" | "number" | "string" | "array" | "object", Kind extends string, Value extends boolean | bigint | number | string | undefined, Validate extends string | {
44
+ [key in Target]?: string;
45
+ }, Exclusive extends boolean | string[], Schema extends object | undefined> {
46
+ /**
47
+ * Target primitive type(s) this tag applies to.
48
+ *
49
+ * The transformer will error if the tag is applied to a property of a
50
+ * different type. For example, `MinLength` targets `"string"` and cannot be
51
+ * applied to numbers.
52
+ */
53
+ target: Target;
54
+ /**
55
+ * Unique identifier for this tag type.
56
+ *
57
+ * Used internally to identify the constraint kind. Examples: `"minimum"`,
58
+ * `"maxLength"`, `"format"`, `"pattern"`.
59
+ */
60
+ kind: Kind;
61
+ /**
62
+ * User-configured constraint value.
63
+ *
64
+ * The value provided by the user when applying the tag. For `Minimum<5>`,
65
+ * this would be `5`. For `Format<"email">`, this would be `"email"`.
66
+ */
67
+ value: Value;
68
+ /**
69
+ * Validation expression template.
70
+ *
71
+ * JavaScript expression string that validates the input value. Use `$input`
72
+ * as a placeholder for the actual value. The expression is inserted into
73
+ * the generated validation function.
74
+ *
75
+ * Can be a single string or an object mapping target types to different
76
+ * expressions (for tags supporting multiple types).
77
+ *
78
+ * @example
79
+ * `"5 <= $input"`; // For Minimum<5>
80
+ *
81
+ * @example
82
+ * `"$input.length <= 10"`; // For MaxLength<10>
83
+ */
84
+ validate?: Validate;
85
+ /**
86
+ * Tag exclusivity configuration.
87
+ *
88
+ * Controls which other tags cannot be combined with this one:
89
+ *
90
+ * - `true`: No duplicate tags of the same kind allowed
91
+ * - `string[]`: List of incompatible tag kinds
92
+ * - `false` (default): No exclusivity restrictions
93
+ *
94
+ * For example, `Minimum` and `ExclusiveMinimum` are mutually exclusive -
95
+ * only one can be applied to a property.
96
+ *
97
+ * @default false
98
+ */
99
+ exclusive?: Exclusive | string[];
100
+ /**
101
+ * Additional JSON Schema properties to output.
102
+ *
103
+ * Object containing schema properties to merge into the generated JSON
104
+ * Schema for the annotated type. For `Minimum<5>`, this would be `{
105
+ * minimum: 5 }`.
106
+ */
107
+ schema?: Schema;
108
+ }
109
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=TagBase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TagBase.js","sourceRoot":"","sources":["../../src/tags/TagBase.ts"],"names":[],"mappings":""}
@@ -0,0 +1,53 @@
1
+ import { TagBase } from "./TagBase";
2
+ /**
3
+ * Numeric precision and bit-width type constraint.
4
+ *
5
+ * `Type<Value>` is a type tag that constrains numeric values to specific
6
+ * bit-width representations. This is essential for Protocol Buffers
7
+ * serialization and ensures values fit within their specified ranges.
8
+ *
9
+ * Available types:
10
+ *
11
+ * - `"int32"`: Signed 32-bit integer (-2,147,483,648 to 2,147,483,647)
12
+ * - `"uint32"`: Unsigned 32-bit integer (0 to 4,294,967,295)
13
+ * - `"int64"`: Signed 64-bit integer (for `number` or `bigint`)
14
+ * - `"uint64"`: Unsigned 64-bit integer (for `number` or `bigint`)
15
+ * - `"float"`: 32-bit floating point
16
+ * - `"double"`: 64-bit floating point (default JavaScript number)
17
+ *
18
+ * For Protocol Buffers, integer types also determine the wire encoding. The
19
+ * constraint is enforced at runtime by `typia.is()`, `typia.assert()`, and
20
+ * `typia.validate()`. It generates appropriate `type` in JSON Schema.
21
+ *
22
+ * @author Jeongho Nam - https://github.com/samchon
23
+ * @example
24
+ * interface Message {
25
+ * // 32-bit unsigned integer
26
+ * id: number & Type<"uint32">;
27
+ * // 64-bit signed integer as bigint
28
+ * timestamp: bigint & Type<"int64">;
29
+ * // 32-bit float for memory efficiency
30
+ * score: number & Type<"float">;
31
+ * }
32
+ *
33
+ * @template Value Numeric type identifier
34
+ */
35
+ export type Type<Value extends "int32" | "uint32" | "int64" | "uint64" | "float" | "double"> = TagBase<{
36
+ target: Value extends "int64" | "uint64" ? "bigint" | "number" : "number";
37
+ kind: "type";
38
+ value: Value;
39
+ validate: Value extends "int32" ? `$importInternal("isTypeInt32")($input)` : Value extends "uint32" ? `$importInternal("isTypeUint32")($input)` : Value extends "int64" ? {
40
+ number: `$importInternal("isTypeInt64")($input)`;
41
+ bigint: `true`;
42
+ } : Value extends "uint64" ? {
43
+ number: `$importInternal("isTypeUint64")($input)`;
44
+ bigint: `BigInt(0) <= $input`;
45
+ } : Value extends "float" ? `$importInternal("isTypeFloat")($input)` : `true`;
46
+ exclusive: true;
47
+ schema: Value extends "uint32" | "uint64" ? {
48
+ type: "integer";
49
+ minimum: 0;
50
+ } : {
51
+ type: Value extends "int32" | "uint32" | "int64" | "uint64" ? "integer" : "number";
52
+ };
53
+ }>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Type.js","sourceRoot":"","sources":["../../src/tags/Type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,41 @@
1
+ import { TagBase } from "./TagBase";
2
+ /**
3
+ * Array unique elements constraint.
4
+ *
5
+ * `UniqueItems` is a type tag that validates all elements in an array are
6
+ * unique (no duplicates). Apply it to array properties using TypeScript
7
+ * intersection types.
8
+ *
9
+ * Uniqueness is determined by:
10
+ *
11
+ * - **Primitives**: Strict equality (`===`)
12
+ * - **Objects**: Deep structural comparison
13
+ *
14
+ * This constraint is commonly combined with {@link MinItems} and {@link MaxItems}
15
+ * for comprehensive array validation. It's useful for modeling set-like data
16
+ * that must be represented as arrays in JSON.
17
+ *
18
+ * The constraint is enforced at runtime by `typia.is()`, `typia.assert()`, and
19
+ * `typia.validate()`. It generates `uniqueItems: true` in JSON Schema.
20
+ *
21
+ * @author Jeongho Nam - https://github.com/samchon
22
+ * @example
23
+ * interface Preferences {
24
+ * // No duplicate tags allowed
25
+ * tags: (string & UniqueItems)[];
26
+ * // Unique user IDs
27
+ * favoriteUserIds: (number & UniqueItems)[];
28
+ * }
29
+ *
30
+ * @template Value Boolean flag, defaults to `true` (enable constraint)
31
+ */
32
+ export type UniqueItems<Value extends boolean = true> = TagBase<{
33
+ target: "array";
34
+ kind: "uniqueItems";
35
+ value: Value;
36
+ validate: Value extends true ? `$importInternal("isUniqueItems")($input)` : undefined;
37
+ exclusive: true;
38
+ schema: {
39
+ uniqueItems: true;
40
+ };
41
+ }>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=UniqueItems.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UniqueItems.js","sourceRoot":"","sources":["../../src/tags/UniqueItems.ts"],"names":[],"mappings":""}
@@ -0,0 +1,21 @@
1
+ export * from "./Constant";
2
+ export * from "./ContentMediaType";
3
+ export * from "./Default";
4
+ export * from "./Example";
5
+ export * from "./Examples";
6
+ export * from "./ExclusiveMaximum";
7
+ export * from "./ExclusiveMinimum";
8
+ export * from "./Format";
9
+ export * from "./JsonSchemaPlugin";
10
+ export * from "./Maximum";
11
+ export * from "./MaxItems";
12
+ export * from "./MaxLength";
13
+ export * from "./Minimum";
14
+ export * from "./MinItems";
15
+ export * from "./MinLength";
16
+ export * from "./MultipleOf";
17
+ export * from "./Pattern";
18
+ export * from "./Sequence";
19
+ export * from "./TagBase";
20
+ export * from "./Type";
21
+ export * from "./UniqueItems";
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./Constant"), exports);
18
+ __exportStar(require("./ContentMediaType"), exports);
19
+ __exportStar(require("./Default"), exports);
20
+ __exportStar(require("./Example"), exports);
21
+ __exportStar(require("./Examples"), exports);
22
+ __exportStar(require("./ExclusiveMaximum"), exports);
23
+ __exportStar(require("./ExclusiveMinimum"), exports);
24
+ __exportStar(require("./Format"), exports);
25
+ __exportStar(require("./JsonSchemaPlugin"), exports);
26
+ __exportStar(require("./Maximum"), exports);
27
+ __exportStar(require("./MaxItems"), exports);
28
+ __exportStar(require("./MaxLength"), exports);
29
+ __exportStar(require("./Minimum"), exports);
30
+ __exportStar(require("./MinItems"), exports);
31
+ __exportStar(require("./MinLength"), exports);
32
+ __exportStar(require("./MultipleOf"), exports);
33
+ __exportStar(require("./Pattern"), exports);
34
+ __exportStar(require("./Sequence"), exports);
35
+ __exportStar(require("./TagBase"), exports);
36
+ __exportStar(require("./Type"), exports);
37
+ __exportStar(require("./UniqueItems"), exports);
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tags/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,qDAAmC;AACnC,4CAA0B;AAC1B,4CAA0B;AAC1B,6CAA2B;AAC3B,qDAAmC;AACnC,qDAAmC;AACnC,2CAAyB;AACzB,qDAAmC;AACnC,4CAA0B;AAC1B,6CAA2B;AAC3B,8CAA4B;AAC5B,4CAA0B;AAC1B,6CAA2B;AAC3B,8CAA4B;AAC5B,+CAA6B;AAC7B,4CAA0B;AAC1B,6CAA2B;AAC3B,4CAA0B;AAC1B,yCAAuB;AACvB,gDAA8B"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Type for assertion guard functions that narrow input type.
3
+ *
4
+ * `AssertionGuard<T>` is a function type that validates input at runtime and
5
+ * asserts it as type `T`. Unlike regular assertions that return the value,
6
+ * assertion guards return void but narrow the input parameter's type.
7
+ *
8
+ * @author Jeongho Nam - https://github.com/samchon
9
+ * @template T Target type to assert
10
+ * @throws {TypeGuardError} When validation fails
11
+ */
12
+ export type AssertionGuard<T> = (input: unknown) => asserts input is T;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=AssertionGuard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssertionGuard.js","sourceRoot":"","sources":["../../src/typings/AssertionGuard.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Atomic (primitive) type utilities for typia's type system.
3
+ *
4
+ * @author Jeongho Nam - https://github.com/samchon
5
+ */
6
+ export declare namespace Atomic {
7
+ /** Union of JavaScript primitive value types. */
8
+ type Type = boolean | number | string | bigint;
9
+ /** String literal names for atomic types. */
10
+ type Literal = "boolean" | "integer" | "number" | "string" | "bigint";
11
+ /** Maps literal type names to their corresponding value types. */
12
+ type Mapper = {
13
+ boolean: boolean;
14
+ integer: number;
15
+ number: number;
16
+ string: string;
17
+ bigint: bigint;
18
+ };
19
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Atomic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Atomic.js","sourceRoot":"","sources":["../../src/typings/Atomic.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ import { Equal } from "./internal/Equal";
2
+ import { IsTuple } from "./internal/IsTuple";
3
+ import { NativeClass } from "./internal/NativeClass";
4
+ import { ValueOf } from "./internal/ValueOf";
5
+ /**
6
+ * Converts all object keys to camelCase.
7
+ *
8
+ * `CamelCase<T>` transforms object property names to camelCase format and
9
+ * erases methods like {@link Resolved}. Recursively processes nested
10
+ * structures.
11
+ *
12
+ * @author Jeongho Nam - https://github.com/samchon
13
+ * @template T Target type to transform
14
+ */
15
+ export type CamelCase<T> = Equal<T, CamelizeMain<T>> extends true ? T : CamelizeMain<T>;
16
+ type CamelizeMain<T> = T extends [never] ? never : T extends {
17
+ valueOf(): boolean | bigint | number | string;
18
+ } ? ValueOf<T> : T extends Function ? never : T extends object ? CamelizeObject<T> : T;
19
+ type CamelizeObject<T extends object> = T extends Array<infer U> ? IsTuple<T> extends true ? CamelizeTuple<T> : CamelizeMain<U>[] : T extends Set<infer U> ? Set<CamelizeMain<U>> : T extends Map<infer K, infer V> ? Map<CamelizeMain<K>, CamelizeMain<V>> : T extends WeakSet<any> | WeakMap<any, any> ? never : T extends NativeClass ? T : {
20
+ [Key in keyof T as CamelizeString<Key & string>]: CamelizeMain<T[Key]>;
21
+ };
22
+ type CamelizeTuple<T extends readonly any[]> = T extends [] ? [] : T extends [infer F] ? [CamelizeMain<F>] : T extends [infer F, ...infer Rest extends readonly any[]] ? [CamelizeMain<F>, ...CamelizeTuple<Rest>] : T extends [(infer F)?] ? [CamelizeMain<F>?] : T extends [(infer F)?, ...infer Rest extends readonly any[]] ? [CamelizeMain<F>?, ...CamelizeTuple<Rest>] : [];
23
+ type CamelizeString<Key extends string> = Key extends `_${infer R}` ? `_${CamelizeString<R>}` : Key extends `${infer _F}_${infer _R}` ? CamelizeSnakeString<Key> : Key extends Uppercase<Key> ? Lowercase<Key> : CamelizePascalString<Key>;
24
+ type CamelizePascalString<Key extends string> = Key extends `${infer F}${infer R}` ? `${Lowercase<F>}${R}` : Key;
25
+ type CamelizeSnakeString<Key extends string> = Key extends `_${infer R}` ? CamelizeSnakeString<R> : Key extends `${infer F}_${infer M}${infer R}` ? M extends "_" ? CamelizeSnakeString<`${F}_${R}`> : `${Lowercase<F>}${Uppercase<M>}${CamelizeSnakeString<R>}` : Lowercase<Key>;
26
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=CamelCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CamelCase.js","sourceRoot":"","sources":["../../src/typings/CamelCase.ts"],"names":[],"mappings":""}