typia 5.2.1 → 5.2.2-dev.20231012-2

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 (91) hide show
  1. package/README.md +1 -1
  2. package/lib/Primitive.d.ts +1 -1
  3. package/lib/executable/TypiaSetupWizard.js +8 -8
  4. package/lib/executable/TypiaSetupWizard.js.map +1 -1
  5. package/lib/factories/JsonMetadataFactory.js +31 -0
  6. package/lib/factories/JsonMetadataFactory.js.map +1 -1
  7. package/lib/factories/MetadataCollection.js +4 -3
  8. package/lib/factories/MetadataCollection.js.map +1 -1
  9. package/lib/programmers/helpers/AtomicPredicator.js +1 -1
  10. package/lib/programmers/helpers/AtomicPredicator.js.map +1 -1
  11. package/package.json +2 -2
  12. package/src/CamelCase.ts +116 -116
  13. package/src/PascalCase.ts +116 -116
  14. package/src/Primitive.ts +135 -135
  15. package/src/Resolved.ts +116 -116
  16. package/src/SnakeCase.ts +156 -156
  17. package/src/executable/TypiaSetupWizard.ts +9 -11
  18. package/src/factories/JsonMetadataFactory.ts +7 -0
  19. package/src/factories/MetadataCollection.ts +6 -1
  20. package/src/factories/internal/metadata/emplace_metadata_object.ts +150 -150
  21. package/src/functional/$clone.ts +4 -4
  22. package/src/functional/$convention.ts +40 -40
  23. package/src/functional/Namespace.ts +164 -164
  24. package/src/http.ts +1149 -1149
  25. package/src/json.ts +648 -648
  26. package/src/misc.ts +651 -651
  27. package/src/module.ts +662 -662
  28. package/src/notations.ts +855 -855
  29. package/src/programmers/IsProgrammer.ts +252 -252
  30. package/src/programmers/TypiaProgrammer.ts +169 -169
  31. package/src/programmers/helpers/AtomicPredicator.ts +1 -1
  32. package/src/programmers/helpers/NotationJoiner.ts +146 -146
  33. package/src/programmers/helpers/OptionPredicator.ts +15 -15
  34. package/src/programmers/json/JsonStringifyProgrammer.ts +964 -964
  35. package/src/programmers/misc/MiscCloneProgrammer.ts +790 -790
  36. package/src/programmers/misc/MiscPruneProgrammer.ts +552 -552
  37. package/src/programmers/notations/NotationAssertGeneralProgrammer.ts +72 -72
  38. package/src/programmers/notations/NotationGeneralProgrammer.ts +720 -720
  39. package/src/programmers/notations/NotationIsGeneralProgrammer.ts +79 -79
  40. package/src/programmers/notations/NotationValidateGeneralProgrammer.ts +88 -88
  41. package/src/protobuf.ts +887 -887
  42. package/src/transformers/CallExpressionTransformer.ts +380 -380
  43. package/src/transformers/ITransformOptions.ts +62 -62
  44. package/src/transformers/features/json/JsonAssertParseTransformer.ts +10 -10
  45. package/src/transformers/features/json/JsonAssertStringifyTransformer.ts +10 -10
  46. package/src/transformers/features/json/JsonCreateAssertParseTransformer.ts +12 -12
  47. package/src/transformers/features/json/JsonCreateAssertStringifyTransformer.ts +12 -12
  48. package/src/transformers/features/json/JsonCreateIsParseTransformer.ts +9 -9
  49. package/src/transformers/features/json/JsonCreateIsStringifyTransformer.ts +12 -12
  50. package/src/transformers/features/json/JsonCreateStringifyTransformer.ts +9 -9
  51. package/src/transformers/features/json/JsonCreateValidateParseTransformer.ts +12 -12
  52. package/src/transformers/features/json/JsonCreateValidateStringifyProgrammer.ts +12 -12
  53. package/src/transformers/features/json/JsonIsParseTransformer.ts +9 -9
  54. package/src/transformers/features/json/JsonIsStringifyTransformer.ts +10 -10
  55. package/src/transformers/features/json/JsonStringifyTransformer.ts +9 -9
  56. package/src/transformers/features/json/JsonValidateParseTransformer.ts +10 -10
  57. package/src/transformers/features/json/JsonValidateStringifyTransformer.ts +10 -10
  58. package/src/transformers/features/misc/MiscAssertCloneTransformer.ts +10 -10
  59. package/src/transformers/features/misc/MiscAssertPruneTransformer.ts +10 -10
  60. package/src/transformers/features/misc/MiscCloneTransformer.ts +9 -9
  61. package/src/transformers/features/misc/MiscCreateAssertCloneTransformer.ts +12 -12
  62. package/src/transformers/features/misc/MiscCreateAssertPruneTransformer.ts +12 -12
  63. package/src/transformers/features/misc/MiscCreateCloneTransformer.ts +9 -9
  64. package/src/transformers/features/misc/MiscCreateIsCloneTransformer.ts +9 -9
  65. package/src/transformers/features/misc/MiscCreateIsPruneTransformer.ts +9 -9
  66. package/src/transformers/features/misc/MiscCreatePruneTransformer.ts +9 -9
  67. package/src/transformers/features/misc/MiscCreateValidateCloneTransformer.ts +12 -12
  68. package/src/transformers/features/misc/MiscCreateValidatePruneTransformer.ts +12 -12
  69. package/src/transformers/features/misc/MiscIsCloneTransformer.ts +9 -9
  70. package/src/transformers/features/misc/MiscIsPruneTransformer.ts +9 -9
  71. package/src/transformers/features/misc/MiscPruneTransformer.ts +9 -9
  72. package/src/transformers/features/misc/MiscValidateCloneTransformer.ts +10 -10
  73. package/src/transformers/features/misc/MiscValidatePruneTransformer.ts +10 -10
  74. package/src/transformers/features/notations/NotationAssertGeneralTransformer.ts +15 -15
  75. package/src/transformers/features/notations/NotationCreateAssertGeneralTransformer.ts +15 -15
  76. package/src/transformers/features/notations/NotationCreateGeneralTransformer.ts +15 -15
  77. package/src/transformers/features/notations/NotationCreateIsGeneralTransformer.ts +15 -15
  78. package/src/transformers/features/notations/NotationCreateValidateGeneralTransformer.ts +17 -17
  79. package/src/transformers/features/notations/NotationGeneralTransformer.ts +11 -11
  80. package/src/transformers/features/notations/NotationIsGeneralTransformer.ts +15 -15
  81. package/src/transformers/features/notations/NotationValidateGeneralTransformer.ts +17 -17
  82. package/src/transformers/features/protobuf/ProtobufCreateAssertDecodeTransformer.ts +12 -12
  83. package/src/transformers/features/protobuf/ProtobufCreateAssertEncodeTransformer.ts +12 -12
  84. package/src/transformers/features/protobuf/ProtobufCreateDecodeTransformer.ts +9 -9
  85. package/src/transformers/features/protobuf/ProtobufCreateEncodeTransformer.ts +9 -9
  86. package/src/transformers/features/protobuf/ProtobufCreateIsDecodeTransformer.ts +12 -12
  87. package/src/transformers/features/protobuf/ProtobufCreateIsEncodeTransformer.ts +12 -12
  88. package/src/transformers/features/protobuf/ProtobufCreateValidateDecodeTransformer.ts +12 -12
  89. package/src/transformers/features/protobuf/ProtobufCreateValidateEncodeTransformer.ts +12 -12
  90. package/src/utils/NamingConvention.ts +91 -91
  91. package/src/utils/StringUtil.ts +4 -4
