typia 7.7.0-dev.20250130 → 8.0.0-dev.20250221

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/README.md +5 -4
  2. package/lib/IReadableURLSearchParams.d.ts +1 -1
  3. package/lib/factories/JsonMetadataFactory.js +1 -1
  4. package/lib/factories/JsonMetadataFactory.js.map +1 -1
  5. package/lib/factories/MetadataTypeTagFactory.js +8 -8
  6. package/lib/factories/MetadataTypeTagFactory.js.map +1 -1
  7. package/lib/factories/ProtobufFactory.js +4 -4
  8. package/lib/factories/ProtobufFactory.js.map +1 -1
  9. package/lib/factories/internal/metadata/iterate_metadata_intersection.js +1 -1
  10. package/lib/factories/internal/metadata/iterate_metadata_intersection.js.map +1 -1
  11. package/lib/http.d.ts +1 -1
  12. package/lib/internal/_isUniqueItems.js +1 -1
  13. package/lib/json.d.ts +5 -5
  14. package/lib/llm.d.ts +8 -8
  15. package/lib/misc.d.ts +10 -10
  16. package/lib/module.d.ts +1 -1
  17. package/lib/programmers/FeatureProgrammer.d.ts +3 -3
  18. package/lib/programmers/TypiaProgrammer.js +1 -1
  19. package/lib/programmers/TypiaProgrammer.js.map +1 -1
  20. package/lib/programmers/helpers/UnionExplorer.js +1 -1
  21. package/lib/programmers/helpers/UnionExplorer.js.map +1 -1
  22. package/lib/programmers/helpers/UnionPredicator.d.ts +1 -1
  23. package/lib/programmers/helpers/UnionPredicator.js +1 -1
  24. package/lib/programmers/helpers/UnionPredicator.js.map +1 -1
  25. package/lib/programmers/json/JsonApplicationProgrammer.js +1 -1
  26. package/lib/programmers/llm/LlmApplicationProgrammer.js +2 -2
  27. package/lib/programmers/llm/LlmApplicationProgrammer.js.map +1 -1
  28. package/lib/programmers/llm/LlmModelPredicator.js +1 -1
  29. package/lib/programmers/llm/LlmModelPredicator.js.map +1 -1
  30. package/lib/programmers/llm/LlmParametersProgrammer.js +1 -1
  31. package/lib/programmers/llm/LlmParametersProgrammer.js.map +1 -1
  32. package/lib/programmers/protobuf/ProtobufEncodeProgrammer.js +1 -1
  33. package/lib/programmers/protobuf/ProtobufEncodeProgrammer.js.map +1 -1
  34. package/lib/schemas/llm/ILlmApplicationOfValidate.d.ts +2 -2
  35. package/lib/tags/Examples.d.ts +3 -3
  36. package/lib/transformers/ImportTransformer.js +3 -3
  37. package/lib/transformers/ImportTransformer.js.map +1 -1
  38. package/lib/transformers/features/json/JsonSchemasTransformer.js +32 -30
  39. package/lib/transformers/features/json/JsonSchemasTransformer.js.map +1 -1
  40. package/lib/transformers/features/json/JsonValidateParseTransformer.js +1 -1
  41. package/lib/transformers/features/json/JsonValidateParseTransformer.js.map +1 -1
  42. package/lib/transformers/features/json/JsonValidateStringifyTransformer.js +1 -1
  43. package/lib/transformers/features/json/JsonValidateStringifyTransformer.js.map +1 -1
  44. package/lib/transformers/features/llm/LlmApplicationOfValidateTransformer.js +29 -23
  45. package/lib/transformers/features/llm/LlmApplicationOfValidateTransformer.js.map +1 -1
  46. package/lib/transformers/features/llm/LlmApplicationTransformer.js +29 -23
  47. package/lib/transformers/features/llm/LlmApplicationTransformer.js.map +1 -1
  48. package/lib/transformers/features/llm/LlmParametersTransformer.js +28 -22
  49. package/lib/transformers/features/llm/LlmParametersTransformer.js.map +1 -1
  50. package/lib/transformers/features/llm/LlmSchemaTransformer.js +28 -22
  51. package/lib/transformers/features/llm/LlmSchemaTransformer.js.map +1 -1
  52. package/lib/transformers/features/misc/MiscValidateCloneTransformer.js +1 -1
  53. package/lib/transformers/features/misc/MiscValidateCloneTransformer.js.map +1 -1
  54. package/lib/transformers/features/misc/MiscValidatePruneTransformer.js +1 -1
  55. package/lib/transformers/features/misc/MiscValidatePruneTransformer.js.map +1 -1
  56. package/lib/transformers/features/reflect/ReflectNameTransformer.js +3 -3
  57. package/package.json +7 -6
  58. package/src/IReadableURLSearchParams.ts +1 -1
  59. package/src/factories/JsonMetadataFactory.ts +1 -1
  60. package/src/factories/MetadataTypeTagFactory.ts +10 -8
  61. package/src/factories/ProtobufFactory.ts +4 -4
  62. package/src/factories/internal/metadata/iterate_metadata_intersection.ts +1 -2
  63. package/src/http.ts +1 -1
  64. package/src/internal/_isUniqueItems.ts +1 -1
  65. package/src/json.ts +6 -6
  66. package/src/llm.ts +8 -8
  67. package/src/misc.ts +11 -11
  68. package/src/module.ts +1 -1
  69. package/src/programmers/FeatureProgrammer.ts +3 -3
  70. package/src/programmers/TypiaProgrammer.ts +1 -1
  71. package/src/programmers/helpers/UnionExplorer.ts +1 -1
  72. package/src/programmers/helpers/UnionPredicator.ts +3 -3
  73. package/src/programmers/json/JsonApplicationProgrammer.ts +1 -1
  74. package/src/programmers/llm/LlmApplicationProgrammer.ts +2 -2
  75. package/src/programmers/llm/LlmModelPredicator.ts +1 -1
  76. package/src/programmers/llm/LlmParametersProgrammer.ts +1 -1
  77. package/src/programmers/protobuf/ProtobufEncodeProgrammer.ts +1 -1
  78. package/src/schemas/llm/ILlmApplicationOfValidate.ts +2 -2
  79. package/src/tags/Examples.ts +3 -3
  80. package/src/transformers/ImportTransformer.ts +3 -3
  81. package/src/transformers/features/json/JsonSchemasTransformer.ts +34 -32
  82. package/src/transformers/features/json/JsonValidateParseTransformer.ts +1 -1
  83. package/src/transformers/features/json/JsonValidateStringifyTransformer.ts +1 -1
  84. package/src/transformers/features/llm/LlmApplicationOfValidateTransformer.ts +33 -25
  85. package/src/transformers/features/llm/LlmApplicationTransformer.ts +32 -25
  86. package/src/transformers/features/llm/LlmParametersTransformer.ts +32 -24
  87. package/src/transformers/features/llm/LlmSchemaTransformer.ts +32 -24
  88. package/src/transformers/features/misc/MiscValidateCloneTransformer.ts +1 -1
  89. package/src/transformers/features/misc/MiscValidatePruneTransformer.ts +1 -1
  90. package/src/transformers/features/reflect/ReflectNameTransformer.ts +3 -3
