typia 3.8.0-dev.20230420 → 3.8.0-dev.20230420-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.
- package/lib/factories/IdentifierFactory.d.ts +6 -2
- package/lib/factories/IdentifierFactory.js +8 -5
- package/lib/factories/IdentifierFactory.js.map +1 -1
- package/lib/factories/LiteralFactory.js +1 -1
- package/lib/factories/LiteralFactory.js.map +1 -1
- package/lib/programmers/AssertProgrammer.js +1 -1
- package/lib/programmers/AssertProgrammer.js.map +1 -1
- package/lib/programmers/CheckerProgrammer.js +1 -1
- package/lib/programmers/CheckerProgrammer.js.map +1 -1
- package/lib/programmers/CloneProgrammer.js +3 -3
- package/lib/programmers/CloneProgrammer.js.map +1 -1
- package/lib/programmers/IsProgrammer.js +2 -2
- package/lib/programmers/IsProgrammer.js.map +1 -1
- package/lib/programmers/PruneProgrammer.js +1 -1
- package/lib/programmers/PruneProgrammer.js.map +1 -1
- package/lib/programmers/RandomProgrammer.js +1 -1
- package/lib/programmers/RandomProgrammer.js.map +1 -1
- package/lib/programmers/StringifyProgrammer.js +3 -3
- package/lib/programmers/StringifyProgrammer.js.map +1 -1
- package/lib/programmers/ValidateProgrammer.js +2 -2
- package/lib/programmers/ValidateProgrammer.js.map +1 -1
- package/lib/programmers/helpers/FunctionImporeter.js +1 -1
- package/lib/programmers/helpers/FunctionImporeter.js.map +1 -1
- package/lib/programmers/helpers/PruneJoiner.js +1 -1
- package/lib/programmers/helpers/PruneJoiner.js.map +1 -1
- package/lib/programmers/helpers/StringifyJoinder.js +1 -1
- package/lib/programmers/helpers/StringifyJoinder.js.map +1 -1
- package/lib/programmers/helpers/UnionExplorer.js +7 -7
- package/lib/programmers/helpers/UnionExplorer.js.map +1 -1
- package/lib/programmers/internal/check_array.js +1 -1
- package/lib/programmers/internal/check_array.js.map +1 -1
- package/lib/programmers/internal/check_dynamic_properties.js +3 -3
- package/lib/programmers/internal/check_dynamic_properties.js.map +1 -1
- package/lib/programmers/internal/check_everything.js +1 -1
- package/lib/programmers/internal/check_everything.js.map +1 -1
- package/lib/programmers/internal/check_string_tags.js +3 -3
- package/lib/programmers/internal/check_string_tags.js.map +1 -1
- package/lib/programmers/internal/check_union_array_like.js +1 -1
- package/lib/programmers/internal/check_union_array_like.js.map +1 -1
- package/lib/programmers/internal/stringify_dynamic_properties.js +4 -4
- package/lib/programmers/internal/stringify_dynamic_properties.js.map +1 -1
- package/package.json +1 -1
- package/src/factories/IdentifierFactory.ts +11 -5
- package/src/factories/LiteralFactory.ts +1 -1
- package/src/programmers/AssertProgrammer.ts +1 -1
- package/src/programmers/CheckerProgrammer.ts +1 -1
- package/src/programmers/CloneProgrammer.ts +3 -3
- package/src/programmers/IsProgrammer.ts +2 -2
- package/src/programmers/PruneProgrammer.ts +1 -1
- package/src/programmers/RandomProgrammer.ts +1 -1
- package/src/programmers/StringifyProgrammer.ts +3 -3
- package/src/programmers/ValidateProgrammer.ts +2 -2
- package/src/programmers/helpers/FunctionImporeter.ts +1 -1
- package/src/programmers/helpers/PruneJoiner.ts +1 -1
- package/src/programmers/helpers/StringifyJoinder.ts +1 -1
- package/src/programmers/helpers/UnionExplorer.ts +11 -11
- package/src/programmers/internal/check_array.ts +1 -1
- package/src/programmers/internal/check_dynamic_properties.ts +3 -3
- package/src/programmers/internal/check_everything.ts +1 -1
- package/src/programmers/internal/check_string_tags.ts +3 -3
- package/src/programmers/internal/check_union_array_like.ts +1 -1
- package/src/programmers/internal/stringify_dynamic_properties.ts +4 -4
|
@@ -588,7 +588,7 @@ export namespace CheckerProgrammer {
|
|
|
588
588
|
tuple.length && tuple[tuple.length - 1]!.rest !== null
|
|
589
589
|
? decode(project)(config)(importer)(
|
|
590
590
|
ts.factory.createCallExpression(
|
|
591
|
-
IdentifierFactory.
|
|
591
|
+
IdentifierFactory.access(input)("slice"),
|
|
592
592
|
undefined,
|
|
593
593
|
[
|
|
594
594
|
ts.factory.createNumericLiteral(
|
|
@@ -159,7 +159,7 @@ export namespace CloneProgrammer {
|
|
|
159
159
|
native === "Number" ||
|
|
160
160
|
native === "String"
|
|
161
161
|
? ts.factory.createCallExpression(
|
|
162
|
-
IdentifierFactory.
|
|
162
|
+
IdentifierFactory.access(input)("valueOf"),
|
|
163
163
|
undefined,
|
|
164
164
|
undefined,
|
|
165
165
|
)
|
|
@@ -207,7 +207,7 @@ export namespace CloneProgrammer {
|
|
|
207
207
|
): ts.Expression => {
|
|
208
208
|
return decode(project, importer)(
|
|
209
209
|
ts.factory.createCallExpression(
|
|
210
|
-
IdentifierFactory.
|
|
210
|
+
IdentifierFactory.access(input)("toJSON"),
|
|
211
211
|
undefined,
|
|
212
212
|
[],
|
|
213
213
|
),
|
|
@@ -244,7 +244,7 @@ export namespace CloneProgrammer {
|
|
|
244
244
|
|
|
245
245
|
return decode(project, importer)(
|
|
246
246
|
ts.factory.createCallExpression(
|
|
247
|
-
IdentifierFactory.
|
|
247
|
+
IdentifierFactory.access(input)("slice"),
|
|
248
248
|
undefined,
|
|
249
249
|
[ts.factory.createNumericLiteral(tuple.length - 1)],
|
|
250
250
|
),
|
|
@@ -66,7 +66,7 @@ export namespace IsProgrammer {
|
|
|
66
66
|
})(importer),
|
|
67
67
|
array: (input, arrow) =>
|
|
68
68
|
ts.factory.createCallExpression(
|
|
69
|
-
IdentifierFactory.
|
|
69
|
+
IdentifierFactory.access(input)("every"),
|
|
70
70
|
undefined,
|
|
71
71
|
[arrow],
|
|
72
72
|
),
|
|
@@ -199,7 +199,7 @@ export namespace IsProgrammer {
|
|
|
199
199
|
ts.factory.createStrictEquality(
|
|
200
200
|
ts.factory.createStringLiteral("function"),
|
|
201
201
|
ValueFactory.TYPEOF(
|
|
202
|
-
IdentifierFactory.
|
|
202
|
+
IdentifierFactory.access(input)("toJSON"),
|
|
203
203
|
),
|
|
204
204
|
),
|
|
205
205
|
);
|
|
@@ -200,7 +200,7 @@ export namespace PruneProgrammer {
|
|
|
200
200
|
|
|
201
201
|
return decode(project)(importer)(
|
|
202
202
|
ts.factory.createCallExpression(
|
|
203
|
-
IdentifierFactory.
|
|
203
|
+
IdentifierFactory.access(input)("slice"),
|
|
204
204
|
undefined,
|
|
205
205
|
[ts.factory.createNumericLiteral(tuple.length - 1)],
|
|
206
206
|
),
|
|
@@ -420,4 +420,4 @@ const COALESCE = (importer: FunctionImporter) => (name: string) =>
|
|
|
420
420
|
ts.factory.createToken(ts.SyntaxKind.QuestionDotToken),
|
|
421
421
|
ts.factory.createIdentifier(name),
|
|
422
422
|
),
|
|
423
|
-
)(IdentifierFactory.
|
|
423
|
+
)(IdentifierFactory.access(importer.use("generator"))(name));
|
|
@@ -479,7 +479,7 @@ export namespace StringifyProgrammer {
|
|
|
479
479
|
|
|
480
480
|
const code = decode(project, importer)(
|
|
481
481
|
ts.factory.createCallExpression(
|
|
482
|
-
IdentifierFactory.
|
|
482
|
+
IdentifierFactory.access(input)("slice"),
|
|
483
483
|
undefined,
|
|
484
484
|
[ts.factory.createNumericLiteral(tuple.length - 1)],
|
|
485
485
|
),
|
|
@@ -538,7 +538,7 @@ export namespace StringifyProgrammer {
|
|
|
538
538
|
return explore.from !== "top"
|
|
539
539
|
? input
|
|
540
540
|
: ts.factory.createCallExpression(
|
|
541
|
-
IdentifierFactory.
|
|
541
|
+
IdentifierFactory.access(input)("toString"),
|
|
542
542
|
undefined,
|
|
543
543
|
undefined,
|
|
544
544
|
);
|
|
@@ -577,7 +577,7 @@ export namespace StringifyProgrammer {
|
|
|
577
577
|
): ts.Expression => {
|
|
578
578
|
return decode(project, importer)(
|
|
579
579
|
ts.factory.createCallExpression(
|
|
580
|
-
IdentifierFactory.
|
|
580
|
+
IdentifierFactory.access(input)("toJSON"),
|
|
581
581
|
undefined,
|
|
582
582
|
[],
|
|
583
583
|
),
|
|
@@ -107,7 +107,7 @@ export namespace ValidateProgrammer {
|
|
|
107
107
|
StatementFactory.constant(
|
|
108
108
|
"$report",
|
|
109
109
|
ts.factory.createCallExpression(
|
|
110
|
-
IdentifierFactory.
|
|
110
|
+
IdentifierFactory.access(
|
|
111
111
|
ts.factory.createParenthesizedExpression(
|
|
112
112
|
ts.factory.createAsExpression(
|
|
113
113
|
modulo,
|
|
@@ -247,7 +247,7 @@ const joiner =
|
|
|
247
247
|
array: (input, arrow) =>
|
|
248
248
|
check_everything(
|
|
249
249
|
ts.factory.createCallExpression(
|
|
250
|
-
IdentifierFactory.
|
|
250
|
+
IdentifierFactory.access(input)("map"),
|
|
251
251
|
undefined,
|
|
252
252
|
[arrow],
|
|
253
253
|
),
|
|
@@ -31,7 +31,7 @@ export class FunctionImporter {
|
|
|
31
31
|
return [...this.used_].map((name) =>
|
|
32
32
|
StatementFactory.constant(
|
|
33
33
|
"$" + name,
|
|
34
|
-
IdentifierFactory.
|
|
34
|
+
IdentifierFactory.access(
|
|
35
35
|
ts.factory.createParenthesizedExpression(
|
|
36
36
|
ts.factory.createAsExpression(
|
|
37
37
|
modulo,
|
|
@@ -28,7 +28,7 @@ export namespace PruneJoiner {
|
|
|
28
28
|
|
|
29
29
|
export const array = (input: ts.Expression, arrow: ts.ArrowFunction) =>
|
|
30
30
|
ts.factory.createCallExpression(
|
|
31
|
-
IdentifierFactory.
|
|
31
|
+
IdentifierFactory.access(input)("forEach"),
|
|
32
32
|
undefined,
|
|
33
33
|
[arrow],
|
|
34
34
|
);
|
|
@@ -70,7 +70,7 @@ export namespace StringifyJoiner {
|
|
|
70
70
|
ts.factory.createCallExpression(
|
|
71
71
|
ts.factory.createPropertyAccessExpression(
|
|
72
72
|
ts.factory.createCallExpression(
|
|
73
|
-
IdentifierFactory.
|
|
73
|
+
IdentifierFactory.access(input)("map"),
|
|
74
74
|
undefined,
|
|
75
75
|
[arrow],
|
|
76
76
|
),
|
|
@@ -76,7 +76,7 @@ export namespace UnionExplorer {
|
|
|
76
76
|
.map((spec) => {
|
|
77
77
|
const key: string = spec.property.key.getSoleLiteral()!;
|
|
78
78
|
const accessor: ts.Expression =
|
|
79
|
-
IdentifierFactory.
|
|
79
|
+
IdentifierFactory.access(input)(key);
|
|
80
80
|
const pred: ts.Expression = spec.neighbour
|
|
81
81
|
? config.objector.checker(
|
|
82
82
|
accessor,
|
|
@@ -159,7 +159,7 @@ export namespace UnionExplorer {
|
|
|
159
159
|
|
|
160
160
|
export const array = (props: array.IProps) =>
|
|
161
161
|
check_union_array_like<Metadata>({
|
|
162
|
-
size: (input) => IdentifierFactory.
|
|
162
|
+
size: (input) => IdentifierFactory.access(input)("length"),
|
|
163
163
|
front: (input) =>
|
|
164
164
|
ts.factory.createElementAccessExpression(input, 0),
|
|
165
165
|
array: (input) => input,
|
|
@@ -171,7 +171,7 @@ export namespace UnionExplorer {
|
|
|
171
171
|
|
|
172
172
|
export const array_or_tuple = (props: array_or_tuple.IProps) =>
|
|
173
173
|
check_union_array_like<Metadata | Metadata[]>({
|
|
174
|
-
size: (input) => IdentifierFactory.
|
|
174
|
+
size: (input) => IdentifierFactory.access(input)("length"),
|
|
175
175
|
front: (input) =>
|
|
176
176
|
ts.factory.createElementAccessExpression(input, 0),
|
|
177
177
|
array: (input) => input,
|
|
@@ -188,13 +188,13 @@ export namespace UnionExplorer {
|
|
|
188
188
|
|
|
189
189
|
export const set = (props: set.IProps) =>
|
|
190
190
|
check_union_array_like<Metadata>({
|
|
191
|
-
size: (input) => IdentifierFactory.
|
|
191
|
+
size: (input) => IdentifierFactory.access(input)("size"),
|
|
192
192
|
front: (input) =>
|
|
193
|
-
IdentifierFactory.
|
|
193
|
+
IdentifierFactory.access(
|
|
194
194
|
ts.factory.createCallExpression(
|
|
195
|
-
IdentifierFactory.
|
|
195
|
+
IdentifierFactory.access(
|
|
196
196
|
ts.factory.createCallExpression(
|
|
197
|
-
IdentifierFactory.
|
|
197
|
+
IdentifierFactory.access(input)("values"),
|
|
198
198
|
undefined,
|
|
199
199
|
undefined,
|
|
200
200
|
),
|
|
@@ -216,13 +216,13 @@ export namespace UnionExplorer {
|
|
|
216
216
|
|
|
217
217
|
export const map = (props: map.IProps) =>
|
|
218
218
|
check_union_array_like<[Metadata, Metadata]>({
|
|
219
|
-
size: (input) => IdentifierFactory.
|
|
219
|
+
size: (input) => IdentifierFactory.access(input)("size"),
|
|
220
220
|
front: (input) =>
|
|
221
|
-
IdentifierFactory.
|
|
221
|
+
IdentifierFactory.access(
|
|
222
222
|
ts.factory.createCallExpression(
|
|
223
|
-
IdentifierFactory.
|
|
223
|
+
IdentifierFactory.access(
|
|
224
224
|
ts.factory.createCallExpression(
|
|
225
|
-
IdentifierFactory.
|
|
225
|
+
IdentifierFactory.access(input)("entries"),
|
|
226
226
|
undefined,
|
|
227
227
|
undefined,
|
|
228
228
|
),
|
|
@@ -22,7 +22,7 @@ export const check_array =
|
|
|
22
22
|
expression: ExpressionFactory.isArray(input),
|
|
23
23
|
tags: [
|
|
24
24
|
...check_array_length(metaTags)(
|
|
25
|
-
IdentifierFactory.
|
|
25
|
+
IdentifierFactory.access(input)("length"),
|
|
26
26
|
),
|
|
27
27
|
...check_custom("array", "Array")(importer)(jsDocTags)(input),
|
|
28
28
|
// check custom array for legacy (3.7.0)
|
|
@@ -20,7 +20,7 @@ export const check_dynamic_properties =
|
|
|
20
20
|
regular: IExpressionEntry<ts.Expression>[],
|
|
21
21
|
dynamic: IExpressionEntry<ts.Expression>[],
|
|
22
22
|
): ts.Expression => {
|
|
23
|
-
const length = IdentifierFactory.
|
|
23
|
+
const length = IdentifierFactory.access(
|
|
24
24
|
ts.factory.createCallExpression(
|
|
25
25
|
ts.factory.createIdentifier("Object.keys"),
|
|
26
26
|
undefined,
|
|
@@ -66,7 +66,7 @@ export const check_dynamic_properties =
|
|
|
66
66
|
check_dynamic_property(props)(input, regular, dynamic),
|
|
67
67
|
])
|
|
68
68
|
: ts.factory.createCallExpression(
|
|
69
|
-
IdentifierFactory.
|
|
69
|
+
IdentifierFactory.access(
|
|
70
70
|
ts.factory.createCallExpression(
|
|
71
71
|
ts.factory.createIdentifier("Object.keys"),
|
|
72
72
|
undefined,
|
|
@@ -170,7 +170,7 @@ const check_dynamic_property =
|
|
|
170
170
|
|
|
171
171
|
const is_regular_property = (regular: IExpressionEntry[]) =>
|
|
172
172
|
ts.factory.createCallExpression(
|
|
173
|
-
IdentifierFactory.
|
|
173
|
+
IdentifierFactory.access(
|
|
174
174
|
ts.factory.createArrayLiteralExpression(
|
|
175
175
|
regular.map((entry) =>
|
|
176
176
|
ts.factory.createStringLiteral(entry.key.getSoleLiteral()!),
|
|
@@ -8,7 +8,7 @@ import { TypeFactory } from "../../factories/TypeFactory";
|
|
|
8
8
|
*/
|
|
9
9
|
export const check_everything = (array: ts.Expression) =>
|
|
10
10
|
ts.factory.createCallExpression(
|
|
11
|
-
IdentifierFactory.
|
|
11
|
+
IdentifierFactory.access(array)("every"),
|
|
12
12
|
undefined,
|
|
13
13
|
[
|
|
14
14
|
ts.factory.createArrowFunction(
|
|
@@ -41,7 +41,7 @@ export const check_string_tags =
|
|
|
41
41
|
tag,
|
|
42
42
|
ts.factory.createStrictEquality(
|
|
43
43
|
ts.factory.createNumericLiteral(tag.value),
|
|
44
|
-
IdentifierFactory.
|
|
44
|
+
IdentifierFactory.access(input)("length"),
|
|
45
45
|
),
|
|
46
46
|
]);
|
|
47
47
|
else if (tag.kind === "minLength")
|
|
@@ -49,7 +49,7 @@ export const check_string_tags =
|
|
|
49
49
|
tag,
|
|
50
50
|
ts.factory.createLessThanEquals(
|
|
51
51
|
ts.factory.createNumericLiteral(tag.value),
|
|
52
|
-
IdentifierFactory.
|
|
52
|
+
IdentifierFactory.access(input)("length"),
|
|
53
53
|
),
|
|
54
54
|
]);
|
|
55
55
|
else if (tag.kind === "maxLength")
|
|
@@ -57,7 +57,7 @@ export const check_string_tags =
|
|
|
57
57
|
tag,
|
|
58
58
|
ts.factory.createGreaterThanEquals(
|
|
59
59
|
ts.factory.createNumericLiteral(tag.value),
|
|
60
|
-
IdentifierFactory.
|
|
60
|
+
IdentifierFactory.access(input)("length"),
|
|
61
61
|
),
|
|
62
62
|
]);
|
|
63
63
|
return conditions.map(([tag, expression]) => ({
|
|
@@ -149,7 +149,7 @@ export const check_union_array_like =
|
|
|
149
149
|
ts.factory.createIdentifier("filtered"),
|
|
150
150
|
ts.factory.createIfStatement(
|
|
151
151
|
ts.factory.createCallExpression(
|
|
152
|
-
IdentifierFactory.
|
|
152
|
+
IdentifierFactory.access(
|
|
153
153
|
ts.factory.createIdentifier("array"),
|
|
154
154
|
)("every"),
|
|
155
155
|
undefined,
|
|
@@ -29,7 +29,7 @@ export const stringify_dynamic_properties = (
|
|
|
29
29
|
// PREPARE RETURN FUNCTION
|
|
30
30
|
const output = () => {
|
|
31
31
|
const mapped = ts.factory.createCallExpression(
|
|
32
|
-
IdentifierFactory.
|
|
32
|
+
IdentifierFactory.access(
|
|
33
33
|
ts.factory.createCallExpression(
|
|
34
34
|
ts.factory.createIdentifier("Object.entries"),
|
|
35
35
|
undefined,
|
|
@@ -65,7 +65,7 @@ export const stringify_dynamic_properties = (
|
|
|
65
65
|
],
|
|
66
66
|
);
|
|
67
67
|
const filtered = ts.factory.createCallExpression(
|
|
68
|
-
IdentifierFactory.
|
|
68
|
+
IdentifierFactory.access(mapped)("filter"),
|
|
69
69
|
undefined,
|
|
70
70
|
[
|
|
71
71
|
ts.factory.createArrowFunction(
|
|
@@ -82,7 +82,7 @@ export const stringify_dynamic_properties = (
|
|
|
82
82
|
],
|
|
83
83
|
);
|
|
84
84
|
return ts.factory.createCallExpression(
|
|
85
|
-
IdentifierFactory.
|
|
85
|
+
IdentifierFactory.access(filtered)("join"),
|
|
86
86
|
undefined,
|
|
87
87
|
[ts.factory.createStringLiteral(",")],
|
|
88
88
|
);
|
|
@@ -93,7 +93,7 @@ export const stringify_dynamic_properties = (
|
|
|
93
93
|
statements.push(
|
|
94
94
|
ts.factory.createIfStatement(
|
|
95
95
|
ts.factory.createCallExpression(
|
|
96
|
-
IdentifierFactory.
|
|
96
|
+
IdentifierFactory.access(
|
|
97
97
|
ts.factory.createArrayLiteralExpression(
|
|
98
98
|
regular.map((key) =>
|
|
99
99
|
ts.factory.createStringLiteral(key),
|