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