package/src/llm.ts CHANGED
@@ -24,7 +24,7 @@ import { ILlmApplicationOfValidate } from "./module";
24
24
  *
25
25
  * By the way, there can be some parameters (or their nested properties) which must be
26
26
  * composed by human, not by LLM. File uploading feature or some sensitive information
27
- * like secrety key (password) are the examples. In that case, you can separate the
27
+ * like security keys (password) are the examples. In that case, you can separate the
28
28
  * function parameters to both LLM and human sides by configuring the
29
29
  * {@link ILlmApplicationOfValidate.IOptions.separate} property. The separated parameters
30
30
  * are assigned to the {@link ILlmFunctionOfValidate.separated} property.
@@ -85,7 +85,7 @@ export function applicationOfValidate(
85
85
  *
86
86
  * By the way, there can be some parameters (or their nested properties) which must be
87
87
  * composed by human, not by LLM. File uploading feature or some sensitive information
88
- * like secrety key (password) are the examples. In that case, you can separate the
88
+ * like security keys (password) are the examples. In that case, you can separate the
89
89
  * function parameters to both LLM and human sides by configuring the
90
90
  * {@link ILlmApplicationOfValidate.IOptions.separate} property. The separated parameters
91
91
  * are assigned to the {@link ILlmFunctionOfValidate.separated} property.
@@ -155,7 +155,7 @@ export function applicationOfValidate(): never {
155
155
  *
156
156
  * By the way, there can be some parameters (or their nested properties) which must be
157
157
  * composed by human, not by LLM. File uploading feature or some sensitive information
158
- * like secrety key (password) are the examples. In that case, you can separate the
158
+ * like security keys (password) are the examples. In that case, you can separate the
159
159
  * function parameters to both LLM and human sides by configuring the
160
160
  * {@link ILlmApplication.IOptions.separate} property. The separated parameters are
161
161
  * assigned to the {@link ILlmFunction.separated} property.
@@ -210,7 +210,7 @@ export function application(
210
210
  *
211
211
  * By the way, there can be some parameters (or their nested properties) which must be
212
212
  * composed by human, not by LLM. File uploading feature or some sensitive information
213
- * like secrety key (password) are the examples. In that case, you can separate the
213
+ * like security keys (password) are the examples. In that case, you can separate the
214
214
  * function parameters to both LLM and human sides by configuring the
215
215
  * {@link ILlmApplication.IOptions.separate} property. The separated parameters are
216
216
  * assigned to the {@link ILlmFunction.separated} property.
@@ -385,8 +385,8 @@ export function parameters(): never {
385
385
  *
386
386
  * > **What LLM function calling is?
387
387
  * >
388
- * > LLM (Large Language Model) selects propert function and fill the arguments,
389
- * > but actuall function call execution is not by LLM, but by you.
388
+ * > LLM (Large Language Model) selects property function and fill the arguments,
389
+ * > but actual function call execution is not by LLM, but by you.
390
390
  * >
391
391
  * > In nowadays, most LLM (Large Language Model) like OpenAI are supporting
392
392
  * > "function calling" feature. The "function calling" means that LLM automatically selects
@@ -432,8 +432,8 @@ export function schema(): never;
432
432
  *
433
433
  * > **What LLM function calling is?
434
434
  * >
435
- * > LLM (Large Language Model) selects propert function and fill the arguments,
436
- * > but actuall function call execution is not by LLM, but by you.
435
+ * > LLM (Large Language Model) selects property function and fill the arguments,
436
+ * > but actual function call execution is not by LLM, but by you.
437
437
  * >
438
438
  * > In nowadays, most LLM (Large Language Model) like OpenAI are supporting
439
439
  * > "function calling" feature. The "function calling" means that LLM automatically selects
package/src/misc.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /* ===========================================================
2
- MISCELLAENOUS
2
+ MISCELLANEOUS
3
3
  - LITERALS
4
4
  - CLONE
5
5
  - PRUNE
@@ -365,7 +365,7 @@ export function isPrune(): never {
365
365
  *
366
366
  * In such reason, when `input` value is not matched with the type `T`, it returns
367
367
  * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's
368
- * no problem on the `input` value, it returns {@link IValidation.ISucess} value after
368
+ * no problem on the `input` value, it returns {@link IValidation.ISuccess} value after
369
369
  * removing every superfluous properties, including nested objects.
370
370
  *
371
371
  * @template T Type of the input value
@@ -385,7 +385,7 @@ export function validatePrune<T>(input: T): IValidation<T>;
385
385
  *
386
386
  * In such reason, when `input` value is not matched with the type `T`, it returns
387
387
  * {@link IValidation.IFailure} value with detailed error reasons. Otherwise, there's
388
- * no problem on the `input` value, it returns {@link IValidation.ISucess} value after
388
+ * no problem on the `input` value, it returns {@link IValidation.ISuccess} value after
389
389
  * removing every superfluous properties, including nested objects.
390
390
  *
391
391
  * @template T Type of the input value
@@ -418,7 +418,7 @@ export function validatePrune<T>(): IValidation<T> {
418
418
  export function createClone(): never;
419
419
 
420
420
  /**
421
- * Creates a resuable {@link clone} function.
421
+ * Creates a reusable {@link clone} function.
422
422
  *
423
423
  * @template T Type of the input value
424
424
  * @returns A reusable `clone` function
@@ -449,7 +449,7 @@ export function createAssertClone(
449
449
  ): never;
450
450
 
451
451
  /**
452
- * Creates a resuable {@link assertClone} function.
452
+ * Creates a reusable {@link assertClone} function.
453
453
  *
454
454
  * @template T Type of the input value
455
455
  * @param errorFactory Custom error factory. Default is `TypeGuardError`
@@ -480,7 +480,7 @@ export function createAssertClone(): never {
480
480
  export function createIsClone(): never;
481
481
 
482
482
  /**
483
- * Creates a resuable {@link isClone} function.
483
+ * Creates a reusable {@link isClone} function.
484
484
  *
485
485
  * @template T Type of the input value
486
486
  * @returns A reusable `clone` function
@@ -508,7 +508,7 @@ export function createIsClone(): never {
508
508
  export function createValidateClone(): never;
509
509
 
510
510
  /**
511
- * Creates a resuable {@link validateClone} function.
511
+ * Creates a reusable {@link validateClone} function.
512
512
  *
513
513
  * @template T Type of the input value
514
514
  * @returns A reusable `clone` function
@@ -538,7 +538,7 @@ export function createValidateClone(): never {
538
538
  export function createPrune(): never;
539
539
 
540
540
  /**
541
- * Creates a resuable {@link prune} function.
541
+ * Creates a reusable {@link prune} function.
542
542
  *
543
543
  * @template T Type of the input value
544
544
  * @returns A reusable `prune` function
@@ -569,7 +569,7 @@ export function createAssertPrune(
569
569
  ): never;
570
570
 
571
571
  /**
572
- * Creates a resuable {@link assertPrune} function.
572
+ * Creates a reusable {@link assertPrune} function.
573
573
  *
574
574
  * @template T Type of the input value
575
575
  * @param errorFactory Custom error factory. Default is `TypeGuardError`
@@ -600,7 +600,7 @@ export function createAssertPrune<T extends object>(): (input: T) => T {
600
600
  export function createIsPrune(): never;
601
601
 
602
602
  /**
603
- * Creates a resuable {@link isPrune} function.
603
+ * Creates a reusable {@link isPrune} function.
604
604
  *
605
605
  * @template T Type of the input value
606
606
  * @returns A reusable `isPrune` function
@@ -628,7 +628,7 @@ export function createIsPrune<T extends object>(): (input: T) => input is T {
628
628
  export function createValidatePrune(): never;
629
629
 
630
630
  /**
631
- * Creates a resuable {@link validatePrune} function.
631
+ * Creates a reusable {@link validatePrune} function.
632
632
  *
633
633
  * @template T Type of the input value
634
634
  * @returns A reusable `validatePrune` function
package/src/module.ts CHANGED
@@ -908,7 +908,7 @@ export function createValidateEquals(): (input: unknown) => IValidation {
908
908
  export function createRandom(generator?: Partial<IRandomGenerator>): never;
909
909
 
910
910
  /**
911
- * Creates a resuable {@link random} function.
911
+ * Creates a reusable {@link random} function.
912
912
  *
913
913
  * @template T Type of the input value
914
914
  * @param generator Random data generator
@@ -150,7 +150,7 @@ export namespace FeatureProgrammer {
150
150
  * Transformer of non-undefined type checking by discrimination.
151
151
  *
152
152
  * When specifying an union type of objects, `typia` tries to find
153
- * descrimination way just by checking only one property type.
153
+ * discrimination way just by checking only one property type.
154
154
  * If succeeded to find the discrimination way, `typia` will check the target
155
155
  * property type and in the checking, non-undefined type checking would be
156
156
  * done.
@@ -164,10 +164,10 @@ export namespace FeatureProgrammer {
164
164
  required?: undefined | ((exp: ts.Expression) => ts.Expression);
165
165
 
166
166
  /**
167
- * Conditon wrapper when unable to specify any object type.
167
+ * Condition wrapper when unable to specify any object type.
168
168
  *
169
169
  * When failed to specify an object type through discrimination, full
170
- * iteration type checking would be happend. In such circumstance, you
170
+ * iteration type checking would be happened. In such circumstance, you
171
171
  * can wrap the condition with additional function.
172
172
  *
173
173
  * @param props Properties of condition
@@ -104,7 +104,7 @@ export namespace TypiaProgrammer {
104
104
  ? "suggestion"
105
105
  : diag.category === ts.DiagnosticCategory.Message
106
106
  ? "message"
107
- : "unkown";
107
+ : "unknown";
108
108
  const [line, pos] = diag.file
109
109
  ? (() => {
110
110
  const lines: string[] = diag
@@ -79,7 +79,7 @@ export namespace UnionExplorer {
79
79
  props.input,
80
80
  key,
81
81
  );
82
- const pred: ts.Expression = spec.neighbour
82
+ const pred: ts.Expression = spec.neighbor
83
83
  ? props.config.objector.checker({
84
84
  input: accessor,
85
85
  metadata: spec.property.value,
@@ -10,7 +10,7 @@ export namespace UnionPredicator {
10
10
  index: number;
11
11
  object: MetadataObjectType;
12
12
  property: MetadataProperty;
13
- neighbour: boolean;
13
+ neighbor: boolean;
14
14
  }
15
15
 
16
16
  export const object = (
@@ -55,7 +55,7 @@ export namespace UnionPredicator {
55
55
  if (unique === true)
56
56
  children.push({
57
57
  property: prop,
58
- neighbour: neighbors.length !== 0,
58
+ neighbor: neighbors.length !== 0,
59
59
  });
60
60
  });
61
61
  if (children.length === 0) return;
@@ -75,5 +75,5 @@ export namespace UnionPredicator {
75
75
 
76
76
  interface ISpecializedProperty {
77
77
  property: MetadataProperty;
78
- neighbour: boolean;
78
+ neighbor: boolean;
79
79
  }
@@ -24,7 +24,7 @@ export namespace JsonApplicationProgrammer {
24
24
  metadata.nullable === false;
25
25
  if (valid === false)
26
26
  output.push(
27
- "JSON application's generic arugment must be a class/interface type.",
27
+ "JSON application's generic argument must be a class/interface type.",
28
28
  );
29
29
 
30
30
  const object: MetadataObjectType | undefined = metadata.objects[0]?.type;
@@ -49,7 +49,7 @@ export namespace LlmApplicationProgrammer {
49
49
  metadata.nullable === false;
50
50
  if (validity === false)
51
51
  output.push(
52
- "LLM application's generic arugment must be a class/interface type.",
52
+ "LLM application's generic argument must be a class/interface type.",
53
53
  );
54
54
 
55
55
  const object: MetadataObjectType | undefined = metadata.objects[0]?.type;
@@ -116,7 +116,7 @@ export namespace LlmApplicationProgrammer {
116
116
  output.push(`${prefix} name must not start with a number.`);
117
117
  if (/^[a-zA-Z0-9_-]+$/.test(name) === false)
118
118
  output.push(
119
- `${prefix} name must be alphanumeric with underscore or hypen.`,
119
+ `${prefix} name must be alphanumeric with underscore or hyphen.`,
120
120
  );
121
121
  if (name.length > 64)
122
122
  output.push(`${prefix} name must not exceed 64 characters.`);
@@ -28,9 +28,9 @@ export namespace LlmModelPredicator {
28
28
  checker: props.context.checker,
29
29
  transformer: props.context.transformer,
30
30
  options: {
31
+ absorb: true,
31
32
  escape: false,
32
33
  constant: true,
33
- absorb: false,
34
34
  functional: false,
35
35
  },
36
36
  collection,
@@ -71,7 +71,7 @@ export namespace LlmParametersProgrammer {
71
71
  const output: string[] = [];
72
72
  if (explore.top === true) {
73
73
  if (metadata.objects.length === 0)
74
- output.push("LLM parameters must be an objec type.");
74
+ output.push("LLM parameters must be an object type.");
75
75
  else if (metadata.objects.length !== 1 || metadata.size() > 1)
76
76
  output.push("LLM parameters must be a single object type.");
77
77
  else {
@@ -828,7 +828,7 @@ export namespace ProtobufEncodeProgrammer {
828
828
  props.input,
829
829
  key,
830
830
  );
831
- const pred: ts.Expression = spec.neighbour
831
+ const pred: ts.Expression = spec.neighbor
832
832
  ? IsProgrammer.decode({
833
833
  context: props.context,
834
834
  functor: props.functor,
@@ -23,7 +23,7 @@ import { ILlmFunctionOfValidate } from "./ILlmFunctionOfValidate";
23
23
  *
24
24
  * By the way, there can be some parameters (or their nested properties) which must be
25
25
  * composed by Human, not by LLM. File uploading feature or some sensitive information
26
- * like secrety key (password) are the examples. In that case, you can separate the
26
+ * like secret keys (password) are the examples. In that case, you can separate the
27
27
  * function parameters to both LLM and human sides by configuring the
28
28
  * {@link ILlmApplication.IOptions.separate} property. The separated parameters are
29
29
  * assigned to the {@link ILlmFunction.separated} property.
@@ -31,7 +31,7 @@ import { ILlmFunctionOfValidate } from "./ILlmFunctionOfValidate";
31
31
  * For reference, when both LLM and Human filled parameter values to call, you can
32
32
  * merge them by calling the {@link HttpLlm.mergeParameters} function. In other words,
33
33
  * if you've configured the {@link ILlmApplication.IOptions.separate} property, you
34
- * have to merge the separated parameters before the funtion call execution.
34
+ * have to merge the separated parameters before the function call execution.
35
35
  *
36
36
  * @reference https://platform.openai.com/docs/guides/function-calling
37
37
  * @author Jeongho Nam - https://github.com/samchon
@@ -1,16 +1,16 @@
1
1
  import { TagBase } from "./TagBase";
2
2
 
3
3
  export type Examples<
4
- Dict extends Record<
4
+ Value extends Record<
5
5
  string,
6
6
  boolean | bigint | number | string | object | Array<unknown> | null
7
7
  >,
8
8
  > = TagBase<{
9
9
  target: "boolean" | "bigint" | "number" | "string" | "array" | "object";
10
10
  kind: "examples";
11
- value: Dict;
11
+ value: Value;
12
12
  exclusive: true;
13
13
  schema: {
14
- examples: Dict;
14
+ examples: Value;
15
15
  };
16
16
  }>;
@@ -75,7 +75,7 @@ export namespace ImportTransformer {
75
75
  }
76
76
 
77
77
  const get_directory_path = (file: string): string => {
78
- const splitted: string[] = path.resolve(file).split(path.sep);
79
- splitted.pop();
80
- return path.resolve(splitted.join(path.sep));
78
+ const split: string[] = path.resolve(file).split(path.sep);
79
+ split.pop();
80
+ return path.resolve(split.join(path.sep));
81
81
  };
@@ -56,42 +56,44 @@ export namespace JsonSchemasTransformer {
56
56
  // GENERATORS
57
57
  //----
58
58
  // METADATA
59
- const collection: MetadataCollection = new MetadataCollection({
60
- replace: MetadataCollection.replace,
61
- });
62
- const results: ValidationPipe<Metadata, MetadataFactory.IError>[] =
63
- types.map((type) =>
64
- MetadataFactory.analyze({
65
- checker: props.context.checker,
66
- transformer: props.context.transformer,
67
- options: {
68
- escape: true,
69
- constant: true,
70
- absorb: false,
71
- validate: JsonSchemasProgrammer.validate,
72
- },
73
- collection,
74
- type,
75
- }),
76
- );
77
-
78
- // REPORT BUG IF REQUIRED
79
- const metadatas: Metadata[] = [];
80
- const errors: MetadataFactory.IError[] = [];
81
- for (const r of results) {
82
- if (r.success === false) errors.push(...r.errors);
83
- else metadatas.push(r.data);
84
- }
85
- if (errors.length)
86
- throw TransformerError.from({
87
- code: "typia.json.application",
88
- errors,
89
- });
59
+ const analyze = (validate: boolean): Metadata[] => {
60
+ const results: ValidationPipe<Metadata, MetadataFactory.IError>[] =
61
+ types.map((type) =>
62
+ MetadataFactory.analyze({
63
+ checker: props.context.checker,
64
+ transformer: props.context.transformer,
65
+ options: {
66
+ absorb: validate,
67
+ constant: true,
68
+ escape: true,
69
+ validate:
70
+ validate === true ? JsonSchemasProgrammer.validate : undefined,
71
+ },
72
+ collection: new MetadataCollection({
73
+ replace: MetadataCollection.replace,
74
+ }),
75
+ type,
76
+ }),
77
+ );
78
+ const metadatas: Metadata[] = [];
79
+ const errors: MetadataFactory.IError[] = [];
80
+ for (const r of results) {
81
+ if (r.success === false) errors.push(...r.errors);
82
+ else metadatas.push(r.data);
83
+ }
84
+ if (errors.length)
85
+ throw TransformerError.from({
86
+ code: "typia.json.application",
87
+ errors,
88
+ });
89
+ return metadatas;
90
+ };
91
+ analyze(true);
90
92
 
91
93
  // APPLICATION
92
94
  const app: IJsonSchemaCollection<any> = JsonSchemasProgrammer.write({
93
95
  version,
94
- metadatas,
96
+ metadatas: analyze(false),
95
97
  });
96
98
  return ts.factory.createAsExpression(
97
99
  LiteralFactory.write(app),
@@ -7,7 +7,7 @@ export namespace JsonValidateParseTransformer {
7
7
  export const transform = (props: ITransformProps) =>
8
8
  GenericTransformer.scalar({
9
9
  ...props,
10
- method: "json.validatParse",
10
+ method: "json.validateParse",
11
11
  write: JsonValidateParseProgrammer.write,
12
12
  });
13
13
  }
@@ -7,7 +7,7 @@ export namespace JsonValidateStringifyTransformer {
7
7
  export const transform = (props: ITransformProps) =>
8
8
  GenericTransformer.scalar({
9
9
  ...props,
10
- method: "json.validatStringify",
10
+ method: "json.validateStringify",
11
11
  write: JsonValidateStringifyProgrammer.write,
12
12
  });
13
13
  }
@@ -43,31 +43,39 @@ export namespace LlmApplicationOfValidateTransformer {
43
43
  }) as Partial<ILlmSchema.IConfig>;
44
44
 
45
45
  const type: ts.Type = props.context.checker.getTypeFromTypeNode(top);
46
- const collection: MetadataCollection = new MetadataCollection({
47
- replace: MetadataCollection.replace,
48
- });
49
- const result: ValidationPipe<Metadata, MetadataFactory.IError> =
50
- MetadataFactory.analyze({
51
- checker: props.context.checker,
52
- transformer: props.context.transformer,
53
- options: {
54
- escape: true,
55
- constant: true,
56
- absorb: false,
57
- functional: true,
58
- validate: LlmApplicationOfValidateProgrammer.validate({
59
- model,
60
- config,
46
+
47
+ // VALIDATE TYPE
48
+ const analyze = (validate: boolean): Metadata => {
49
+ const result: ValidationPipe<Metadata, MetadataFactory.IError> =
50
+ MetadataFactory.analyze({
51
+ checker: props.context.checker,
52
+ transformer: props.context.transformer,
53
+ options: {
54
+ absorb: validate,
55
+ escape: true,
56
+ constant: true,
57
+ functional: true,
58
+ validate:
59
+ validate === true
60
+ ? LlmApplicationOfValidateProgrammer.validate({
61
+ model,
62
+ config,
63
+ })
64
+ : undefined,
65
+ },
66
+ collection: new MetadataCollection({
67
+ replace: MetadataCollection.replace,
61
68
  }),
62
- },
63
- collection,
64
- type,
65
- });
66
- if (result.success === false)
67
- throw TransformerError.from({
68
- code: "typia.llm.application",
69
- errors: result.errors,
70
- });
69
+ type,
70
+ });
71
+ if (result.success === false)
72
+ throw TransformerError.from({
73
+ code: "typia.llm.applicationOfValidate",
74
+ errors: result.errors,
75
+ });
76
+ return result.data;
77
+ };
78
+ analyze(true);
71
79
 
72
80
  // GENERATE LLM APPLICATION
73
81
  const schema: ILlmApplication<ILlmSchema.Model> =
@@ -75,7 +83,7 @@ export namespace LlmApplicationOfValidateTransformer {
75
83
  model,
76
84
  context: props.context,
77
85
  modulo: props.modulo,
78
- metadata: result.data,
86
+ metadata: analyze(false),
79
87
  config,
80
88
  name: top.getFullText().trim(),
81
89
  });
@@ -43,37 +43,44 @@ export namespace LlmApplicationTransformer {
43
43
  }) as Partial<ILlmSchema.IConfig>;
44
44
 
45
45
  const type: ts.Type = props.context.checker.getTypeFromTypeNode(top);
46
- const collection: MetadataCollection = new MetadataCollection({
47
- replace: MetadataCollection.replace,
48
- });
49
- const result: ValidationPipe<Metadata, MetadataFactory.IError> =
50
- MetadataFactory.analyze({
51
- checker: props.context.checker,
52
- transformer: props.context.transformer,
53
- options: {
54
- escape: true,
55
- constant: true,
56
- absorb: false,
57
- functional: true,
58
- validate: LlmApplicationProgrammer.validate({
59
- model,
60
- config,
46
+ // VALIDATE TYPE
47
+ const analyze = (validate: boolean): Metadata => {
48
+ const result: ValidationPipe<Metadata, MetadataFactory.IError> =
49
+ MetadataFactory.analyze({
50
+ checker: props.context.checker,
51
+ transformer: props.context.transformer,
52
+ options: {
53
+ absorb: validate,
54
+ escape: true,
55
+ constant: true,
56
+ functional: true,
57
+ validate:
58
+ validate === true
59
+ ? LlmApplicationProgrammer.validate({
60
+ model,
61
+ config,
62
+ })
63
+ : undefined,
64
+ },
65
+ collection: new MetadataCollection({
66
+ replace: MetadataCollection.replace,
61
67
  }),
62
- },
63
- collection,
64
- type,
65
- });
66
- if (result.success === false)
67
- throw TransformerError.from({
68
- code: "typia.llm.applicationOfValidate",
69
- errors: result.errors,
70
- });
68
+ type,
69
+ });
70
+ if (result.success === false)
71
+ throw TransformerError.from({
72
+ code: "typia.llm.application",
73
+ errors: result.errors,
74
+ });
75
+ return result.data;
76
+ };
77
+ analyze(true);
71
78
 
72
79
  // GENERATE LLM APPLICATION
73
80
  const schema: ILlmApplication<ILlmSchema.Model> =
74
81
  LlmApplicationProgrammer.write({
75
82
  model,
76
- metadata: result.data,
83
+ metadata: analyze(false),
77
84
  config,
78
85
  });
79
86
  const literal: ts.Expression = ts.factory.createAsExpression(
@@ -44,35 +44,43 @@ export namespace LlmParametersTransformer {
44
44
  }) as Partial<ILlmSchema.IConfig>;
45
45
 
46
46
  const type: ts.Type = props.context.checker.getTypeFromTypeNode(top);
47
- const collection: MetadataCollection = new MetadataCollection({
48
- replace: MetadataCollection.replace,
49
- });
50
- const result: ValidationPipe<Metadata, MetadataFactory.IError> =
51
- MetadataFactory.analyze({
52
- checker: props.context.checker,
53
- transformer: props.context.transformer,
54
- options: {
55
- escape: true,
56
- constant: true,
57
- absorb: false,
58
- validate: LlmParametersProgrammer.validate({
59
- model,
60
- config,
47
+
48
+ // VALIDATE TYPE
49
+ const analyze = (validate: boolean): Metadata => {
50
+ const result: ValidationPipe<Metadata, MetadataFactory.IError> =
51
+ MetadataFactory.analyze({
52
+ checker: props.context.checker,
53
+ transformer: props.context.transformer,
54
+ options: {
55
+ absorb: validate,
56
+ escape: true,
57
+ constant: true,
58
+ validate:
59
+ validate === true
60
+ ? LlmParametersProgrammer.validate({
61
+ model,
62
+ config,
63
+ })
64
+ : undefined,
65
+ },
66
+ collection: new MetadataCollection({
67
+ replace: MetadataCollection.replace,
61
68
  }),
62
- },
63
- collection,
64
- type,
65
- });
66
- if (result.success === false)
67
- throw TransformerError.from({
68
- code: "typia.llm.parameters",
69
- errors: result.errors,
70
- });
69
+ type,
70
+ });
71
+ if (result.success === false)
72
+ throw TransformerError.from({
73
+ code: "typia.llm.parameters",
74
+ errors: result.errors,
75
+ });
76
+ return result.data;
77
+ };
78
+ analyze(true);
71
79
 
72
80
  // GENERATE LLM SCHEMA
73
81
  const out: ILlmFunction<any>["parameters"] = LlmParametersProgrammer.write({
74
82
  model,
75
- metadata: result.data,
83
+ metadata: analyze(false),
76
84
  config,
77
85
  });
78
86
  return ts.factory.createAsExpression(