typia 7.6.0-dev.20241229 → 7.7.0-dev.20250130

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 (113) hide show
  1. package/lib/TypeGuardError.mjs +26 -0
  2. package/lib/TypeGuardError.mjs.map +1 -0
  3. package/lib/executable/setup/PluginConfigurator.js +3 -3
  4. package/lib/executable/typia.js +15 -15
  5. package/lib/functional.mjs +120 -0
  6. package/lib/functional.mjs.map +1 -0
  7. package/lib/http.d.ts +15 -15
  8. package/lib/http.mjs +165 -0
  9. package/lib/http.mjs.map +1 -0
  10. package/lib/index.mjs +27 -1142
  11. package/lib/index.mjs.map +1 -1
  12. package/lib/json.mjs +105 -0
  13. package/lib/json.mjs.map +1 -0
  14. package/lib/llm.mjs +33 -0
  15. package/lib/llm.mjs.map +1 -0
  16. package/lib/misc.mjs +111 -0
  17. package/lib/misc.mjs.map +1 -0
  18. package/lib/module.d.ts +4 -4
  19. package/lib/module.mjs +139 -0
  20. package/lib/module.mjs.map +1 -0
  21. package/lib/notations.mjs +153 -0
  22. package/lib/notations.mjs.map +1 -0
  23. package/lib/programmers/json/JsonApplicationProgrammer.d.ts +12 -0
  24. package/lib/programmers/json/JsonApplicationProgrammer.js +22 -22
  25. package/lib/programmers/json/JsonApplicationProgrammer.js.map +1 -1
  26. package/lib/programmers/llm/LlmApplicationOfValidateProgrammer.js +15 -7
  27. package/lib/programmers/llm/LlmApplicationOfValidateProgrammer.js.map +1 -1
  28. package/lib/programmers/llm/LlmApplicationProgrammer.js +39 -15
  29. package/lib/programmers/llm/LlmApplicationProgrammer.js.map +1 -1
  30. package/lib/protobuf.d.ts +9 -9
  31. package/lib/protobuf.mjs +111 -0
  32. package/lib/protobuf.mjs.map +1 -0
  33. package/lib/reflect.mjs +18 -0
  34. package/lib/reflect.mjs.map +1 -0
  35. package/lib/schemas/llm/ILlmApplicationOfValidate.mjs +6 -0
  36. package/lib/schemas/llm/ILlmApplicationOfValidate.mjs.map +1 -0
  37. package/lib/schemas/llm/ILlmFunctionOfValidate.mjs +6 -0
  38. package/lib/schemas/llm/ILlmFunctionOfValidate.mjs.map +1 -0
  39. package/lib/tags/TagBase.d.ts +1 -1
  40. package/lib/tags/Type.d.ts +0 -1
  41. package/lib/tags/index.mjs +2 -0
  42. package/lib/tags/index.mjs.map +1 -0
  43. package/package.json +10 -8
  44. package/src/AssertionGuard.ts +1 -1
  45. package/src/CamelCase.ts +75 -75
  46. package/src/PascalCase.ts +71 -71
  47. package/src/Primitive.ts +92 -92
  48. package/src/Resolved.ts +74 -74
  49. package/src/SnakeCase.ts +126 -126
  50. package/src/TypeGuardError.ts +37 -37
  51. package/src/executable/setup/CommandExecutor.ts +8 -8
  52. package/src/executable/setup/PluginConfigurator.ts +69 -69
  53. package/src/executable/typia.ts +55 -55
  54. package/src/factories/CommentFactory.ts +79 -79
  55. package/src/factories/ValueFactory.ts +12 -12
  56. package/src/factories/internal/metadata/emend_metadata_atomics.ts +45 -45
  57. package/src/http.ts +15 -15
  58. package/src/index.ts +4 -4
  59. package/src/module.ts +4 -4
  60. package/src/programmers/helpers/ICheckEntry.ts +13 -13
  61. package/src/programmers/helpers/IExpressionEntry.ts +12 -12
  62. package/src/programmers/helpers/ProtobufWire.ts +34 -34
  63. package/src/programmers/internal/stringify_native.ts +7 -7
  64. package/src/programmers/json/JsonApplicationProgrammer.ts +27 -27
  65. package/src/programmers/llm/LlmApplicationOfValidateProgrammer.ts +16 -2
  66. package/src/programmers/llm/LlmApplicationProgrammer.ts +50 -12
  67. package/src/protobuf.ts +9 -9
  68. package/src/schemas/metadata/IJsDocTagInfo.ts +10 -10
  69. package/src/schemas/metadata/IMetadataArrayType.ts +10 -10
  70. package/src/schemas/metadata/IMetadataAtomic.ts +6 -6
  71. package/src/schemas/metadata/IMetadataConstant.ts +18 -18
  72. package/src/schemas/metadata/IMetadataEscaped.ts +6 -6
  73. package/src/schemas/metadata/IMetadataFunction.ts +8 -8
  74. package/src/schemas/metadata/IMetadataParameter.ts +9 -9
  75. package/src/schemas/metadata/IMetadataProperty.ts +9 -9
  76. package/src/schemas/metadata/IMetadataTupleType.ts +10 -10
  77. package/src/schemas/metadata/MetadataArrayType.ts +57 -57
  78. package/src/schemas/metadata/MetadataConstant.ts +34 -34
  79. package/src/schemas/metadata/MetadataEscaped.ts +51 -51
  80. package/src/schemas/metadata/MetadataFunction.ts +49 -49
  81. package/src/schemas/metadata/MetadataTupleType.ts +67 -67
  82. package/src/tags/Constant.ts +15 -15
  83. package/src/tags/ContentMediaType.ts +10 -10
  84. package/src/tags/Default.ts +22 -22
  85. package/src/tags/ExclusiveMaximum.ts +25 -25
  86. package/src/tags/ExclusiveMinimum.ts +25 -25
  87. package/src/tags/MaxItems.ts +12 -12
  88. package/src/tags/MaxLength.ts +12 -12
  89. package/src/tags/Maximum.ts +19 -19
  90. package/src/tags/MinItems.ts +12 -12
  91. package/src/tags/MinLength.ts +12 -12
  92. package/src/tags/Minimum.ts +19 -19
  93. package/src/tags/MultipleOf.ts +21 -21
  94. package/src/tags/Pattern.ts +31 -31
  95. package/src/tags/TagBase.ts +1 -1
  96. package/src/tags/Type.ts +0 -1
  97. package/src/tags/internal/FormatCheatSheet.ts +73 -73
  98. package/src/typings/Atomic.ts +13 -13
  99. package/src/typings/ClassProperties.ts +5 -5
  100. package/src/typings/Customizable.ts +5 -5
  101. package/src/typings/Equal.ts +18 -18
  102. package/src/typings/IsTuple.ts +9 -9
  103. package/src/typings/NativeClass.ts +23 -23
  104. package/src/typings/OmitNever.ts +3 -3
  105. package/src/typings/ProtobufAtomic.ts +19 -19
  106. package/src/typings/SpecialFields.ts +3 -3
  107. package/src/typings/ValidationPipe.ts +9 -9
  108. package/src/typings/ValueOf.ts +20 -20
  109. package/src/typings/Writable.ts +11 -11
  110. package/src/utils/ArrayUtil.ts +41 -41
  111. package/src/utils/Escaper.ts +50 -50
  112. package/src/utils/PatternUtil.ts +29 -29
  113. package/src/utils/Singleton.ts +16 -16
