typia 7.0.0-dev.20240928 → 7.0.0-dev.20240930
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/internal/metadata/emplace_metadata_object.js +2 -1
- package/lib/factories/internal/metadata/emplace_metadata_object.js.map +1 -1
- package/lib/programmers/AssertProgrammer.js +14 -10
- package/lib/programmers/AssertProgrammer.js.map +1 -1
- package/lib/programmers/CheckerProgrammer.d.ts +5 -1
- package/lib/programmers/CheckerProgrammer.js +161 -135
- package/lib/programmers/CheckerProgrammer.js.map +1 -1
- package/lib/programmers/FeatureProgrammer.d.ts +91 -28
- package/lib/programmers/FeatureProgrammer.js +158 -139
- package/lib/programmers/FeatureProgrammer.js.map +1 -1
- package/lib/programmers/IsProgrammer.d.ts +5 -1
- package/lib/programmers/IsProgrammer.js +70 -67
- package/lib/programmers/IsProgrammer.js.map +1 -1
- package/lib/programmers/ValidateProgrammer.js +7 -3
- package/lib/programmers/ValidateProgrammer.js.map +1 -1
- package/lib/programmers/helpers/UnionExplorer.js +31 -6
- package/lib/programmers/helpers/UnionExplorer.js.map +1 -1
- package/lib/programmers/internal/feature_object_entries.js +18 -14
- package/lib/programmers/internal/feature_object_entries.js.map +1 -1
- package/lib/programmers/json/JsonStringifyProgrammer.js +101 -62
- package/lib/programmers/json/JsonStringifyProgrammer.js.map +1 -1
- package/lib/programmers/misc/MiscCloneProgrammer.js +101 -62
- package/lib/programmers/misc/MiscCloneProgrammer.js.map +1 -1
- package/lib/programmers/misc/MiscPruneProgrammer.js +97 -62
- package/lib/programmers/misc/MiscPruneProgrammer.js.map +1 -1
- package/lib/programmers/notations/NotationGeneralProgrammer.js +118 -60
- package/lib/programmers/notations/NotationGeneralProgrammer.js.map +1 -1
- package/package.json +1 -1
- package/src/factories/internal/metadata/emplace_metadata_object.ts +2 -1
- package/src/programmers/AssertProgrammer.ts +14 -10
- package/src/programmers/CheckerProgrammer.ts +139 -134
- package/src/programmers/FeatureProgrammer.ts +324 -266
- package/src/programmers/IsProgrammer.ts +80 -77
- package/src/programmers/ValidateProgrammer.ts +7 -3
- package/src/programmers/helpers/UnionExplorer.ts +33 -12
- package/src/programmers/internal/feature_object_entries.ts +18 -15
- package/src/programmers/json/JsonStringifyProgrammer.ts +103 -76
- package/src/programmers/misc/MiscCloneProgrammer.ts +122 -95
- package/src/programmers/misc/MiscPruneProgrammer.ts +111 -90
- package/src/programmers/notations/NotationGeneralProgrammer.ts +138 -91
|
@@ -19,68 +19,69 @@ import { OptionPredicator } from "./helpers/OptionPredicator";
|
|
|
19
19
|
import { check_object } from "./internal/check_object";
|
|
20
20
|
|
|
21
21
|
export namespace IsProgrammer {
|
|
22
|
-
export const configure =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
22
|
+
export const configure = (props: {
|
|
23
|
+
options?: Partial<CONFIG.IOptions>;
|
|
24
|
+
context: ITypiaContext;
|
|
25
|
+
importer: FunctionImporter;
|
|
26
|
+
}): CheckerProgrammer.IConfig => ({
|
|
27
|
+
prefix: "$i",
|
|
28
|
+
equals: !!props.options?.object,
|
|
29
|
+
trace: false,
|
|
30
|
+
path: false,
|
|
31
|
+
numeric: OptionPredicator.numeric({
|
|
32
|
+
numeric: props.options?.numeric,
|
|
33
|
+
}),
|
|
34
|
+
atomist: ({ entry }) =>
|
|
35
|
+
[
|
|
36
|
+
...(entry.expression ? [entry.expression] : []),
|
|
37
|
+
...(entry.conditions.length === 0
|
|
38
|
+
? []
|
|
39
|
+
: [
|
|
40
|
+
entry.conditions
|
|
41
|
+
.map((set) =>
|
|
42
|
+
set
|
|
43
|
+
.map((s) => s.expression)
|
|
44
|
+
.reduce((a, b) => ts.factory.createLogicalAnd(a, b)),
|
|
45
|
+
)
|
|
46
|
+
.reduce((a, b) => ts.factory.createLogicalOr(a, b)),
|
|
47
|
+
]),
|
|
48
|
+
].reduce((x, y) => ts.factory.createLogicalAnd(x, y)),
|
|
49
|
+
combiner: (next) => {
|
|
50
|
+
const initial: ts.TrueLiteral | ts.FalseLiteral =
|
|
51
|
+
next.logic === "and"
|
|
52
|
+
? ts.factory.createTrue()
|
|
53
|
+
: ts.factory.createFalse();
|
|
54
|
+
const binder =
|
|
55
|
+
next.logic === "and"
|
|
56
|
+
? ts.factory.createLogicalAnd
|
|
57
|
+
: ts.factory.createLogicalOr;
|
|
58
|
+
return next.binaries.length
|
|
59
|
+
? next.binaries.map((binary) => binary.expression).reduce(binder)
|
|
60
|
+
: initial;
|
|
61
|
+
},
|
|
62
|
+
joiner: {
|
|
63
|
+
object:
|
|
64
|
+
props.options?.object ||
|
|
65
|
+
check_object({
|
|
66
|
+
equals: !!props.options?.object,
|
|
67
|
+
undefined: OptionPredicator.undefined({
|
|
68
|
+
undefined: props.options?.undefined,
|
|
69
|
+
}),
|
|
70
|
+
assert: true,
|
|
71
|
+
reduce: ts.factory.createLogicalAnd,
|
|
72
|
+
positive: ts.factory.createTrue(),
|
|
73
|
+
superfluous: () => ts.factory.createFalse(),
|
|
74
|
+
})(props.context)(props.importer),
|
|
75
|
+
array: (props) =>
|
|
76
|
+
ts.factory.createCallExpression(
|
|
77
|
+
IdentifierFactory.access(props.input)("every"),
|
|
78
|
+
undefined,
|
|
79
|
+
[props.arrow],
|
|
80
|
+
),
|
|
81
|
+
failure: () => ts.factory.createFalse(),
|
|
82
|
+
},
|
|
83
|
+
success: ts.factory.createTrue(),
|
|
84
|
+
});
|
|
84
85
|
|
|
85
86
|
export namespace CONFIG {
|
|
86
87
|
export interface IOptions {
|
|
@@ -113,16 +114,20 @@ export namespace IsProgrammer {
|
|
|
113
114
|
// CONFIGURATION
|
|
114
115
|
const config: CheckerProgrammer.IConfig = {
|
|
115
116
|
...configure({
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
117
|
+
options: {
|
|
118
|
+
object: check_object({
|
|
119
|
+
equals: props.config.equals,
|
|
120
|
+
undefined: OptionPredicator.undefined(props.context.options),
|
|
121
|
+
assert: true,
|
|
122
|
+
reduce: ts.factory.createLogicalAnd,
|
|
123
|
+
positive: ts.factory.createTrue(),
|
|
124
|
+
superfluous: () => ts.factory.createFalse(),
|
|
125
|
+
})(props.context)(props.importer),
|
|
126
|
+
numeric: OptionPredicator.numeric(props.context.options),
|
|
127
|
+
},
|
|
128
|
+
context: props.context,
|
|
129
|
+
importer: props.importer,
|
|
130
|
+
}),
|
|
126
131
|
trace: props.config.equals,
|
|
127
132
|
};
|
|
128
133
|
|
|
@@ -168,9 +173,7 @@ export namespace IsProgrammer {
|
|
|
168
173
|
importer: FunctionImporter;
|
|
169
174
|
collection: MetadataCollection;
|
|
170
175
|
}) => {
|
|
171
|
-
const config: CheckerProgrammer.IConfig = configure(
|
|
172
|
-
props.importer,
|
|
173
|
-
);
|
|
176
|
+
const config: CheckerProgrammer.IConfig = configure(props);
|
|
174
177
|
const next = {
|
|
175
178
|
...props,
|
|
176
179
|
config,
|
|
@@ -212,7 +215,7 @@ export namespace IsProgrammer {
|
|
|
212
215
|
}) =>
|
|
213
216
|
CheckerProgrammer.decode({
|
|
214
217
|
context: props.context,
|
|
215
|
-
config: configure(
|
|
218
|
+
config: configure(props),
|
|
216
219
|
importer: props.importer,
|
|
217
220
|
metadata: props.metadata,
|
|
218
221
|
input: props.input,
|
|
@@ -227,7 +230,7 @@ export namespace IsProgrammer {
|
|
|
227
230
|
explore: FeatureProgrammer.IExplore;
|
|
228
231
|
}) =>
|
|
229
232
|
CheckerProgrammer.decode_object({
|
|
230
|
-
config: configure(
|
|
233
|
+
config: configure(props),
|
|
231
234
|
importer: props.importer,
|
|
232
235
|
object: props.object,
|
|
233
236
|
input: props.input,
|
|
@@ -251,9 +251,13 @@ const combine =
|
|
|
251
251
|
(next) => {
|
|
252
252
|
if (next.explore.tracable === false)
|
|
253
253
|
return IsProgrammer.configure({
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
254
|
+
options: {
|
|
255
|
+
object: validate_object(props),
|
|
256
|
+
numeric: true,
|
|
257
|
+
},
|
|
258
|
+
context: props.context,
|
|
259
|
+
importer: props.importer,
|
|
260
|
+
}).combiner(next);
|
|
257
261
|
|
|
258
262
|
const path: string = next.explore.postfix
|
|
259
263
|
? `_path + ${next.explore.postfix}`
|
|
@@ -36,23 +36,32 @@ export namespace UnionExplorer {
|
|
|
36
36
|
): ts.Expression => {
|
|
37
37
|
// BREAKER
|
|
38
38
|
if (targets.length === 1)
|
|
39
|
-
return config.objector.decoder(
|
|
39
|
+
return config.objector.decoder({
|
|
40
|
+
input,
|
|
41
|
+
object: targets[0]!,
|
|
42
|
+
explore,
|
|
43
|
+
});
|
|
40
44
|
|
|
41
45
|
const expected: string = `(${targets.map((t) => t.name).join(" | ")})`;
|
|
42
46
|
|
|
43
47
|
// POSSIBLE TO SPECIALIZE?
|
|
44
48
|
const specList = UnionPredicator.object(targets);
|
|
45
49
|
if (specList.length === 0) {
|
|
46
|
-
const condition: ts.Expression = config.objector.unionizer(
|
|
50
|
+
const condition: ts.Expression = config.objector.unionizer({
|
|
47
51
|
input,
|
|
48
|
-
targets,
|
|
49
|
-
{
|
|
52
|
+
objects: targets,
|
|
53
|
+
explore: {
|
|
50
54
|
...explore,
|
|
51
55
|
tracable: false,
|
|
52
56
|
},
|
|
53
|
-
);
|
|
57
|
+
});
|
|
54
58
|
return config.objector.full
|
|
55
|
-
? config.objector.full(
|
|
59
|
+
? config.objector.full({
|
|
60
|
+
condition,
|
|
61
|
+
expected,
|
|
62
|
+
explore,
|
|
63
|
+
input,
|
|
64
|
+
})
|
|
56
65
|
: condition;
|
|
57
66
|
}
|
|
58
67
|
const remained: MetadataObject[] = targets.filter(
|
|
@@ -66,10 +75,14 @@ export namespace UnionExplorer {
|
|
|
66
75
|
const key: string = spec.property.key.getSoleLiteral()!;
|
|
67
76
|
const accessor: ts.Expression = IdentifierFactory.access(input)(key);
|
|
68
77
|
const pred: ts.Expression = spec.neighbour
|
|
69
|
-
? config.objector.checker(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
78
|
+
? config.objector.checker({
|
|
79
|
+
input: accessor,
|
|
80
|
+
metadata: spec.property.value,
|
|
81
|
+
explore: {
|
|
82
|
+
...explore,
|
|
83
|
+
tracable: false,
|
|
84
|
+
postfix: IdentifierFactory.postfix(key),
|
|
85
|
+
},
|
|
73
86
|
})
|
|
74
87
|
: (config.objector.required || ((exp) => exp))(
|
|
75
88
|
ExpressionFactory.isRequired(accessor),
|
|
@@ -77,14 +90,22 @@ export namespace UnionExplorer {
|
|
|
77
90
|
return ts.factory.createIfStatement(
|
|
78
91
|
(config.objector.is || ((exp) => exp))(pred),
|
|
79
92
|
ts.factory.createReturnStatement(
|
|
80
|
-
config.objector.decoder(
|
|
93
|
+
config.objector.decoder({
|
|
94
|
+
object: spec.object,
|
|
95
|
+
input,
|
|
96
|
+
explore,
|
|
97
|
+
}),
|
|
81
98
|
),
|
|
82
99
|
i === array.length - 1
|
|
83
100
|
? remained.length
|
|
84
101
|
? ts.factory.createReturnStatement(
|
|
85
102
|
object(config, level + 1)(input, remained, explore),
|
|
86
103
|
)
|
|
87
|
-
: config.objector.failure(
|
|
104
|
+
: config.objector.failure({
|
|
105
|
+
input,
|
|
106
|
+
expected,
|
|
107
|
+
explore,
|
|
108
|
+
})
|
|
88
109
|
: undefined,
|
|
89
110
|
);
|
|
90
111
|
})
|
|
@@ -20,9 +20,9 @@ export const feature_object_entries =
|
|
|
20
20
|
>,
|
|
21
21
|
) =>
|
|
22
22
|
(importer: FunctionImporter) =>
|
|
23
|
-
(
|
|
23
|
+
(object: MetadataObject) =>
|
|
24
24
|
(input: ts.Expression, from: "object" | "top" | "array" = "object") =>
|
|
25
|
-
|
|
25
|
+
object.properties.map((prop) => {
|
|
26
26
|
const sole: string | null = prop.key.getSoleLiteral();
|
|
27
27
|
const propInput =
|
|
28
28
|
sole === null
|
|
@@ -36,23 +36,26 @@ export const feature_object_entries =
|
|
|
36
36
|
input,
|
|
37
37
|
ts.factory.createStringLiteral(sole),
|
|
38
38
|
);
|
|
39
|
-
|
|
40
39
|
return {
|
|
41
40
|
input: propInput,
|
|
42
41
|
key: prop.key,
|
|
43
42
|
meta: prop.value,
|
|
44
|
-
expression: config.decoder(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
43
|
+
expression: config.decoder({
|
|
44
|
+
input: propInput,
|
|
45
|
+
metadata: prop.value,
|
|
46
|
+
explore: {
|
|
47
|
+
tracable: config.path || config.trace,
|
|
48
|
+
source: "function",
|
|
49
|
+
from,
|
|
50
|
+
postfix: config.trace
|
|
51
|
+
? sole !== null
|
|
52
|
+
? IdentifierFactory.postfix(sole)
|
|
53
|
+
: (() => {
|
|
54
|
+
importer.use("join");
|
|
55
|
+
return `$join(key)`;
|
|
56
|
+
})()
|
|
57
|
+
: "",
|
|
58
|
+
},
|
|
56
59
|
}),
|
|
57
60
|
};
|
|
58
61
|
});
|
|
@@ -100,9 +100,11 @@ export namespace JsonStringifyProgrammer {
|
|
|
100
100
|
ts.factory.createArrowFunction(
|
|
101
101
|
undefined,
|
|
102
102
|
undefined,
|
|
103
|
-
FeatureProgrammer.parameterDeclarations(
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
FeatureProgrammer.parameterDeclarations({
|
|
104
|
+
config: props.config,
|
|
105
|
+
type: TypeFactory.keyword("any"),
|
|
106
|
+
input: ts.factory.createIdentifier("input"),
|
|
107
|
+
}),
|
|
106
108
|
TypeFactory.keyword("any"),
|
|
107
109
|
undefined,
|
|
108
110
|
decode_array_inline({
|
|
@@ -139,9 +141,11 @@ export namespace JsonStringifyProgrammer {
|
|
|
139
141
|
ts.factory.createArrowFunction(
|
|
140
142
|
undefined,
|
|
141
143
|
undefined,
|
|
142
|
-
FeatureProgrammer.parameterDeclarations(
|
|
143
|
-
|
|
144
|
-
|
|
144
|
+
FeatureProgrammer.parameterDeclarations({
|
|
145
|
+
config: props.config,
|
|
146
|
+
type: TypeFactory.keyword("any"),
|
|
147
|
+
input: ts.factory.createIdentifier("input"),
|
|
148
|
+
}),
|
|
145
149
|
TypeFactory.keyword("any"),
|
|
146
150
|
undefined,
|
|
147
151
|
decode_tuple_inline({
|
|
@@ -520,10 +524,16 @@ export namespace JsonStringifyProgrammer {
|
|
|
520
524
|
explore: FeatureProgrammer.IExplore;
|
|
521
525
|
}): ts.CallExpression =>
|
|
522
526
|
FeatureProgrammer.decode_object({
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
+
config: {
|
|
528
|
+
trace: false,
|
|
529
|
+
path: false,
|
|
530
|
+
prefix: PREFIX,
|
|
531
|
+
},
|
|
532
|
+
importer: props.importer,
|
|
533
|
+
object: props.object,
|
|
534
|
+
input: props.input,
|
|
535
|
+
explore: props.explore,
|
|
536
|
+
});
|
|
527
537
|
|
|
528
538
|
const decode_array = (props: {
|
|
529
539
|
config: FeatureProgrammer.IConfig;
|
|
@@ -540,11 +550,15 @@ export namespace JsonStringifyProgrammer {
|
|
|
540
550
|
),
|
|
541
551
|
),
|
|
542
552
|
undefined,
|
|
543
|
-
FeatureProgrammer.argumentsArray(
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
553
|
+
FeatureProgrammer.argumentsArray({
|
|
554
|
+
config: props.config,
|
|
555
|
+
input: props.input,
|
|
556
|
+
explore: {
|
|
557
|
+
...props.explore,
|
|
558
|
+
source: "function",
|
|
559
|
+
from: "array",
|
|
560
|
+
},
|
|
561
|
+
}),
|
|
548
562
|
)
|
|
549
563
|
: decode_array_inline(props);
|
|
550
564
|
|
|
@@ -555,9 +569,14 @@ export namespace JsonStringifyProgrammer {
|
|
|
555
569
|
array: MetadataArray;
|
|
556
570
|
explore: FeatureProgrammer.IExplore;
|
|
557
571
|
}) =>
|
|
558
|
-
FeatureProgrammer.decode_array(
|
|
559
|
-
|
|
560
|
-
|
|
572
|
+
FeatureProgrammer.decode_array({
|
|
573
|
+
config: props.config,
|
|
574
|
+
importer: props.importer,
|
|
575
|
+
combiner: StringifyJoiner.array,
|
|
576
|
+
array: props.array,
|
|
577
|
+
input: props.input,
|
|
578
|
+
explore: props.explore,
|
|
579
|
+
});
|
|
561
580
|
|
|
562
581
|
const decode_tuple = (props: {
|
|
563
582
|
context: ITypiaContext;
|
|
@@ -575,10 +594,14 @@ export namespace JsonStringifyProgrammer {
|
|
|
575
594
|
),
|
|
576
595
|
),
|
|
577
596
|
undefined,
|
|
578
|
-
FeatureProgrammer.argumentsArray(
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
597
|
+
FeatureProgrammer.argumentsArray({
|
|
598
|
+
config: props.config,
|
|
599
|
+
explore: {
|
|
600
|
+
...props.explore,
|
|
601
|
+
source: "function",
|
|
602
|
+
},
|
|
603
|
+
input: props.input,
|
|
604
|
+
}),
|
|
582
605
|
)
|
|
583
606
|
: decode_tuple_inline({
|
|
584
607
|
...props,
|
|
@@ -738,9 +761,7 @@ export namespace JsonStringifyProgrammer {
|
|
|
738
761
|
props.importer.useLocal(`${PREFIX}u${props.metadata.union_index!}`),
|
|
739
762
|
),
|
|
740
763
|
undefined,
|
|
741
|
-
FeatureProgrammer.argumentsArray(props
|
|
742
|
-
props.input,
|
|
743
|
-
),
|
|
764
|
+
FeatureProgrammer.argumentsArray(props),
|
|
744
765
|
);
|
|
745
766
|
|
|
746
767
|
const explore_arrays = (props: {
|
|
@@ -832,9 +853,11 @@ export namespace JsonStringifyProgrammer {
|
|
|
832
853
|
props.elements.map((e) => e.type.name).join(" | "),
|
|
833
854
|
() =>
|
|
834
855
|
arrow({
|
|
835
|
-
parameters: FeatureProgrammer.parameterDeclarations(
|
|
836
|
-
|
|
837
|
-
|
|
856
|
+
parameters: FeatureProgrammer.parameterDeclarations({
|
|
857
|
+
config: props.config,
|
|
858
|
+
type: TypeFactory.keyword("any"),
|
|
859
|
+
input: ts.factory.createIdentifier("input"),
|
|
860
|
+
}),
|
|
838
861
|
explore: {
|
|
839
862
|
...arrayExplore,
|
|
840
863
|
postfix: "",
|
|
@@ -844,7 +867,11 @@ export namespace JsonStringifyProgrammer {
|
|
|
844
867
|
),
|
|
845
868
|
),
|
|
846
869
|
undefined,
|
|
847
|
-
FeatureProgrammer.argumentsArray(
|
|
870
|
+
FeatureProgrammer.argumentsArray({
|
|
871
|
+
config: props.config,
|
|
872
|
+
explore: arrayExplore,
|
|
873
|
+
input: props.input,
|
|
874
|
+
}),
|
|
848
875
|
);
|
|
849
876
|
};
|
|
850
877
|
|
|
@@ -947,73 +974,74 @@ export namespace JsonStringifyProgrammer {
|
|
|
947
974
|
trace: false,
|
|
948
975
|
path: false,
|
|
949
976
|
initializer,
|
|
950
|
-
decoder: () =>
|
|
977
|
+
decoder: (next) =>
|
|
951
978
|
decode({
|
|
952
979
|
context: props.context,
|
|
953
980
|
importer: props.importer,
|
|
954
981
|
config,
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
explore,
|
|
982
|
+
metadata: next.metadata,
|
|
983
|
+
input: next.input,
|
|
984
|
+
explore: next.explore,
|
|
958
985
|
}),
|
|
959
986
|
objector: {
|
|
960
|
-
checker: () =>
|
|
987
|
+
checker: (next) =>
|
|
961
988
|
IsProgrammer.decode({
|
|
962
989
|
context: props.context,
|
|
963
990
|
importer: props.importer,
|
|
964
|
-
metadata,
|
|
965
|
-
input,
|
|
966
|
-
explore,
|
|
991
|
+
metadata: next.metadata,
|
|
992
|
+
input: next.input,
|
|
993
|
+
explore: next.explore,
|
|
967
994
|
}),
|
|
968
|
-
decoder: () =>
|
|
995
|
+
decoder: (next) =>
|
|
969
996
|
decode_object({
|
|
970
997
|
importer: props.importer,
|
|
971
|
-
input,
|
|
972
|
-
object,
|
|
973
|
-
explore,
|
|
998
|
+
input: next.input,
|
|
999
|
+
object: next.object,
|
|
1000
|
+
explore: next.explore,
|
|
974
1001
|
}),
|
|
975
1002
|
joiner: (next) =>
|
|
976
1003
|
StringifyJoiner.object({
|
|
977
1004
|
...next,
|
|
978
1005
|
importer: props.importer,
|
|
979
1006
|
}),
|
|
980
|
-
unionizer:
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1007
|
+
unionizer: (next) =>
|
|
1008
|
+
decode_union_object((input, object, explore) =>
|
|
1009
|
+
IsProgrammer.decode_object({
|
|
1010
|
+
context: props.context,
|
|
1011
|
+
importer: props.importer,
|
|
1012
|
+
input,
|
|
1013
|
+
object,
|
|
1014
|
+
explore,
|
|
1015
|
+
}),
|
|
1016
|
+
)((input, object, explore) =>
|
|
1017
|
+
decode_object({
|
|
1018
|
+
importer: props.importer,
|
|
1019
|
+
input,
|
|
1020
|
+
object,
|
|
1021
|
+
explore,
|
|
1022
|
+
}),
|
|
1023
|
+
)((exp) => exp)((input, expected) =>
|
|
1024
|
+
create_throw_error({
|
|
1025
|
+
importer: props.importer,
|
|
1026
|
+
expected,
|
|
1027
|
+
input,
|
|
1028
|
+
}),
|
|
1029
|
+
)(next.input, next.objects, next.explore),
|
|
1030
|
+
failure: (next) =>
|
|
1003
1031
|
create_throw_error({
|
|
1004
1032
|
importer: props.importer,
|
|
1005
|
-
expected,
|
|
1006
|
-
input,
|
|
1033
|
+
expected: next.expected,
|
|
1034
|
+
input: next.input,
|
|
1007
1035
|
}),
|
|
1008
1036
|
},
|
|
1009
1037
|
generator: {
|
|
1010
|
-
arrays: (
|
|
1038
|
+
arrays: (collection) =>
|
|
1011
1039
|
write_array_functions({
|
|
1012
1040
|
config,
|
|
1013
1041
|
importer: props.importer,
|
|
1014
1042
|
collection,
|
|
1015
1043
|
}),
|
|
1016
|
-
tuples: (
|
|
1044
|
+
tuples: (collection) =>
|
|
1017
1045
|
write_tuple_functions({
|
|
1018
1046
|
config,
|
|
1019
1047
|
context: props.context,
|
|
@@ -1025,14 +1053,13 @@ export namespace JsonStringifyProgrammer {
|
|
|
1025
1053
|
return config;
|
|
1026
1054
|
};
|
|
1027
1055
|
|
|
1028
|
-
const initializer: FeatureProgrammer.IConfig["initializer"] =
|
|
1029
|
-
(
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
});
|
|
1056
|
+
const initializer: FeatureProgrammer.IConfig["initializer"] = (props) =>
|
|
1057
|
+
JsonMetadataFactory.analyze({
|
|
1058
|
+
method: `typia.json.${props.importer.method}`,
|
|
1059
|
+
checker: props.context.checker,
|
|
1060
|
+
transformer: props.context.transformer,
|
|
1061
|
+
type: props.type,
|
|
1062
|
+
});
|
|
1036
1063
|
|
|
1037
1064
|
const create_throw_error = (props: {
|
|
1038
1065
|
importer: FunctionImporter;
|