typia 5.0.0-dev.20230823-2 → 5.0.0-dev.20230824
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/ExpressionFactory.d.ts +2 -0
- package/lib/factories/ExpressionFactory.js +24 -0
- package/lib/factories/ExpressionFactory.js.map +1 -1
- package/lib/factories/IdentifierFactory.d.ts +2 -1
- package/lib/factories/IdentifierFactory.js +11 -0
- package/lib/factories/IdentifierFactory.js.map +1 -1
- package/lib/factories/MetadataCollection.d.ts +7 -7
- package/lib/factories/MetadataCollection.js +4 -4
- package/lib/factories/MetadataCollection.js.map +1 -1
- package/lib/factories/MetadataTagFactory.d.ts +2 -2
- package/lib/factories/MetadataTagFactory.js +9 -7
- package/lib/factories/MetadataTagFactory.js.map +1 -1
- package/lib/factories/ProtobufFactory.js +9 -8
- package/lib/factories/ProtobufFactory.js.map +1 -1
- package/lib/factories/internal/metadata/emend_metadata_atomics.js +6 -6
- package/lib/factories/internal/metadata/emend_metadata_atomics.js.map +1 -1
- package/lib/factories/internal/metadata/emplace_metadata_array_type.d.ts +5 -0
- package/lib/factories/internal/metadata/{emplace_metadata_array.js → emplace_metadata_array_type.js} +4 -4
- package/lib/factories/internal/metadata/emplace_metadata_array_type.js.map +1 -0
- package/lib/factories/internal/metadata/emplace_metadata_tuple.d.ts +2 -2
- package/lib/factories/internal/metadata/iterate_metadata_array.js +7 -3
- package/lib/factories/internal/metadata/iterate_metadata_array.js.map +1 -1
- package/lib/factories/internal/metadata/iterate_metadata_atomic.js +1 -1
- package/lib/factories/internal/metadata/iterate_metadata_atomic.js.map +1 -1
- package/lib/factories/internal/metadata/iterate_metadata_collection.js +20 -12
- package/lib/factories/internal/metadata/iterate_metadata_collection.js.map +1 -1
- package/lib/factories/internal/metadata/iterate_metadata_comment_tags.d.ts +2 -0
- package/lib/factories/internal/metadata/{iterate_metadata_tag.js → iterate_metadata_comment_tags.js} +4 -4
- package/lib/factories/internal/metadata/iterate_metadata_comment_tags.js.map +1 -0
- package/lib/factories/internal/metadata/iterate_metadata_intersection.js +138 -16
- package/lib/factories/internal/metadata/iterate_metadata_intersection.js.map +1 -1
- package/lib/factories/internal/metadata/iterate_metadata_object.js +0 -7
- package/lib/factories/internal/metadata/iterate_metadata_object.js.map +1 -1
- package/lib/factories/internal/metadata/iterate_metadata_sort.js +2 -2
- package/lib/factories/internal/metadata/iterate_metadata_sort.js.map +1 -1
- package/lib/factories/internal/metadata/iterate_metadata_tuple.js +6 -2
- package/lib/factories/internal/metadata/iterate_metadata_tuple.js.map +1 -1
- package/lib/factories/internal/metadata/iterate_metadata_type_tags.d.ts +3 -0
- package/lib/factories/internal/metadata/iterate_metadata_type_tags.js +157 -0
- package/lib/factories/internal/metadata/iterate_metadata_type_tags.js.map +1 -0
- package/lib/functional/$any.js +2 -1
- package/lib/functional/$any.js.map +1 -1
- package/lib/functional/$clone.d.ts +2 -0
- package/lib/functional/$clone.js +8 -0
- package/lib/functional/$clone.js.map +1 -0
- package/lib/module.d.ts +2 -39
- package/lib/module.js +3 -17
- package/lib/module.js.map +1 -1
- package/lib/programmers/AssertProgrammer.js +1 -3
- package/lib/programmers/AssertProgrammer.js.map +1 -1
- package/lib/programmers/CheckerProgrammer.js +38 -29
- package/lib/programmers/CheckerProgrammer.js.map +1 -1
- package/lib/programmers/FeatureProgrammer.d.ts +4 -4
- package/lib/programmers/FeatureProgrammer.js.map +1 -1
- package/lib/programmers/IsProgrammer.d.ts +1 -1
- package/lib/programmers/IsProgrammer.js +1 -3
- package/lib/programmers/IsProgrammer.js.map +1 -1
- package/lib/programmers/RandomProgrammer.js +44 -33
- package/lib/programmers/RandomProgrammer.js.map +1 -1
- package/lib/programmers/ValidateProgrammer.js +1 -3
- package/lib/programmers/ValidateProgrammer.js.map +1 -1
- package/lib/programmers/helpers/AtomicPredicator.js +2 -2
- package/lib/programmers/helpers/AtomicPredicator.js.map +1 -1
- package/lib/programmers/helpers/ICheckEntry.d.ts +1 -1
- package/lib/programmers/helpers/ProtobufUtil.js +2 -2
- package/lib/programmers/helpers/ProtobufUtil.js.map +1 -1
- package/lib/programmers/helpers/RandomJoiner.d.ts +4 -4
- package/lib/programmers/helpers/RandomJoiner.js.map +1 -1
- package/lib/programmers/helpers/RandomRanger.d.ts +6 -6
- package/lib/programmers/helpers/RandomRanger.js.map +1 -1
- package/lib/programmers/helpers/UnionExplorer.d.ts +8 -8
- package/lib/programmers/helpers/UnionExplorer.js +40 -29
- package/lib/programmers/helpers/UnionExplorer.js.map +1 -1
- package/lib/programmers/internal/application_array.js +1 -1
- package/lib/programmers/internal/application_array.js.map +1 -1
- package/lib/programmers/internal/application_default_string.js +2 -2
- package/lib/programmers/internal/application_default_string.js.map +1 -1
- package/lib/programmers/internal/application_resolved.js +2 -2
- package/lib/programmers/internal/application_resolved.js.map +1 -1
- package/lib/programmers/internal/application_schema.js +5 -5
- package/lib/programmers/internal/application_schema.js.map +1 -1
- package/lib/programmers/internal/application_string.js.map +1 -1
- package/lib/programmers/internal/application_tuple.js +10 -9
- package/lib/programmers/internal/application_tuple.js.map +1 -1
- package/lib/programmers/internal/check_array_length.js.map +1 -1
- package/lib/programmers/internal/check_array_tags.js +39 -0
- package/lib/programmers/internal/check_array_tags.js.map +1 -0
- package/lib/programmers/internal/check_bigint.js +88 -74
- package/lib/programmers/internal/check_bigint.js.map +1 -1
- package/lib/programmers/internal/check_number.js +142 -131
- package/lib/programmers/internal/check_number.js.map +1 -1
- package/lib/programmers/internal/check_string.js +30 -6
- package/lib/programmers/internal/check_string.js.map +1 -1
- package/lib/programmers/internal/check_string_tags.js.map +1 -1
- package/lib/programmers/internal/check_template.js +16 -49
- package/lib/programmers/internal/check_template.js.map +1 -1
- package/lib/programmers/internal/check_union_array_like.js +3 -2
- package/lib/programmers/internal/check_union_array_like.js.map +1 -1
- package/lib/programmers/internal/metadata_to_pattern.js +4 -4
- package/lib/programmers/internal/metadata_to_pattern.js.map +1 -1
- package/lib/programmers/internal/stringify_dynamic_properties.js +2 -1
- package/lib/programmers/internal/stringify_dynamic_properties.js.map +1 -1
- package/lib/programmers/internal/wrap_metadata_rest_tuple.js +9 -5
- package/lib/programmers/internal/wrap_metadata_rest_tuple.js.map +1 -1
- package/lib/programmers/json/JsonStringifyProgrammer.js +29 -23
- package/lib/programmers/json/JsonStringifyProgrammer.js.map +1 -1
- package/lib/programmers/misc/MiscCloneProgrammer.js +10 -10
- package/lib/programmers/misc/MiscCloneProgrammer.js.map +1 -1
- package/lib/programmers/misc/MiscLiteralsProgrammer.js +2 -2
- package/lib/programmers/misc/MiscLiteralsProgrammer.js.map +1 -1
- package/lib/programmers/misc/MiscPruneProgrammer.js +13 -13
- package/lib/programmers/misc/MiscPruneProgrammer.js.map +1 -1
- package/lib/programmers/protobuf/ProtobufDecodeProgrammer.js +6 -6
- package/lib/programmers/protobuf/ProtobufDecodeProgrammer.js.map +1 -1
- package/lib/programmers/protobuf/ProtobufEncodeProgrammer.js +2 -2
- package/lib/programmers/protobuf/ProtobufEncodeProgrammer.js.map +1 -1
- package/lib/programmers/protobuf/ProtobufMessageProgrammer.js +1 -1
- package/lib/programmers/protobuf/ProtobufMessageProgrammer.js.map +1 -1
- package/lib/schemas/json/IJsonSchema.d.ts +2 -2
- package/lib/schemas/metadata/IMetadata.d.ts +11 -4
- package/lib/schemas/metadata/IMetadataAlias.d.ts +2 -2
- package/lib/schemas/metadata/IMetadataArray.d.ts +4 -6
- package/lib/schemas/metadata/IMetadataArrayType.d.ts +8 -0
- package/lib/{CustomValidatorMap.js → schemas/metadata/IMetadataArrayType.js} +1 -1
- package/lib/schemas/metadata/IMetadataArrayType.js.map +1 -0
- package/lib/schemas/metadata/IMetadataAtomic.d.ts +5 -0
- package/lib/schemas/metadata/IMetadataAtomic.js +3 -0
- package/lib/schemas/metadata/IMetadataAtomic.js.map +1 -0
- package/lib/schemas/metadata/IMetadataCollection.d.ts +4 -4
- package/lib/schemas/metadata/{IMetadataTag.d.ts → IMetadataCommentTag.d.ts} +2 -2
- package/lib/schemas/metadata/IMetadataCommentTag.js +3 -0
- package/lib/schemas/metadata/IMetadataCommentTag.js.map +1 -0
- package/lib/schemas/metadata/IMetadataProperty.d.ts +2 -2
- package/lib/schemas/metadata/IMetadataTuple.d.ts +4 -6
- package/lib/schemas/metadata/IMetadataTupleType.d.ts +8 -0
- package/lib/schemas/metadata/IMetadataTupleType.js +3 -0
- package/lib/schemas/metadata/IMetadataTupleType.js.map +1 -0
- package/lib/schemas/metadata/IMetadataTypeTag.d.ts +6 -0
- package/lib/schemas/metadata/IMetadataTypeTag.js +3 -0
- package/lib/schemas/metadata/IMetadataTypeTag.js.map +1 -0
- package/lib/schemas/metadata/Metadata.d.ts +2 -2
- package/lib/schemas/metadata/Metadata.js +206 -146
- package/lib/schemas/metadata/Metadata.js.map +1 -1
- package/lib/schemas/metadata/MetadataAlias.d.ts +2 -2
- package/lib/schemas/metadata/MetadataArray.d.ts +6 -6
- package/lib/schemas/metadata/MetadataArray.js +5 -19
- package/lib/schemas/metadata/MetadataArray.js.map +1 -1
- package/lib/schemas/metadata/MetadataArrayType.d.ts +14 -0
- package/lib/schemas/metadata/MetadataArrayType.js +36 -0
- package/lib/schemas/metadata/MetadataArrayType.js.map +1 -0
- package/lib/schemas/metadata/MetadataProperty.d.ts +2 -2
- package/lib/schemas/metadata/MetadataTuple.d.ts +4 -6
- package/lib/schemas/metadata/MetadataTuple.js +5 -19
- package/lib/schemas/metadata/MetadataTuple.js.map +1 -1
- package/lib/schemas/metadata/MetadataTupleType.d.ts +13 -0
- package/lib/schemas/metadata/MetadataTupleType.js +40 -0
- package/lib/schemas/metadata/MetadataTupleType.js.map +1 -0
- package/lib/tags/ExclusiveMaximum.d.ts +8 -0
- package/lib/tags/ExclusiveMaximum.js +3 -0
- package/lib/tags/ExclusiveMaximum.js.map +1 -0
- package/lib/tags/ExclusiveMinimum.d.ts +8 -0
- package/lib/tags/ExclusiveMinimum.js +3 -0
- package/lib/tags/ExclusiveMinimum.js.map +1 -0
- package/lib/tags/Format.d.ts +8 -0
- package/lib/{schemas/metadata/IMetadataTag.js → tags/Format.js} +1 -1
- package/lib/tags/Format.js.map +1 -0
- package/lib/tags/MaxItems.d.ts +8 -0
- package/lib/tags/MaxItems.js +3 -0
- package/lib/tags/MaxItems.js.map +1 -0
- package/lib/tags/MaxLength.d.ts +8 -0
- package/lib/tags/MaxLength.js +3 -0
- package/lib/tags/MaxLength.js.map +1 -0
- package/lib/tags/Maximum.d.ts +8 -0
- package/lib/tags/Maximum.js +3 -0
- package/lib/tags/Maximum.js.map +1 -0
- package/lib/tags/MinItems.d.ts +8 -0
- package/lib/tags/MinItems.js +3 -0
- package/lib/tags/MinItems.js.map +1 -0
- package/lib/tags/MinLength.d.ts +8 -0
- package/lib/tags/MinLength.js +3 -0
- package/lib/tags/MinLength.js.map +1 -0
- package/lib/tags/Minimum.d.ts +8 -0
- package/lib/tags/Minimum.js +3 -0
- package/lib/tags/Minimum.js.map +1 -0
- package/lib/tags/MultipleOf.d.ts +8 -0
- package/lib/tags/MultipleOf.js +3 -0
- package/lib/tags/MultipleOf.js.map +1 -0
- package/lib/tags/Pattern.d.ts +8 -0
- package/lib/tags/Pattern.js +3 -0
- package/lib/tags/Pattern.js.map +1 -0
- package/lib/tags/TagBase.d.ts +10 -0
- package/lib/tags/TagBase.js +3 -0
- package/lib/tags/TagBase.js.map +1 -0
- package/lib/tags/Type.d.ts +13 -0
- package/lib/tags/Type.js +3 -0
- package/lib/tags/Type.js.map +1 -0
- package/lib/tags/index.d.ts +12 -0
- package/lib/tags/index.js +29 -0
- package/lib/tags/index.js.map +1 -0
- package/lib/transformers/FileTransformer.d.ts +1 -1
- package/lib/transformers/FileTransformer.js +12 -1
- package/lib/transformers/FileTransformer.js.map +1 -1
- package/lib/transformers/IProject.d.ts +1 -0
- package/lib/transformers/features/json/JsonApplicationTransformer.js +4 -2
- package/lib/transformers/features/json/JsonApplicationTransformer.js.map +1 -1
- package/package.json +1 -1
- package/src/factories/ExpressionFactory.ts +44 -0
- package/src/factories/IdentifierFactory.ts +15 -0
- package/src/factories/MetadataCollection.ts +18 -12
- package/src/factories/MetadataTagFactory.ts +22 -21
- package/src/factories/ProtobufFactory.ts +10 -8
- package/src/factories/internal/metadata/emend_metadata_atomics.ts +7 -5
- package/src/factories/internal/metadata/{emplace_metadata_array.ts → emplace_metadata_array_type.ts} +3 -3
- package/src/factories/internal/metadata/emplace_metadata_tuple.ts +2 -2
- package/src/factories/internal/metadata/iterate_metadata_array.ts +13 -5
- package/src/factories/internal/metadata/iterate_metadata_atomic.ts +6 -4
- package/src/factories/internal/metadata/iterate_metadata_collection.ts +23 -16
- package/src/factories/internal/metadata/{iterate_metadata_tag.ts → iterate_metadata_comment_tags.ts} +1 -1
- package/src/factories/internal/metadata/iterate_metadata_intersection.ts +109 -15
- package/src/factories/internal/metadata/iterate_metadata_object.ts +10 -10
- package/src/factories/internal/metadata/iterate_metadata_sort.ts +2 -2
- package/src/factories/internal/metadata/iterate_metadata_tuple.ts +12 -4
- package/src/factories/internal/metadata/iterate_metadata_type_tags.ts +183 -0
- package/src/functional/$any.ts +3 -1
- package/src/functional/$clone.ts +4 -0
- package/src/module.ts +2 -55
- package/src/programmers/AssertProgrammer.ts +1 -1
- package/src/programmers/CheckerProgrammer.ts +80 -47
- package/src/programmers/FeatureProgrammer.ts +6 -6
- package/src/programmers/IsProgrammer.ts +1 -1
- package/src/programmers/RandomProgrammer.ts +68 -45
- package/src/programmers/ValidateProgrammer.ts +1 -1
- package/src/programmers/helpers/AtomicPredicator.ts +2 -2
- package/src/programmers/helpers/ICheckEntry.ts +1 -1
- package/src/programmers/helpers/ProtobufUtil.ts +1 -1
- package/src/programmers/helpers/RandomJoiner.ts +8 -4
- package/src/programmers/helpers/RandomRanger.ts +8 -8
- package/src/programmers/helpers/UnionExplorer.ts +48 -34
- package/src/programmers/internal/application_array.ts +5 -4
- package/src/programmers/internal/application_default_string.ts +6 -2
- package/src/programmers/internal/application_resolved.ts +2 -2
- package/src/programmers/internal/application_schema.ts +5 -5
- package/src/programmers/internal/application_string.ts +2 -2
- package/src/programmers/internal/application_tuple.ts +12 -11
- package/src/programmers/internal/check_array_length.ts +2 -2
- package/src/programmers/internal/check_array_tags.ts +45 -0
- package/src/programmers/internal/check_bigint.ts +45 -17
- package/src/programmers/internal/check_number.ts +97 -70
- package/src/programmers/internal/check_string.ts +43 -12
- package/src/programmers/internal/check_string_tags.ts +3 -3
- package/src/programmers/internal/check_template.ts +1 -12
- package/src/programmers/internal/check_union_array_like.ts +6 -5
- package/src/programmers/internal/metadata_to_pattern.ts +4 -4
- package/src/programmers/internal/stringify_dynamic_properties.ts +1 -1
- package/src/programmers/internal/wrap_metadata_rest_tuple.ts +9 -5
- package/src/programmers/json/JsonStringifyProgrammer.ts +41 -25
- package/src/programmers/misc/MiscCloneProgrammer.ts +24 -14
- package/src/programmers/misc/MiscLiteralsProgrammer.ts +2 -2
- package/src/programmers/misc/MiscPruneProgrammer.ts +27 -17
- package/src/programmers/protobuf/ProtobufDecodeProgrammer.ts +12 -12
- package/src/programmers/protobuf/ProtobufEncodeProgrammer.ts +14 -14
- package/src/programmers/protobuf/ProtobufMessageProgrammer.ts +6 -6
- package/src/schemas/json/IJsonSchema.ts +2 -2
- package/src/schemas/metadata/IMetadata.ts +11 -5
- package/src/schemas/metadata/IMetadataAlias.ts +2 -2
- package/src/schemas/metadata/IMetadataArray.ts +4 -7
- package/src/schemas/metadata/IMetadataArrayType.ts +10 -0
- package/src/schemas/metadata/IMetadataAtomic.ts +6 -0
- package/src/schemas/metadata/IMetadataCollection.ts +4 -4
- package/src/schemas/metadata/{IMetadataTag.ts → IMetadataCommentTag.ts} +17 -17
- package/src/schemas/metadata/IMetadataDictionary.ts +4 -4
- package/src/schemas/metadata/IMetadataProperty.ts +2 -2
- package/src/schemas/metadata/IMetadataTuple.ts +4 -7
- package/src/schemas/metadata/IMetadataTupleType.ts +10 -0
- package/src/schemas/metadata/IMetadataTypeTag.ts +6 -0
- package/src/schemas/metadata/Metadata.ts +109 -44
- package/src/schemas/metadata/MetadataAlias.ts +2 -2
- package/src/schemas/metadata/MetadataArray.ts +10 -34
- package/src/schemas/metadata/MetadataArrayType.ts +57 -0
- package/src/schemas/metadata/MetadataProperty.ts +2 -2
- package/src/schemas/metadata/MetadataTuple.ts +10 -37
- package/src/schemas/metadata/MetadataTupleType.ts +67 -0
- package/src/tags/ExclusiveMaximum.ts +8 -0
- package/src/tags/ExclusiveMinimum.ts +8 -0
- package/src/tags/Format.ts +29 -0
- package/src/tags/MaxItems.ts +8 -0
- package/src/tags/MaxLength.ts +8 -0
- package/src/tags/Maximum.ts +8 -0
- package/src/tags/MinItems.ts +8 -0
- package/src/tags/MinLength.ts +8 -0
- package/src/tags/Minimum.ts +8 -0
- package/src/tags/MultipleOf.ts +10 -0
- package/src/tags/Pattern.ts +8 -0
- package/src/tags/TagBase.ts +17 -0
- package/src/tags/Type.ts +30 -0
- package/src/tags/index.ts +12 -0
- package/src/transformers/FileTransformer.ts +2 -2
- package/src/transformers/IProject.ts +1 -0
- package/src/transformers/features/json/JsonApplicationTransformer.ts +3 -2
- package/src/typings/Atomic.ts +1 -0
- package/lib/CustomValidatorMap.d.ts +0 -110
- package/lib/CustomValidatorMap.js.map +0 -1
- package/lib/factories/internal/metadata/emplace_metadata_array.d.ts +0 -5
- package/lib/factories/internal/metadata/emplace_metadata_array.js.map +0 -1
- package/lib/factories/internal/metadata/iterate_metadata_tag.d.ts +0 -2
- package/lib/factories/internal/metadata/iterate_metadata_tag.js.map +0 -1
- package/lib/programmers/internal/check_array.js +0 -44
- package/lib/programmers/internal/check_array.js.map +0 -1
- package/lib/programmers/internal/check_custom.d.ts +0 -1
- package/lib/programmers/internal/check_custom.js +0 -30
- package/lib/programmers/internal/check_custom.js.map +0 -1
- package/lib/schemas/metadata/IMetadataTag.js.map +0 -1
- package/src/CustomValidatorMap.ts +0 -126
- package/src/programmers/internal/check_array.ts +0 -30
- package/src/programmers/internal/check_custom.ts +0 -31
- /package/lib/programmers/internal/{check_array.d.ts → check_array_tags.d.ts} +0 -0
|
@@ -9,11 +9,14 @@ import { TypeFactory } from "../factories/TypeFactory";
|
|
|
9
9
|
import { ValueFactory } from "../factories/ValueFactory";
|
|
10
10
|
|
|
11
11
|
import { IJsDocTagInfo } from "../schemas/metadata/IJsDocTagInfo";
|
|
12
|
-
import {
|
|
12
|
+
import { IMetadataCommentTag } from "../schemas/metadata/IMetadataCommentTag";
|
|
13
|
+
import { IMetadataTypeTag } from "../schemas/metadata/IMetadataTypeTag";
|
|
13
14
|
import { Metadata } from "../schemas/metadata/Metadata";
|
|
14
15
|
import { MetadataArray } from "../schemas/metadata/MetadataArray";
|
|
16
|
+
import { MetadataArrayType } from "../schemas/metadata/MetadataArrayType";
|
|
15
17
|
import { MetadataObject } from "../schemas/metadata/MetadataObject";
|
|
16
18
|
import { MetadataTuple } from "../schemas/metadata/MetadataTuple";
|
|
19
|
+
import { MetadataTupleType } from "../schemas/metadata/MetadataTupleType";
|
|
17
20
|
|
|
18
21
|
import { IProject } from "../transformers/IProject";
|
|
19
22
|
|
|
@@ -24,8 +27,8 @@ import { ICheckEntry } from "./helpers/ICheckEntry";
|
|
|
24
27
|
import { IExpressionEntry } from "./helpers/IExpressionEntry";
|
|
25
28
|
import { OptionPredicator } from "./helpers/OptionPredicator";
|
|
26
29
|
import { UnionExplorer } from "./helpers/UnionExplorer";
|
|
27
|
-
import { check_array } from "./internal/check_array";
|
|
28
30
|
import { check_array_length } from "./internal/check_array_length";
|
|
31
|
+
import { check_array_tags } from "./internal/check_array_tags";
|
|
29
32
|
import { check_bigint } from "./internal/check_bigint";
|
|
30
33
|
import { check_native } from "./internal/check_native";
|
|
31
34
|
import { check_number } from "./internal/check_number";
|
|
@@ -150,6 +153,7 @@ export namespace CheckerProgrammer {
|
|
|
150
153
|
},
|
|
151
154
|
[],
|
|
152
155
|
[],
|
|
156
|
+
[],
|
|
153
157
|
),
|
|
154
158
|
),
|
|
155
159
|
),
|
|
@@ -292,7 +296,7 @@ export namespace CheckerProgrammer {
|
|
|
292
296
|
input: ts.Expression,
|
|
293
297
|
meta: Metadata,
|
|
294
298
|
explore: IExplore,
|
|
295
|
-
metaTags:
|
|
299
|
+
metaTags: IMetadataCommentTag[],
|
|
296
300
|
jsDocTags: ts.JSDocTagInfo[],
|
|
297
301
|
): ts.Expression => {
|
|
298
302
|
if (meta.any) return config.success;
|
|
@@ -354,35 +358,40 @@ export namespace CheckerProgrammer {
|
|
|
354
358
|
add(true, getConstantValue(val));
|
|
355
359
|
|
|
356
360
|
// ATOMIC VALUES
|
|
357
|
-
for (const
|
|
358
|
-
if (AtomicPredicator.atomic(meta)(type) === false)
|
|
359
|
-
|
|
361
|
+
for (const atom of meta.atomics)
|
|
362
|
+
if (AtomicPredicator.atomic(meta)(atom.type) === false)
|
|
363
|
+
continue;
|
|
364
|
+
else if (atom.type === "number")
|
|
360
365
|
binaries.push({
|
|
361
366
|
expression: config.atomist(explore)(
|
|
362
|
-
check_number(project, config.numeric)(
|
|
367
|
+
check_number(project, config.numeric)(
|
|
368
|
+
atom.tags,
|
|
363
369
|
metaTags,
|
|
364
|
-
)(
|
|
370
|
+
)(input),
|
|
365
371
|
)(input),
|
|
366
372
|
combined: false,
|
|
367
373
|
});
|
|
368
|
-
else if (type === "bigint")
|
|
374
|
+
else if (atom.type === "bigint")
|
|
369
375
|
binaries.push({
|
|
370
376
|
expression: config.atomist(explore)(
|
|
371
|
-
check_bigint(
|
|
377
|
+
check_bigint(project)(atom.tags, metaTags)(input),
|
|
372
378
|
)(input),
|
|
373
379
|
combined: false,
|
|
374
380
|
});
|
|
375
|
-
else if (type === "string")
|
|
381
|
+
else if (atom.type === "string")
|
|
376
382
|
binaries.push({
|
|
377
383
|
expression: config.atomist(explore)(
|
|
378
|
-
check_string(
|
|
384
|
+
check_string(project)(importer)(
|
|
385
|
+
atom.tags,
|
|
386
|
+
metaTags,
|
|
387
|
+
)(input),
|
|
379
388
|
)(input),
|
|
380
389
|
combined: false,
|
|
381
390
|
});
|
|
382
391
|
else
|
|
383
392
|
add(
|
|
384
393
|
true,
|
|
385
|
-
ts.factory.createStringLiteral(type),
|
|
394
|
+
ts.factory.createStringLiteral(atom.type),
|
|
386
395
|
ValueFactory.TYPEOF(input),
|
|
387
396
|
);
|
|
388
397
|
|
|
@@ -391,9 +400,7 @@ export namespace CheckerProgrammer {
|
|
|
391
400
|
if (AtomicPredicator.template(meta))
|
|
392
401
|
binaries.push({
|
|
393
402
|
expression: config.atomist(explore)(
|
|
394
|
-
check_template(
|
|
395
|
-
meta.templates,
|
|
396
|
-
)(input),
|
|
403
|
+
check_template(meta.templates)(input),
|
|
397
404
|
)(input),
|
|
398
405
|
combined: false,
|
|
399
406
|
});
|
|
@@ -475,13 +482,12 @@ export namespace CheckerProgrammer {
|
|
|
475
482
|
// ARRAYS AND TUPLES
|
|
476
483
|
if (meta.tuples.length + meta.arrays.length > 0) {
|
|
477
484
|
const install = prepare(
|
|
478
|
-
config.atomist(explore)(
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
)(input),
|
|
485
|
+
config.atomist(explore)({
|
|
486
|
+
expression: ExpressionFactory.isArray(input),
|
|
487
|
+
tags: [],
|
|
488
|
+
})(input),
|
|
483
489
|
[...meta.tuples, ...meta.arrays]
|
|
484
|
-
.map((elem) => elem.name)
|
|
490
|
+
.map((elem) => elem.type.name)
|
|
485
491
|
.join(" | "),
|
|
486
492
|
);
|
|
487
493
|
if (meta.arrays.length === 0)
|
|
@@ -512,7 +518,7 @@ export namespace CheckerProgrammer {
|
|
|
512
518
|
jsDocTags,
|
|
513
519
|
),
|
|
514
520
|
);
|
|
515
|
-
else if (meta.arrays.some((elem) => elem.value.any))
|
|
521
|
+
else if (meta.arrays.some((elem) => elem.type.value.any))
|
|
516
522
|
install(null);
|
|
517
523
|
else if (meta.tuples.length === 0)
|
|
518
524
|
if (meta.arrays.length === 1)
|
|
@@ -668,14 +674,15 @@ export namespace CheckerProgrammer {
|
|
|
668
674
|
input: ts.Expression,
|
|
669
675
|
array: MetadataArray,
|
|
670
676
|
explore: IExplore,
|
|
671
|
-
metaTags:
|
|
677
|
+
metaTags: IMetadataCommentTag[],
|
|
672
678
|
jsDocTags: IJsDocTagInfo[],
|
|
673
679
|
) => {
|
|
674
|
-
if (array.recursive === false)
|
|
680
|
+
if (array.type.recursive === false)
|
|
675
681
|
return decode_array_inline(project)(config)(importer)(
|
|
676
682
|
input,
|
|
677
|
-
array,
|
|
683
|
+
array.type,
|
|
678
684
|
explore,
|
|
685
|
+
array.tags,
|
|
679
686
|
metaTags,
|
|
680
687
|
jsDocTags,
|
|
681
688
|
);
|
|
@@ -688,7 +695,9 @@ export namespace CheckerProgrammer {
|
|
|
688
695
|
return ts.factory.createLogicalOr(
|
|
689
696
|
ts.factory.createCallExpression(
|
|
690
697
|
ts.factory.createIdentifier(
|
|
691
|
-
importer.useLocal(
|
|
698
|
+
importer.useLocal(
|
|
699
|
+
`${config.prefix}a${array.type.index}`,
|
|
700
|
+
),
|
|
692
701
|
),
|
|
693
702
|
undefined,
|
|
694
703
|
FeatureProgrammer.argumentsArray(config)({
|
|
@@ -697,7 +706,7 @@ export namespace CheckerProgrammer {
|
|
|
697
706
|
from: "array",
|
|
698
707
|
})(input),
|
|
699
708
|
),
|
|
700
|
-
config.joiner.failure(input, array.name, explore),
|
|
709
|
+
config.joiner.failure(input, array.type.name, explore),
|
|
701
710
|
);
|
|
702
711
|
};
|
|
703
712
|
|
|
@@ -705,12 +714,34 @@ export namespace CheckerProgrammer {
|
|
|
705
714
|
(project: IProject) =>
|
|
706
715
|
(config: IConfig) =>
|
|
707
716
|
(importer: FunctionImporter) =>
|
|
708
|
-
|
|
717
|
+
(
|
|
718
|
+
input: ts.Expression,
|
|
719
|
+
array: MetadataArrayType,
|
|
720
|
+
explore: IExplore,
|
|
721
|
+
matrix: IMetadataTypeTag[][],
|
|
722
|
+
metaTags: IMetadataCommentTag[],
|
|
723
|
+
jsDocTags: IJsDocTagInfo[],
|
|
724
|
+
): ts.Expression => {
|
|
725
|
+
const tagger = check_array_tags(project)(matrix, metaTags)(input);
|
|
726
|
+
const main = FeatureProgrammer.decode_array({
|
|
709
727
|
prefix: config.prefix,
|
|
710
728
|
trace: config.trace,
|
|
711
729
|
path: config.path,
|
|
712
730
|
decoder: () => decode(project)(config)(importer),
|
|
713
|
-
})(importer)(config.joiner.array)
|
|
731
|
+
})(importer)(config.joiner.array)(
|
|
732
|
+
input,
|
|
733
|
+
array,
|
|
734
|
+
explore,
|
|
735
|
+
metaTags,
|
|
736
|
+
jsDocTags,
|
|
737
|
+
);
|
|
738
|
+
return tagger.expression === null && tagger.tags.length === 0
|
|
739
|
+
? main
|
|
740
|
+
: ts.factory.createLogicalAnd(
|
|
741
|
+
config.atomist(explore)(tagger)(input),
|
|
742
|
+
main,
|
|
743
|
+
);
|
|
744
|
+
};
|
|
714
745
|
|
|
715
746
|
const decode_tuple =
|
|
716
747
|
(project: IProject) =>
|
|
@@ -720,13 +751,13 @@ export namespace CheckerProgrammer {
|
|
|
720
751
|
input: ts.Expression,
|
|
721
752
|
tuple: MetadataTuple,
|
|
722
753
|
explore: IExplore,
|
|
723
|
-
tagList:
|
|
754
|
+
tagList: IMetadataCommentTag[],
|
|
724
755
|
jsDocTags: ts.JSDocTagInfo[],
|
|
725
756
|
): ts.Expression => {
|
|
726
|
-
if (tuple.recursive === false)
|
|
757
|
+
if (tuple.type.recursive === false)
|
|
727
758
|
return decode_tuple_inline(project)(config)(importer)(
|
|
728
759
|
input,
|
|
729
|
-
tuple,
|
|
760
|
+
tuple.type,
|
|
730
761
|
explore,
|
|
731
762
|
tagList,
|
|
732
763
|
jsDocTags,
|
|
@@ -739,7 +770,9 @@ export namespace CheckerProgrammer {
|
|
|
739
770
|
return ts.factory.createLogicalOr(
|
|
740
771
|
ts.factory.createCallExpression(
|
|
741
772
|
ts.factory.createIdentifier(
|
|
742
|
-
importer.useLocal(
|
|
773
|
+
importer.useLocal(
|
|
774
|
+
`${config.prefix}t${tuple.type.index}`,
|
|
775
|
+
),
|
|
743
776
|
),
|
|
744
777
|
undefined,
|
|
745
778
|
FeatureProgrammer.argumentsArray(config)({
|
|
@@ -747,7 +780,7 @@ export namespace CheckerProgrammer {
|
|
|
747
780
|
source: "function",
|
|
748
781
|
})(input),
|
|
749
782
|
),
|
|
750
|
-
config.joiner.failure(input, tuple.name, explore),
|
|
783
|
+
config.joiner.failure(input, tuple.type.name, explore),
|
|
751
784
|
);
|
|
752
785
|
};
|
|
753
786
|
|
|
@@ -757,9 +790,9 @@ export namespace CheckerProgrammer {
|
|
|
757
790
|
(importer: FunctionImporter) =>
|
|
758
791
|
(
|
|
759
792
|
input: ts.Expression,
|
|
760
|
-
tuple:
|
|
793
|
+
tuple: MetadataTupleType,
|
|
761
794
|
explore: IExplore,
|
|
762
|
-
tagList:
|
|
795
|
+
tagList: IMetadataCommentTag[],
|
|
763
796
|
jsDocTags: ts.JSDocTagInfo[],
|
|
764
797
|
): ts.Expression => {
|
|
765
798
|
const binaries: ts.Expression[] = tuple.elements
|
|
@@ -882,7 +915,7 @@ export namespace CheckerProgrammer {
|
|
|
882
915
|
input: ts.Expression,
|
|
883
916
|
sets: Metadata[],
|
|
884
917
|
explore: IExplore,
|
|
885
|
-
tags:
|
|
918
|
+
tags: IMetadataCommentTag[],
|
|
886
919
|
jsDocTags: IJsDocTagInfo[],
|
|
887
920
|
): ts.Expression =>
|
|
888
921
|
ts.factory.createCallExpression(
|
|
@@ -908,7 +941,7 @@ export namespace CheckerProgrammer {
|
|
|
908
941
|
input: ts.Expression,
|
|
909
942
|
maps: Metadata.Entry[],
|
|
910
943
|
explore: IExplore,
|
|
911
|
-
tags:
|
|
944
|
+
tags: IMetadataCommentTag[],
|
|
912
945
|
jsDocTags: IJsDocTagInfo[],
|
|
913
946
|
): ts.Expression =>
|
|
914
947
|
ts.factory.createCallExpression(
|
|
@@ -964,7 +997,7 @@ export namespace CheckerProgrammer {
|
|
|
964
997
|
input: ts.Expression,
|
|
965
998
|
tuples: MetadataTuple[],
|
|
966
999
|
explore: IExplore,
|
|
967
|
-
tags:
|
|
1000
|
+
tags: IMetadataCommentTag[],
|
|
968
1001
|
jsDocTags: IJsDocTagInfo[],
|
|
969
1002
|
): ts.Expression =>
|
|
970
1003
|
explore_array_like_union_types(config)(importer)(
|
|
@@ -988,7 +1021,7 @@ export namespace CheckerProgrammer {
|
|
|
988
1021
|
input: ts.Expression,
|
|
989
1022
|
arrays: MetadataArray[],
|
|
990
1023
|
explore: IExplore,
|
|
991
|
-
tags:
|
|
1024
|
+
tags: IMetadataCommentTag[],
|
|
992
1025
|
jsDocTags: IJsDocTagInfo[],
|
|
993
1026
|
): ts.Expression =>
|
|
994
1027
|
explore_array_like_union_types(config)(importer)(
|
|
@@ -1012,7 +1045,7 @@ export namespace CheckerProgrammer {
|
|
|
1012
1045
|
input: ts.Expression,
|
|
1013
1046
|
elements: Array<MetadataArray | MetadataTuple>,
|
|
1014
1047
|
explore: IExplore,
|
|
1015
|
-
tags:
|
|
1048
|
+
tags: IMetadataCommentTag[],
|
|
1016
1049
|
jsDocTags: IJsDocTagInfo[],
|
|
1017
1050
|
): ts.Expression =>
|
|
1018
1051
|
explore_array_like_union_types(config)(importer)(
|
|
@@ -1071,7 +1104,7 @@ export namespace CheckerProgrammer {
|
|
|
1071
1104
|
input: ts.Expression,
|
|
1072
1105
|
elements: T[],
|
|
1073
1106
|
explore: IExplore,
|
|
1074
|
-
tags:
|
|
1107
|
+
tags: IMetadataCommentTag[],
|
|
1075
1108
|
jsDocTags: IJsDocTagInfo[],
|
|
1076
1109
|
) => ts.ArrowFunction,
|
|
1077
1110
|
) =>
|
|
@@ -1079,7 +1112,7 @@ export namespace CheckerProgrammer {
|
|
|
1079
1112
|
input: ts.Expression,
|
|
1080
1113
|
elements: T[],
|
|
1081
1114
|
explore: IExplore,
|
|
1082
|
-
tags:
|
|
1115
|
+
tags: IMetadataCommentTag[],
|
|
1083
1116
|
jsDocTags: IJsDocTagInfo[],
|
|
1084
1117
|
): ts.Expression => {
|
|
1085
1118
|
const arrow =
|
|
@@ -1093,7 +1126,7 @@ export namespace CheckerProgrammer {
|
|
|
1093
1126
|
tags,
|
|
1094
1127
|
jsDocTags,
|
|
1095
1128
|
);
|
|
1096
|
-
if (elements.every((e) => e.recursive === false))
|
|
1129
|
+
if (elements.every((e) => e.type.recursive === false))
|
|
1097
1130
|
ts.factory.createCallExpression(
|
|
1098
1131
|
arrow([])(explore)(input),
|
|
1099
1132
|
undefined,
|
|
@@ -1109,7 +1142,7 @@ export namespace CheckerProgrammer {
|
|
|
1109
1142
|
ts.factory.createIdentifier(
|
|
1110
1143
|
importer.emplaceUnion(
|
|
1111
1144
|
config.prefix,
|
|
1112
|
-
elements.map((e) => e.name).join(" | "),
|
|
1145
|
+
elements.map((e) => e.type.name).join(" | "),
|
|
1113
1146
|
() =>
|
|
1114
1147
|
arrow(
|
|
1115
1148
|
FeatureProgrammer.parameterDeclarations(
|
|
@@ -1128,7 +1161,7 @@ export namespace CheckerProgrammer {
|
|
|
1128
1161
|
),
|
|
1129
1162
|
config.joiner.failure(
|
|
1130
1163
|
input,
|
|
1131
|
-
elements.map((e) => e.name).join(" | "),
|
|
1164
|
+
elements.map((e) => e.type.name).join(" | "),
|
|
1132
1165
|
explore,
|
|
1133
1166
|
),
|
|
1134
1167
|
);
|
|
@@ -7,9 +7,9 @@ import { TypeFactory } from "../factories/TypeFactory";
|
|
|
7
7
|
import { ValueFactory } from "../factories/ValueFactory";
|
|
8
8
|
|
|
9
9
|
import { IJsDocTagInfo } from "../schemas/metadata/IJsDocTagInfo";
|
|
10
|
-
import {
|
|
10
|
+
import { IMetadataCommentTag } from "../schemas/metadata/IMetadataCommentTag";
|
|
11
11
|
import { Metadata } from "../schemas/metadata/Metadata";
|
|
12
|
-
import {
|
|
12
|
+
import { MetadataArrayType } from "../schemas/metadata/MetadataArrayType";
|
|
13
13
|
import { MetadataObject } from "../schemas/metadata/MetadataObject";
|
|
14
14
|
|
|
15
15
|
import { IProject } from "../transformers/IProject";
|
|
@@ -195,7 +195,7 @@ export namespace FeatureProgrammer {
|
|
|
195
195
|
input: ts.Expression,
|
|
196
196
|
target: T,
|
|
197
197
|
explore: IExplore,
|
|
198
|
-
metaTags:
|
|
198
|
+
metaTags: IMetadataCommentTag[],
|
|
199
199
|
jsDocTags: ts.JSDocTagInfo[],
|
|
200
200
|
): Output;
|
|
201
201
|
}
|
|
@@ -349,7 +349,7 @@ export namespace FeatureProgrammer {
|
|
|
349
349
|
combiner: (
|
|
350
350
|
input: ts.Expression,
|
|
351
351
|
arrow: ts.ArrowFunction,
|
|
352
|
-
metaTags:
|
|
352
|
+
metaTags: IMetadataCommentTag[],
|
|
353
353
|
jsDocTags: ts.JSDocTagInfo[],
|
|
354
354
|
) => ts.Expression,
|
|
355
355
|
) => {
|
|
@@ -366,9 +366,9 @@ export namespace FeatureProgrammer {
|
|
|
366
366
|
|
|
367
367
|
return (
|
|
368
368
|
input: ts.Expression,
|
|
369
|
-
array:
|
|
369
|
+
array: MetadataArrayType,
|
|
370
370
|
explore: IExplore,
|
|
371
|
-
metaTags:
|
|
371
|
+
metaTags: IMetadataCommentTag[],
|
|
372
372
|
jsDocTags: IJsDocTagInfo[],
|
|
373
373
|
) => {
|
|
374
374
|
const arrow: ts.ArrowFunction = ts.factory.createArrowFunction(
|
|
@@ -31,7 +31,7 @@ export namespace IsProgrammer {
|
|
|
31
31
|
}),
|
|
32
32
|
atomist: () => (entry) => () =>
|
|
33
33
|
[
|
|
34
|
-
entry.expression,
|
|
34
|
+
...(entry.expression ? [entry.expression] : []),
|
|
35
35
|
...entry.tags.map((tag) => tag.expression),
|
|
36
36
|
].reduce((x, y) => ts.factory.createLogicalAnd(x, y)),
|
|
37
37
|
combiner: () => (type: "and" | "or") => {
|
|
@@ -9,11 +9,13 @@ import { TemplateFactory } from "../factories/TemplateFactory";
|
|
|
9
9
|
import { TypeFactory } from "../factories/TypeFactory";
|
|
10
10
|
|
|
11
11
|
import { ICommentTag } from "../schemas/metadata/ICommentTag";
|
|
12
|
-
import {
|
|
12
|
+
import { IMetadataCommentTag } from "../schemas/metadata/IMetadataCommentTag";
|
|
13
13
|
import { Metadata } from "../schemas/metadata/Metadata";
|
|
14
14
|
import { MetadataArray } from "../schemas/metadata/MetadataArray";
|
|
15
|
+
import { MetadataArrayType } from "../schemas/metadata/MetadataArrayType";
|
|
15
16
|
import { MetadataObject } from "../schemas/metadata/MetadataObject";
|
|
16
17
|
import { MetadataTuple } from "../schemas/metadata/MetadataTuple";
|
|
18
|
+
import { MetadataTupleType } from "../schemas/metadata/MetadataTupleType";
|
|
17
19
|
|
|
18
20
|
import { IProject } from "../transformers/IProject";
|
|
19
21
|
|
|
@@ -225,7 +227,7 @@ export namespace RandomProgrammer {
|
|
|
225
227
|
(explore: IExplore) =>
|
|
226
228
|
(
|
|
227
229
|
meta: Metadata,
|
|
228
|
-
tags:
|
|
230
|
+
tags: IMetadataCommentTag[],
|
|
229
231
|
comments: ICommentTag[],
|
|
230
232
|
): ts.Expression => {
|
|
231
233
|
const expressions: ts.Expression[] = [];
|
|
@@ -248,14 +250,14 @@ export namespace RandomProgrammer {
|
|
|
248
250
|
// ATOMIC VARIABLES
|
|
249
251
|
for (const template of meta.templates)
|
|
250
252
|
expressions.push(decode_template(importer)(explore)(template));
|
|
251
|
-
for (const
|
|
252
|
-
if (
|
|
253
|
+
for (const a of meta.atomics)
|
|
254
|
+
if (a.type === "boolean")
|
|
253
255
|
expressions.push(decode_boolean(importer));
|
|
254
|
-
else if (
|
|
256
|
+
else if (a.type === "number")
|
|
255
257
|
expressions.push(decode_number(importer)(tags, comments));
|
|
256
|
-
else if (
|
|
258
|
+
else if (a.type === "string")
|
|
257
259
|
expressions.push(decode_string(importer)(tags, comments));
|
|
258
|
-
else if (
|
|
260
|
+
else if (a.type === "bigint")
|
|
259
261
|
expressions.push(decode_bigint(importer)(tags, comments));
|
|
260
262
|
|
|
261
263
|
// INSTANCE TYPES
|
|
@@ -343,7 +345,10 @@ export namespace RandomProgrammer {
|
|
|
343
345
|
|
|
344
346
|
const decode_number =
|
|
345
347
|
(importer: FunctionImporter) =>
|
|
346
|
-
(
|
|
348
|
+
(
|
|
349
|
+
tags: IMetadataCommentTag[],
|
|
350
|
+
comments: ICommentTag[],
|
|
351
|
+
): ts.Expression => {
|
|
347
352
|
const type = tags.find(
|
|
348
353
|
(t) =>
|
|
349
354
|
t.kind === "type" &&
|
|
@@ -391,7 +396,7 @@ export namespace RandomProgrammer {
|
|
|
391
396
|
|
|
392
397
|
const decode_bigint =
|
|
393
398
|
(importer: FunctionImporter) =>
|
|
394
|
-
(tags:
|
|
399
|
+
(tags: IMetadataCommentTag[], comments: ICommentTag[]): ts.Expression =>
|
|
395
400
|
random_custom(COALESCE(importer))("bigint")(comments)(
|
|
396
401
|
RandomRanger.number({
|
|
397
402
|
type: tags.find(
|
|
@@ -419,7 +424,7 @@ export namespace RandomProgrammer {
|
|
|
419
424
|
|
|
420
425
|
const decode_string =
|
|
421
426
|
(importer: FunctionImporter) =>
|
|
422
|
-
(tags:
|
|
427
|
+
(tags: IMetadataCommentTag[], comments: ICommentTag[]): ts.Expression =>
|
|
423
428
|
random_custom(COALESCE(importer))("string")(comments)(
|
|
424
429
|
(() => {
|
|
425
430
|
for (const t of tags)
|
|
@@ -458,7 +463,7 @@ export namespace RandomProgrammer {
|
|
|
458
463
|
(explore: IExplore) =>
|
|
459
464
|
(
|
|
460
465
|
array: MetadataArray,
|
|
461
|
-
tags:
|
|
466
|
+
tags: IMetadataCommentTag[],
|
|
462
467
|
comments: ICommentTag[],
|
|
463
468
|
) => {
|
|
464
469
|
const length: ts.Expression | undefined = RandomRanger.length(
|
|
@@ -472,10 +477,10 @@ export namespace RandomProgrammer {
|
|
|
472
477
|
minimum: "minItems",
|
|
473
478
|
maximum: "maxItems",
|
|
474
479
|
})(tags);
|
|
475
|
-
if (array.recursive)
|
|
480
|
+
if (array.type.recursive)
|
|
476
481
|
return ts.factory.createCallExpression(
|
|
477
482
|
ts.factory.createIdentifier(
|
|
478
|
-
importer.useLocal(PREFIX.array(array.index!)),
|
|
483
|
+
importer.useLocal(PREFIX.array(array.type.index!)),
|
|
479
484
|
),
|
|
480
485
|
undefined,
|
|
481
486
|
[
|
|
@@ -491,7 +496,7 @@ export namespace RandomProgrammer {
|
|
|
491
496
|
);
|
|
492
497
|
const expr: ts.Expression = RandomJoiner.array(COALESCE(importer))(
|
|
493
498
|
decode(importer)(explore),
|
|
494
|
-
)(explore)(length)(array.value, tags, comments);
|
|
499
|
+
)(explore)(length)(array.type.value, tags, comments);
|
|
495
500
|
return explore.recursive
|
|
496
501
|
? ts.factory.createConditionalExpression(
|
|
497
502
|
ts.factory.createLogicalAnd(
|
|
@@ -514,13 +519,13 @@ export namespace RandomProgrammer {
|
|
|
514
519
|
(explore: IExplore) =>
|
|
515
520
|
(
|
|
516
521
|
tuple: MetadataTuple,
|
|
517
|
-
tags:
|
|
522
|
+
tags: IMetadataCommentTag[],
|
|
518
523
|
comments: ICommentTag[],
|
|
519
524
|
): ts.Expression =>
|
|
520
|
-
tuple.recursive
|
|
525
|
+
tuple.type.recursive
|
|
521
526
|
? ts.factory.createCallExpression(
|
|
522
527
|
ts.factory.createIdentifier(
|
|
523
|
-
importer.useLocal(PREFIX.tuple(tuple.index!)),
|
|
528
|
+
importer.useLocal(PREFIX.tuple(tuple.type.index!)),
|
|
524
529
|
),
|
|
525
530
|
undefined,
|
|
526
531
|
[
|
|
@@ -534,7 +539,7 @@ export namespace RandomProgrammer {
|
|
|
534
539
|
],
|
|
535
540
|
)
|
|
536
541
|
: RandomJoiner.tuple(decode(importer)(explore))(
|
|
537
|
-
tuple.elements,
|
|
542
|
+
tuple.type.elements,
|
|
538
543
|
tags,
|
|
539
544
|
comments,
|
|
540
545
|
);
|
|
@@ -573,18 +578,25 @@ export namespace RandomProgrammer {
|
|
|
573
578
|
const decode_set =
|
|
574
579
|
(importer: FunctionImporter) =>
|
|
575
580
|
(explore: IExplore) =>
|
|
576
|
-
(
|
|
581
|
+
(
|
|
582
|
+
meta: Metadata,
|
|
583
|
+
tags: IMetadataCommentTag[],
|
|
584
|
+
comments: ICommentTag[],
|
|
585
|
+
) =>
|
|
577
586
|
ts.factory.createNewExpression(
|
|
578
587
|
ts.factory.createIdentifier("Set"),
|
|
579
588
|
undefined,
|
|
580
589
|
[
|
|
581
590
|
decode_array(importer)(explore)(
|
|
582
591
|
MetadataArray.create({
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
592
|
+
tags: [],
|
|
593
|
+
type: MetadataArrayType.create({
|
|
594
|
+
value: meta,
|
|
595
|
+
recursive: false,
|
|
596
|
+
index: null,
|
|
597
|
+
nullables: [],
|
|
598
|
+
name: `Set<${meta.getName()}>`,
|
|
599
|
+
}),
|
|
588
600
|
}),
|
|
589
601
|
tags,
|
|
590
602
|
comments,
|
|
@@ -595,32 +607,43 @@ export namespace RandomProgrammer {
|
|
|
595
607
|
const decode_map =
|
|
596
608
|
(importer: FunctionImporter) =>
|
|
597
609
|
(explore: IExplore) =>
|
|
598
|
-
(
|
|
610
|
+
(
|
|
611
|
+
m: Metadata.Entry,
|
|
612
|
+
tags: IMetadataCommentTag[],
|
|
613
|
+
comments: ICommentTag[],
|
|
614
|
+
) =>
|
|
599
615
|
ts.factory.createNewExpression(
|
|
600
616
|
ts.factory.createIdentifier("Map"),
|
|
601
617
|
undefined,
|
|
602
618
|
[
|
|
603
619
|
decode_array(importer)(explore)(
|
|
604
620
|
MetadataArray.create({
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
(
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
621
|
+
tags: [],
|
|
622
|
+
type: MetadataArrayType.create({
|
|
623
|
+
name: `Map<${m.key.getName()}, ${m.value.getName()}>`,
|
|
624
|
+
index: null,
|
|
625
|
+
recursive: false,
|
|
626
|
+
nullables: [],
|
|
627
|
+
value: Metadata.create({
|
|
628
|
+
...Metadata.initialize(),
|
|
629
|
+
tuples: [
|
|
630
|
+
(() => {
|
|
631
|
+
const type =
|
|
632
|
+
MetadataTupleType.create({
|
|
633
|
+
name: `[${m.key.getName()}, ${m.value.getName()}]`,
|
|
634
|
+
index: null,
|
|
635
|
+
recursive: false,
|
|
636
|
+
nullables: [],
|
|
637
|
+
elements: [m.key, m.value],
|
|
638
|
+
});
|
|
639
|
+
type.of_map = true;
|
|
640
|
+
return MetadataTuple.create({
|
|
641
|
+
type,
|
|
642
|
+
tags: [],
|
|
643
|
+
});
|
|
644
|
+
})(),
|
|
645
|
+
],
|
|
646
|
+
}),
|
|
624
647
|
}),
|
|
625
648
|
}),
|
|
626
649
|
tags,
|
|
@@ -633,7 +656,7 @@ export namespace RandomProgrammer {
|
|
|
633
656
|
(importer: FunctionImporter) =>
|
|
634
657
|
(
|
|
635
658
|
type: string,
|
|
636
|
-
tags:
|
|
659
|
+
tags: IMetadataCommentTag[],
|
|
637
660
|
comments: ICommentTag[],
|
|
638
661
|
): ts.Expression => {
|
|
639
662
|
if (type === "Boolean") return decode_boolean(importer);
|
|
@@ -8,7 +8,7 @@ export namespace AtomicPredicator {
|
|
|
8
8
|
export const constant =
|
|
9
9
|
(meta: Metadata) =>
|
|
10
10
|
(name: Atomic.Literal): boolean =>
|
|
11
|
-
!ArrayUtil.has(meta.atomics, (
|
|
11
|
+
!ArrayUtil.has(meta.atomics, (a) => a.type === name) &&
|
|
12
12
|
!ArrayUtil.has(
|
|
13
13
|
meta.natives,
|
|
14
14
|
(native) => native.toLowerCase() === name,
|
|
@@ -25,7 +25,7 @@ export namespace AtomicPredicator {
|
|
|
25
25
|
export const native = (name: string) => LIKE.has(name.toLowerCase());
|
|
26
26
|
|
|
27
27
|
export const template = (meta: Metadata): boolean =>
|
|
28
|
-
!ArrayUtil.has(meta.atomics, (
|
|
28
|
+
!ArrayUtil.has(meta.atomics, (a) => a.type === "string");
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
const LIKE = new Set(["boolean", "number", "string"]);
|