@@ -1,41 +1,41 @@
1
- export namespace ArrayUtil {
2
- export const has = <T>(array: T[], pred: (elem: T) => boolean): boolean =>
3
- array.some(pred);
4
-
5
- export const add = <T>(
6
- array: T[],
7
- value: T,
8
- pred: (x: T, y: T) => boolean = (x, y) => x === y,
9
- ): boolean => {
10
- if (array.some((elem) => pred(elem, value))) return false;
11
- array.push(value);
12
- return true;
13
- };
14
-
15
- export const set = <Key, T>(
16
- array: T[],
17
- value: T,
18
- key: (elem: T) => Key,
19
- ): void => {
20
- if (array.some((elem) => key(elem) === key(value))) return;
21
- array.push(value);
22
- };
23
-
24
- export const take = <T>(
25
- array: T[],
26
- pred: (elem: T) => boolean,
27
- init: () => T,
28
- ): T => {
29
- const index: number = array.findIndex(pred);
30
- if (index !== -1) return array[index]!;
31
-
32
- const elem: T = init();
33
- array.push(elem);
34
- return elem;
35
- };
36
-
37
- export const repeat = <T>(
38
- count: number,
39
- closure: (index: number, count: number) => T,
40
- ): T[] => new Array(count).fill("").map((_, index) => closure(index, count));
41
- }
1
+ export namespace ArrayUtil {
2
+ export const has = <T>(array: T[], pred: (elem: T) => boolean): boolean =>
3
+ array.some(pred);
4
+
5
+ export const add = <T>(
6
+ array: T[],
7
+ value: T,
8
+ pred: (x: T, y: T) => boolean = (x, y) => x === y,
9
+ ): boolean => {
10
+ if (array.some((elem) => pred(elem, value))) return false;
11
+ array.push(value);
12
+ return true;
13
+ };
14
+
15
+ export const set = <Key, T>(
16
+ array: T[],
17
+ value: T,
18
+ key: (elem: T) => Key,
19
+ ): void => {
20
+ if (array.some((elem) => key(elem) === key(value))) return;
21
+ array.push(value);
22
+ };
23
+
24
+ export const take = <T>(
25
+ array: T[],
26
+ pred: (elem: T) => boolean,
27
+ init: () => T,
28
+ ): T => {
29
+ const index: number = array.findIndex(pred);
30
+ if (index !== -1) return array[index]!;
31
+
32
+ const elem: T = init();
33
+ array.push(elem);
34
+ return elem;
35
+ };
36
+
37
+ export const repeat = <T>(
38
+ count: number,
39
+ closure: (index: number, count: number) => T,
40
+ ): T[] => new Array(count).fill("").map((_, index) => closure(index, count));
41
+ }
@@ -1,50 +1,50 @@
1
- export namespace Escaper {
2
- export const variable = (str: string): boolean =>
3
- reserved(str) === false && /^[a-zA-Z_$][a-zA-Z_$0-9]*$/g.test(str);
4
-
5
- export const reserved = (str: string): boolean => RESERVED.has(str);
6
- }
7
-
8
- const RESERVED: Set<string> = new Set([
9
- "break",
10
- "case",
11
- "catch",
12
- "class",
13
- "const",
14
- "continue",
15
- "debugger",
16
- "default",
17
- "delete",
18
- "do",
19
- "else",
20
- "enum",
21
- "export",
22
- "extends",
23
- "false",
24
- "finally",
25
- "for",
26
- "function",
27
- "if",
28
- "import",
29
- "in",
30
- "instanceof",
31
- "module",
32
- "new",
33
- "null",
34
- "package",
35
- "public",
36
- "private",
37
- "protected",
38
- "return",
39
- "super",
40
- "switch",
41
- "this",
42
- "throw",
43
- "true",
44
- "try",
45
- "typeof",
46
- "var",
47
- "void",
48
- "while",
49
- "with",
50
- ]);
1
+ export namespace Escaper {
2
+ export const variable = (str: string): boolean =>
3
+ reserved(str) === false && /^[a-zA-Z_$][a-zA-Z_$0-9]*$/g.test(str);
4
+
5
+ export const reserved = (str: string): boolean => RESERVED.has(str);
6
+ }
7
+
8
+ const RESERVED: Set<string> = new Set([
9
+ "break",
10
+ "case",
11
+ "catch",
12
+ "class",
13
+ "const",
14
+ "continue",
15
+ "debugger",
16
+ "default",
17
+ "delete",
18
+ "do",
19
+ "else",
20
+ "enum",
21
+ "export",
22
+ "extends",
23
+ "false",
24
+ "finally",
25
+ "for",
26
+ "function",
27
+ "if",
28
+ "import",
29
+ "in",
30
+ "instanceof",
31
+ "module",
32
+ "new",
33
+ "null",
34
+ "package",
35
+ "public",
36
+ "private",
37
+ "protected",
38
+ "return",
39
+ "super",
40
+ "switch",
41
+ "this",
42
+ "throw",
43
+ "true",
44
+ "try",
45
+ "typeof",
46
+ "var",
47
+ "void",
48
+ "while",
49
+ "with",
50
+ ]);
@@ -1,29 +1,29 @@
1
- export namespace PatternUtil {
2
- export const fix = (str: string): string => {
3
- const first: number = str.indexOf(STRING);
4
- const last: number = str.lastIndexOf(STRING);
5
- return [
6
- first === -1 || none("(")(str.slice(0, first)) ? "^" : "",
7
- str,
8
- last === -1 || none(")")(str.slice(last + STRING.length)) ? "$" : "",
9
- ].join("");
10
- };
11
-
12
- export const escape = (str: string): string => {
13
- return str.replace(/[|\\/{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
14
- };
15
-
16
- export const NUMBER =
17
- "[+-]?" + // optional sign
18
- "\\d+(?:\\.\\d+)?" + // integer or decimal
19
- "(?:[eE][+-]?\\d+)?"; // optional exponent
20
- export const BOOLEAN = "true|false";
21
- export const STRING = "(.*)";
22
- }
23
-
24
- const none =
25
- (parenthesis: string) =>
26
- (str: string): boolean => {
27
- for (const ch of str) if (ch !== parenthesis) return true;
28
- return false;
29
- };
1
+ export namespace PatternUtil {
2
+ export const fix = (str: string): string => {
3
+ const first: number = str.indexOf(STRING);
4
+ const last: number = str.lastIndexOf(STRING);
5
+ return [
6
+ first === -1 || none("(")(str.slice(0, first)) ? "^" : "",
7
+ str,
8
+ last === -1 || none(")")(str.slice(last + STRING.length)) ? "$" : "",
9
+ ].join("");
10
+ };
11
+
12
+ export const escape = (str: string): string => {
13
+ return str.replace(/[|\\/{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
14
+ };
15
+
16
+ export const NUMBER =
17
+ "[+-]?" + // optional sign
18
+ "\\d+(?:\\.\\d+)?" + // integer or decimal
19
+ "(?:[eE][+-]?\\d+)?"; // optional exponent
20
+ export const BOOLEAN = "true|false";
21
+ export const STRING = "(.*)";
22
+ }
23
+
24
+ const none =
25
+ (parenthesis: string) =>
26
+ (str: string): boolean => {
27
+ for (const ch of str) if (ch !== parenthesis) return true;
28
+ return false;
29
+ };
@@ -1,16 +1,16 @@
1
- export class Singleton<T, Args extends any[] = []> {
2
- private readonly closure_: (...args: Args) => T;
3
- private value_: T | object;
4
-
5
- public constructor(closure: (...args: Args) => T) {
6
- this.closure_ = closure;
7
- this.value_ = NOT_MOUNTED_YET;
8
- }
9
-
10
- public get(...args: Args): T {
11
- if (this.value_ === NOT_MOUNTED_YET) this.value_ = this.closure_(...args);
12
- return this.value_ as T;
13
- }
14
- }
15
-
16
- const NOT_MOUNTED_YET = {};
1
+ export class Singleton<T, Args extends any[] = []> {
2
+ private readonly closure_: (...args: Args) => T;
3
+ private value_: T | object;
4
+
5
+ public constructor(closure: (...args: Args) => T) {
6
+ this.closure_ = closure;
7
+ this.value_ = NOT_MOUNTED_YET;
8
+ }
9
+
10
+ public get(...args: Args): T {
11
+ if (this.value_ === NOT_MOUNTED_YET) this.value_ = this.closure_(...args);
12
+ return this.value_ as T;
13
+ }
14
+ }
15
+
16
+ const NOT_MOUNTED_YET = {};