typia 3.7.0-dev.20230310 → 3.7.0-dev.20230331
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/README.md +16 -45
- package/lib/IRandomGenerator.d.ts +2 -1
- package/lib/executable/TypiaSetupWizard.js +12 -2
- package/lib/executable/TypiaSetupWizard.js.map +1 -1
- package/lib/factories/MetadataCollection.d.ts +9 -1
- package/lib/factories/MetadataCollection.js +75 -2
- package/lib/factories/MetadataCollection.js.map +1 -1
- package/lib/factories/MetadataTagFactory.js +151 -132
- package/lib/factories/MetadataTagFactory.js.map +1 -1
- package/lib/factories/TypeFactory.js +1 -1
- package/lib/factories/TypeFactory.js.map +1 -1
- package/lib/factories/TypiaFileFactory.js +61 -54
- package/lib/factories/TypiaFileFactory.js.map +1 -1
- package/lib/functional/$dictionary.d.ts +1 -0
- package/lib/functional/$dictionary.js +14 -0
- package/lib/functional/$dictionary.js.map +1 -0
- package/lib/functional/$is_custom.d.ts +2 -0
- package/lib/functional/$is_custom.js +12 -0
- package/lib/functional/$is_custom.js.map +1 -0
- package/lib/functional/$is_date.d.ts +1 -0
- package/lib/functional/$is_date.js +9 -0
- package/lib/functional/$is_date.js.map +1 -0
- package/lib/functional/$is_datetime.d.ts +1 -0
- package/lib/functional/$is_datetime.js +8 -0
- package/lib/functional/$is_datetime.js.map +1 -0
- package/lib/functional/Namespace.js +6 -0
- package/lib/functional/Namespace.js.map +1 -1
- package/lib/metadata/IMetadataTag.d.ts +30 -38
- package/lib/metadata/Metadata.js +2 -2
- package/lib/metadata/Metadata.js.map +1 -1
- package/lib/module.d.ts +25 -2
- package/lib/module.js +12 -5
- package/lib/module.js.map +1 -1
- package/lib/programmers/CheckerProgrammer.d.ts +2 -2
- package/lib/programmers/CheckerProgrammer.js +22 -22
- package/lib/programmers/CheckerProgrammer.js.map +1 -1
- package/lib/programmers/CloneProgrammer.js +2 -2
- package/lib/programmers/CloneProgrammer.js.map +1 -1
- package/lib/programmers/FeatureProgrammer.d.ts +3 -2
- package/lib/programmers/FeatureProgrammer.js +5 -5
- package/lib/programmers/FeatureProgrammer.js.map +1 -1
- package/lib/programmers/IsProgrammer.d.ts +1 -1
- package/lib/programmers/IsProgrammer.js +2 -2
- package/lib/programmers/IsProgrammer.js.map +1 -1
- package/lib/programmers/PruneProgrammer.js +2 -2
- package/lib/programmers/PruneProgrammer.js.map +1 -1
- package/lib/programmers/RandomProgrammer.js +1 -2
- package/lib/programmers/RandomProgrammer.js.map +1 -1
- package/lib/programmers/StringifyProgrammer.js +6 -6
- package/lib/programmers/StringifyProgrammer.js.map +1 -1
- package/lib/programmers/helpers/UnionExplorer.d.ts +7 -7
- package/lib/programmers/helpers/UnionExplorer.js +6 -6
- package/lib/programmers/helpers/UnionExplorer.js.map +1 -1
- package/lib/programmers/internal/application_object.js +11 -11
- package/lib/programmers/internal/application_object.js.map +1 -1
- package/lib/programmers/internal/application_schema.js +3 -5
- package/lib/programmers/internal/application_schema.js.map +1 -1
- package/lib/programmers/internal/application_string.js +8 -5
- package/lib/programmers/internal/application_string.js.map +1 -1
- package/lib/programmers/internal/check_array.js +36 -7
- package/lib/programmers/internal/check_array.js.map +1 -1
- package/lib/programmers/internal/check_bigint.d.ts +3 -1
- package/lib/programmers/internal/check_bigint.js +90 -61
- package/lib/programmers/internal/check_bigint.js.map +1 -1
- package/lib/programmers/internal/check_custom.d.ts +4 -0
- package/lib/programmers/internal/check_custom.js +30 -0
- package/lib/programmers/internal/check_custom.js.map +1 -0
- package/lib/programmers/internal/check_number.js +104 -75
- package/lib/programmers/internal/check_number.js.map +1 -1
- package/lib/programmers/internal/check_string.js +4 -3
- package/lib/programmers/internal/check_string.js.map +1 -1
- package/lib/programmers/internal/check_union_array_like.d.ts +2 -2
- package/lib/programmers/internal/check_union_array_like.js +4 -4
- package/lib/programmers/internal/check_union_array_like.js.map +1 -1
- package/lib/programmers/internal/check_union_tuple.js +2 -2
- package/lib/programmers/internal/check_union_tuple.js.map +1 -1
- package/lib/programmers/internal/feature_object_entries.js +1 -1
- package/lib/programmers/internal/feature_object_entries.js.map +1 -1
- package/lib/transformers/CallExpressionTransformer.js +1 -3
- package/lib/transformers/CallExpressionTransformer.js.map +1 -1
- package/lib/transformers/features/miscellaneous/ApplicationTransformer.js +3 -1
- package/lib/transformers/features/miscellaneous/ApplicationTransformer.js.map +1 -1
- package/lib/transformers/features/miscellaneous/CreateRandomGenerator.js +1 -1
- package/lib/transformers/features/miscellaneous/CreateRandomGenerator.js.map +1 -1
- package/lib/transformers/features/miscellaneous/RandomTransformer.js +1 -1
- package/lib/transformers/features/miscellaneous/RandomTransformer.js.map +1 -1
- package/lib/transformers/internal/GenericTransformer.js +2 -2
- package/lib/transformers/internal/GenericTransformer.js.map +1 -1
- package/lib/typings/Customizable.d.ts +7 -0
- package/lib/{messages/IProtocolMap.js → typings/Customizable.js} +1 -1
- package/lib/typings/Customizable.js.map +1 -0
- package/lib/utils/RandomGenerator.js +8 -2
- package/lib/utils/RandomGenerator.js.map +1 -1
- package/package.json +10 -9
- package/src/IRandomGenerator.ts +2 -1
- package/src/executable/TypiaSetupWizard.ts +16 -6
- package/src/factories/MetadataCollection.ts +41 -2
- package/src/factories/MetadataTagFactory.ts +186 -149
- package/src/factories/TypeFactory.ts +1 -1
- package/src/factories/TypiaFileFactory.ts +10 -7
- package/src/functional/$dictionary.ts +17 -0
- package/src/functional/$is_custom.ts +14 -0
- package/src/functional/$is_date.ts +4 -0
- package/src/functional/$is_datetime.ts +3 -0
- package/src/functional/Namespace.ts +6 -0
- package/src/metadata/IMetadataTag.ts +46 -70
- package/src/metadata/Metadata.ts +3 -6
- package/src/module.ts +39 -10
- package/src/programmers/CheckerProgrammer.ts +44 -14
- package/src/programmers/CloneProgrammer.ts +2 -0
- package/src/programmers/FeatureProgrammer.ts +12 -5
- package/src/programmers/IsProgrammer.ts +2 -1
- package/src/programmers/PruneProgrammer.ts +2 -0
- package/src/programmers/RandomProgrammer.ts +1 -4
- package/src/programmers/StringifyProgrammer.ts +6 -0
- package/src/programmers/helpers/UnionExplorer.ts +7 -0
- package/src/programmers/internal/application_object.ts +5 -5
- package/src/programmers/internal/application_schema.ts +3 -7
- package/src/programmers/internal/application_string.ts +6 -2
- package/src/programmers/internal/check_array.ts +19 -10
- package/src/programmers/internal/check_bigint.ts +77 -57
- package/src/programmers/internal/check_custom.ts +32 -0
- package/src/programmers/internal/check_number.ts +16 -6
- package/src/programmers/internal/check_string.ts +8 -2
- package/src/programmers/internal/check_union_array_like.ts +5 -0
- package/src/programmers/internal/check_union_tuple.ts +2 -0
- package/src/programmers/internal/feature_object_entries.ts +1 -0
- package/src/transformers/CallExpressionTransformer.ts +9 -16
- package/src/transformers/features/miscellaneous/ApplicationTransformer.ts +3 -1
- package/src/transformers/features/miscellaneous/CreateRandomGenerator.ts +1 -1
- package/src/transformers/features/miscellaneous/RandomTransformer.ts +1 -1
- package/src/transformers/internal/GenericTransformer.ts +2 -2
- package/src/typings/Customizable.ts +7 -0
- package/src/utils/RandomGenerator.ts +8 -2
- package/lib/factories/ProtocolFactory.d.ts +0 -8
- package/lib/factories/ProtocolFactory.js +0 -112
- package/lib/factories/ProtocolFactory.js.map +0 -1
- package/lib/factories/internal/protocols/ProtocolMetadataUtil.d.ts +0 -16
- package/lib/factories/internal/protocols/ProtocolMetadataUtil.js +0 -156
- package/lib/factories/internal/protocols/ProtocolMetadataUtil.js.map +0 -1
- package/lib/factories/internal/protocols/emplace_protocol_object.d.ts +0 -3
- package/lib/factories/internal/protocols/emplace_protocol_object.js +0 -47
- package/lib/factories/internal/protocols/emplace_protocol_object.js.map +0 -1
- package/lib/factories/internal/protocols/emplace_protocol_property.d.ts +0 -4
- package/lib/factories/internal/protocols/emplace_protocol_property.js +0 -20
- package/lib/factories/internal/protocols/emplace_protocol_property.js.map +0 -1
- package/lib/factories/internal/protocols/iterate_protocol_atomic.d.ts +0 -3
- package/lib/factories/internal/protocols/iterate_protocol_atomic.js +0 -69
- package/lib/factories/internal/protocols/iterate_protocol_atomic.js.map +0 -1
- package/lib/factories/internal/protocols/iterate_protocol_constant.d.ts +0 -2
- package/lib/factories/internal/protocols/iterate_protocol_constant.js +0 -30
- package/lib/factories/internal/protocols/iterate_protocol_constant.js.map +0 -1
- package/lib/factories/internal/protocols/iterate_protocol_main.d.ts +0 -3
- package/lib/factories/internal/protocols/iterate_protocol_main.js +0 -17
- package/lib/factories/internal/protocols/iterate_protocol_main.js.map +0 -1
- package/lib/factories/internal/protocols/iterate_protocol_map.d.ts +0 -4
- package/lib/factories/internal/protocols/iterate_protocol_map.js +0 -75
- package/lib/factories/internal/protocols/iterate_protocol_map.js.map +0 -1
- package/lib/factories/internal/protocols/iterate_protocol_metadata.d.ts +0 -5
- package/lib/factories/internal/protocols/iterate_protocol_metadata.js +0 -190
- package/lib/factories/internal/protocols/iterate_protocol_metadata.js.map +0 -1
- package/lib/factories/internal/protocols/iterate_protocol_native.d.ts +0 -2
- package/lib/factories/internal/protocols/iterate_protocol_native.js +0 -33
- package/lib/factories/internal/protocols/iterate_protocol_native.js.map +0 -1
- package/lib/factories/internal/protocols/iterate_protocol_never.d.ts +0 -1
- package/lib/factories/internal/protocols/iterate_protocol_never.js +0 -6
- package/lib/factories/internal/protocols/iterate_protocol_never.js.map +0 -1
- package/lib/factories/internal/protocols/iterate_protocol_object.d.ts +0 -4
- package/lib/factories/internal/protocols/iterate_protocol_object.js +0 -157
- package/lib/factories/internal/protocols/iterate_protocol_object.js.map +0 -1
- package/lib/factories/internal/protocols/iterate_protocol_repeated.d.ts +0 -5
- package/lib/factories/internal/protocols/iterate_protocol_repeated.js +0 -25
- package/lib/factories/internal/protocols/iterate_protocol_repeated.js.map +0 -1
- package/lib/factories/internal/protocols/iterate_protocol_tuple.d.ts +0 -3
- package/lib/factories/internal/protocols/iterate_protocol_tuple.js +0 -46
- package/lib/factories/internal/protocols/iterate_protocol_tuple.js.map +0 -1
- package/lib/functional/$proto_bytes.d.ts +0 -2
- package/lib/functional/$proto_bytes.js +0 -37
- package/lib/functional/$proto_bytes.js.map +0 -1
- package/lib/functional/$proto_field.d.ts +0 -10
- package/lib/functional/$proto_field.js +0 -42
- package/lib/functional/$proto_field.js.map +0 -1
- package/lib/functional/$proto_float.d.ts +0 -4
- package/lib/functional/$proto_float.js +0 -28
- package/lib/functional/$proto_float.js.map +0 -1
- package/lib/functional/$proto_i32.d.ts +0 -2
- package/lib/functional/$proto_i32.js +0 -23
- package/lib/functional/$proto_i32.js.map +0 -1
- package/lib/functional/$proto_i64.d.ts +0 -2
- package/lib/functional/$proto_i64.js +0 -31
- package/lib/functional/$proto_i64.js.map +0 -1
- package/lib/functional/$proto_size.d.ts +0 -6
- package/lib/functional/$proto_size.js +0 -76
- package/lib/functional/$proto_size.js.map +0 -1
- package/lib/functional/$proto_string.d.ts +0 -2
- package/lib/functional/$proto_string.js +0 -34
- package/lib/functional/$proto_string.js.map +0 -1
- package/lib/functional/$varint.d.ts +0 -6
- package/lib/functional/$varint.js +0 -99
- package/lib/functional/$varint.js.map +0 -1
- package/lib/functional/$zigzag.d.ts +0 -4
- package/lib/functional/$zigzag.js +0 -34
- package/lib/functional/$zigzag.js.map +0 -1
- package/lib/messages/IProtocolMap.d.ts +0 -5
- package/lib/messages/IProtocolMap.js.map +0 -1
- package/lib/messages/IProtocolMessage.d.ts +0 -5
- package/lib/messages/IProtocolMessage.js +0 -3
- package/lib/messages/IProtocolMessage.js.map +0 -1
- package/lib/messages/IProtocolProperty.d.ts +0 -12
- package/lib/messages/IProtocolProperty.js +0 -3
- package/lib/messages/IProtocolProperty.js.map +0 -1
- package/lib/programmers/MessageProgrammer.d.ts +0 -5
- package/lib/programmers/MessageProgrammer.js +0 -141
- package/lib/programmers/MessageProgrammer.js.map +0 -1
- package/lib/transformers/features/protocols/MessageTransformer.d.ts +0 -5
- package/lib/transformers/features/protocols/MessageTransformer.js +0 -17
- package/lib/transformers/features/protocols/MessageTransformer.js.map +0 -1
- package/lib/utils/NameEncoder.d.ts +0 -4
- package/lib/utils/NameEncoder.js +0 -89
- package/lib/utils/NameEncoder.js.map +0 -1
- package/src/factories/ProtocolFactory.ts +0 -79
- package/src/factories/internal/protocols/ProtocolMetadataUtil.ts +0 -163
- package/src/factories/internal/protocols/emplace_protocol_object.ts +0 -25
- package/src/factories/internal/protocols/emplace_protocol_property.ts +0 -12
- package/src/factories/internal/protocols/iterate_protocol_atomic.ts +0 -34
- package/src/factories/internal/protocols/iterate_protocol_constant.ts +0 -27
- package/src/factories/internal/protocols/iterate_protocol_main.ts +0 -19
- package/src/factories/internal/protocols/iterate_protocol_map.ts +0 -58
- package/src/factories/internal/protocols/iterate_protocol_metadata.ts +0 -96
- package/src/factories/internal/protocols/iterate_protocol_native.ts +0 -34
- package/src/factories/internal/protocols/iterate_protocol_never.ts +0 -1
- package/src/factories/internal/protocols/iterate_protocol_object.ts +0 -110
- package/src/factories/internal/protocols/iterate_protocol_repeated.ts +0 -34
- package/src/factories/internal/protocols/iterate_protocol_tuple.ts +0 -29
- package/src/functional/$proto_bytes.ts +0 -25
- package/src/functional/$proto_field.ts +0 -30
- package/src/functional/$proto_float.ts +0 -37
- package/src/functional/$proto_i32.ts +0 -29
- package/src/functional/$proto_i64.ts +0 -37
- package/src/functional/$proto_size.ts +0 -82
- package/src/functional/$proto_string.ts +0 -24
- package/src/functional/$varint.ts +0 -130
- package/src/functional/$zigzag.ts +0 -39
- package/src/messages/IProtocolMap.ts +0 -5
- package/src/messages/IProtocolMessage.ts +0 -6
- package/src/messages/IProtocolProperty.ts +0 -13
- package/src/programmers/MessageProgrammer.ts +0 -126
- package/src/transformers/features/protocols/MessageTransformer.ts +0 -32
- package/src/utils/NameEncoder.ts +0 -32
|
@@ -2,21 +2,30 @@ import ts from "typescript";
|
|
|
2
2
|
|
|
3
3
|
import { ExpressionFactory } from "../../factories/ExpressionFactory";
|
|
4
4
|
|
|
5
|
+
import { IJsDocTagInfo } from "../../metadata/IJsDocTagInfo";
|
|
5
6
|
import { IMetadataTag } from "../../metadata/IMetadataTag";
|
|
6
7
|
|
|
8
|
+
import { FunctionImporter } from "../helpers/FunctionImporeter";
|
|
7
9
|
import { check_array_length } from "./check_array_length";
|
|
10
|
+
import { check_custom } from "./check_custom";
|
|
8
11
|
|
|
9
12
|
/**
|
|
10
13
|
* @internal
|
|
11
14
|
*/
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
export const check_array =
|
|
16
|
+
(importer: FunctionImporter) =>
|
|
17
|
+
(
|
|
18
|
+
input: ts.Expression,
|
|
19
|
+
metaTags: IMetadataTag[],
|
|
20
|
+
jsDocTags: IJsDocTagInfo[],
|
|
21
|
+
): ts.Expression => {
|
|
22
|
+
const conditions: ts.Expression[] = [ExpressionFactory.isArray(input)];
|
|
17
23
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
const length: ts.Expression | null = check_array_length(
|
|
25
|
+
input,
|
|
26
|
+
metaTags,
|
|
27
|
+
);
|
|
28
|
+
if (length !== null) conditions.push(length);
|
|
29
|
+
conditions.push(...check_custom("array")(importer)(input, jsDocTags));
|
|
30
|
+
return conditions.reduce((x, y) => ts.factory.createLogicalAnd(x, y));
|
|
31
|
+
};
|
|
@@ -1,64 +1,84 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
|
|
3
|
+
import { IJsDocTagInfo } from "../../metadata/IJsDocTagInfo";
|
|
3
4
|
import { IMetadataTag } from "../../metadata/IMetadataTag";
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
ts.factory.createIdentifier(`${Math.floor(value)}n`);
|
|
6
|
+
import { FunctionImporter } from "../helpers/FunctionImporeter";
|
|
7
|
+
import { check_custom } from "./check_custom";
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
export const check_bigint =
|
|
10
|
+
(importer: FunctionImporter) =>
|
|
11
|
+
(
|
|
12
|
+
input: ts.Expression,
|
|
13
|
+
metaTags: IMetadataTag[],
|
|
14
|
+
jsDocTags: IJsDocTagInfo[],
|
|
15
|
+
): ts.Expression => {
|
|
16
|
+
const caster = (value: number) =>
|
|
17
|
+
ts.factory.createIdentifier(`${Math.floor(value)}n`);
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
ts.factory.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
),
|
|
25
|
-
);
|
|
26
|
-
else if (tag.kind === "step") {
|
|
27
|
-
const modulo = () =>
|
|
28
|
-
ts.factory.createModulo(input, caster(tag.value));
|
|
29
|
-
const minimum = (() => {
|
|
30
|
-
for (const tag of tagList)
|
|
31
|
-
if (tag.kind === "minimum") return tag.value;
|
|
32
|
-
else if (tag.kind === "exclusiveMinimum") return tag.value;
|
|
33
|
-
return undefined;
|
|
34
|
-
})();
|
|
35
|
-
conditions.push(
|
|
36
|
-
ts.factory.createStrictEquality(
|
|
37
|
-
caster(0),
|
|
38
|
-
minimum !== undefined
|
|
39
|
-
? ts.factory.createSubtract(modulo(), caster(minimum))
|
|
40
|
-
: modulo(),
|
|
41
|
-
),
|
|
42
|
-
);
|
|
43
|
-
} else if (tag.kind === "minimum")
|
|
44
|
-
conditions.push(
|
|
45
|
-
ts.factory.createLessThanEquals(caster(tag.value), input),
|
|
46
|
-
);
|
|
47
|
-
else if (tag.kind === "maximum")
|
|
48
|
-
conditions.push(
|
|
49
|
-
ts.factory.createGreaterThanEquals(caster(tag.value), input),
|
|
50
|
-
);
|
|
51
|
-
else if (tag.kind === "exclusiveMinimum")
|
|
52
|
-
conditions.push(
|
|
53
|
-
ts.factory.createLessThan(caster(tag.value), input),
|
|
54
|
-
);
|
|
55
|
-
else if (tag.kind === "exclusiveMaximum")
|
|
56
|
-
conditions.push(
|
|
57
|
-
ts.factory.createGreaterThan(caster(tag.value), input),
|
|
58
|
-
);
|
|
19
|
+
// TYPEOF STATEMENT
|
|
20
|
+
const conditions: ts.Expression[] = [
|
|
21
|
+
ts.factory.createStrictEquality(
|
|
22
|
+
ts.factory.createStringLiteral("bigint"),
|
|
23
|
+
ts.factory.createTypeOfExpression(input),
|
|
24
|
+
),
|
|
25
|
+
];
|
|
59
26
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
27
|
+
// TAG (RANGE)
|
|
28
|
+
for (const tag of metaTags)
|
|
29
|
+
if (tag.kind === "multipleOf")
|
|
30
|
+
conditions.push(
|
|
31
|
+
ts.factory.createStrictEquality(
|
|
32
|
+
caster(0),
|
|
33
|
+
ts.factory.createModulo(input, caster(tag.value)),
|
|
34
|
+
),
|
|
35
|
+
);
|
|
36
|
+
else if (tag.kind === "step") {
|
|
37
|
+
const modulo = () =>
|
|
38
|
+
ts.factory.createModulo(input, caster(tag.value));
|
|
39
|
+
const minimum = (() => {
|
|
40
|
+
for (const tag of metaTags)
|
|
41
|
+
if (tag.kind === "minimum") return tag.value;
|
|
42
|
+
else if (tag.kind === "exclusiveMinimum")
|
|
43
|
+
return tag.value;
|
|
44
|
+
return undefined;
|
|
45
|
+
})();
|
|
46
|
+
conditions.push(
|
|
47
|
+
ts.factory.createStrictEquality(
|
|
48
|
+
caster(0),
|
|
49
|
+
minimum !== undefined
|
|
50
|
+
? ts.factory.createSubtract(
|
|
51
|
+
modulo(),
|
|
52
|
+
caster(minimum),
|
|
53
|
+
)
|
|
54
|
+
: modulo(),
|
|
55
|
+
),
|
|
56
|
+
);
|
|
57
|
+
} else if (tag.kind === "minimum")
|
|
58
|
+
conditions.push(
|
|
59
|
+
ts.factory.createLessThanEquals(caster(tag.value), input),
|
|
60
|
+
);
|
|
61
|
+
else if (tag.kind === "maximum")
|
|
62
|
+
conditions.push(
|
|
63
|
+
ts.factory.createGreaterThanEquals(
|
|
64
|
+
caster(tag.value),
|
|
65
|
+
input,
|
|
66
|
+
),
|
|
67
|
+
);
|
|
68
|
+
else if (tag.kind === "exclusiveMinimum")
|
|
69
|
+
conditions.push(
|
|
70
|
+
ts.factory.createLessThan(caster(tag.value), input),
|
|
71
|
+
);
|
|
72
|
+
else if (tag.kind === "exclusiveMaximum")
|
|
73
|
+
conditions.push(
|
|
74
|
+
ts.factory.createGreaterThan(caster(tag.value), input),
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
// CUSTOM TAGS
|
|
78
|
+
conditions.push(...check_custom("bigint")(importer)(input, jsDocTags));
|
|
79
|
+
|
|
80
|
+
// COMBINATION
|
|
81
|
+
return conditions.length === 1
|
|
82
|
+
? conditions[0]!
|
|
83
|
+
: conditions.reduce((x, y) => ts.factory.createLogicalAnd(x, y));
|
|
84
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
|
|
3
|
+
import { MetadataTagFactory } from "../../factories/MetadataTagFactory";
|
|
4
|
+
|
|
5
|
+
import { IJsDocTagInfo } from "../../metadata/IJsDocTagInfo";
|
|
6
|
+
|
|
7
|
+
import { FunctionImporter } from "../helpers/FunctionImporeter";
|
|
8
|
+
|
|
9
|
+
export const check_custom =
|
|
10
|
+
(type: string) =>
|
|
11
|
+
(importer: FunctionImporter) =>
|
|
12
|
+
(input: ts.Expression, jsDocTags: IJsDocTagInfo[]) =>
|
|
13
|
+
jsDocTags
|
|
14
|
+
.filter(
|
|
15
|
+
(tag) =>
|
|
16
|
+
tag.name !== "random" &&
|
|
17
|
+
MetadataTagFactory._PARSER[tag.name] === undefined,
|
|
18
|
+
)
|
|
19
|
+
.map((tag) =>
|
|
20
|
+
ts.factory.createCallExpression(
|
|
21
|
+
importer.use("is_custom"),
|
|
22
|
+
undefined,
|
|
23
|
+
[
|
|
24
|
+
ts.factory.createStringLiteral(tag.name),
|
|
25
|
+
ts.factory.createStringLiteral(type),
|
|
26
|
+
ts.factory.createStringLiteral(
|
|
27
|
+
tag.text?.[0]?.text ?? "",
|
|
28
|
+
),
|
|
29
|
+
input,
|
|
30
|
+
],
|
|
31
|
+
),
|
|
32
|
+
);
|
|
@@ -4,14 +4,21 @@ import { IMetadataTag } from "../../metadata/IMetadataTag";
|
|
|
4
4
|
|
|
5
5
|
import { IProject } from "../../transformers/IProject";
|
|
6
6
|
|
|
7
|
+
import { FunctionImporter } from "../helpers/FunctionImporeter";
|
|
7
8
|
import { OptionPredicator } from "../helpers/OptionPredicator";
|
|
9
|
+
import { check_custom } from "./check_custom";
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* @internal
|
|
11
13
|
*/
|
|
12
14
|
export const check_number =
|
|
13
15
|
({ options }: IProject, numeric: boolean) =>
|
|
14
|
-
(
|
|
16
|
+
(importer: FunctionImporter) =>
|
|
17
|
+
(
|
|
18
|
+
input: ts.Expression,
|
|
19
|
+
metaTags: IMetadataTag[],
|
|
20
|
+
jsDocTags: ts.JSDocTagInfo[],
|
|
21
|
+
) => {
|
|
15
22
|
// TYPEOF STATEMENT
|
|
16
23
|
const conditions: ts.Expression[] = [
|
|
17
24
|
ts.factory.createStrictEquality(
|
|
@@ -22,16 +29,16 @@ export const check_number =
|
|
|
22
29
|
|
|
23
30
|
// CHECK FINITE AND NAN
|
|
24
31
|
const finite: boolean =
|
|
25
|
-
(!!
|
|
32
|
+
(!!metaTags.find(
|
|
26
33
|
(tag) =>
|
|
27
34
|
tag.kind === "minimum" || tag.kind === "exclusiveMinimum",
|
|
28
35
|
) &&
|
|
29
|
-
!!
|
|
36
|
+
!!metaTags.find(
|
|
30
37
|
(tag) =>
|
|
31
38
|
tag.kind === "maximum" ||
|
|
32
39
|
tag.kind === "exclusiveMaximum",
|
|
33
40
|
)) ||
|
|
34
|
-
!!
|
|
41
|
+
!!metaTags.find(
|
|
35
42
|
(tag) => tag.kind === "step" || tag.kind === "multipleOf",
|
|
36
43
|
);
|
|
37
44
|
|
|
@@ -56,7 +63,7 @@ export const check_number =
|
|
|
56
63
|
);
|
|
57
64
|
|
|
58
65
|
// TAG (RANGE)
|
|
59
|
-
for (const tag of
|
|
66
|
+
for (const tag of metaTags)
|
|
60
67
|
if (tag.kind === "type") {
|
|
61
68
|
conditions.push(
|
|
62
69
|
ts.factory.createStrictEquality(
|
|
@@ -92,7 +99,7 @@ export const check_number =
|
|
|
92
99
|
ts.factory.createNumericLiteral(tag.value),
|
|
93
100
|
);
|
|
94
101
|
const minimum = (() => {
|
|
95
|
-
for (const tag of
|
|
102
|
+
for (const tag of metaTags)
|
|
96
103
|
if (tag.kind === "minimum") return tag.value;
|
|
97
104
|
else if (tag.kind === "exclusiveMinimum")
|
|
98
105
|
return tag.value;
|
|
@@ -138,6 +145,9 @@ export const check_number =
|
|
|
138
145
|
),
|
|
139
146
|
);
|
|
140
147
|
|
|
148
|
+
// CUSTOM TAGS
|
|
149
|
+
conditions.push(...check_custom("number")(importer)(input, jsDocTags));
|
|
150
|
+
|
|
141
151
|
// COMBINATION
|
|
142
152
|
return conditions.length === 1
|
|
143
153
|
? conditions[0]!
|
|
@@ -3,19 +3,25 @@ import ts from "typescript";
|
|
|
3
3
|
import { IMetadataTag } from "../../metadata/IMetadataTag";
|
|
4
4
|
|
|
5
5
|
import { FunctionImporter } from "../helpers/FunctionImporeter";
|
|
6
|
+
import { check_custom } from "./check_custom";
|
|
6
7
|
import { check_string_tags } from "./check_string_tags";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* @internal
|
|
10
11
|
*/
|
|
11
12
|
export function check_string(importer: FunctionImporter) {
|
|
12
|
-
return function (
|
|
13
|
+
return function (
|
|
14
|
+
input: ts.Expression,
|
|
15
|
+
metaTags: IMetadataTag[],
|
|
16
|
+
jsDocTags: ts.JSDocTagInfo[],
|
|
17
|
+
) {
|
|
13
18
|
const conditions: ts.Expression[] = [
|
|
14
19
|
ts.factory.createStrictEquality(
|
|
15
20
|
ts.factory.createStringLiteral("string"),
|
|
16
21
|
ts.factory.createTypeOfExpression(input),
|
|
17
22
|
),
|
|
18
|
-
...check_string_tags(importer)(input,
|
|
23
|
+
...check_string_tags(importer)(input, metaTags),
|
|
24
|
+
...check_custom("string")(importer)(input, jsDocTags),
|
|
19
25
|
];
|
|
20
26
|
return conditions.length === 1
|
|
21
27
|
? conditions[0]!
|
|
@@ -18,6 +18,7 @@ export const check_union_array_like =
|
|
|
18
18
|
targets: T[],
|
|
19
19
|
explore: FeatureProgrammer.IExplore,
|
|
20
20
|
tags: IMetadataTag[],
|
|
21
|
+
jsDocTags: ts.JSDocTagInfo[],
|
|
21
22
|
) => {
|
|
22
23
|
// ONLY ONE TYPE
|
|
23
24
|
if (targets.length === 1)
|
|
@@ -26,6 +27,7 @@ export const check_union_array_like =
|
|
|
26
27
|
targets[0]!,
|
|
27
28
|
explore,
|
|
28
29
|
tags,
|
|
30
|
+
jsDocTags,
|
|
29
31
|
);
|
|
30
32
|
|
|
31
33
|
//----
|
|
@@ -58,6 +60,7 @@ export const check_union_array_like =
|
|
|
58
60
|
postfix: `"[0]"`,
|
|
59
61
|
},
|
|
60
62
|
tags,
|
|
63
|
+
jsDocTags,
|
|
61
64
|
input,
|
|
62
65
|
),
|
|
63
66
|
),
|
|
@@ -80,6 +83,7 @@ export const check_union_array_like =
|
|
|
80
83
|
tracable: true,
|
|
81
84
|
},
|
|
82
85
|
tags,
|
|
86
|
+
jsDocTags,
|
|
83
87
|
),
|
|
84
88
|
),
|
|
85
89
|
]),
|
|
@@ -239,6 +243,7 @@ export namespace check_union_array_like {
|
|
|
239
243
|
target: T,
|
|
240
244
|
explore: FeatureProgrammer.IExplore,
|
|
241
245
|
tags: IMetadataTag[],
|
|
246
|
+
jsDocTags: ts.JSDocTagInfo[],
|
|
242
247
|
array: ts.Expression,
|
|
243
248
|
): ts.Expression;
|
|
244
249
|
decoder: UnionExplorer.Decoder<T>;
|
|
@@ -23,6 +23,7 @@ export const check_union_tuple =
|
|
|
23
23
|
elements: Metadata[],
|
|
24
24
|
explore: CheckerProgrammer.IExplore,
|
|
25
25
|
tags: IMetadataTag[],
|
|
26
|
+
jsDocTags: ts.JSDocTagInfo[],
|
|
26
27
|
array: ts.Expression,
|
|
27
28
|
) =>
|
|
28
29
|
CheckerProgrammer.decode_tuple(project, config, importer, true)(
|
|
@@ -30,4 +31,5 @@ export const check_union_tuple =
|
|
|
30
31
|
elements,
|
|
31
32
|
explore,
|
|
32
33
|
tags,
|
|
34
|
+
jsDocTags,
|
|
33
35
|
);
|
|
@@ -28,7 +28,6 @@ import { CreateIsParseTransformer } from "./features/parsers/CreateIsParseTransf
|
|
|
28
28
|
import { CreateValidateParseTransformer } from "./features/parsers/CreateValidateParseTransformer";
|
|
29
29
|
import { IsParseTransformer } from "./features/parsers/IsParseTransformer";
|
|
30
30
|
import { ValidateParseTransformer } from "./features/parsers/ValidateParseTransformer";
|
|
31
|
-
import { MessageTransformer } from "./features/protocols/MessageTransformer";
|
|
32
31
|
import { AssertStringifyTransformer } from "./features/stringifiers/AssertStringifyTransformer";
|
|
33
32
|
import { CreateAssertStringifyTransformer } from "./features/stringifiers/CreateAssertStringifyTransformer";
|
|
34
33
|
import { CreateIsStringifyTransformer } from "./features/stringifiers/CreateIsStringifyTransformer";
|
|
@@ -95,7 +94,7 @@ const CLI_PATH = path.resolve(
|
|
|
95
94
|
|
|
96
95
|
const FUNCTORS: Record<string, () => Task> = {
|
|
97
96
|
//----
|
|
98
|
-
//
|
|
97
|
+
// SINGLE FUNCTIONS
|
|
99
98
|
//----
|
|
100
99
|
// BASIC VALIDATORS
|
|
101
100
|
assert: () => AssertTransformer.transform(false),
|
|
@@ -108,23 +107,13 @@ const FUNCTORS: Record<string, () => Task> = {
|
|
|
108
107
|
equals: () => IsTransformer.transform(true),
|
|
109
108
|
validateEquals: () => ValidateTransformer.transform(true),
|
|
110
109
|
|
|
111
|
-
|
|
112
|
-
// PROTOCOL BUFFER
|
|
113
|
-
//----
|
|
114
|
-
message: () => MessageTransformer.transform,
|
|
115
|
-
|
|
116
|
-
//----
|
|
117
|
-
// JSON FUNCTIONS
|
|
118
|
-
//----
|
|
119
|
-
// SCHEMA DEFINITION
|
|
120
|
-
application: () => ApplicationTransformer.transform,
|
|
121
|
-
|
|
122
|
-
// PARSER FUNCTIONS
|
|
110
|
+
// PARSE FUNCTIONS
|
|
123
111
|
isParse: () => IsParseTransformer.transform,
|
|
124
112
|
assertParse: () => AssertParseTransformer.transform,
|
|
125
113
|
validateParse: () => ValidateParseTransformer.transform,
|
|
126
114
|
|
|
127
115
|
// STRINGIFY FUNCTIONS
|
|
116
|
+
application: () => ApplicationTransformer.transform,
|
|
128
117
|
stringify: () => StringifyTransformer.transform,
|
|
129
118
|
assertStringify: () => AssertStringifyTransformer.transform,
|
|
130
119
|
isStringify: () => IsStringifyTransformer.transform,
|
|
@@ -147,19 +136,23 @@ const FUNCTORS: Record<string, () => Task> = {
|
|
|
147
136
|
//----
|
|
148
137
|
// FACTORY FUNCTIONS
|
|
149
138
|
//----
|
|
150
|
-
// VALIDATORS
|
|
139
|
+
// BASIC VALIDATORS
|
|
151
140
|
createAssert: () => CreateAssertTransformer.transform(false),
|
|
152
141
|
createAssertType: () => CreateAssertTransformer.transform(false),
|
|
153
142
|
createIs: () => CreateIsTransformer.transform(false),
|
|
154
143
|
createValidate: () => CreateValidateTransformer.transform(false),
|
|
144
|
+
|
|
145
|
+
// STRICT VALIDATORS
|
|
155
146
|
createAssertEquals: () => CreateAssertTransformer.transform(true),
|
|
156
147
|
createEquals: () => CreateIsTransformer.transform(true),
|
|
157
148
|
createValidateEquals: () => CreateValidateTransformer.transform(true),
|
|
158
149
|
|
|
159
|
-
//
|
|
150
|
+
// PARSE FUNCTIONS
|
|
160
151
|
createIsParse: () => CreateIsParseTransformer.transform,
|
|
161
152
|
createAssertParse: () => CreateAssertParseTransformer.transform,
|
|
162
153
|
createValidateParse: () => CreateValidateParseTransformer.transform,
|
|
154
|
+
|
|
155
|
+
// STRINGIFY FUNCTIONS
|
|
163
156
|
createStringify: () => CreateStringifyTransformer.transform,
|
|
164
157
|
createAssertStringify: () => CreateAssertStringifyTransformer.transform,
|
|
165
158
|
createIsStringify: () => CreateIsStringifyTransformer.transform,
|
|
@@ -59,7 +59,9 @@ export namespace ApplicationTransformer {
|
|
|
59
59
|
// GENERATORS
|
|
60
60
|
//----
|
|
61
61
|
// METADATA
|
|
62
|
-
const collection: MetadataCollection = new MetadataCollection(
|
|
62
|
+
const collection: MetadataCollection = new MetadataCollection({
|
|
63
|
+
replace: MetadataCollection.replace,
|
|
64
|
+
});
|
|
63
65
|
const metadatas: Array<Metadata> = types.map((type) =>
|
|
64
66
|
MetadataFactory.generate(checker, collection, type, {
|
|
65
67
|
resolve: true,
|
|
@@ -47,7 +47,7 @@ export namespace GenericTransformer {
|
|
|
47
47
|
programmer(project, modulo)(
|
|
48
48
|
type,
|
|
49
49
|
generic
|
|
50
|
-
? node.
|
|
50
|
+
? node.getFullText().trim()
|
|
51
51
|
: name(project.checker)(type)(node),
|
|
52
52
|
),
|
|
53
53
|
undefined,
|
|
@@ -84,7 +84,7 @@ export namespace GenericTransformer {
|
|
|
84
84
|
);
|
|
85
85
|
|
|
86
86
|
// DO TRANSFORM
|
|
87
|
-
return programmer(project, modulo)(type, node.
|
|
87
|
+
return programmer(project, modulo)(type, node.getFullText().trim());
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
const name =
|
|
@@ -84,7 +84,13 @@ export namespace RandomGenerator {
|
|
|
84
84
|
|
|
85
85
|
export function date(min?: number, max?: number): string {
|
|
86
86
|
min ??= 0;
|
|
87
|
-
max ??= Date.now();
|
|
88
|
-
return new Date(number(min, max)).
|
|
87
|
+
max ??= Date.now() * 2;
|
|
88
|
+
return new Date(number(min, max)).toISOString().substring(0, 10);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function datetime(min?: number, max?: number): string {
|
|
92
|
+
min ??= 0;
|
|
93
|
+
max ??= Date.now() * 2;
|
|
94
|
+
return new Date(number(min, max)).toISOString();
|
|
89
95
|
}
|
|
90
96
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
import { Metadata } from "../metadata/Metadata";
|
|
3
|
-
import { IProtocolMessage } from "../messages/IProtocolMessage";
|
|
4
|
-
import { MetadataCollection } from "./MetadataCollection";
|
|
5
|
-
export declare namespace ProtocolFactory {
|
|
6
|
-
const metadata: (checker: ts.TypeChecker) => (collection: MetadataCollection) => (type: ts.Type) => Metadata;
|
|
7
|
-
const generate: (collection: MetadataCollection) => (dict: Map<string, IProtocolMessage>) => (meta: Metadata) => void;
|
|
8
|
-
}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __values = (this && this.__values) || function(o) {
|
|
3
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
4
|
-
if (m) return m.call(o);
|
|
5
|
-
if (o && typeof o.length === "number") return {
|
|
6
|
-
next: function () {
|
|
7
|
-
if (o && i >= o.length) o = void 0;
|
|
8
|
-
return { value: o && o[i++], done: !o };
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.ProtocolFactory = void 0;
|
|
15
|
-
var MetadataFactory_1 = require("./MetadataFactory");
|
|
16
|
-
var emplace_protocol_object_1 = require("./internal/protocols/emplace_protocol_object");
|
|
17
|
-
var iterate_protocol_main_1 = require("./internal/protocols/iterate_protocol_main");
|
|
18
|
-
var ProtocolFactory;
|
|
19
|
-
(function (ProtocolFactory) {
|
|
20
|
-
ProtocolFactory.metadata = function (checker) {
|
|
21
|
-
return function (collection) {
|
|
22
|
-
return function (type) {
|
|
23
|
-
return MetadataFactory_1.MetadataFactory.generate(checker, collection, type, {
|
|
24
|
-
resolve: false,
|
|
25
|
-
constant: true,
|
|
26
|
-
validate: function (meta) {
|
|
27
|
-
if (meta.any)
|
|
28
|
-
throw new Error("Error on typia.message(): any type is not supported in protocol buffer.");
|
|
29
|
-
else if (meta.functional && meta.size() !== 1)
|
|
30
|
-
throw new Error("Error on typia.message(): functional type is not supported in protocol buffer.");
|
|
31
|
-
else if (meta.objects.find(function (o) { return o.name === "__Main"; }))
|
|
32
|
-
throw new Error("Error on typia.message(): reserved type \"__Main\" has been detected.");
|
|
33
|
-
else if (meta.objects.find(function (o) { return o.name === "__Timestamp"; }))
|
|
34
|
-
throw new Error("Error on typia.message(): reserved type \"__Timestamp\" has been detected.");
|
|
35
|
-
else if (meta.objects.some(function (o) {
|
|
36
|
-
return o.properties.some(function (p) { return !is_atomic_key(p.key); });
|
|
37
|
-
}) ||
|
|
38
|
-
meta.maps.some(function (m) { return !is_atomic_key(m.key); }))
|
|
39
|
-
throw new Error("Error on typia.message(): only atomic key type is supported in protocol buffer.");
|
|
40
|
-
},
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
ProtocolFactory.generate = function (collection) {
|
|
46
|
-
return function (dict) {
|
|
47
|
-
return function (meta) {
|
|
48
|
-
var e_1, _a;
|
|
49
|
-
try {
|
|
50
|
-
for (var _b = __values(collection.objects()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
51
|
-
var obj = _c.value;
|
|
52
|
-
(0, emplace_protocol_object_1.emplace_protocol_object)(dict)(obj);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
56
|
-
finally {
|
|
57
|
-
try {
|
|
58
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
59
|
-
}
|
|
60
|
-
finally { if (e_1) throw e_1.error; }
|
|
61
|
-
}
|
|
62
|
-
(0, iterate_protocol_main_1.iterate_protocol_main)(dict)(meta);
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
var is_atomic_key = function (key) {
|
|
67
|
-
var e_2, _a, e_3, _b;
|
|
68
|
-
if (key.required &&
|
|
69
|
-
key.nullable === false &&
|
|
70
|
-
key.functional === false &&
|
|
71
|
-
key.resolved === null &&
|
|
72
|
-
key.size() ===
|
|
73
|
-
key.atomics.length +
|
|
74
|
-
key.constants
|
|
75
|
-
.map(function (c) { return c.values.length; })
|
|
76
|
-
.reduce(function (a, b) { return a + b; }, 0) +
|
|
77
|
-
key.templates.length) {
|
|
78
|
-
var set = new Set();
|
|
79
|
-
try {
|
|
80
|
-
for (var _c = __values(key.atomics), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
81
|
-
var atomic = _d.value;
|
|
82
|
-
set.add(atomic);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
86
|
-
finally {
|
|
87
|
-
try {
|
|
88
|
-
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
89
|
-
}
|
|
90
|
-
finally { if (e_2) throw e_2.error; }
|
|
91
|
-
}
|
|
92
|
-
try {
|
|
93
|
-
for (var _e = __values(key.constants), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
94
|
-
var constant = _f.value;
|
|
95
|
-
set.add(constant.type);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
99
|
-
finally {
|
|
100
|
-
try {
|
|
101
|
-
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
|
102
|
-
}
|
|
103
|
-
finally { if (e_3) throw e_3.error; }
|
|
104
|
-
}
|
|
105
|
-
if (key.templates.length)
|
|
106
|
-
set.add("string");
|
|
107
|
-
return set.size === 1;
|
|
108
|
-
}
|
|
109
|
-
return false;
|
|
110
|
-
};
|
|
111
|
-
})(ProtocolFactory = exports.ProtocolFactory || (exports.ProtocolFactory = {}));
|
|
112
|
-
//# sourceMappingURL=ProtocolFactory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Prot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