@@ -1,164 +1,164 @@
1
- import { NamingConvention } from "../utils/NamingConvention";
2
- import { RandomGenerator } from "../utils/RandomGenerator";
3
-
4
- import { IValidation } from "../IValidation";
5
- import { TypeGuardError } from "../TypeGuardError";
6
- import { $HeadersReader } from "./$HeadersReader";
7
- import { $ParameterReader } from "./$ParameterReader";
8
- import { $ProtobufReader } from "./$ProtobufReader";
9
- import { $ProtobufSizer } from "./$ProtobufSizer";
10
- import { $ProtobufWriter } from "./$ProtobufWriter";
11
- import { $QueryReader } from "./$QueryReader";
12
- import { $any } from "./$any";
13
- import { $convention } from "./$convention";
14
- import { $every } from "./$every";
15
- import { $guard } from "./$guard";
16
- import { $is_between } from "./$is_between";
17
- import { $join } from "./$join";
18
- import { $number } from "./$number";
19
- import { $report } from "./$report";
20
- import { $rest } from "./$rest";
21
- import { $string } from "./$string";
22
- import { $strlen } from "./$strlen";
23
- import { $tail } from "./$tail";
24
-
25
- /**
26
- * @internal
27
- */
28
- export namespace Namespace {
29
- export const is = () => ({
30
- is_between: $is_between,
31
- });
32
-
33
- export const assert = (method: string) => ({
34
- ...is(),
35
- join: $join,
36
- every: $every,
37
- guard: $guard(`typia.${method}`),
38
- predicate: (
39
- matched: boolean,
40
- exceptionable: boolean,
41
- closure: () => Omit<TypeGuardError.IProps, "method">,
42
- ): boolean => {
43
- if (matched === false && exceptionable === true)
44
- throw new TypeGuardError({
45
- ...closure(),
46
- method: `typia.${method}`,
47
- });
48
- return matched;
49
- },
50
- });
51
-
52
- export const validate = () => ({
53
- ...is(),
54
- join: $join,
55
- report: $report,
56
- predicate:
57
- (res: IValidation) =>
58
- (
59
- matched: boolean,
60
- exceptionable: boolean,
61
- closure: () => IValidation.IError,
62
- ) => {
63
- // CHECK FAILURE
64
- if (matched === false && exceptionable === true)
65
- (() => {
66
- res.success &&= false;
67
- const errorList = (res as IValidation.IFailure).errors;
68
-
69
- // TRACE ERROR
70
- const error = closure();
71
- if (errorList.length) {
72
- const last = errorList[errorList.length - 1]!.path;
73
- if (
74
- last.length >= error.path.length &&
75
- last.substring(0, error.path.length) ===
76
- error.path
77
- )
78
- return;
79
- }
80
- errorList.push(error);
81
- return;
82
- })();
83
- return matched;
84
- },
85
- });
86
-
87
- export namespace json {
88
- export const stringify = (method: string) => ({
89
- ...is(),
90
- number: $number,
91
- string: $string,
92
- tail: $tail,
93
- rest: $rest,
94
- throws: $throws(`json.${method}`),
95
- });
96
- }
97
-
98
- export namespace protobuf {
99
- export const decode = (method: string) => ({
100
- Reader: $ProtobufReader,
101
- throws: $throws(`protobuf.${method}`),
102
- });
103
-
104
- export const encode = (method: string) => ({
105
- Sizer: $ProtobufSizer,
106
- Writer: $ProtobufWriter,
107
- strlen: $strlen,
108
- throws: $throws(method),
109
- });
110
- }
111
-
112
- export namespace http {
113
- export const query = () => $QueryReader;
114
- export const headers = () => $HeadersReader;
115
- export const parameter = () => $ParameterReader;
116
- }
117
-
118
- export namespace misc {
119
- export const clone = (method: string) => ({
120
- ...is(),
121
- throws: $throws(`misc.${method}`),
122
- any: $any,
123
- });
124
-
125
- export const prune = (method: string) => ({
126
- ...is(),
127
- throws: $throws(`misc.${method}`),
128
- });
129
- }
130
-
131
- export namespace notations {
132
- export const camel = (method: string) => ({
133
- ...base(method),
134
- any: $convention(NamingConvention.camel),
135
- });
136
- export const pascal = (method: string) => ({
137
- ...base(method),
138
- any: $convention(NamingConvention.pascal),
139
- });
140
- export const snake = (method: string) => ({
141
- ...base(method),
142
- any: $convention(NamingConvention.snake),
143
- });
144
-
145
- const base = (method: string) => ({
146
- ...is(),
147
- throws: $throws(`notations.${method}`),
148
- });
149
- }
150
-
151
- export const random = () => ({
152
- generator: RandomGenerator,
153
- pick: RandomGenerator.pick,
154
- });
155
-
156
- const $throws =
157
- (method: string) =>
158
- (props: Pick<TypeGuardError.IProps, "expected" | "value">) => {
159
- throw new TypeGuardError({
160
- ...props,
161
- method: `typia.${method}`,
162
- });
163
- };
164
- }
1
+ import { NamingConvention } from "../utils/NamingConvention";
2
+ import { RandomGenerator } from "../utils/RandomGenerator";
3
+
4
+ import { IValidation } from "../IValidation";
5
+ import { TypeGuardError } from "../TypeGuardError";
6
+ import { $HeadersReader } from "./$HeadersReader";
7
+ import { $ParameterReader } from "./$ParameterReader";
8
+ import { $ProtobufReader } from "./$ProtobufReader";
9
+ import { $ProtobufSizer } from "./$ProtobufSizer";
10
+ import { $ProtobufWriter } from "./$ProtobufWriter";
11
+ import { $QueryReader } from "./$QueryReader";
12
+ import { $any } from "./$any";
13
+ import { $convention } from "./$convention";
14
+ import { $every } from "./$every";
15
+ import { $guard } from "./$guard";
16
+ import { $is_between } from "./$is_between";
17
+ import { $join } from "./$join";
18
+ import { $number } from "./$number";
19
+ import { $report } from "./$report";
20
+ import { $rest } from "./$rest";
21
+ import { $string } from "./$string";
22
+ import { $strlen } from "./$strlen";
23
+ import { $tail } from "./$tail";
24
+
25
+ /**
26
+ * @internal
27
+ */
28
+ export namespace Namespace {
29
+ export const is = () => ({
30
+ is_between: $is_between,
31
+ });
32
+
33
+ export const assert = (method: string) => ({
34
+ ...is(),
35
+ join: $join,
36
+ every: $every,
37
+ guard: $guard(`typia.${method}`),
38
+ predicate: (
39
+ matched: boolean,
40
+ exceptionable: boolean,
41
+ closure: () => Omit<TypeGuardError.IProps, "method">,
42
+ ): boolean => {
43
+ if (matched === false && exceptionable === true)
44
+ throw new TypeGuardError({
45
+ ...closure(),
46
+ method: `typia.${method}`,
47
+ });
48
+ return matched;
49
+ },
50
+ });
51
+
52
+ export const validate = () => ({
53
+ ...is(),
54
+ join: $join,
55
+ report: $report,
56
+ predicate:
57
+ (res: IValidation) =>
58
+ (
59
+ matched: boolean,
60
+ exceptionable: boolean,
61
+ closure: () => IValidation.IError,
62
+ ) => {
63
+ // CHECK FAILURE
64
+ if (matched === false && exceptionable === true)
65
+ (() => {
66
+ res.success &&= false;
67
+ const errorList = (res as IValidation.IFailure).errors;
68
+
69
+ // TRACE ERROR
70
+ const error = closure();
71
+ if (errorList.length) {
72
+ const last = errorList[errorList.length - 1]!.path;
73
+ if (
74
+ last.length >= error.path.length &&
75
+ last.substring(0, error.path.length) ===
76
+ error.path
77
+ )
78
+ return;
79
+ }
80
+ errorList.push(error);
81
+ return;
82
+ })();
83
+ return matched;
84
+ },
85
+ });
86
+
87
+ export namespace json {
88
+ export const stringify = (method: string) => ({
89
+ ...is(),
90
+ number: $number,
91
+ string: $string,
92
+ tail: $tail,
93
+ rest: $rest,
94
+ throws: $throws(`json.${method}`),
95
+ });
96
+ }
97
+
98
+ export namespace protobuf {
99
+ export const decode = (method: string) => ({
100
+ Reader: $ProtobufReader,
101
+ throws: $throws(`protobuf.${method}`),
102
+ });
103
+
104
+ export const encode = (method: string) => ({
105
+ Sizer: $ProtobufSizer,
106
+ Writer: $ProtobufWriter,
107
+ strlen: $strlen,
108
+ throws: $throws(method),
109
+ });
110
+ }
111
+
112
+ export namespace http {
113
+ export const query = () => $QueryReader;
114
+ export const headers = () => $HeadersReader;
115
+ export const parameter = () => $ParameterReader;
116
+ }
117
+
118
+ export namespace misc {
119
+ export const clone = (method: string) => ({
120
+ ...is(),
121
+ throws: $throws(`misc.${method}`),
122
+ any: $any,
123
+ });
124
+
125
+ export const prune = (method: string) => ({
126
+ ...is(),
127
+ throws: $throws(`misc.${method}`),
128
+ });
129
+ }
130
+
131
+ export namespace notations {
132
+ export const camel = (method: string) => ({
133
+ ...base(method),
134
+ any: $convention(NamingConvention.camel),
135
+ });
136
+ export const pascal = (method: string) => ({
137
+ ...base(method),
138
+ any: $convention(NamingConvention.pascal),
139
+ });
140
+ export const snake = (method: string) => ({
141
+ ...base(method),
142
+ any: $convention(NamingConvention.snake),
143
+ });
144
+
145
+ const base = (method: string) => ({
146
+ ...is(),
147
+ throws: $throws(`notations.${method}`),
148
+ });
149
+ }
150
+
151
+ export const random = () => ({
152
+ generator: RandomGenerator,
153
+ pick: RandomGenerator.pick,
154
+ });
155
+
156
+ const $throws =
157
+ (method: string) =>
158
+ (props: Pick<TypeGuardError.IProps, "expected" | "value">) => {
159
+ throw new TypeGuardError({
160
+ ...props,
161
+ method: `typia.${method}`,
162
+ });
163
+ };
164
+ }