@typia/transform 12.0.0-dev.20260311 → 12.0.0-dev.20260312

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.
@@ -1,579 +1,581 @@
1
- import {
2
- FunctionAssertReturnProgrammer,
3
- FunctionalAssertFunctionProgrammer,
4
- FunctionalAssertParametersProgrammer,
5
- FunctionalIsFunctionProgrammer,
6
- FunctionalIsParametersProgrammer,
7
- FunctionalIsReturnProgrammer,
8
- FunctionalValidateFunctionProgrammer,
9
- FunctionalValidateParametersProgrammer,
10
- FunctionalValidateReturnProgrammer,
11
- ITypiaContext,
12
- } from "@typia/core";
13
- import { NamingConvention } from "@typia/utils";
14
- import path from "path";
15
- import ts from "typescript";
16
-
17
- import { ITransformProps } from "./ITransformProps";
18
- import { AssertTransformer } from "./features/AssertTransformer";
19
- import { CreateAssertTransformer } from "./features/CreateAssertTransformer";
20
- import { CreateIsTransformer } from "./features/CreateIsTransformer";
21
- import { CreateRandomTransformer } from "./features/CreateRandomTransformer";
22
- import { CreateValidateTransformer } from "./features/CreateValidateTransformer";
23
- import { IsTransformer } from "./features/IsTransformer";
24
- import { RandomTransformer } from "./features/RandomTransformer";
25
- import { ValidateTransformer } from "./features/ValidateTransformer";
26
- import { FunctionalGenericTransformer } from "./features/functional/FunctionalGenericTransformer";
27
- import { CreateHttpAssertFormDataTransformer } from "./features/http/CreateHttpAssertFormDataTransformer";
28
- import { CreateHttpAssertHeadersTransformer } from "./features/http/CreateHttpAssertHeadersTransformer";
29
- import { CreateHttpAssertQueryTransformer } from "./features/http/CreateHttpAssertQueryTransformer";
30
- import { CreateHttpFormDataTransformer } from "./features/http/CreateHttpFormDataTransformer";
31
- import { CreateHttpHeadersTransformer } from "./features/http/CreateHttpHeadersTransformer";
32
- import { CreateHttpIsFormDataTransformer } from "./features/http/CreateHttpIsFormDataTransformer";
33
- import { CreateHttpIsHeadersTransformer } from "./features/http/CreateHttpIsHeadersTransformer";
34
- import { CreateHttpIsQueryTransformer } from "./features/http/CreateHttpIsQueryTransformer";
35
- import { CreateHttpParameterTransformer } from "./features/http/CreateHttpParameterTransformer";
36
- import { CreateHttpQueryTransformer } from "./features/http/CreateHttpQueryTransformer";
37
- import { CreateHttpValidateFormDataTransformer } from "./features/http/CreateHttpValidateFormDataTransformer";
38
- import { CreateHttpValidateHeadersTransformer } from "./features/http/CreateHttpValidateHeadersTransformer";
39
- import { CreateHttpValidateQueryTransformer } from "./features/http/CreateHttpValidateQueryTransformer";
40
- import { HttpAssertFormDataTransformer } from "./features/http/HttpAssertFormDataTransformer";
41
- import { HttpAssertHeadersTransformer } from "./features/http/HttpAssertHeadersTransformer";
42
- import { HttpAssertQueryTransformer } from "./features/http/HttpAssertQueryTransformer";
43
- import { HttpFormDataTransformer } from "./features/http/HttpFormDataTransformer";
44
- import { HttpHeadersTransformer } from "./features/http/HttpHeadersTransformer";
45
- import { HttpIsFormDataTransformer } from "./features/http/HttpIsFormDataTransformer";
46
- import { HttpIsHeadersTransformer } from "./features/http/HttpIsHeadersTransformer";
47
- import { HttpIsQueryTransformer } from "./features/http/HttpIsQueryTransformer";
48
- import { HttpParameterTransformer } from "./features/http/HttpParameterTransformer";
49
- import { HttpQueryTransformer } from "./features/http/HttpQueryTransformer";
50
- import { HttpValidateFormDataTransformer } from "./features/http/HttpValidateFormDataTransformer";
51
- import { HttpValidateHeadersTransformer } from "./features/http/HttpValidateHeadersTransformer";
52
- import { HttpValidateQueryTransformer } from "./features/http/HttpValidateQueryTransformer";
53
- import { JsonApplicationTransformer } from "./features/json/JsonApplicationTransformer";
54
- // import { JsonApplicationTransformer } from "./features/json/JsonApplicationTransformer";
55
- import { JsonAssertParseTransformer } from "./features/json/JsonAssertParseTransformer";
56
- import { JsonAssertStringifyTransformer } from "./features/json/JsonAssertStringifyTransformer";
57
- import { JsonCreateAssertParseTransformer } from "./features/json/JsonCreateAssertParseTransformer";
58
- import { JsonCreateAssertStringifyTransformer } from "./features/json/JsonCreateAssertStringifyTransformer";
59
- import { JsonCreateIsParseTransformer } from "./features/json/JsonCreateIsParseTransformer";
60
- import { JsonCreateIsStringifyTransformer } from "./features/json/JsonCreateIsStringifyTransformer";
61
- import { JsonCreateStringifyTransformer } from "./features/json/JsonCreateStringifyTransformer";
62
- import { JsonCreateValidateParseTransformer } from "./features/json/JsonCreateValidateParseTransformer";
63
- import { JsonCreateValidateStringifyTransformer } from "./features/json/JsonCreateValidateStringifyProgrammer";
64
- import { JsonIsParseTransformer } from "./features/json/JsonIsParseTransformer";
65
- import { JsonIsStringifyTransformer } from "./features/json/JsonIsStringifyTransformer";
66
- import { JsonSchemaTransformer } from "./features/json/JsonSchemaTransformer";
67
- import { JsonSchemasTransformer } from "./features/json/JsonSchemasTransformer";
68
- import { JsonStringifyTransformer } from "./features/json/JsonStringifyTransformer";
69
- import { JsonValidateParseTransformer } from "./features/json/JsonValidateParseTransformer";
70
- import { JsonValidateStringifyTransformer } from "./features/json/JsonValidateStringifyTransformer";
71
- import { LlmApplicationTransformer } from "./features/llm/LlmApplicationTransformer";
72
- import { LlmCoerceTransformer } from "./features/llm/LlmCoerceTransformer";
73
- import { LlmControllerTransformer } from "./features/llm/LlmControllerTransformer";
74
- import { LlmCreateCoerceTransformer } from "./features/llm/LlmCreateCoerceTransformer";
75
- import { LlmCreateParseTransformer } from "./features/llm/LlmCreateParseTransformer";
76
- import { LlmParametersTransformer } from "./features/llm/LlmParametersTransformer";
77
- import { LlmParseTransformer } from "./features/llm/LlmParseTransformer";
78
- import { LlmSchemaTransformer } from "./features/llm/LlmSchemaTransformer";
79
- import { MiscAssertCloneTransformer } from "./features/misc/MiscAssertCloneTransformer";
80
- import { MiscAssertPruneTransformer } from "./features/misc/MiscAssertPruneTransformer";
81
- import { MiscCloneTransformer } from "./features/misc/MiscCloneTransformer";
82
- import { MiscCreateAssertCloneTransformer } from "./features/misc/MiscCreateAssertCloneTransformer";
83
- import { MiscCreateAssertPruneTransformer } from "./features/misc/MiscCreateAssertPruneTransformer";
84
- import { MiscCreateCloneTransformer } from "./features/misc/MiscCreateCloneTransformer";
85
- import { MiscCreateIsCloneTransformer } from "./features/misc/MiscCreateIsCloneTransformer";
86
- import { MiscCreateIsPruneTransformer } from "./features/misc/MiscCreateIsPruneTransformer";
87
- import { MiscCreatePruneTransformer } from "./features/misc/MiscCreatePruneTransformer";
88
- import { MiscCreateValidateCloneTransformer } from "./features/misc/MiscCreateValidateCloneTransformer";
89
- import { MiscCreateValidatePruneTransformer } from "./features/misc/MiscCreateValidatePruneTransformer";
90
- import { MiscIsCloneTransformer } from "./features/misc/MiscIsCloneTransformer";
91
- import { MiscIsPruneTransformer } from "./features/misc/MiscIsPruneTransformer";
92
- import { MiscLiteralsTransformer } from "./features/misc/MiscLiteralsTransformer";
93
- import { MiscPruneTransformer } from "./features/misc/MiscPruneTransformer";
94
- import { MiscValidateCloneTransformer } from "./features/misc/MiscValidateCloneTransformer";
95
- import { MiscValidatePruneTransformer } from "./features/misc/MiscValidatePruneTransformer";
96
- import { NotationAssertGeneralTransformer } from "./features/notations/NotationAssertGeneralTransformer";
97
- import { NotationCreateAssertGeneralTransformer } from "./features/notations/NotationCreateAssertGeneralTransformer";
98
- import { NotationCreateGeneralTransformer } from "./features/notations/NotationCreateGeneralTransformer";
99
- import { NotationCreateIsGeneralTransformer } from "./features/notations/NotationCreateIsGeneralTransformer";
100
- import { NotationCreateValidateGeneralTransformer } from "./features/notations/NotationCreateValidateGeneralTransformer";
101
- import { NotationGeneralTransformer } from "./features/notations/NotationGeneralTransformer";
102
- import { NotationIsGeneralTransformer } from "./features/notations/NotationIsGeneralTransformer";
103
- import { NotationValidateGeneralTransformer } from "./features/notations/NotationValidateGeneralTransformer";
104
- import { ProtobufAssertDecodeTransformer } from "./features/protobuf/ProtobufAssertDecodeTransformer";
105
- import { ProtobufAssertEncodeTransformer } from "./features/protobuf/ProtobufAssertEncodeTransformer";
106
- import { ProtobufCreateAssertDecodeTransformer } from "./features/protobuf/ProtobufCreateAssertDecodeTransformer";
107
- import { ProtobufCreateAssertEncodeTransformer } from "./features/protobuf/ProtobufCreateAssertEncodeTransformer";
108
- import { ProtobufCreateDecodeTransformer } from "./features/protobuf/ProtobufCreateDecodeTransformer";
109
- import { ProtobufCreateEncodeTransformer } from "./features/protobuf/ProtobufCreateEncodeTransformer";
110
- import { ProtobufCreateIsDecodeTransformer } from "./features/protobuf/ProtobufCreateIsDecodeTransformer";
111
- import { ProtobufCreateIsEncodeTransformer } from "./features/protobuf/ProtobufCreateIsEncodeTransformer";
112
- import { ProtobufCreateValidateDecodeTransformer } from "./features/protobuf/ProtobufCreateValidateDecodeTransformer";
113
- import { ProtobufCreateValidateEncodeTransformer } from "./features/protobuf/ProtobufCreateValidateEncodeTransformer";
114
- import { ProtobufDecodeTransformer } from "./features/protobuf/ProtobufDecodeTransformer";
115
- import { ProtobufEncodeTransformer } from "./features/protobuf/ProtobufEncodeTransformer";
116
- import { ProtobufIsDecodeTransformer } from "./features/protobuf/ProtobufIsDecodeTransformer";
117
- import { ProtobufIsEncodeTransformer } from "./features/protobuf/ProtobufIsEncodeTransformer";
118
- import { ProtobufMessageTransformer } from "./features/protobuf/ProtobufMessageTransformer";
119
- import { ProtobufValidateDecodeTransformer } from "./features/protobuf/ProtobufValidateDecodeTransformer";
120
- import { ProtobufValidateEncodeTransformer } from "./features/protobuf/ProtobufValidateEncodeTransformer";
121
- import { ReflectMetadataTransformer } from "./features/reflect/ReflectMetadataTransformer";
122
- import { ReflectNameTransformer } from "./features/reflect/ReflectNameTransformer";
123
- import { ReflectSchemaTransformer } from "./features/reflect/ReflectSchemaTransformer";
124
- import { ReflectSchemasTransformer } from "./features/reflect/ReflectSchemasTransformer";
125
-
126
- /**
127
- * Transforms `typia.*` function call expressions.
128
- *
129
- * Routes typia function calls (e.g., `typia.is<T>()`, `typia.assert<T>()`) to
130
- * their corresponding transformers. Identifies calls by resolving the
131
- * declaration signature and matching against registered functor map.
132
- *
133
- * @author Jeongho Nam - https://github.com/samchon
134
- */
135
- export namespace CallExpressionTransformer {
136
- export const transform = (props: {
137
- context: ITypiaContext;
138
- expression: ts.CallExpression;
139
- }): ts.Expression | null => {
140
- //----
141
- // VALIDATIONS
142
- //----
143
- // SIGNATURE DECLARATION
144
- const declaration: ts.Declaration | undefined =
145
- props.context.checker.getResolvedSignature(props.expression)?.declaration;
146
- if (!declaration) return props.expression;
147
-
148
- // FILE PATH
149
- const location: string = path.resolve(declaration.getSourceFile().fileName);
150
- if (isTarget(location) === false) return props.expression;
151
-
152
- //----
153
- // TRANSFORMATION
154
- //----
155
- // FUNCTION NAME
156
- const module: string = location.split(path.sep).at(-1)!.split(".")[0]!;
157
- const { name } =
158
- props.context.checker.getTypeAtLocation(declaration).symbol;
159
-
160
- // FIND TRANSFORMER
161
- const functor: (() => Task) | undefined = FUNCTORS[module]?.[name];
162
- if (functor === undefined) return props.expression;
163
-
164
- // RETURNS WITH TRANSFORMATION
165
- const result: ts.Expression | null = functor()({
166
- context: props.context,
167
- modulo: props.expression.expression,
168
- expression: props.expression,
169
- });
170
- return result ?? props.expression;
171
- };
172
-
173
- const isTarget = (location: string): boolean => {
174
- const files: string[] = Object.keys(FUNCTORS);
175
- return files.some(
176
- (f) =>
177
- location.includes(path.join("typia", "lib", `${f}.d.ts`)) ||
178
- location.includes(path.join("typia", "src", `${f}.ts`)),
179
- );
180
- };
181
- }
182
-
183
- type Task = (props: ITransformProps) => ts.Expression | null;
184
-
185
- const FUNCTORS: Record<string, Record<string, () => Task>> = {
186
- module: {
187
- // BASIC
188
- assert: () => AssertTransformer.transform({ equals: false, guard: false }),
189
- assertGuard: () =>
190
- AssertTransformer.transform({ equals: false, guard: true }),
191
- assertType: () =>
192
- AssertTransformer.transform({ equals: false, guard: false }),
193
- is: () => IsTransformer.transform({ equals: false }),
194
- validate: () => ValidateTransformer.transform({ equals: false }),
195
-
196
- // STRICT
197
- assertEquals: () =>
198
- AssertTransformer.transform({ equals: true, guard: false }),
199
- assertGuardEquals: () =>
200
- AssertTransformer.transform({ equals: true, guard: true }),
201
- equals: () => IsTransformer.transform({ equals: true }),
202
- validateEquals: () => ValidateTransformer.transform({ equals: true }),
203
-
204
- // RANDOM + INTERNAL
205
- random: () => RandomTransformer.transform,
206
- metadata: () => ReflectMetadataTransformer.transform,
207
-
208
- // FACTORIES
209
- createAssert: () =>
210
- CreateAssertTransformer.transform({ equals: false, guard: false }),
211
- createAssertGuard: () =>
212
- CreateAssertTransformer.transform({ equals: false, guard: true }),
213
- createAssertType: () =>
214
- CreateAssertTransformer.transform({ equals: false, guard: false }),
215
- createIs: () => CreateIsTransformer.transform({ equals: false }),
216
- createValidate: () =>
217
- CreateValidateTransformer.transform({
218
- equals: false,
219
- standardSchema: true,
220
- }),
221
- createAssertEquals: () =>
222
- CreateAssertTransformer.transform({ equals: true, guard: false }),
223
- createAssertGuardEquals: () =>
224
- CreateAssertTransformer.transform({ equals: true, guard: true }),
225
- createEquals: () => CreateIsTransformer.transform({ equals: true }),
226
- createValidateEquals: () =>
227
- CreateValidateTransformer.transform({
228
- equals: true,
229
- standardSchema: true,
230
- }),
231
- createRandom: () => CreateRandomTransformer.transform,
232
- },
233
- functional: {
234
- // ASSERTIONS
235
- assertFunction: () =>
236
- FunctionalGenericTransformer.transform({
237
- method: "assertFunction",
238
- config: {
239
- equals: false,
240
- },
241
- programmer: FunctionalAssertFunctionProgrammer.write,
242
- }),
243
- assertParameters: () =>
244
- FunctionalGenericTransformer.transform({
245
- method: "assertParameters",
246
- config: {
247
- equals: false,
248
- },
249
- programmer: FunctionalAssertParametersProgrammer.write,
250
- }),
251
- assertReturn: () =>
252
- FunctionalGenericTransformer.transform({
253
- method: "assertReturn",
254
- config: {
255
- equals: false,
256
- },
257
- programmer: FunctionAssertReturnProgrammer.write,
258
- }),
259
- assertEqualsFunction: () =>
260
- FunctionalGenericTransformer.transform({
261
- method: "assertEqualsFunction",
262
- config: {
263
- equals: true,
264
- },
265
- programmer: FunctionalAssertFunctionProgrammer.write,
266
- }),
267
- assertEqualsParameters: () =>
268
- FunctionalGenericTransformer.transform({
269
- method: "assertEqualsParameters",
270
- config: {
271
- equals: true,
272
- },
273
- programmer: FunctionalAssertParametersProgrammer.write,
274
- }),
275
- assertEqualsReturn: () =>
276
- FunctionalGenericTransformer.transform({
277
- method: "assertEqualsReturn",
278
- config: {
279
- equals: true,
280
- },
281
- programmer: FunctionAssertReturnProgrammer.write,
282
- }),
283
-
284
- // IS
285
- isFunction: () =>
286
- FunctionalGenericTransformer.transform({
287
- method: "isFunction",
288
- config: {
289
- equals: false,
290
- },
291
- programmer: FunctionalIsFunctionProgrammer.write,
292
- }),
293
- isParameters: () =>
294
- FunctionalGenericTransformer.transform({
295
- method: "isParameters",
296
- config: {
297
- equals: false,
298
- },
299
- programmer: FunctionalIsParametersProgrammer.write,
300
- }),
301
- isReturn: () =>
302
- FunctionalGenericTransformer.transform({
303
- method: "isReturn",
304
- config: {
305
- equals: false,
306
- },
307
- programmer: FunctionalIsReturnProgrammer.write,
308
- }),
309
- equalsFunction: () =>
310
- FunctionalGenericTransformer.transform({
311
- method: "equalsFunction",
312
- config: {
313
- equals: true,
314
- },
315
- programmer: FunctionalIsFunctionProgrammer.write,
316
- }),
317
- equalsParameters: () =>
318
- FunctionalGenericTransformer.transform({
319
- method: "equalsParameters",
320
- config: {
321
- equals: true,
322
- },
323
- programmer: FunctionalIsParametersProgrammer.write,
324
- }),
325
- equalsReturn: () =>
326
- FunctionalGenericTransformer.transform({
327
- method: "equalsReturn",
328
- config: {
329
- equals: true,
330
- },
331
- programmer: FunctionalIsReturnProgrammer.write,
332
- }),
333
-
334
- // VALIDATIONS
335
- validateFunction: () =>
336
- FunctionalGenericTransformer.transform({
337
- method: "validateFunction",
338
- config: {
339
- equals: false,
340
- },
341
- programmer: FunctionalValidateFunctionProgrammer.write,
342
- }),
343
- validateParameters: () =>
344
- FunctionalGenericTransformer.transform({
345
- method: "validateParameters",
346
- config: {
347
- equals: false,
348
- },
349
- programmer: FunctionalValidateParametersProgrammer.write,
350
- }),
351
- validateReturn: () =>
352
- FunctionalGenericTransformer.transform({
353
- method: "validateReturn",
354
- config: {
355
- equals: false,
356
- },
357
- programmer: FunctionalValidateReturnProgrammer.write,
358
- }),
359
- validateEqualsFunction: () =>
360
- FunctionalGenericTransformer.transform({
361
- method: "validateEqualsFunction",
362
- config: {
363
- equals: true,
364
- },
365
- programmer: FunctionalValidateFunctionProgrammer.write,
366
- }),
367
- validateEqualsParameters: () =>
368
- FunctionalGenericTransformer.transform({
369
- method: "validateEqualsParameters",
370
- config: {
371
- equals: true,
372
- },
373
- programmer: FunctionalValidateParametersProgrammer.write,
374
- }),
375
- validateEqualsReturn: () =>
376
- FunctionalGenericTransformer.transform({
377
- method: "validateEqualsReturn",
378
- config: {
379
- equals: true,
380
- },
381
- programmer: FunctionalValidateReturnProgrammer.write,
382
- }),
383
- },
384
- http: {
385
- // FORM-DATA
386
- formData: () => HttpFormDataTransformer.transform,
387
- isFormData: () => HttpIsFormDataTransformer.transform,
388
- assertFormData: () => HttpAssertFormDataTransformer.transform,
389
- validateFormData: () => HttpValidateFormDataTransformer.transform,
390
-
391
- // HEADERS
392
- headers: () => HttpHeadersTransformer.transform,
393
- isHeaders: () => HttpIsHeadersTransformer.transform,
394
- assertHeaders: () => HttpAssertHeadersTransformer.transform,
395
- validateHeaders: () => HttpValidateHeadersTransformer.transform,
396
-
397
- // PARAMETER
398
- parameter: () => HttpParameterTransformer.transform,
399
-
400
- // QUERY
401
- query: () => HttpQueryTransformer.transform,
402
- isQuery: () => HttpIsQueryTransformer.transform,
403
- assertQuery: () => HttpAssertQueryTransformer.transform,
404
- validateQuery: () => HttpValidateQueryTransformer.transform,
405
-
406
- // FACTORIES
407
- createFormData: () => CreateHttpFormDataTransformer.transform,
408
- createIsFormData: () => CreateHttpIsFormDataTransformer.transform,
409
- createAssertFormData: () => CreateHttpAssertFormDataTransformer.transform,
410
- createValidateFormData: () =>
411
- CreateHttpValidateFormDataTransformer.transform,
412
- createHeaders: () => CreateHttpHeadersTransformer.transform,
413
- createIsHeaders: () => CreateHttpIsHeadersTransformer.transform,
414
- createAssertHeaders: () => CreateHttpAssertHeadersTransformer.transform,
415
- createValidateHeaders: () => CreateHttpValidateHeadersTransformer.transform,
416
- createParameter: () => CreateHttpParameterTransformer.transform,
417
- createQuery: () => CreateHttpQueryTransformer.transform,
418
- createIsQuery: () => CreateHttpIsQueryTransformer.transform,
419
- createAssertQuery: () => CreateHttpAssertQueryTransformer.transform,
420
- createValidateQuery: () => CreateHttpValidateQueryTransformer.transform,
421
- },
422
- llm: {
423
- controller: () => LlmControllerTransformer.transform,
424
- applicationOfValidate: () => LlmApplicationTransformer.transform,
425
- application: () => LlmApplicationTransformer.transform,
426
- parameters: () => LlmParametersTransformer.transform,
427
- schema: () => LlmSchemaTransformer.transform,
428
- parse: () => LlmParseTransformer.transform,
429
- createParse: () => LlmCreateParseTransformer.transform,
430
- coerce: () => LlmCoerceTransformer.transform,
431
- createCoerce: () => LlmCreateCoerceTransformer.transform,
432
- },
433
- json: {
434
- // METADATA
435
- schema: () => JsonSchemaTransformer.transform,
436
- schemas: () => JsonSchemasTransformer.transform,
437
- application: () => JsonApplicationTransformer.transform,
438
-
439
- // PARSER
440
- isParse: () => JsonIsParseTransformer.transform,
441
- assertParse: () => JsonAssertParseTransformer.transform,
442
- validateParse: () => JsonValidateParseTransformer.transform,
443
-
444
- // STRINGIFY
445
- stringify: () => JsonStringifyTransformer.transform,
446
- assertStringify: () => JsonAssertStringifyTransformer.transform,
447
- isStringify: () => JsonIsStringifyTransformer.transform,
448
- validateStringify: () => JsonValidateStringifyTransformer.transform,
449
-
450
- // FACTORIES
451
- createIsParse: () => JsonCreateIsParseTransformer.transform,
452
- createAssertParse: () => JsonCreateAssertParseTransformer.transform,
453
- createValidateParse: () => JsonCreateValidateParseTransformer.transform,
454
- createStringify: () => JsonCreateStringifyTransformer.transform,
455
- createAssertStringify: () => JsonCreateAssertStringifyTransformer.transform,
456
- createIsStringify: () => JsonCreateIsStringifyTransformer.transform,
457
- createValidateStringify: () =>
458
- JsonCreateValidateStringifyTransformer.transform,
459
- },
460
- protobuf: {
461
- // SCHEMA
462
- message: () => ProtobufMessageTransformer.transform,
463
-
464
- // ENCODE
465
- encode: () => ProtobufEncodeTransformer.transform,
466
- assertEncode: () => ProtobufAssertEncodeTransformer.transform,
467
- isEncode: () => ProtobufIsEncodeTransformer.transform,
468
- validateEncode: () => ProtobufValidateEncodeTransformer.transform,
469
-
470
- // DECODE
471
- decode: () => ProtobufDecodeTransformer.transform,
472
- assertDecode: () => ProtobufAssertDecodeTransformer.transform,
473
- isDecode: () => ProtobufIsDecodeTransformer.transform,
474
- validateDecode: () => ProtobufValidateDecodeTransformer.transform,
475
-
476
- // FACTORIES
477
- createEncode: () => ProtobufCreateEncodeTransformer.transform,
478
- createAssertEncode: () => ProtobufCreateAssertEncodeTransformer.transform,
479
- createIsEncode: () => ProtobufCreateIsEncodeTransformer.transform,
480
- createValidateEncode: () =>
481
- ProtobufCreateValidateEncodeTransformer.transform,
482
- createDecode: () => ProtobufCreateDecodeTransformer.transform,
483
- createAssertDecode: () => ProtobufCreateAssertDecodeTransformer.transform,
484
- createIsDecode: () => ProtobufCreateIsDecodeTransformer.transform,
485
- createValidateDecode: () =>
486
- ProtobufCreateValidateDecodeTransformer.transform,
487
- },
488
- reflect: {
489
- metadata: () => ReflectMetadataTransformer.transform,
490
- name: () => ReflectNameTransformer.transform,
491
- schema: () => ReflectSchemaTransformer.transform,
492
- schemas: () => ReflectSchemasTransformer.transform,
493
- },
494
- misc: {
495
- literals: () => MiscLiteralsTransformer.transform,
496
-
497
- // CLONE
498
- clone: () => MiscCloneTransformer.transform,
499
- assertClone: () => MiscAssertCloneTransformer.transform,
500
- isClone: () => MiscIsCloneTransformer.transform,
501
- validateClone: () => MiscValidateCloneTransformer.transform,
502
-
503
- // PRUNE
504
- prune: () => MiscPruneTransformer.transform,
505
- assertPrune: () => MiscAssertPruneTransformer.transform,
506
- isPrune: () => MiscIsPruneTransformer.transform,
507
- validatePrune: () => MiscValidatePruneTransformer.transform,
508
-
509
- // FACTORIES
510
- createClone: () => MiscCreateCloneTransformer.transform,
511
- createAssertClone: () => MiscCreateAssertCloneTransformer.transform,
512
- createIsClone: () => MiscCreateIsCloneTransformer.transform,
513
- createValidateClone: () => MiscCreateValidateCloneTransformer.transform,
514
- createPrune: () => MiscCreatePruneTransformer.transform,
515
- createAssertPrune: () => MiscCreateAssertPruneTransformer.transform,
516
- createIsPrune: () => MiscCreateIsPruneTransformer.transform,
517
- createValidatePrune: () => MiscCreateValidatePruneTransformer.transform,
518
- },
519
- notations: {
520
- // CAMEL
521
- camel: () => NotationGeneralTransformer.transform(NamingConvention.camel),
522
- assertCamel: () =>
523
- NotationAssertGeneralTransformer.transform(NamingConvention.camel),
524
- isCamel: () =>
525
- NotationIsGeneralTransformer.transform(NamingConvention.camel),
526
- validateCamel: () =>
527
- NotationValidateGeneralTransformer.transform(NamingConvention.camel),
528
-
529
- // PASCAL
530
- pascal: () => NotationGeneralTransformer.transform(NamingConvention.pascal),
531
- assertPascal: () =>
532
- NotationAssertGeneralTransformer.transform(NamingConvention.pascal),
533
- isPascal: () =>
534
- NotationIsGeneralTransformer.transform(NamingConvention.pascal),
535
- validatePascal: () =>
536
- NotationValidateGeneralTransformer.transform(NamingConvention.pascal),
537
-
538
- // SNAKE
539
- snake: () => NotationGeneralTransformer.transform(NamingConvention.snake),
540
- assertSnake: () =>
541
- NotationAssertGeneralTransformer.transform(NamingConvention.snake),
542
- isSnake: () =>
543
- NotationIsGeneralTransformer.transform(NamingConvention.snake),
544
- validateSnake: () =>
545
- NotationValidateGeneralTransformer.transform(NamingConvention.snake),
546
-
547
- // FACTORIES
548
- createCamel: () =>
549
- NotationCreateGeneralTransformer.transform(NamingConvention.camel),
550
- createAssertCamel: () =>
551
- NotationCreateAssertGeneralTransformer.transform(NamingConvention.camel),
552
- createIsCamel: () =>
553
- NotationCreateIsGeneralTransformer.transform(NamingConvention.camel),
554
- createValidateCamel: () =>
555
- NotationCreateValidateGeneralTransformer.transform(
556
- NamingConvention.camel,
557
- ),
558
- createPascal: () =>
559
- NotationCreateGeneralTransformer.transform(NamingConvention.pascal),
560
- createAssertPascal: () =>
561
- NotationCreateAssertGeneralTransformer.transform(NamingConvention.pascal),
562
- createIsPascal: () =>
563
- NotationCreateIsGeneralTransformer.transform(NamingConvention.pascal),
564
- createValidatePascal: () =>
565
- NotationCreateValidateGeneralTransformer.transform(
566
- NamingConvention.pascal,
567
- ),
568
- createSnake: () =>
569
- NotationCreateGeneralTransformer.transform(NamingConvention.snake),
570
- createAssertSnake: () =>
571
- NotationCreateAssertGeneralTransformer.transform(NamingConvention.snake),
572
- createIsSnake: () =>
573
- NotationCreateIsGeneralTransformer.transform(NamingConvention.snake),
574
- createValidateSnake: () =>
575
- NotationCreateValidateGeneralTransformer.transform(
576
- NamingConvention.snake,
577
- ),
578
- },
579
- };
1
+ import {
2
+ FunctionAssertReturnProgrammer,
3
+ FunctionalAssertFunctionProgrammer,
4
+ FunctionalAssertParametersProgrammer,
5
+ FunctionalIsFunctionProgrammer,
6
+ FunctionalIsParametersProgrammer,
7
+ FunctionalIsReturnProgrammer,
8
+ FunctionalValidateFunctionProgrammer,
9
+ FunctionalValidateParametersProgrammer,
10
+ FunctionalValidateReturnProgrammer,
11
+ ITypiaContext,
12
+ } from "@typia/core";
13
+ import { NamingConvention } from "@typia/utils";
14
+ import path from "path";
15
+ import ts from "typescript";
16
+
17
+ import { ITransformProps } from "./ITransformProps";
18
+ import { AssertTransformer } from "./features/AssertTransformer";
19
+ import { CreateAssertTransformer } from "./features/CreateAssertTransformer";
20
+ import { CreateIsTransformer } from "./features/CreateIsTransformer";
21
+ import { CreateRandomTransformer } from "./features/CreateRandomTransformer";
22
+ import { CreateValidateTransformer } from "./features/CreateValidateTransformer";
23
+ import { IsTransformer } from "./features/IsTransformer";
24
+ import { RandomTransformer } from "./features/RandomTransformer";
25
+ import { ValidateTransformer } from "./features/ValidateTransformer";
26
+ import { FunctionalGenericTransformer } from "./features/functional/FunctionalGenericTransformer";
27
+ import { CreateHttpAssertFormDataTransformer } from "./features/http/CreateHttpAssertFormDataTransformer";
28
+ import { CreateHttpAssertHeadersTransformer } from "./features/http/CreateHttpAssertHeadersTransformer";
29
+ import { CreateHttpAssertQueryTransformer } from "./features/http/CreateHttpAssertQueryTransformer";
30
+ import { CreateHttpFormDataTransformer } from "./features/http/CreateHttpFormDataTransformer";
31
+ import { CreateHttpHeadersTransformer } from "./features/http/CreateHttpHeadersTransformer";
32
+ import { CreateHttpIsFormDataTransformer } from "./features/http/CreateHttpIsFormDataTransformer";
33
+ import { CreateHttpIsHeadersTransformer } from "./features/http/CreateHttpIsHeadersTransformer";
34
+ import { CreateHttpIsQueryTransformer } from "./features/http/CreateHttpIsQueryTransformer";
35
+ import { CreateHttpParameterTransformer } from "./features/http/CreateHttpParameterTransformer";
36
+ import { CreateHttpQueryTransformer } from "./features/http/CreateHttpQueryTransformer";
37
+ import { CreateHttpValidateFormDataTransformer } from "./features/http/CreateHttpValidateFormDataTransformer";
38
+ import { CreateHttpValidateHeadersTransformer } from "./features/http/CreateHttpValidateHeadersTransformer";
39
+ import { CreateHttpValidateQueryTransformer } from "./features/http/CreateHttpValidateQueryTransformer";
40
+ import { HttpAssertFormDataTransformer } from "./features/http/HttpAssertFormDataTransformer";
41
+ import { HttpAssertHeadersTransformer } from "./features/http/HttpAssertHeadersTransformer";
42
+ import { HttpAssertQueryTransformer } from "./features/http/HttpAssertQueryTransformer";
43
+ import { HttpFormDataTransformer } from "./features/http/HttpFormDataTransformer";
44
+ import { HttpHeadersTransformer } from "./features/http/HttpHeadersTransformer";
45
+ import { HttpIsFormDataTransformer } from "./features/http/HttpIsFormDataTransformer";
46
+ import { HttpIsHeadersTransformer } from "./features/http/HttpIsHeadersTransformer";
47
+ import { HttpIsQueryTransformer } from "./features/http/HttpIsQueryTransformer";
48
+ import { HttpParameterTransformer } from "./features/http/HttpParameterTransformer";
49
+ import { HttpQueryTransformer } from "./features/http/HttpQueryTransformer";
50
+ import { HttpValidateFormDataTransformer } from "./features/http/HttpValidateFormDataTransformer";
51
+ import { HttpValidateHeadersTransformer } from "./features/http/HttpValidateHeadersTransformer";
52
+ import { HttpValidateQueryTransformer } from "./features/http/HttpValidateQueryTransformer";
53
+ import { JsonApplicationTransformer } from "./features/json/JsonApplicationTransformer";
54
+ // import { JsonApplicationTransformer } from "./features/json/JsonApplicationTransformer";
55
+ import { JsonAssertParseTransformer } from "./features/json/JsonAssertParseTransformer";
56
+ import { JsonAssertStringifyTransformer } from "./features/json/JsonAssertStringifyTransformer";
57
+ import { JsonCreateAssertParseTransformer } from "./features/json/JsonCreateAssertParseTransformer";
58
+ import { JsonCreateAssertStringifyTransformer } from "./features/json/JsonCreateAssertStringifyTransformer";
59
+ import { JsonCreateIsParseTransformer } from "./features/json/JsonCreateIsParseTransformer";
60
+ import { JsonCreateIsStringifyTransformer } from "./features/json/JsonCreateIsStringifyTransformer";
61
+ import { JsonCreateStringifyTransformer } from "./features/json/JsonCreateStringifyTransformer";
62
+ import { JsonCreateValidateParseTransformer } from "./features/json/JsonCreateValidateParseTransformer";
63
+ import { JsonCreateValidateStringifyTransformer } from "./features/json/JsonCreateValidateStringifyProgrammer";
64
+ import { JsonIsParseTransformer } from "./features/json/JsonIsParseTransformer";
65
+ import { JsonIsStringifyTransformer } from "./features/json/JsonIsStringifyTransformer";
66
+ import { JsonSchemaTransformer } from "./features/json/JsonSchemaTransformer";
67
+ import { JsonSchemasTransformer } from "./features/json/JsonSchemasTransformer";
68
+ import { JsonStringifyTransformer } from "./features/json/JsonStringifyTransformer";
69
+ import { JsonValidateParseTransformer } from "./features/json/JsonValidateParseTransformer";
70
+ import { JsonValidateStringifyTransformer } from "./features/json/JsonValidateStringifyTransformer";
71
+ import { LlmApplicationTransformer } from "./features/llm/LlmApplicationTransformer";
72
+ import { LlmCoerceTransformer } from "./features/llm/LlmCoerceTransformer";
73
+ import { LlmControllerTransformer } from "./features/llm/LlmControllerTransformer";
74
+ import { LlmCreateCoerceTransformer } from "./features/llm/LlmCreateCoerceTransformer";
75
+ import { LlmCreateParseTransformer } from "./features/llm/LlmCreateParseTransformer";
76
+ import { LlmParametersTransformer } from "./features/llm/LlmParametersTransformer";
77
+ import { LlmParseTransformer } from "./features/llm/LlmParseTransformer";
78
+ import { LlmSchemaTransformer } from "./features/llm/LlmSchemaTransformer";
79
+ import { LlmStructuredOutputTransformer } from "./features/llm/LlmStructuredOutputTransformer";
80
+ import { MiscAssertCloneTransformer } from "./features/misc/MiscAssertCloneTransformer";
81
+ import { MiscAssertPruneTransformer } from "./features/misc/MiscAssertPruneTransformer";
82
+ import { MiscCloneTransformer } from "./features/misc/MiscCloneTransformer";
83
+ import { MiscCreateAssertCloneTransformer } from "./features/misc/MiscCreateAssertCloneTransformer";
84
+ import { MiscCreateAssertPruneTransformer } from "./features/misc/MiscCreateAssertPruneTransformer";
85
+ import { MiscCreateCloneTransformer } from "./features/misc/MiscCreateCloneTransformer";
86
+ import { MiscCreateIsCloneTransformer } from "./features/misc/MiscCreateIsCloneTransformer";
87
+ import { MiscCreateIsPruneTransformer } from "./features/misc/MiscCreateIsPruneTransformer";
88
+ import { MiscCreatePruneTransformer } from "./features/misc/MiscCreatePruneTransformer";
89
+ import { MiscCreateValidateCloneTransformer } from "./features/misc/MiscCreateValidateCloneTransformer";
90
+ import { MiscCreateValidatePruneTransformer } from "./features/misc/MiscCreateValidatePruneTransformer";
91
+ import { MiscIsCloneTransformer } from "./features/misc/MiscIsCloneTransformer";
92
+ import { MiscIsPruneTransformer } from "./features/misc/MiscIsPruneTransformer";
93
+ import { MiscLiteralsTransformer } from "./features/misc/MiscLiteralsTransformer";
94
+ import { MiscPruneTransformer } from "./features/misc/MiscPruneTransformer";
95
+ import { MiscValidateCloneTransformer } from "./features/misc/MiscValidateCloneTransformer";
96
+ import { MiscValidatePruneTransformer } from "./features/misc/MiscValidatePruneTransformer";
97
+ import { NotationAssertGeneralTransformer } from "./features/notations/NotationAssertGeneralTransformer";
98
+ import { NotationCreateAssertGeneralTransformer } from "./features/notations/NotationCreateAssertGeneralTransformer";
99
+ import { NotationCreateGeneralTransformer } from "./features/notations/NotationCreateGeneralTransformer";
100
+ import { NotationCreateIsGeneralTransformer } from "./features/notations/NotationCreateIsGeneralTransformer";
101
+ import { NotationCreateValidateGeneralTransformer } from "./features/notations/NotationCreateValidateGeneralTransformer";
102
+ import { NotationGeneralTransformer } from "./features/notations/NotationGeneralTransformer";
103
+ import { NotationIsGeneralTransformer } from "./features/notations/NotationIsGeneralTransformer";
104
+ import { NotationValidateGeneralTransformer } from "./features/notations/NotationValidateGeneralTransformer";
105
+ import { ProtobufAssertDecodeTransformer } from "./features/protobuf/ProtobufAssertDecodeTransformer";
106
+ import { ProtobufAssertEncodeTransformer } from "./features/protobuf/ProtobufAssertEncodeTransformer";
107
+ import { ProtobufCreateAssertDecodeTransformer } from "./features/protobuf/ProtobufCreateAssertDecodeTransformer";
108
+ import { ProtobufCreateAssertEncodeTransformer } from "./features/protobuf/ProtobufCreateAssertEncodeTransformer";
109
+ import { ProtobufCreateDecodeTransformer } from "./features/protobuf/ProtobufCreateDecodeTransformer";
110
+ import { ProtobufCreateEncodeTransformer } from "./features/protobuf/ProtobufCreateEncodeTransformer";
111
+ import { ProtobufCreateIsDecodeTransformer } from "./features/protobuf/ProtobufCreateIsDecodeTransformer";
112
+ import { ProtobufCreateIsEncodeTransformer } from "./features/protobuf/ProtobufCreateIsEncodeTransformer";
113
+ import { ProtobufCreateValidateDecodeTransformer } from "./features/protobuf/ProtobufCreateValidateDecodeTransformer";
114
+ import { ProtobufCreateValidateEncodeTransformer } from "./features/protobuf/ProtobufCreateValidateEncodeTransformer";
115
+ import { ProtobufDecodeTransformer } from "./features/protobuf/ProtobufDecodeTransformer";
116
+ import { ProtobufEncodeTransformer } from "./features/protobuf/ProtobufEncodeTransformer";
117
+ import { ProtobufIsDecodeTransformer } from "./features/protobuf/ProtobufIsDecodeTransformer";
118
+ import { ProtobufIsEncodeTransformer } from "./features/protobuf/ProtobufIsEncodeTransformer";
119
+ import { ProtobufMessageTransformer } from "./features/protobuf/ProtobufMessageTransformer";
120
+ import { ProtobufValidateDecodeTransformer } from "./features/protobuf/ProtobufValidateDecodeTransformer";
121
+ import { ProtobufValidateEncodeTransformer } from "./features/protobuf/ProtobufValidateEncodeTransformer";
122
+ import { ReflectMetadataTransformer } from "./features/reflect/ReflectMetadataTransformer";
123
+ import { ReflectNameTransformer } from "./features/reflect/ReflectNameTransformer";
124
+ import { ReflectSchemaTransformer } from "./features/reflect/ReflectSchemaTransformer";
125
+ import { ReflectSchemasTransformer } from "./features/reflect/ReflectSchemasTransformer";
126
+
127
+ /**
128
+ * Transforms `typia.*` function call expressions.
129
+ *
130
+ * Routes typia function calls (e.g., `typia.is<T>()`, `typia.assert<T>()`) to
131
+ * their corresponding transformers. Identifies calls by resolving the
132
+ * declaration signature and matching against registered functor map.
133
+ *
134
+ * @author Jeongho Nam - https://github.com/samchon
135
+ */
136
+ export namespace CallExpressionTransformer {
137
+ export const transform = (props: {
138
+ context: ITypiaContext;
139
+ expression: ts.CallExpression;
140
+ }): ts.Expression | null => {
141
+ //----
142
+ // VALIDATIONS
143
+ //----
144
+ // SIGNATURE DECLARATION
145
+ const declaration: ts.Declaration | undefined =
146
+ props.context.checker.getResolvedSignature(props.expression)?.declaration;
147
+ if (!declaration) return props.expression;
148
+
149
+ // FILE PATH
150
+ const location: string = path.resolve(declaration.getSourceFile().fileName);
151
+ if (isTarget(location) === false) return props.expression;
152
+
153
+ //----
154
+ // TRANSFORMATION
155
+ //----
156
+ // FUNCTION NAME
157
+ const module: string = location.split(path.sep).at(-1)!.split(".")[0]!;
158
+ const { name } =
159
+ props.context.checker.getTypeAtLocation(declaration).symbol;
160
+
161
+ // FIND TRANSFORMER
162
+ const functor: (() => Task) | undefined = FUNCTORS[module]?.[name];
163
+ if (functor === undefined) return props.expression;
164
+
165
+ // RETURNS WITH TRANSFORMATION
166
+ const result: ts.Expression | null = functor()({
167
+ context: props.context,
168
+ modulo: props.expression.expression,
169
+ expression: props.expression,
170
+ });
171
+ return result ?? props.expression;
172
+ };
173
+
174
+ const isTarget = (location: string): boolean => {
175
+ const files: string[] = Object.keys(FUNCTORS);
176
+ return files.some(
177
+ (f) =>
178
+ location.includes(path.join("typia", "lib", `${f}.d.ts`)) ||
179
+ location.includes(path.join("typia", "src", `${f}.ts`)),
180
+ );
181
+ };
182
+ }
183
+
184
+ type Task = (props: ITransformProps) => ts.Expression | null;
185
+
186
+ const FUNCTORS: Record<string, Record<string, () => Task>> = {
187
+ module: {
188
+ // BASIC
189
+ assert: () => AssertTransformer.transform({ equals: false, guard: false }),
190
+ assertGuard: () =>
191
+ AssertTransformer.transform({ equals: false, guard: true }),
192
+ assertType: () =>
193
+ AssertTransformer.transform({ equals: false, guard: false }),
194
+ is: () => IsTransformer.transform({ equals: false }),
195
+ validate: () => ValidateTransformer.transform({ equals: false }),
196
+
197
+ // STRICT
198
+ assertEquals: () =>
199
+ AssertTransformer.transform({ equals: true, guard: false }),
200
+ assertGuardEquals: () =>
201
+ AssertTransformer.transform({ equals: true, guard: true }),
202
+ equals: () => IsTransformer.transform({ equals: true }),
203
+ validateEquals: () => ValidateTransformer.transform({ equals: true }),
204
+
205
+ // RANDOM + INTERNAL
206
+ random: () => RandomTransformer.transform,
207
+ metadata: () => ReflectMetadataTransformer.transform,
208
+
209
+ // FACTORIES
210
+ createAssert: () =>
211
+ CreateAssertTransformer.transform({ equals: false, guard: false }),
212
+ createAssertGuard: () =>
213
+ CreateAssertTransformer.transform({ equals: false, guard: true }),
214
+ createAssertType: () =>
215
+ CreateAssertTransformer.transform({ equals: false, guard: false }),
216
+ createIs: () => CreateIsTransformer.transform({ equals: false }),
217
+ createValidate: () =>
218
+ CreateValidateTransformer.transform({
219
+ equals: false,
220
+ standardSchema: true,
221
+ }),
222
+ createAssertEquals: () =>
223
+ CreateAssertTransformer.transform({ equals: true, guard: false }),
224
+ createAssertGuardEquals: () =>
225
+ CreateAssertTransformer.transform({ equals: true, guard: true }),
226
+ createEquals: () => CreateIsTransformer.transform({ equals: true }),
227
+ createValidateEquals: () =>
228
+ CreateValidateTransformer.transform({
229
+ equals: true,
230
+ standardSchema: true,
231
+ }),
232
+ createRandom: () => CreateRandomTransformer.transform,
233
+ },
234
+ functional: {
235
+ // ASSERTIONS
236
+ assertFunction: () =>
237
+ FunctionalGenericTransformer.transform({
238
+ method: "assertFunction",
239
+ config: {
240
+ equals: false,
241
+ },
242
+ programmer: FunctionalAssertFunctionProgrammer.write,
243
+ }),
244
+ assertParameters: () =>
245
+ FunctionalGenericTransformer.transform({
246
+ method: "assertParameters",
247
+ config: {
248
+ equals: false,
249
+ },
250
+ programmer: FunctionalAssertParametersProgrammer.write,
251
+ }),
252
+ assertReturn: () =>
253
+ FunctionalGenericTransformer.transform({
254
+ method: "assertReturn",
255
+ config: {
256
+ equals: false,
257
+ },
258
+ programmer: FunctionAssertReturnProgrammer.write,
259
+ }),
260
+ assertEqualsFunction: () =>
261
+ FunctionalGenericTransformer.transform({
262
+ method: "assertEqualsFunction",
263
+ config: {
264
+ equals: true,
265
+ },
266
+ programmer: FunctionalAssertFunctionProgrammer.write,
267
+ }),
268
+ assertEqualsParameters: () =>
269
+ FunctionalGenericTransformer.transform({
270
+ method: "assertEqualsParameters",
271
+ config: {
272
+ equals: true,
273
+ },
274
+ programmer: FunctionalAssertParametersProgrammer.write,
275
+ }),
276
+ assertEqualsReturn: () =>
277
+ FunctionalGenericTransformer.transform({
278
+ method: "assertEqualsReturn",
279
+ config: {
280
+ equals: true,
281
+ },
282
+ programmer: FunctionAssertReturnProgrammer.write,
283
+ }),
284
+
285
+ // IS
286
+ isFunction: () =>
287
+ FunctionalGenericTransformer.transform({
288
+ method: "isFunction",
289
+ config: {
290
+ equals: false,
291
+ },
292
+ programmer: FunctionalIsFunctionProgrammer.write,
293
+ }),
294
+ isParameters: () =>
295
+ FunctionalGenericTransformer.transform({
296
+ method: "isParameters",
297
+ config: {
298
+ equals: false,
299
+ },
300
+ programmer: FunctionalIsParametersProgrammer.write,
301
+ }),
302
+ isReturn: () =>
303
+ FunctionalGenericTransformer.transform({
304
+ method: "isReturn",
305
+ config: {
306
+ equals: false,
307
+ },
308
+ programmer: FunctionalIsReturnProgrammer.write,
309
+ }),
310
+ equalsFunction: () =>
311
+ FunctionalGenericTransformer.transform({
312
+ method: "equalsFunction",
313
+ config: {
314
+ equals: true,
315
+ },
316
+ programmer: FunctionalIsFunctionProgrammer.write,
317
+ }),
318
+ equalsParameters: () =>
319
+ FunctionalGenericTransformer.transform({
320
+ method: "equalsParameters",
321
+ config: {
322
+ equals: true,
323
+ },
324
+ programmer: FunctionalIsParametersProgrammer.write,
325
+ }),
326
+ equalsReturn: () =>
327
+ FunctionalGenericTransformer.transform({
328
+ method: "equalsReturn",
329
+ config: {
330
+ equals: true,
331
+ },
332
+ programmer: FunctionalIsReturnProgrammer.write,
333
+ }),
334
+
335
+ // VALIDATIONS
336
+ validateFunction: () =>
337
+ FunctionalGenericTransformer.transform({
338
+ method: "validateFunction",
339
+ config: {
340
+ equals: false,
341
+ },
342
+ programmer: FunctionalValidateFunctionProgrammer.write,
343
+ }),
344
+ validateParameters: () =>
345
+ FunctionalGenericTransformer.transform({
346
+ method: "validateParameters",
347
+ config: {
348
+ equals: false,
349
+ },
350
+ programmer: FunctionalValidateParametersProgrammer.write,
351
+ }),
352
+ validateReturn: () =>
353
+ FunctionalGenericTransformer.transform({
354
+ method: "validateReturn",
355
+ config: {
356
+ equals: false,
357
+ },
358
+ programmer: FunctionalValidateReturnProgrammer.write,
359
+ }),
360
+ validateEqualsFunction: () =>
361
+ FunctionalGenericTransformer.transform({
362
+ method: "validateEqualsFunction",
363
+ config: {
364
+ equals: true,
365
+ },
366
+ programmer: FunctionalValidateFunctionProgrammer.write,
367
+ }),
368
+ validateEqualsParameters: () =>
369
+ FunctionalGenericTransformer.transform({
370
+ method: "validateEqualsParameters",
371
+ config: {
372
+ equals: true,
373
+ },
374
+ programmer: FunctionalValidateParametersProgrammer.write,
375
+ }),
376
+ validateEqualsReturn: () =>
377
+ FunctionalGenericTransformer.transform({
378
+ method: "validateEqualsReturn",
379
+ config: {
380
+ equals: true,
381
+ },
382
+ programmer: FunctionalValidateReturnProgrammer.write,
383
+ }),
384
+ },
385
+ http: {
386
+ // FORM-DATA
387
+ formData: () => HttpFormDataTransformer.transform,
388
+ isFormData: () => HttpIsFormDataTransformer.transform,
389
+ assertFormData: () => HttpAssertFormDataTransformer.transform,
390
+ validateFormData: () => HttpValidateFormDataTransformer.transform,
391
+
392
+ // HEADERS
393
+ headers: () => HttpHeadersTransformer.transform,
394
+ isHeaders: () => HttpIsHeadersTransformer.transform,
395
+ assertHeaders: () => HttpAssertHeadersTransformer.transform,
396
+ validateHeaders: () => HttpValidateHeadersTransformer.transform,
397
+
398
+ // PARAMETER
399
+ parameter: () => HttpParameterTransformer.transform,
400
+
401
+ // QUERY
402
+ query: () => HttpQueryTransformer.transform,
403
+ isQuery: () => HttpIsQueryTransformer.transform,
404
+ assertQuery: () => HttpAssertQueryTransformer.transform,
405
+ validateQuery: () => HttpValidateQueryTransformer.transform,
406
+
407
+ // FACTORIES
408
+ createFormData: () => CreateHttpFormDataTransformer.transform,
409
+ createIsFormData: () => CreateHttpIsFormDataTransformer.transform,
410
+ createAssertFormData: () => CreateHttpAssertFormDataTransformer.transform,
411
+ createValidateFormData: () =>
412
+ CreateHttpValidateFormDataTransformer.transform,
413
+ createHeaders: () => CreateHttpHeadersTransformer.transform,
414
+ createIsHeaders: () => CreateHttpIsHeadersTransformer.transform,
415
+ createAssertHeaders: () => CreateHttpAssertHeadersTransformer.transform,
416
+ createValidateHeaders: () => CreateHttpValidateHeadersTransformer.transform,
417
+ createParameter: () => CreateHttpParameterTransformer.transform,
418
+ createQuery: () => CreateHttpQueryTransformer.transform,
419
+ createIsQuery: () => CreateHttpIsQueryTransformer.transform,
420
+ createAssertQuery: () => CreateHttpAssertQueryTransformer.transform,
421
+ createValidateQuery: () => CreateHttpValidateQueryTransformer.transform,
422
+ },
423
+ llm: {
424
+ controller: () => LlmControllerTransformer.transform,
425
+ applicationOfValidate: () => LlmApplicationTransformer.transform,
426
+ application: () => LlmApplicationTransformer.transform,
427
+ structuredOutput: () => LlmStructuredOutputTransformer.transform,
428
+ parameters: () => LlmParametersTransformer.transform,
429
+ schema: () => LlmSchemaTransformer.transform,
430
+ parse: () => LlmParseTransformer.transform,
431
+ createParse: () => LlmCreateParseTransformer.transform,
432
+ coerce: () => LlmCoerceTransformer.transform,
433
+ createCoerce: () => LlmCreateCoerceTransformer.transform,
434
+ },
435
+ json: {
436
+ // METADATA
437
+ schema: () => JsonSchemaTransformer.transform,
438
+ schemas: () => JsonSchemasTransformer.transform,
439
+ application: () => JsonApplicationTransformer.transform,
440
+
441
+ // PARSER
442
+ isParse: () => JsonIsParseTransformer.transform,
443
+ assertParse: () => JsonAssertParseTransformer.transform,
444
+ validateParse: () => JsonValidateParseTransformer.transform,
445
+
446
+ // STRINGIFY
447
+ stringify: () => JsonStringifyTransformer.transform,
448
+ assertStringify: () => JsonAssertStringifyTransformer.transform,
449
+ isStringify: () => JsonIsStringifyTransformer.transform,
450
+ validateStringify: () => JsonValidateStringifyTransformer.transform,
451
+
452
+ // FACTORIES
453
+ createIsParse: () => JsonCreateIsParseTransformer.transform,
454
+ createAssertParse: () => JsonCreateAssertParseTransformer.transform,
455
+ createValidateParse: () => JsonCreateValidateParseTransformer.transform,
456
+ createStringify: () => JsonCreateStringifyTransformer.transform,
457
+ createAssertStringify: () => JsonCreateAssertStringifyTransformer.transform,
458
+ createIsStringify: () => JsonCreateIsStringifyTransformer.transform,
459
+ createValidateStringify: () =>
460
+ JsonCreateValidateStringifyTransformer.transform,
461
+ },
462
+ protobuf: {
463
+ // SCHEMA
464
+ message: () => ProtobufMessageTransformer.transform,
465
+
466
+ // ENCODE
467
+ encode: () => ProtobufEncodeTransformer.transform,
468
+ assertEncode: () => ProtobufAssertEncodeTransformer.transform,
469
+ isEncode: () => ProtobufIsEncodeTransformer.transform,
470
+ validateEncode: () => ProtobufValidateEncodeTransformer.transform,
471
+
472
+ // DECODE
473
+ decode: () => ProtobufDecodeTransformer.transform,
474
+ assertDecode: () => ProtobufAssertDecodeTransformer.transform,
475
+ isDecode: () => ProtobufIsDecodeTransformer.transform,
476
+ validateDecode: () => ProtobufValidateDecodeTransformer.transform,
477
+
478
+ // FACTORIES
479
+ createEncode: () => ProtobufCreateEncodeTransformer.transform,
480
+ createAssertEncode: () => ProtobufCreateAssertEncodeTransformer.transform,
481
+ createIsEncode: () => ProtobufCreateIsEncodeTransformer.transform,
482
+ createValidateEncode: () =>
483
+ ProtobufCreateValidateEncodeTransformer.transform,
484
+ createDecode: () => ProtobufCreateDecodeTransformer.transform,
485
+ createAssertDecode: () => ProtobufCreateAssertDecodeTransformer.transform,
486
+ createIsDecode: () => ProtobufCreateIsDecodeTransformer.transform,
487
+ createValidateDecode: () =>
488
+ ProtobufCreateValidateDecodeTransformer.transform,
489
+ },
490
+ reflect: {
491
+ metadata: () => ReflectMetadataTransformer.transform,
492
+ name: () => ReflectNameTransformer.transform,
493
+ schema: () => ReflectSchemaTransformer.transform,
494
+ schemas: () => ReflectSchemasTransformer.transform,
495
+ },
496
+ misc: {
497
+ literals: () => MiscLiteralsTransformer.transform,
498
+
499
+ // CLONE
500
+ clone: () => MiscCloneTransformer.transform,
501
+ assertClone: () => MiscAssertCloneTransformer.transform,
502
+ isClone: () => MiscIsCloneTransformer.transform,
503
+ validateClone: () => MiscValidateCloneTransformer.transform,
504
+
505
+ // PRUNE
506
+ prune: () => MiscPruneTransformer.transform,
507
+ assertPrune: () => MiscAssertPruneTransformer.transform,
508
+ isPrune: () => MiscIsPruneTransformer.transform,
509
+ validatePrune: () => MiscValidatePruneTransformer.transform,
510
+
511
+ // FACTORIES
512
+ createClone: () => MiscCreateCloneTransformer.transform,
513
+ createAssertClone: () => MiscCreateAssertCloneTransformer.transform,
514
+ createIsClone: () => MiscCreateIsCloneTransformer.transform,
515
+ createValidateClone: () => MiscCreateValidateCloneTransformer.transform,
516
+ createPrune: () => MiscCreatePruneTransformer.transform,
517
+ createAssertPrune: () => MiscCreateAssertPruneTransformer.transform,
518
+ createIsPrune: () => MiscCreateIsPruneTransformer.transform,
519
+ createValidatePrune: () => MiscCreateValidatePruneTransformer.transform,
520
+ },
521
+ notations: {
522
+ // CAMEL
523
+ camel: () => NotationGeneralTransformer.transform(NamingConvention.camel),
524
+ assertCamel: () =>
525
+ NotationAssertGeneralTransformer.transform(NamingConvention.camel),
526
+ isCamel: () =>
527
+ NotationIsGeneralTransformer.transform(NamingConvention.camel),
528
+ validateCamel: () =>
529
+ NotationValidateGeneralTransformer.transform(NamingConvention.camel),
530
+
531
+ // PASCAL
532
+ pascal: () => NotationGeneralTransformer.transform(NamingConvention.pascal),
533
+ assertPascal: () =>
534
+ NotationAssertGeneralTransformer.transform(NamingConvention.pascal),
535
+ isPascal: () =>
536
+ NotationIsGeneralTransformer.transform(NamingConvention.pascal),
537
+ validatePascal: () =>
538
+ NotationValidateGeneralTransformer.transform(NamingConvention.pascal),
539
+
540
+ // SNAKE
541
+ snake: () => NotationGeneralTransformer.transform(NamingConvention.snake),
542
+ assertSnake: () =>
543
+ NotationAssertGeneralTransformer.transform(NamingConvention.snake),
544
+ isSnake: () =>
545
+ NotationIsGeneralTransformer.transform(NamingConvention.snake),
546
+ validateSnake: () =>
547
+ NotationValidateGeneralTransformer.transform(NamingConvention.snake),
548
+
549
+ // FACTORIES
550
+ createCamel: () =>
551
+ NotationCreateGeneralTransformer.transform(NamingConvention.camel),
552
+ createAssertCamel: () =>
553
+ NotationCreateAssertGeneralTransformer.transform(NamingConvention.camel),
554
+ createIsCamel: () =>
555
+ NotationCreateIsGeneralTransformer.transform(NamingConvention.camel),
556
+ createValidateCamel: () =>
557
+ NotationCreateValidateGeneralTransformer.transform(
558
+ NamingConvention.camel,
559
+ ),
560
+ createPascal: () =>
561
+ NotationCreateGeneralTransformer.transform(NamingConvention.pascal),
562
+ createAssertPascal: () =>
563
+ NotationCreateAssertGeneralTransformer.transform(NamingConvention.pascal),
564
+ createIsPascal: () =>
565
+ NotationCreateIsGeneralTransformer.transform(NamingConvention.pascal),
566
+ createValidatePascal: () =>
567
+ NotationCreateValidateGeneralTransformer.transform(
568
+ NamingConvention.pascal,
569
+ ),
570
+ createSnake: () =>
571
+ NotationCreateGeneralTransformer.transform(NamingConvention.snake),
572
+ createAssertSnake: () =>
573
+ NotationCreateAssertGeneralTransformer.transform(NamingConvention.snake),
574
+ createIsSnake: () =>
575
+ NotationCreateIsGeneralTransformer.transform(NamingConvention.snake),
576
+ createValidateSnake: () =>
577
+ NotationCreateValidateGeneralTransformer.transform(
578
+ NamingConvention.snake,
579
+ ),
580
+ },
581
+ };