typia 4.3.2-dev.20230821 → 4.3.3-dev.20230825
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/iterate_metadata_intersection.js +2 -0
- package/lib/factories/internal/metadata/iterate_metadata_intersection.js.map +1 -1
- package/lib/programmers/helpers/CloneJoiner.js +10 -2
- package/lib/programmers/helpers/CloneJoiner.js.map +1 -1
- package/lib/programmers/internal/check_dynamic_properties.js +1 -1
- package/lib/programmers/internal/check_dynamic_properties.js.map +1 -1
- package/package.json +2 -2
- package/src/CustomValidatorMap.ts +126 -126
- package/src/IRandomGenerator.ts +34 -34
- package/src/IValidation.ts +21 -21
- package/src/Primitive.ts +131 -131
- package/src/TypeGuardError.ts +36 -36
- package/src/executable/TypiaGenerateWizard.ts +85 -85
- package/src/executable/TypiaSetupWizard.ts +153 -153
- package/src/executable/setup/ArgumentParser.ts +45 -45
- package/src/executable/setup/CommandExecutor.ts +8 -8
- package/src/executable/setup/FileRetriever.ts +22 -22
- package/src/executable/setup/PackageManager.ts +71 -71
- package/src/executable/setup/PluginConfigurator.ts +70 -70
- package/src/executable/typia.ts +52 -52
- package/src/factories/CommentFactory.ts +84 -84
- package/src/factories/ExpressionFactory.ts +77 -77
- package/src/factories/IdentifierFactory.ts +59 -59
- package/src/factories/LiteralFactory.ts +39 -39
- package/src/factories/MetadataCollection.ts +269 -269
- package/src/factories/MetadataFactory.ts +34 -34
- package/src/factories/MetadataTagFactory.ts +361 -361
- package/src/factories/StatementFactory.ts +24 -24
- package/src/factories/TemplateFactory.ts +58 -58
- package/src/factories/TypeFactory.ts +124 -124
- package/src/factories/ValueFactory.ts +12 -12
- package/src/factories/internal/metadata/MetadataHelper.ts +12 -12
- package/src/factories/internal/metadata/emend_metadata_atomics.ts +33 -33
- package/src/factories/internal/metadata/emplace_metadata_alias.ts +40 -40
- package/src/factories/internal/metadata/emplace_metadata_array.ts +34 -34
- package/src/factories/internal/metadata/emplace_metadata_object.ts +136 -136
- package/src/factories/internal/metadata/emplace_metadata_tuple.ts +50 -50
- package/src/factories/internal/metadata/explore_metadata.ts +38 -38
- package/src/factories/internal/metadata/iterate_metadata.ts +81 -81
- package/src/factories/internal/metadata/iterate_metadata_alias.ts +30 -30
- package/src/factories/internal/metadata/iterate_metadata_array.ts +24 -24
- package/src/factories/internal/metadata/iterate_metadata_atomic.ts +59 -59
- package/src/factories/internal/metadata/iterate_metadata_coalesce.ts +33 -33
- package/src/factories/internal/metadata/iterate_metadata_collection.ts +133 -133
- package/src/factories/internal/metadata/iterate_metadata_constant.ts +58 -58
- package/src/factories/internal/metadata/iterate_metadata_intersection.ts +88 -84
- package/src/factories/internal/metadata/iterate_metadata_map.ts +41 -41
- package/src/factories/internal/metadata/iterate_metadata_native.ts +219 -219
- package/src/factories/internal/metadata/iterate_metadata_object.ts +43 -43
- package/src/factories/internal/metadata/iterate_metadata_resolve.ts +49 -49
- package/src/factories/internal/metadata/iterate_metadata_set.ts +33 -33
- package/src/factories/internal/metadata/iterate_metadata_sort.ts +69 -69
- package/src/factories/internal/metadata/iterate_metadata_tag.ts +31 -31
- package/src/factories/internal/metadata/iterate_metadata_template.ts +38 -38
- package/src/factories/internal/metadata/iterate_metadata_tuple.ts +24 -24
- package/src/factories/internal/metadata/iterate_metadata_union.ts +24 -24
- package/src/functional/$any.ts +2 -2
- package/src/functional/$dictionary.ts +25 -25
- package/src/functional/$every.ts +11 -11
- package/src/functional/$guard.ts +35 -35
- package/src/functional/$is_between.ts +2 -2
- package/src/functional/$is_custom.ts +14 -14
- package/src/functional/$is_date.ts +3 -3
- package/src/functional/$is_datetime.ts +2 -2
- package/src/functional/$is_email.ts +4 -4
- package/src/functional/$is_ipv4.ts +4 -4
- package/src/functional/$is_ipv6.ts +4 -4
- package/src/functional/$is_url.ts +4 -4
- package/src/functional/$is_uuid.ts +4 -4
- package/src/functional/$join.ts +46 -46
- package/src/functional/$number.ts +12 -12
- package/src/functional/$report.ts +15 -15
- package/src/functional/$rest.ts +3 -3
- package/src/functional/$string.ts +50 -50
- package/src/functional/$tail.ts +5 -5
- package/src/functional/Namespace.ts +127 -127
- package/src/index.ts +4 -4
- package/src/metadata/ICommentTag.ts +4 -4
- package/src/metadata/IJsDocTagInfo.ts +10 -10
- package/src/metadata/IMetadata.ts +28 -28
- package/src/metadata/IMetadataAlias.ts +14 -14
- package/src/metadata/IMetadataApplication.ts +7 -7
- package/src/metadata/IMetadataArray.ts +10 -10
- package/src/metadata/IMetadataCollection.ts +11 -11
- package/src/metadata/IMetadataConstant.ts +16 -16
- package/src/metadata/IMetadataDictionary.ts +14 -14
- package/src/metadata/IMetadataEntry.ts +6 -6
- package/src/metadata/IMetadataObject.ts +18 -18
- package/src/metadata/IMetadataProperty.ts +11 -11
- package/src/metadata/IMetadataResolved.ts +6 -6
- package/src/metadata/IMetadataTag.ts +112 -112
- package/src/metadata/IMetadataTuple.ts +10 -10
- package/src/metadata/Metadata.ts +607 -607
- package/src/metadata/MetadataAlias.ts +66 -66
- package/src/metadata/MetadataArray.ts +55 -55
- package/src/metadata/MetadataConstant.ts +3 -3
- package/src/metadata/MetadataObject.ts +129 -129
- package/src/metadata/MetadataProperty.ts +64 -64
- package/src/metadata/MetadataResolved.ts +51 -51
- package/src/metadata/MetadataTuple.ts +58 -58
- package/src/module.ts +2038 -2038
- package/src/programmers/ApplicationProgrammer.ts +47 -47
- package/src/programmers/AssertCloneProgrammer.ts +71 -71
- package/src/programmers/AssertParseProgrammer.ts +66 -66
- package/src/programmers/AssertProgrammer.ts +279 -279
- package/src/programmers/AssertPruneProgrammer.ts +68 -68
- package/src/programmers/AssertStringifyProgrammer.ts +66 -66
- package/src/programmers/CheckerProgrammer.ts +1173 -1173
- package/src/programmers/CloneProgrammer.ts +587 -587
- package/src/programmers/FeatureProgrammer.ts +495 -495
- package/src/programmers/IsCloneProgrammer.ts +78 -78
- package/src/programmers/IsParseProgrammer.ts +72 -72
- package/src/programmers/IsProgrammer.ts +239 -239
- package/src/programmers/IsPruneProgrammer.ts +73 -73
- package/src/programmers/IsStringifyProgrammer.ts +76 -76
- package/src/programmers/LiteralsProgrammer.ts +64 -64
- package/src/programmers/PruneProgrammer.ts +542 -542
- package/src/programmers/RandomProgrammer.ts +578 -578
- package/src/programmers/StringifyProgrammer.ts +986 -986
- package/src/programmers/TypiaProgrammer.ts +129 -129
- package/src/programmers/ValidateCloneProgrammer.ts +85 -85
- package/src/programmers/ValidateParseProgrammer.ts +70 -70
- package/src/programmers/ValidateProgrammer.ts +305 -305
- package/src/programmers/ValidatePruneProgrammer.ts +78 -78
- package/src/programmers/ValidateStringifyProgrammer.ts +84 -84
- package/src/programmers/helpers/AtomicPredicator.ts +31 -31
- package/src/programmers/helpers/CloneJoiner.ts +168 -131
- package/src/programmers/helpers/FunctionImporeter.ts +78 -78
- package/src/programmers/helpers/ICheckEntry.ts +12 -12
- package/src/programmers/helpers/IExpressionEntry.ts +12 -12
- package/src/programmers/helpers/OptionPredicator.ts +15 -15
- package/src/programmers/helpers/PruneJoiner.ts +143 -143
- package/src/programmers/helpers/RandomJoiner.ts +173 -173
- package/src/programmers/helpers/RandomRanger.ts +208 -208
- package/src/programmers/helpers/StringifyJoinder.ts +113 -113
- package/src/programmers/helpers/StringifyPredicator.ts +13 -13
- package/src/programmers/helpers/UnionExplorer.ts +305 -305
- package/src/programmers/helpers/UnionPredicator.ts +81 -81
- package/src/programmers/helpers/disable_function_importer_declare.ts +26 -26
- package/src/programmers/internal/JSON_SCHEMA_PREFIX.ts +1 -1
- package/src/programmers/internal/application_alias.ts +66 -66
- package/src/programmers/internal/application_array.ts +30 -30
- package/src/programmers/internal/application_boolean.ts +15 -15
- package/src/programmers/internal/application_constant.ts +26 -26
- package/src/programmers/internal/application_default.ts +17 -17
- package/src/programmers/internal/application_default_string.ts +33 -33
- package/src/programmers/internal/application_native.ts +39 -39
- package/src/programmers/internal/application_number.ts +80 -80
- package/src/programmers/internal/application_object.ts +165 -165
- package/src/programmers/internal/application_resolved.ts +55 -55
- package/src/programmers/internal/application_schema.ts +157 -157
- package/src/programmers/internal/application_string.ts +44 -44
- package/src/programmers/internal/application_templates.ts +25 -25
- package/src/programmers/internal/application_tuple.ts +57 -57
- package/src/programmers/internal/check_array.ts +30 -30
- package/src/programmers/internal/check_array_length.ts +35 -35
- package/src/programmers/internal/check_bigint.ts +110 -110
- package/src/programmers/internal/check_custom.ts +31 -31
- package/src/programmers/internal/check_dynamic_properties.ts +194 -195
- package/src/programmers/internal/check_everything.ts +28 -28
- package/src/programmers/internal/check_native.ts +21 -21
- package/src/programmers/internal/check_object.ts +55 -55
- package/src/programmers/internal/check_string.ts +25 -25
- package/src/programmers/internal/check_string_tags.ts +67 -67
- package/src/programmers/internal/check_template.ts +56 -56
- package/src/programmers/internal/check_union_array_like.ts +329 -329
- package/src/programmers/internal/decode_union_object.ts +73 -73
- package/src/programmers/internal/feature_object_entries.ts +63 -63
- package/src/programmers/internal/get_comment_tags.ts +23 -23
- package/src/programmers/internal/metadata_to_pattern.ts +34 -34
- package/src/programmers/internal/prune_object_properties.ts +60 -60
- package/src/programmers/internal/random_custom.ts +29 -29
- package/src/programmers/internal/stringify_dynamic_properties.ts +171 -171
- package/src/programmers/internal/stringify_native.ts +7 -7
- package/src/programmers/internal/stringify_regular_properties.ts +83 -83
- package/src/programmers/internal/template_to_pattern.ts +15 -15
- package/src/programmers/internal/wrap_metadata_rest_tuple.ts +16 -16
- package/src/schemas/IJsonApplication.ts +8 -8
- package/src/schemas/IJsonComponents.ts +33 -33
- package/src/schemas/IJsonSchema.ts +133 -133
- package/src/transform.ts +27 -27
- package/src/transformers/CallExpressionTransformer.ts +179 -179
- package/src/transformers/FileTransformer.ts +47 -47
- package/src/transformers/IProject.ts +11 -11
- package/src/transformers/ITransformOptions.ts +62 -62
- package/src/transformers/ImportTransformer.ts +66 -66
- package/src/transformers/NodeTransformer.ts +13 -13
- package/src/transformers/features/miscellaneous/ApplicationTransformer.ts +112 -112
- package/src/transformers/features/miscellaneous/AssertCloneTransformer.ts +9 -9
- package/src/transformers/features/miscellaneous/AssertPruneTransformer.ts +9 -9
- package/src/transformers/features/miscellaneous/CloneTransformer.ts +9 -9
- package/src/transformers/features/miscellaneous/CreateAssertCloneTransformer.ts +9 -9
- package/src/transformers/features/miscellaneous/CreateAssertPruneTransformer.ts +9 -9
- package/src/transformers/features/miscellaneous/CreateCloneTransformer.ts +9 -9
- package/src/transformers/features/miscellaneous/CreateIsCloneTransformer.ts +9 -9
- package/src/transformers/features/miscellaneous/CreateIsPruneTransformer.ts +9 -9
- package/src/transformers/features/miscellaneous/CreatePruneTransformer.ts +9 -9
- package/src/transformers/features/miscellaneous/CreateRandomTransformer.ts +39 -39
- package/src/transformers/features/miscellaneous/CreateValidateCloneTransformer.ts +9 -9
- package/src/transformers/features/miscellaneous/CreateValidatePruneTransformer.ts +9 -9
- package/src/transformers/features/miscellaneous/IsCloneTransformer.ts +9 -9
- package/src/transformers/features/miscellaneous/IsPruneTransformer.ts +9 -9
- package/src/transformers/features/miscellaneous/LiteralsTransformer.ts +28 -28
- package/src/transformers/features/miscellaneous/MetadataTransformer.ts +53 -53
- package/src/transformers/features/miscellaneous/PruneTransformer.ts +9 -9
- package/src/transformers/features/miscellaneous/RandomTransformer.ts +42 -42
- package/src/transformers/features/miscellaneous/ValidateCloneTransformer.ts +9 -9
- package/src/transformers/features/miscellaneous/ValidatePruneTransformer.ts +9 -9
- package/src/transformers/features/parsers/AssertParseTransformer.ts +9 -9
- package/src/transformers/features/parsers/CreateAssertParseTransformer.ts +9 -9
- package/src/transformers/features/parsers/CreateIsParseTransformer.ts +9 -9
- package/src/transformers/features/parsers/CreateValidateParseTransformer.ts +9 -9
- package/src/transformers/features/parsers/IsParseTransformer.ts +9 -9
- package/src/transformers/features/parsers/ValidateParseTransformer.ts +9 -9
- package/src/transformers/features/stringifiers/AssertStringifyTransformer.ts +10 -10
- package/src/transformers/features/stringifiers/CreateAssertStringifyTransformer.ts +12 -12
- package/src/transformers/features/stringifiers/CreateIsStringifyTransformer.ts +9 -9
- package/src/transformers/features/stringifiers/CreateStringifyTransformer.ts +9 -9
- package/src/transformers/features/stringifiers/CreateValidateStringifyProgrammer.ts +12 -12
- package/src/transformers/features/stringifiers/IsStringifyTransformer.ts +9 -9
- package/src/transformers/features/stringifiers/StringifyTransformer.ts +9 -9
- package/src/transformers/features/stringifiers/ValidateStringifyTransformer.ts +10 -10
- package/src/transformers/features/validators/AssertTransformer.ts +11 -11
- package/src/transformers/features/validators/CreateAssertTransformer.ts +13 -13
- package/src/transformers/features/validators/CreateIsTransformer.ts +11 -11
- package/src/transformers/features/validators/CreateValidateTransformer.ts +13 -13
- package/src/transformers/features/validators/IsTransformer.ts +11 -11
- package/src/transformers/features/validators/ValidateTransformer.ts +11 -11
- package/src/transformers/internal/GenericTransformer.ts +97 -97
- package/src/typings/Atomic.ts +17 -17
- package/src/typings/ClassProperties.ts +5 -5
- package/src/typings/Customizable.ts +5 -5
- package/src/typings/OmitNever.ts +3 -3
- package/src/typings/SpecialFields.ts +3 -3
- package/src/typings/Writable.ts +11 -11
- package/src/utils/ArrayUtil.ts +45 -45
- package/src/utils/Escaper.ts +46 -46
- package/src/utils/MapUtil.ts +12 -12
- package/src/utils/PatternUtil.ts +33 -33
- package/src/utils/RandomGenerator.ts +81 -81
- package/src/utils/Singleton.ts +17 -17
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import { ClassProperties } from "../typings/ClassProperties";
|
|
2
|
-
|
|
3
|
-
import { IJsDocTagInfo } from "./IJsDocTagInfo";
|
|
4
|
-
import { IMetadataAlias } from "./IMetadataAlias";
|
|
5
|
-
import { IMetadataTag } from "./IMetadataTag";
|
|
6
|
-
import { Metadata } from "./Metadata";
|
|
7
|
-
|
|
8
|
-
export class MetadataAlias {
|
|
9
|
-
public readonly name: string;
|
|
10
|
-
public readonly value: Metadata;
|
|
11
|
-
public readonly description: string | null;
|
|
12
|
-
public readonly tags: IMetadataTag[];
|
|
13
|
-
public readonly jsDocTags: IJsDocTagInfo[];
|
|
14
|
-
public readonly recursive: boolean;
|
|
15
|
-
public readonly nullables: boolean[];
|
|
16
|
-
|
|
17
|
-
/* -----------------------------------------------------------
|
|
18
|
-
CONSTRUCTORS
|
|
19
|
-
----------------------------------------------------------- */
|
|
20
|
-
/**
|
|
21
|
-
* @hidden
|
|
22
|
-
*/
|
|
23
|
-
private constructor(props: ClassProperties<MetadataAlias>) {
|
|
24
|
-
this.name = props.name;
|
|
25
|
-
this.value = props.value;
|
|
26
|
-
this.description = props.description;
|
|
27
|
-
this.tags = props.tags;
|
|
28
|
-
this.jsDocTags = props.jsDocTags;
|
|
29
|
-
this.recursive = props.recursive;
|
|
30
|
-
this.nullables = props.nullables;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @internal
|
|
35
|
-
*/
|
|
36
|
-
public static create(props: ClassProperties<MetadataAlias>): MetadataAlias {
|
|
37
|
-
return new MetadataAlias(props);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* @internal
|
|
42
|
-
*/
|
|
43
|
-
public static _From_without_value(props: Omit<IMetadataAlias, "value">) {
|
|
44
|
-
return this.create({
|
|
45
|
-
name: props.name,
|
|
46
|
-
value: null!,
|
|
47
|
-
description: props.description,
|
|
48
|
-
recursive: props.recursive,
|
|
49
|
-
tags: props.tags.slice(),
|
|
50
|
-
jsDocTags: props.jsDocTags.slice(),
|
|
51
|
-
nullables: props.nullables.slice(),
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
public toJSON(): IMetadataAlias {
|
|
56
|
-
return {
|
|
57
|
-
name: this.name,
|
|
58
|
-
value: this.value.toJSON(),
|
|
59
|
-
description: this.description,
|
|
60
|
-
recursive: this.recursive,
|
|
61
|
-
tags: this.tags.slice(),
|
|
62
|
-
jsDocTags: this.jsDocTags.slice(),
|
|
63
|
-
nullables: this.nullables.slice(),
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
}
|
|
1
|
+
import { ClassProperties } from "../typings/ClassProperties";
|
|
2
|
+
|
|
3
|
+
import { IJsDocTagInfo } from "./IJsDocTagInfo";
|
|
4
|
+
import { IMetadataAlias } from "./IMetadataAlias";
|
|
5
|
+
import { IMetadataTag } from "./IMetadataTag";
|
|
6
|
+
import { Metadata } from "./Metadata";
|
|
7
|
+
|
|
8
|
+
export class MetadataAlias {
|
|
9
|
+
public readonly name: string;
|
|
10
|
+
public readonly value: Metadata;
|
|
11
|
+
public readonly description: string | null;
|
|
12
|
+
public readonly tags: IMetadataTag[];
|
|
13
|
+
public readonly jsDocTags: IJsDocTagInfo[];
|
|
14
|
+
public readonly recursive: boolean;
|
|
15
|
+
public readonly nullables: boolean[];
|
|
16
|
+
|
|
17
|
+
/* -----------------------------------------------------------
|
|
18
|
+
CONSTRUCTORS
|
|
19
|
+
----------------------------------------------------------- */
|
|
20
|
+
/**
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
private constructor(props: ClassProperties<MetadataAlias>) {
|
|
24
|
+
this.name = props.name;
|
|
25
|
+
this.value = props.value;
|
|
26
|
+
this.description = props.description;
|
|
27
|
+
this.tags = props.tags;
|
|
28
|
+
this.jsDocTags = props.jsDocTags;
|
|
29
|
+
this.recursive = props.recursive;
|
|
30
|
+
this.nullables = props.nullables;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
public static create(props: ClassProperties<MetadataAlias>): MetadataAlias {
|
|
37
|
+
return new MetadataAlias(props);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
public static _From_without_value(props: Omit<IMetadataAlias, "value">) {
|
|
44
|
+
return this.create({
|
|
45
|
+
name: props.name,
|
|
46
|
+
value: null!,
|
|
47
|
+
description: props.description,
|
|
48
|
+
recursive: props.recursive,
|
|
49
|
+
tags: props.tags.slice(),
|
|
50
|
+
jsDocTags: props.jsDocTags.slice(),
|
|
51
|
+
nullables: props.nullables.slice(),
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
public toJSON(): IMetadataAlias {
|
|
56
|
+
return {
|
|
57
|
+
name: this.name,
|
|
58
|
+
value: this.value.toJSON(),
|
|
59
|
+
description: this.description,
|
|
60
|
+
recursive: this.recursive,
|
|
61
|
+
tags: this.tags.slice(),
|
|
62
|
+
jsDocTags: this.jsDocTags.slice(),
|
|
63
|
+
nullables: this.nullables.slice(),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import { ClassProperties } from "../typings/ClassProperties";
|
|
2
|
-
|
|
3
|
-
import { IMetadataArray } from "./IMetadataArray";
|
|
4
|
-
import { Metadata } from "./Metadata";
|
|
5
|
-
|
|
6
|
-
export class MetadataArray {
|
|
7
|
-
public readonly name: string;
|
|
8
|
-
public readonly value: Metadata;
|
|
9
|
-
public readonly nullables: boolean[];
|
|
10
|
-
public readonly recursive: boolean;
|
|
11
|
-
public readonly index: number | null;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @hidden
|
|
15
|
-
*/
|
|
16
|
-
private constructor(props: ClassProperties<MetadataArray>) {
|
|
17
|
-
this.name = props.name;
|
|
18
|
-
this.value = props.value;
|
|
19
|
-
this.index = props.index;
|
|
20
|
-
this.recursive = props.recursive;
|
|
21
|
-
this.nullables = props.nullables;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @internal
|
|
26
|
-
*/
|
|
27
|
-
public static _From_without_value(
|
|
28
|
-
props: Omit<IMetadataArray, "value">,
|
|
29
|
-
): MetadataArray {
|
|
30
|
-
return this.create({
|
|
31
|
-
name: props.name,
|
|
32
|
-
value: null!,
|
|
33
|
-
index: props.index,
|
|
34
|
-
recursive: props.recursive,
|
|
35
|
-
nullables: props.nullables,
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* @internal
|
|
41
|
-
*/
|
|
42
|
-
public static create(props: ClassProperties<MetadataArray>): MetadataArray {
|
|
43
|
-
return new MetadataArray(props);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
public toJSON(): IMetadataArray {
|
|
47
|
-
return {
|
|
48
|
-
name: this.name,
|
|
49
|
-
value: this.value.toJSON(),
|
|
50
|
-
nullables: this.nullables,
|
|
51
|
-
recursive: this.recursive,
|
|
52
|
-
index: this.index,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
}
|
|
1
|
+
import { ClassProperties } from "../typings/ClassProperties";
|
|
2
|
+
|
|
3
|
+
import { IMetadataArray } from "./IMetadataArray";
|
|
4
|
+
import { Metadata } from "./Metadata";
|
|
5
|
+
|
|
6
|
+
export class MetadataArray {
|
|
7
|
+
public readonly name: string;
|
|
8
|
+
public readonly value: Metadata;
|
|
9
|
+
public readonly nullables: boolean[];
|
|
10
|
+
public readonly recursive: boolean;
|
|
11
|
+
public readonly index: number | null;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @hidden
|
|
15
|
+
*/
|
|
16
|
+
private constructor(props: ClassProperties<MetadataArray>) {
|
|
17
|
+
this.name = props.name;
|
|
18
|
+
this.value = props.value;
|
|
19
|
+
this.index = props.index;
|
|
20
|
+
this.recursive = props.recursive;
|
|
21
|
+
this.nullables = props.nullables;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
public static _From_without_value(
|
|
28
|
+
props: Omit<IMetadataArray, "value">,
|
|
29
|
+
): MetadataArray {
|
|
30
|
+
return this.create({
|
|
31
|
+
name: props.name,
|
|
32
|
+
value: null!,
|
|
33
|
+
index: props.index,
|
|
34
|
+
recursive: props.recursive,
|
|
35
|
+
nullables: props.nullables,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
public static create(props: ClassProperties<MetadataArray>): MetadataArray {
|
|
43
|
+
return new MetadataArray(props);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public toJSON(): IMetadataArray {
|
|
47
|
+
return {
|
|
48
|
+
name: this.name,
|
|
49
|
+
value: this.value.toJSON(),
|
|
50
|
+
nullables: this.nullables,
|
|
51
|
+
recursive: this.recursive,
|
|
52
|
+
index: this.index,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IMetadataConstant } from "./IMetadataConstant";
|
|
2
|
-
|
|
3
|
-
export type MetadataConstant = IMetadataConstant;
|
|
1
|
+
import { IMetadataConstant } from "./IMetadataConstant";
|
|
2
|
+
|
|
3
|
+
export type MetadataConstant = IMetadataConstant;
|
|
@@ -1,129 +1,129 @@
|
|
|
1
|
-
import { ClassProperties } from "../typings/ClassProperties";
|
|
2
|
-
|
|
3
|
-
import { IJsDocTagInfo } from "./IJsDocTagInfo";
|
|
4
|
-
import { IMetadataObject } from "./IMetadataObject";
|
|
5
|
-
import { MetadataProperty } from "./MetadataProperty";
|
|
6
|
-
|
|
7
|
-
export class MetadataObject {
|
|
8
|
-
public readonly name: string;
|
|
9
|
-
public readonly properties: Array<MetadataProperty>;
|
|
10
|
-
public readonly description: string | undefined;
|
|
11
|
-
public readonly jsDocTags: IJsDocTagInfo[];
|
|
12
|
-
|
|
13
|
-
public readonly index: number;
|
|
14
|
-
public validated: boolean;
|
|
15
|
-
public recursive: boolean;
|
|
16
|
-
public nullables: boolean[] = [];
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
public tagged_: boolean = false;
|
|
22
|
-
|
|
23
|
-
/* -----------------------------------------------------------
|
|
24
|
-
CONSTRUCTORS
|
|
25
|
-
----------------------------------------------------------- */
|
|
26
|
-
/**
|
|
27
|
-
* @hidden
|
|
28
|
-
*/
|
|
29
|
-
private constructor(
|
|
30
|
-
props: Omit<ClassProperties<MetadataObject>, "tagged_">,
|
|
31
|
-
) {
|
|
32
|
-
this.name = props.name;
|
|
33
|
-
this.properties = props.properties;
|
|
34
|
-
this.description = props.description;
|
|
35
|
-
this.jsDocTags = props.jsDocTags;
|
|
36
|
-
|
|
37
|
-
this.index = props.index;
|
|
38
|
-
this.validated = props.validated;
|
|
39
|
-
this.recursive = props.recursive;
|
|
40
|
-
this.nullables = [];
|
|
41
|
-
|
|
42
|
-
this.tagged_ = false;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* @internal
|
|
47
|
-
*/
|
|
48
|
-
public static create(
|
|
49
|
-
props: Omit<ClassProperties<MetadataObject>, "tagged_">,
|
|
50
|
-
) {
|
|
51
|
-
return new MetadataObject(props);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @internal
|
|
56
|
-
*/
|
|
57
|
-
public static _From_without_properties(
|
|
58
|
-
obj: IMetadataObject,
|
|
59
|
-
): MetadataObject {
|
|
60
|
-
return this.create({
|
|
61
|
-
name: obj.name,
|
|
62
|
-
properties: [],
|
|
63
|
-
description: obj.description,
|
|
64
|
-
jsDocTags: obj.jsDocTags,
|
|
65
|
-
|
|
66
|
-
index: obj.index,
|
|
67
|
-
validated: obj.validated,
|
|
68
|
-
recursive: obj.recursive,
|
|
69
|
-
nullables: obj.nullables.slice(),
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* @internal
|
|
75
|
-
*/
|
|
76
|
-
public _Is_simple(level: number = 0): boolean {
|
|
77
|
-
return (
|
|
78
|
-
this.recursive === false &&
|
|
79
|
-
this.properties.length < 10 &&
|
|
80
|
-
this.properties.every(
|
|
81
|
-
(property) =>
|
|
82
|
-
property.key.isSoleLiteral() &&
|
|
83
|
-
property.value.size() === 1 &&
|
|
84
|
-
property.value.isRequired() === true &&
|
|
85
|
-
property.value.nullable === false &&
|
|
86
|
-
(property.value.atomics.length === 1 ||
|
|
87
|
-
(level < 1 &&
|
|
88
|
-
property.value.objects.length === 1 &&
|
|
89
|
-
property.value.objects[0]!._Is_simple(level + 1))),
|
|
90
|
-
)
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
public toJSON(): IMetadataObject {
|
|
95
|
-
return {
|
|
96
|
-
name: this.name,
|
|
97
|
-
properties: this.properties.map((property) => property.toJSON()),
|
|
98
|
-
description: this.description,
|
|
99
|
-
jsDocTags: this.jsDocTags,
|
|
100
|
-
|
|
101
|
-
index: this.index,
|
|
102
|
-
validated: this.validated,
|
|
103
|
-
recursive: this.recursive,
|
|
104
|
-
nullables: this.nullables.slice(),
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* @internal
|
|
111
|
-
*/
|
|
112
|
-
export namespace MetadataObject {
|
|
113
|
-
export const intersects = (x: MetadataObject, y: MetadataObject): boolean =>
|
|
114
|
-
x.properties.some(
|
|
115
|
-
(prop) =>
|
|
116
|
-
y.properties.find(
|
|
117
|
-
(oppo) => prop.key.getName() === oppo.key.getName(),
|
|
118
|
-
) !== undefined,
|
|
119
|
-
);
|
|
120
|
-
|
|
121
|
-
export const covers = (x: MetadataObject, y: MetadataObject): boolean =>
|
|
122
|
-
x.properties.length >= y.properties.length &&
|
|
123
|
-
x.properties.every(
|
|
124
|
-
(prop) =>
|
|
125
|
-
y.properties.find(
|
|
126
|
-
(oppo) => prop.key.getName() === oppo.key.getName(),
|
|
127
|
-
) !== undefined,
|
|
128
|
-
);
|
|
129
|
-
}
|
|
1
|
+
import { ClassProperties } from "../typings/ClassProperties";
|
|
2
|
+
|
|
3
|
+
import { IJsDocTagInfo } from "./IJsDocTagInfo";
|
|
4
|
+
import { IMetadataObject } from "./IMetadataObject";
|
|
5
|
+
import { MetadataProperty } from "./MetadataProperty";
|
|
6
|
+
|
|
7
|
+
export class MetadataObject {
|
|
8
|
+
public readonly name: string;
|
|
9
|
+
public readonly properties: Array<MetadataProperty>;
|
|
10
|
+
public readonly description: string | undefined;
|
|
11
|
+
public readonly jsDocTags: IJsDocTagInfo[];
|
|
12
|
+
|
|
13
|
+
public readonly index: number;
|
|
14
|
+
public validated: boolean;
|
|
15
|
+
public recursive: boolean;
|
|
16
|
+
public nullables: boolean[] = [];
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
public tagged_: boolean = false;
|
|
22
|
+
|
|
23
|
+
/* -----------------------------------------------------------
|
|
24
|
+
CONSTRUCTORS
|
|
25
|
+
----------------------------------------------------------- */
|
|
26
|
+
/**
|
|
27
|
+
* @hidden
|
|
28
|
+
*/
|
|
29
|
+
private constructor(
|
|
30
|
+
props: Omit<ClassProperties<MetadataObject>, "tagged_">,
|
|
31
|
+
) {
|
|
32
|
+
this.name = props.name;
|
|
33
|
+
this.properties = props.properties;
|
|
34
|
+
this.description = props.description;
|
|
35
|
+
this.jsDocTags = props.jsDocTags;
|
|
36
|
+
|
|
37
|
+
this.index = props.index;
|
|
38
|
+
this.validated = props.validated;
|
|
39
|
+
this.recursive = props.recursive;
|
|
40
|
+
this.nullables = [];
|
|
41
|
+
|
|
42
|
+
this.tagged_ = false;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
public static create(
|
|
49
|
+
props: Omit<ClassProperties<MetadataObject>, "tagged_">,
|
|
50
|
+
) {
|
|
51
|
+
return new MetadataObject(props);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
public static _From_without_properties(
|
|
58
|
+
obj: IMetadataObject,
|
|
59
|
+
): MetadataObject {
|
|
60
|
+
return this.create({
|
|
61
|
+
name: obj.name,
|
|
62
|
+
properties: [],
|
|
63
|
+
description: obj.description,
|
|
64
|
+
jsDocTags: obj.jsDocTags,
|
|
65
|
+
|
|
66
|
+
index: obj.index,
|
|
67
|
+
validated: obj.validated,
|
|
68
|
+
recursive: obj.recursive,
|
|
69
|
+
nullables: obj.nullables.slice(),
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
76
|
+
public _Is_simple(level: number = 0): boolean {
|
|
77
|
+
return (
|
|
78
|
+
this.recursive === false &&
|
|
79
|
+
this.properties.length < 10 &&
|
|
80
|
+
this.properties.every(
|
|
81
|
+
(property) =>
|
|
82
|
+
property.key.isSoleLiteral() &&
|
|
83
|
+
property.value.size() === 1 &&
|
|
84
|
+
property.value.isRequired() === true &&
|
|
85
|
+
property.value.nullable === false &&
|
|
86
|
+
(property.value.atomics.length === 1 ||
|
|
87
|
+
(level < 1 &&
|
|
88
|
+
property.value.objects.length === 1 &&
|
|
89
|
+
property.value.objects[0]!._Is_simple(level + 1))),
|
|
90
|
+
)
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
public toJSON(): IMetadataObject {
|
|
95
|
+
return {
|
|
96
|
+
name: this.name,
|
|
97
|
+
properties: this.properties.map((property) => property.toJSON()),
|
|
98
|
+
description: this.description,
|
|
99
|
+
jsDocTags: this.jsDocTags,
|
|
100
|
+
|
|
101
|
+
index: this.index,
|
|
102
|
+
validated: this.validated,
|
|
103
|
+
recursive: this.recursive,
|
|
104
|
+
nullables: this.nullables.slice(),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* @internal
|
|
111
|
+
*/
|
|
112
|
+
export namespace MetadataObject {
|
|
113
|
+
export const intersects = (x: MetadataObject, y: MetadataObject): boolean =>
|
|
114
|
+
x.properties.some(
|
|
115
|
+
(prop) =>
|
|
116
|
+
y.properties.find(
|
|
117
|
+
(oppo) => prop.key.getName() === oppo.key.getName(),
|
|
118
|
+
) !== undefined,
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
export const covers = (x: MetadataObject, y: MetadataObject): boolean =>
|
|
122
|
+
x.properties.length >= y.properties.length &&
|
|
123
|
+
x.properties.every(
|
|
124
|
+
(prop) =>
|
|
125
|
+
y.properties.find(
|
|
126
|
+
(oppo) => prop.key.getName() === oppo.key.getName(),
|
|
127
|
+
) !== undefined,
|
|
128
|
+
);
|
|
129
|
+
}
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import { ClassProperties } from "../typings/ClassProperties";
|
|
2
|
-
|
|
3
|
-
import { IJsDocTagInfo } from "./IJsDocTagInfo";
|
|
4
|
-
import { IMetadataDictionary } from "./IMetadataDictionary";
|
|
5
|
-
import { IMetadataProperty } from "./IMetadataProperty";
|
|
6
|
-
import { IMetadataTag } from "./IMetadataTag";
|
|
7
|
-
import { Metadata } from "./Metadata";
|
|
8
|
-
|
|
9
|
-
export class MetadataProperty {
|
|
10
|
-
public readonly key: Metadata;
|
|
11
|
-
public readonly value: Metadata;
|
|
12
|
-
public readonly description: string | null;
|
|
13
|
-
public readonly tags: IMetadataTag[];
|
|
14
|
-
public readonly jsDocTags: IJsDocTagInfo[];
|
|
15
|
-
|
|
16
|
-
/* -----------------------------------------------------------
|
|
17
|
-
CONSTRUCTORS
|
|
18
|
-
----------------------------------------------------------- */
|
|
19
|
-
/**
|
|
20
|
-
* @hidden
|
|
21
|
-
*/
|
|
22
|
-
private constructor(props: ClassProperties<MetadataProperty>) {
|
|
23
|
-
this.key = props.key;
|
|
24
|
-
this.value = props.value;
|
|
25
|
-
this.description = props.description;
|
|
26
|
-
this.tags = props.tags;
|
|
27
|
-
this.jsDocTags = props.jsDocTags;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @internal
|
|
32
|
-
*/
|
|
33
|
-
public static create(
|
|
34
|
-
props: ClassProperties<MetadataProperty>,
|
|
35
|
-
): MetadataProperty {
|
|
36
|
-
return new MetadataProperty(props);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* @internal
|
|
41
|
-
*/
|
|
42
|
-
public static _From(
|
|
43
|
-
property: IMetadataProperty,
|
|
44
|
-
dict: IMetadataDictionary,
|
|
45
|
-
) {
|
|
46
|
-
return this.create({
|
|
47
|
-
key: Metadata._From(property.key, dict),
|
|
48
|
-
value: Metadata._From(property.value, dict),
|
|
49
|
-
description: property.description,
|
|
50
|
-
tags: property.tags.slice(),
|
|
51
|
-
jsDocTags: property.jsDocTags.slice(),
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
public toJSON(): IMetadataProperty {
|
|
56
|
-
return {
|
|
57
|
-
key: this.key.toJSON(),
|
|
58
|
-
value: this.value.toJSON(),
|
|
59
|
-
description: this.description,
|
|
60
|
-
tags: this.tags,
|
|
61
|
-
jsDocTags: this.jsDocTags,
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
}
|
|
1
|
+
import { ClassProperties } from "../typings/ClassProperties";
|
|
2
|
+
|
|
3
|
+
import { IJsDocTagInfo } from "./IJsDocTagInfo";
|
|
4
|
+
import { IMetadataDictionary } from "./IMetadataDictionary";
|
|
5
|
+
import { IMetadataProperty } from "./IMetadataProperty";
|
|
6
|
+
import { IMetadataTag } from "./IMetadataTag";
|
|
7
|
+
import { Metadata } from "./Metadata";
|
|
8
|
+
|
|
9
|
+
export class MetadataProperty {
|
|
10
|
+
public readonly key: Metadata;
|
|
11
|
+
public readonly value: Metadata;
|
|
12
|
+
public readonly description: string | null;
|
|
13
|
+
public readonly tags: IMetadataTag[];
|
|
14
|
+
public readonly jsDocTags: IJsDocTagInfo[];
|
|
15
|
+
|
|
16
|
+
/* -----------------------------------------------------------
|
|
17
|
+
CONSTRUCTORS
|
|
18
|
+
----------------------------------------------------------- */
|
|
19
|
+
/**
|
|
20
|
+
* @hidden
|
|
21
|
+
*/
|
|
22
|
+
private constructor(props: ClassProperties<MetadataProperty>) {
|
|
23
|
+
this.key = props.key;
|
|
24
|
+
this.value = props.value;
|
|
25
|
+
this.description = props.description;
|
|
26
|
+
this.tags = props.tags;
|
|
27
|
+
this.jsDocTags = props.jsDocTags;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
public static create(
|
|
34
|
+
props: ClassProperties<MetadataProperty>,
|
|
35
|
+
): MetadataProperty {
|
|
36
|
+
return new MetadataProperty(props);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
public static _From(
|
|
43
|
+
property: IMetadataProperty,
|
|
44
|
+
dict: IMetadataDictionary,
|
|
45
|
+
) {
|
|
46
|
+
return this.create({
|
|
47
|
+
key: Metadata._From(property.key, dict),
|
|
48
|
+
value: Metadata._From(property.value, dict),
|
|
49
|
+
description: property.description,
|
|
50
|
+
tags: property.tags.slice(),
|
|
51
|
+
jsDocTags: property.jsDocTags.slice(),
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
public toJSON(): IMetadataProperty {
|
|
56
|
+
return {
|
|
57
|
+
key: this.key.toJSON(),
|
|
58
|
+
value: this.value.toJSON(),
|
|
59
|
+
description: this.description,
|
|
60
|
+
tags: this.tags,
|
|
61
|
+
jsDocTags: this.jsDocTags,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}
|