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
|
@@ -90,9 +90,11 @@ export namespace MiscCloneProgrammer {
|
|
|
90
90
|
ts.factory.createArrowFunction(
|
|
91
91
|
undefined,
|
|
92
92
|
undefined,
|
|
93
|
-
FeatureProgrammer.parameterDeclarations(
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
FeatureProgrammer.parameterDeclarations({
|
|
94
|
+
config: props.config,
|
|
95
|
+
type: TypeFactory.keyword("any"),
|
|
96
|
+
input: ts.factory.createIdentifier("input"),
|
|
97
|
+
}),
|
|
96
98
|
TypeFactory.keyword("any"),
|
|
97
99
|
undefined,
|
|
98
100
|
decode_array_inline({
|
|
@@ -129,9 +131,11 @@ export namespace MiscCloneProgrammer {
|
|
|
129
131
|
ts.factory.createArrowFunction(
|
|
130
132
|
undefined,
|
|
131
133
|
undefined,
|
|
132
|
-
FeatureProgrammer.parameterDeclarations(
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
FeatureProgrammer.parameterDeclarations({
|
|
135
|
+
config: props.config,
|
|
136
|
+
type: TypeFactory.keyword("any"),
|
|
137
|
+
input: ts.factory.createIdentifier("input"),
|
|
138
|
+
}),
|
|
135
139
|
TypeFactory.keyword("any"),
|
|
136
140
|
undefined,
|
|
137
141
|
decode_tuple_inline({
|
|
@@ -335,10 +339,16 @@ export namespace MiscCloneProgrammer {
|
|
|
335
339
|
explore: FeatureProgrammer.IExplore;
|
|
336
340
|
}) =>
|
|
337
341
|
FeatureProgrammer.decode_object({
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
+
config: {
|
|
343
|
+
trace: false,
|
|
344
|
+
path: false,
|
|
345
|
+
prefix: PREFIX,
|
|
346
|
+
},
|
|
347
|
+
importer: props.importer,
|
|
348
|
+
input: props.input,
|
|
349
|
+
object: props.object,
|
|
350
|
+
explore: props.explore,
|
|
351
|
+
});
|
|
342
352
|
|
|
343
353
|
const decode_array = (props: {
|
|
344
354
|
config: FeatureProgrammer.IConfig;
|
|
@@ -355,11 +365,15 @@ export namespace MiscCloneProgrammer {
|
|
|
355
365
|
),
|
|
356
366
|
),
|
|
357
367
|
undefined,
|
|
358
|
-
FeatureProgrammer.argumentsArray(
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
368
|
+
FeatureProgrammer.argumentsArray({
|
|
369
|
+
config: props.config,
|
|
370
|
+
explore: {
|
|
371
|
+
...props.explore,
|
|
372
|
+
source: "function",
|
|
373
|
+
from: "array",
|
|
374
|
+
},
|
|
375
|
+
input: props.input,
|
|
376
|
+
}),
|
|
363
377
|
)
|
|
364
378
|
: decode_array_inline(props);
|
|
365
379
|
|
|
@@ -370,9 +384,14 @@ export namespace MiscCloneProgrammer {
|
|
|
370
384
|
array: MetadataArray;
|
|
371
385
|
explore: FeatureProgrammer.IExplore;
|
|
372
386
|
}) =>
|
|
373
|
-
FeatureProgrammer.decode_array(
|
|
374
|
-
|
|
375
|
-
|
|
387
|
+
FeatureProgrammer.decode_array({
|
|
388
|
+
config: props.config,
|
|
389
|
+
importer: props.importer,
|
|
390
|
+
combiner: CloneJoiner.array,
|
|
391
|
+
array: props.array,
|
|
392
|
+
input: props.input,
|
|
393
|
+
explore: props.explore,
|
|
394
|
+
});
|
|
376
395
|
|
|
377
396
|
const decode_tuple = (props: {
|
|
378
397
|
context: ITypiaContext;
|
|
@@ -390,10 +409,14 @@ export namespace MiscCloneProgrammer {
|
|
|
390
409
|
),
|
|
391
410
|
),
|
|
392
411
|
undefined,
|
|
393
|
-
FeatureProgrammer.argumentsArray(
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
412
|
+
FeatureProgrammer.argumentsArray({
|
|
413
|
+
config: props.config,
|
|
414
|
+
explore: {
|
|
415
|
+
...props.explore,
|
|
416
|
+
source: "function",
|
|
417
|
+
},
|
|
418
|
+
input: props.input,
|
|
419
|
+
}),
|
|
397
420
|
)
|
|
398
421
|
: decode_tuple_inline({
|
|
399
422
|
...props,
|
|
@@ -678,9 +701,7 @@ export namespace MiscCloneProgrammer {
|
|
|
678
701
|
props.importer.useLocal(`${PREFIX}u${props.metadata.union_index!}`),
|
|
679
702
|
),
|
|
680
703
|
undefined,
|
|
681
|
-
FeatureProgrammer.argumentsArray(props
|
|
682
|
-
props.input,
|
|
683
|
-
),
|
|
704
|
+
FeatureProgrammer.argumentsArray(props),
|
|
684
705
|
);
|
|
685
706
|
|
|
686
707
|
const explore_arrays = (props: {
|
|
@@ -772,9 +793,11 @@ export namespace MiscCloneProgrammer {
|
|
|
772
793
|
props.elements.map((e) => e.type.name).join(" | "),
|
|
773
794
|
() =>
|
|
774
795
|
arrow({
|
|
775
|
-
parameters: FeatureProgrammer.parameterDeclarations(
|
|
776
|
-
|
|
777
|
-
|
|
796
|
+
parameters: FeatureProgrammer.parameterDeclarations({
|
|
797
|
+
config: props.config,
|
|
798
|
+
type: TypeFactory.keyword("any"),
|
|
799
|
+
input: ts.factory.createIdentifier("input"),
|
|
800
|
+
}),
|
|
778
801
|
explore: {
|
|
779
802
|
...arrayExplore,
|
|
780
803
|
postfix: "",
|
|
@@ -784,7 +807,11 @@ export namespace MiscCloneProgrammer {
|
|
|
784
807
|
),
|
|
785
808
|
),
|
|
786
809
|
undefined,
|
|
787
|
-
FeatureProgrammer.argumentsArray(
|
|
810
|
+
FeatureProgrammer.argumentsArray({
|
|
811
|
+
config: props.config,
|
|
812
|
+
input: props.input,
|
|
813
|
+
explore: arrayExplore,
|
|
814
|
+
}),
|
|
788
815
|
);
|
|
789
816
|
};
|
|
790
817
|
|
|
@@ -822,69 +849,70 @@ export namespace MiscCloneProgrammer {
|
|
|
822
849
|
trace: false,
|
|
823
850
|
path: false,
|
|
824
851
|
initializer,
|
|
825
|
-
decoder: () =>
|
|
852
|
+
decoder: (next) =>
|
|
826
853
|
decode({
|
|
827
854
|
context: props.context,
|
|
828
855
|
importer: props.importer,
|
|
829
856
|
config,
|
|
830
|
-
input,
|
|
831
|
-
metadata,
|
|
832
|
-
explore,
|
|
857
|
+
input: next.input,
|
|
858
|
+
metadata: next.metadata,
|
|
859
|
+
explore: next.explore,
|
|
833
860
|
}),
|
|
834
861
|
objector: {
|
|
835
|
-
checker: () =>
|
|
862
|
+
checker: (next) =>
|
|
836
863
|
IsProgrammer.decode({
|
|
837
864
|
context: props.context,
|
|
838
865
|
importer: props.importer,
|
|
839
|
-
input,
|
|
840
|
-
metadata,
|
|
841
|
-
explore,
|
|
866
|
+
input: next.input,
|
|
867
|
+
metadata: next.metadata,
|
|
868
|
+
explore: next.explore,
|
|
842
869
|
}),
|
|
843
|
-
decoder: () =>
|
|
870
|
+
decoder: (next) =>
|
|
844
871
|
decode_object({
|
|
845
872
|
importer: props.importer,
|
|
846
|
-
input,
|
|
847
|
-
object,
|
|
848
|
-
explore,
|
|
873
|
+
input: next.input,
|
|
874
|
+
object: next.object,
|
|
875
|
+
explore: next.explore,
|
|
849
876
|
}),
|
|
850
877
|
joiner: CloneJoiner.object,
|
|
851
|
-
unionizer:
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
878
|
+
unionizer: (next) =>
|
|
879
|
+
decode_union_object((input, object, explore) =>
|
|
880
|
+
IsProgrammer.decode_object({
|
|
881
|
+
context: props.context,
|
|
882
|
+
importer: props.importer,
|
|
883
|
+
input,
|
|
884
|
+
object,
|
|
885
|
+
explore,
|
|
886
|
+
}),
|
|
887
|
+
)((input, object, explore) =>
|
|
888
|
+
decode_object({
|
|
889
|
+
importer: props.importer,
|
|
890
|
+
input,
|
|
891
|
+
object,
|
|
892
|
+
explore,
|
|
893
|
+
}),
|
|
894
|
+
)((exp) => exp)((input, expected) =>
|
|
895
|
+
create_throw_error({
|
|
896
|
+
importer: props.importer,
|
|
897
|
+
expected,
|
|
898
|
+
input,
|
|
899
|
+
}),
|
|
900
|
+
)(next.input, next.objects, next.explore),
|
|
901
|
+
failure: (next) =>
|
|
874
902
|
create_throw_error({
|
|
875
903
|
importer: props.importer,
|
|
876
|
-
expected,
|
|
877
|
-
input,
|
|
904
|
+
expected: next.expected,
|
|
905
|
+
input: next.input,
|
|
878
906
|
}),
|
|
879
907
|
},
|
|
880
908
|
generator: {
|
|
881
|
-
arrays: (
|
|
909
|
+
arrays: (collection) =>
|
|
882
910
|
write_array_functions({
|
|
883
911
|
importer: props.importer,
|
|
884
912
|
config,
|
|
885
913
|
collection,
|
|
886
914
|
}),
|
|
887
|
-
tuples: (
|
|
915
|
+
tuples: (collection) =>
|
|
888
916
|
write_tuple_functions({
|
|
889
917
|
context: props.context,
|
|
890
918
|
importer: props.importer,
|
|
@@ -896,34 +924,33 @@ export namespace MiscCloneProgrammer {
|
|
|
896
924
|
return config;
|
|
897
925
|
};
|
|
898
926
|
|
|
899
|
-
const initializer: FeatureProgrammer.IConfig["initializer"] =
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
return output;
|
|
916
|
-
},
|
|
927
|
+
const initializer: FeatureProgrammer.IConfig["initializer"] = (props) => {
|
|
928
|
+
const collection = new MetadataCollection();
|
|
929
|
+
const result = MetadataFactory.analyze({
|
|
930
|
+
checker: props.context.checker,
|
|
931
|
+
transformer: props.context.transformer,
|
|
932
|
+
options: {
|
|
933
|
+
escape: false,
|
|
934
|
+
constant: true,
|
|
935
|
+
absorb: true,
|
|
936
|
+
validate: (metadata) => {
|
|
937
|
+
const output: string[] = [];
|
|
938
|
+
if (metadata.natives.some((n) => n === "WeakSet"))
|
|
939
|
+
output.push("unable to clone WeakSet");
|
|
940
|
+
else if (metadata.natives.some((n) => n === "WeakMap"))
|
|
941
|
+
output.push("unable to clone WeakMap");
|
|
942
|
+
return output;
|
|
917
943
|
},
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
944
|
+
},
|
|
945
|
+
collection,
|
|
946
|
+
type: props.type,
|
|
947
|
+
});
|
|
948
|
+
if (result.success === false)
|
|
949
|
+
throw TransformerError.from(`typia.misc.${props.importer.method}`)(
|
|
950
|
+
result.errors,
|
|
951
|
+
);
|
|
952
|
+
return [collection, result.data];
|
|
953
|
+
};
|
|
927
954
|
|
|
928
955
|
const create_throw_error = (props: {
|
|
929
956
|
importer: FunctionImporter;
|
|
@@ -90,9 +90,11 @@ export namespace MiscPruneProgrammer {
|
|
|
90
90
|
ts.factory.createArrowFunction(
|
|
91
91
|
undefined,
|
|
92
92
|
undefined,
|
|
93
|
-
FeatureProgrammer.parameterDeclarations(
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
FeatureProgrammer.parameterDeclarations({
|
|
94
|
+
config: props.config,
|
|
95
|
+
type: TypeFactory.keyword("any"),
|
|
96
|
+
input: ts.factory.createIdentifier("input"),
|
|
97
|
+
}),
|
|
96
98
|
TypeFactory.keyword("any"),
|
|
97
99
|
undefined,
|
|
98
100
|
decode_array_inline({
|
|
@@ -129,9 +131,11 @@ export namespace MiscPruneProgrammer {
|
|
|
129
131
|
ts.factory.createArrowFunction(
|
|
130
132
|
undefined,
|
|
131
133
|
undefined,
|
|
132
|
-
FeatureProgrammer.parameterDeclarations(
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
FeatureProgrammer.parameterDeclarations({
|
|
135
|
+
config: props.config,
|
|
136
|
+
type: TypeFactory.keyword("any"),
|
|
137
|
+
input: ts.factory.createIdentifier("input"),
|
|
138
|
+
}),
|
|
135
139
|
TypeFactory.keyword("any"),
|
|
136
140
|
undefined,
|
|
137
141
|
decode_tuple_inline({
|
|
@@ -273,10 +277,16 @@ export namespace MiscPruneProgrammer {
|
|
|
273
277
|
explore: FeatureProgrammer.IExplore;
|
|
274
278
|
}) =>
|
|
275
279
|
FeatureProgrammer.decode_object({
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
+
config: {
|
|
281
|
+
trace: false,
|
|
282
|
+
path: false,
|
|
283
|
+
prefix: PREFIX,
|
|
284
|
+
},
|
|
285
|
+
importer: props.importer,
|
|
286
|
+
object: props.object,
|
|
287
|
+
input: props.input,
|
|
288
|
+
explore: props.explore,
|
|
289
|
+
});
|
|
280
290
|
|
|
281
291
|
const decode_array = (props: {
|
|
282
292
|
config: FeatureProgrammer.IConfig;
|
|
@@ -293,11 +303,15 @@ export namespace MiscPruneProgrammer {
|
|
|
293
303
|
),
|
|
294
304
|
),
|
|
295
305
|
undefined,
|
|
296
|
-
FeatureProgrammer.argumentsArray(
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
306
|
+
FeatureProgrammer.argumentsArray({
|
|
307
|
+
config: props.config,
|
|
308
|
+
explore: {
|
|
309
|
+
...props.explore,
|
|
310
|
+
source: "function",
|
|
311
|
+
from: "array",
|
|
312
|
+
},
|
|
313
|
+
input: props.input,
|
|
314
|
+
}),
|
|
301
315
|
)
|
|
302
316
|
: decode_array_inline(props);
|
|
303
317
|
|
|
@@ -308,9 +322,14 @@ export namespace MiscPruneProgrammer {
|
|
|
308
322
|
array: MetadataArray;
|
|
309
323
|
explore: FeatureProgrammer.IExplore;
|
|
310
324
|
}): ts.Expression =>
|
|
311
|
-
FeatureProgrammer.decode_array(
|
|
312
|
-
|
|
313
|
-
|
|
325
|
+
FeatureProgrammer.decode_array({
|
|
326
|
+
config: props.config,
|
|
327
|
+
importer: props.importer,
|
|
328
|
+
combiner: PruneJoiner.array,
|
|
329
|
+
array: props.array,
|
|
330
|
+
input: props.input,
|
|
331
|
+
explore: props.explore,
|
|
332
|
+
});
|
|
314
333
|
|
|
315
334
|
const decode_tuple = (props: {
|
|
316
335
|
context: ITypiaContext;
|
|
@@ -328,10 +347,14 @@ export namespace MiscPruneProgrammer {
|
|
|
328
347
|
),
|
|
329
348
|
),
|
|
330
349
|
undefined,
|
|
331
|
-
FeatureProgrammer.argumentsArray(
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
350
|
+
FeatureProgrammer.argumentsArray({
|
|
351
|
+
config: props.config,
|
|
352
|
+
explore: {
|
|
353
|
+
...props.explore,
|
|
354
|
+
source: "function",
|
|
355
|
+
},
|
|
356
|
+
input: props.input,
|
|
357
|
+
}),
|
|
335
358
|
)
|
|
336
359
|
: decode_tuple_inline({
|
|
337
360
|
...props,
|
|
@@ -415,9 +438,7 @@ export namespace MiscPruneProgrammer {
|
|
|
415
438
|
props.importer.useLocal(`${PREFIX}u${props.metadata.union_index!}`),
|
|
416
439
|
),
|
|
417
440
|
undefined,
|
|
418
|
-
FeatureProgrammer.argumentsArray(props
|
|
419
|
-
props.input,
|
|
420
|
-
),
|
|
441
|
+
FeatureProgrammer.argumentsArray(props),
|
|
421
442
|
);
|
|
422
443
|
};
|
|
423
444
|
|
|
@@ -510,9 +531,11 @@ export namespace MiscPruneProgrammer {
|
|
|
510
531
|
props.elements.map((e) => e.type.name).join(" | "),
|
|
511
532
|
() =>
|
|
512
533
|
arrow({
|
|
513
|
-
parameters: FeatureProgrammer.parameterDeclarations(
|
|
514
|
-
|
|
515
|
-
|
|
534
|
+
parameters: FeatureProgrammer.parameterDeclarations({
|
|
535
|
+
config: props.config,
|
|
536
|
+
type: TypeFactory.keyword("any"),
|
|
537
|
+
input: ts.factory.createIdentifier("input"),
|
|
538
|
+
}),
|
|
516
539
|
explore: {
|
|
517
540
|
...arrayExplore,
|
|
518
541
|
postfix: "",
|
|
@@ -522,9 +545,7 @@ export namespace MiscPruneProgrammer {
|
|
|
522
545
|
),
|
|
523
546
|
),
|
|
524
547
|
undefined,
|
|
525
|
-
FeatureProgrammer.argumentsArray(props
|
|
526
|
-
props.input,
|
|
527
|
-
),
|
|
548
|
+
FeatureProgrammer.argumentsArray(props),
|
|
528
549
|
);
|
|
529
550
|
};
|
|
530
551
|
|
|
@@ -560,69 +581,70 @@ export namespace MiscPruneProgrammer {
|
|
|
560
581
|
trace: false,
|
|
561
582
|
path: false,
|
|
562
583
|
initializer,
|
|
563
|
-
decoder: () =>
|
|
584
|
+
decoder: (next) =>
|
|
564
585
|
decode({
|
|
565
586
|
context: props.context,
|
|
566
587
|
importer: props.importer,
|
|
567
588
|
config,
|
|
568
|
-
input,
|
|
569
|
-
metadata,
|
|
570
|
-
explore,
|
|
589
|
+
input: next.input,
|
|
590
|
+
metadata: next.metadata,
|
|
591
|
+
explore: next.explore,
|
|
571
592
|
}),
|
|
572
593
|
objector: {
|
|
573
|
-
checker: () =>
|
|
594
|
+
checker: (next) =>
|
|
574
595
|
IsProgrammer.decode({
|
|
575
596
|
context: props.context,
|
|
576
597
|
importer: props.importer,
|
|
577
|
-
input,
|
|
578
|
-
metadata,
|
|
579
|
-
explore,
|
|
598
|
+
input: next.input,
|
|
599
|
+
metadata: next.metadata,
|
|
600
|
+
explore: next.explore,
|
|
580
601
|
}),
|
|
581
|
-
decoder: () =>
|
|
602
|
+
decoder: (next) =>
|
|
582
603
|
decode_object({
|
|
583
604
|
importer: props.importer,
|
|
584
|
-
input,
|
|
585
|
-
object,
|
|
586
|
-
explore,
|
|
605
|
+
input: next.input,
|
|
606
|
+
object: next.object,
|
|
607
|
+
explore: next.explore,
|
|
587
608
|
}),
|
|
588
609
|
joiner: PruneJoiner.object,
|
|
589
|
-
unionizer:
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
610
|
+
unionizer: (next) =>
|
|
611
|
+
decode_union_object((input, object, explore) =>
|
|
612
|
+
IsProgrammer.decode_object({
|
|
613
|
+
context: props.context,
|
|
614
|
+
importer: props.importer,
|
|
615
|
+
input,
|
|
616
|
+
object,
|
|
617
|
+
explore,
|
|
618
|
+
}),
|
|
619
|
+
)((input, object, explore) =>
|
|
620
|
+
decode_object({
|
|
621
|
+
importer: props.importer,
|
|
622
|
+
input,
|
|
623
|
+
object,
|
|
624
|
+
explore,
|
|
625
|
+
}),
|
|
626
|
+
)((exp) => exp)((input, expected) =>
|
|
627
|
+
create_throw_error({
|
|
628
|
+
importer: props.importer,
|
|
629
|
+
expected,
|
|
630
|
+
input,
|
|
631
|
+
}),
|
|
632
|
+
)(next.input, next.objects, next.explore),
|
|
633
|
+
failure: (next) =>
|
|
612
634
|
create_throw_error({
|
|
613
635
|
importer: props.importer,
|
|
614
|
-
expected,
|
|
615
|
-
input,
|
|
636
|
+
expected: next.expected,
|
|
637
|
+
input: next.input,
|
|
616
638
|
}),
|
|
617
639
|
},
|
|
618
640
|
generator: {
|
|
619
|
-
arrays: (
|
|
641
|
+
arrays: (collection) =>
|
|
620
642
|
write_array_functions({
|
|
621
643
|
config,
|
|
622
644
|
importer: props.importer,
|
|
623
645
|
collection,
|
|
624
646
|
}),
|
|
625
|
-
tuples: (
|
|
647
|
+
tuples: (collection) =>
|
|
626
648
|
write_tuple_functions({
|
|
627
649
|
config,
|
|
628
650
|
context: props.context,
|
|
@@ -634,26 +656,25 @@ export namespace MiscPruneProgrammer {
|
|
|
634
656
|
return config;
|
|
635
657
|
};
|
|
636
658
|
|
|
637
|
-
const initializer: FeatureProgrammer.IConfig["initializer"] =
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
};
|
|
659
|
+
const initializer: FeatureProgrammer.IConfig["initializer"] = (props) => {
|
|
660
|
+
const collection = new MetadataCollection();
|
|
661
|
+
const result = MetadataFactory.analyze({
|
|
662
|
+
checker: props.context.checker,
|
|
663
|
+
transformer: props.context.transformer,
|
|
664
|
+
options: {
|
|
665
|
+
escape: false,
|
|
666
|
+
constant: true,
|
|
667
|
+
absorb: true,
|
|
668
|
+
},
|
|
669
|
+
collection,
|
|
670
|
+
type: props.type,
|
|
671
|
+
});
|
|
672
|
+
if (result.success === false)
|
|
673
|
+
throw TransformerError.from(`typia.misc.${props.importer.method}`)(
|
|
674
|
+
result.errors,
|
|
675
|
+
);
|
|
676
|
+
return [collection, result.data];
|
|
677
|
+
};
|
|
657
678
|
|
|
658
679
|
const create_throw_error = (props: {
|
|
659
680
|
importer: FunctionImporter;
|