typia 3.6.2 → 3.6.4
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 +2 -1
- package/lib/factories/internal/metadata/emplace_metadata_object.js +8 -7
- package/lib/factories/internal/metadata/emplace_metadata_object.js.map +1 -1
- package/lib/functional/$is_uuid.js +1 -1
- package/lib/functional/$is_uuid.js.map +1 -1
- package/lib/module.d.ts +2 -2
- package/package.json +1 -1
- package/src/executable/setup/ArgumentParser.ts +91 -91
- package/src/executable/setup/FileRetriever.ts +33 -33
- package/src/executable/setup/PackageManager.ts +92 -92
- package/src/executable/setup/PluginConfigurator.ts +99 -99
- package/src/factories/internal/metadata/emplace_metadata_object.ts +142 -140
- package/src/functional/$is_uuid.ts +1 -2
- package/src/module.ts +1946 -1946
- package/src/programmers/AssertCloneProgrammer.ts +70 -70
- package/src/programmers/AssertParseProgrammer.ts +65 -65
- package/src/programmers/AssertProgrammer.ts +232 -232
- package/src/programmers/AssertPruneProgrammer.ts +67 -67
- package/src/programmers/AssertStringifyProgrammer.ts +71 -71
- package/src/programmers/CheckerProgrammer.ts +893 -893
- package/src/programmers/CloneProgrammer.ts +386 -386
- package/src/programmers/FeatureProgrammer.ts +505 -505
- package/src/programmers/IsCloneProgrammer.ts +80 -80
- package/src/programmers/IsParseProgrammer.ts +74 -74
- package/src/programmers/IsPruneProgrammer.ts +75 -75
- package/src/programmers/IsStringifyProgrammer.ts +81 -81
- package/src/programmers/PruneProgrammer.ts +341 -341
- package/src/programmers/RandomProgrammer.ts +391 -391
- package/src/programmers/StringifyProgrammer.ts +795 -795
- package/src/programmers/ValidateCloneProgrammer.ts +90 -90
- package/src/programmers/ValidateParseProgrammer.ts +69 -69
- package/src/programmers/ValidateProgrammer.ts +266 -266
- package/src/programmers/ValidatePruneProgrammer.ts +83 -83
- package/src/programmers/ValidateStringifyProgrammer.ts +89 -89
- 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/CreateRandomGenerator.ts +42 -42
- 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/PruneTransformer.ts +9 -9
- package/src/transformers/features/miscellaneous/RandomTransformer.ts +48 -48
- 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 +9 -9
- 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 +11 -11
- 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 +12 -12
- package/src/transformers/features/validators/CreateIsTransformer.ts +10 -10
- package/src/transformers/features/validators/CreateValidateTransformer.ts +12 -12
- package/src/transformers/features/validators/IsTransformer.ts +10 -10
- package/src/transformers/features/validators/ValidateTransformer.ts +11 -11
- package/src/transformers/internal/GenericTransformer.ts +99 -99
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
|
|
3
|
-
import { IdentifierFactory } from "../factories/IdentifierFactory";
|
|
4
|
-
import { StatementFactory } from "../factories/StatementFactory";
|
|
5
|
-
import { TypeFactory } from "../factories/TypeFactory";
|
|
6
|
-
|
|
7
|
-
import { IProject } from "../transformers/IProject";
|
|
8
|
-
|
|
9
|
-
import { PruneProgrammer } from "./PruneProgrammer";
|
|
10
|
-
import { ValidateProgrammer } from "./ValidateProgrammer";
|
|
11
|
-
|
|
12
|
-
export namespace ValidatePruneProgrammer {
|
|
13
|
-
export const generate =
|
|
14
|
-
(project: IProject, modulo: ts.LeftHandSideExpression) =>
|
|
15
|
-
(type: ts.Type, name?: string) =>
|
|
16
|
-
ts.factory.createArrowFunction(
|
|
17
|
-
undefined,
|
|
18
|
-
undefined,
|
|
19
|
-
[
|
|
20
|
-
IdentifierFactory.parameter(
|
|
21
|
-
"input",
|
|
22
|
-
TypeFactory.keyword("any"),
|
|
23
|
-
),
|
|
24
|
-
],
|
|
25
|
-
ts.factory.createTypeReferenceNode(
|
|
26
|
-
`typia.IValidation<${
|
|
27
|
-
name ?? TypeFactory.getFullName(project.checker, type)
|
|
28
|
-
}>`,
|
|
29
|
-
),
|
|
30
|
-
undefined,
|
|
31
|
-
ts.factory.createBlock([
|
|
32
|
-
StatementFactory.constant(
|
|
33
|
-
"validate",
|
|
34
|
-
ValidateProgrammer.generate(
|
|
35
|
-
{
|
|
36
|
-
...project,
|
|
37
|
-
options: {
|
|
38
|
-
...project.options,
|
|
39
|
-
functional: false,
|
|
40
|
-
numeric: true,
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
modulo,
|
|
44
|
-
)(type, name),
|
|
45
|
-
),
|
|
46
|
-
StatementFactory.constant(
|
|
47
|
-
"prune",
|
|
48
|
-
PruneProgrammer.generate(
|
|
49
|
-
{
|
|
50
|
-
...project,
|
|
51
|
-
options: {
|
|
52
|
-
...project.options,
|
|
53
|
-
functional: false,
|
|
54
|
-
numeric: false,
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
modulo,
|
|
58
|
-
)(type, name),
|
|
59
|
-
),
|
|
60
|
-
StatementFactory.constant(
|
|
61
|
-
"output",
|
|
62
|
-
ts.factory.createCallExpression(
|
|
63
|
-
ts.factory.createIdentifier("validate"),
|
|
64
|
-
undefined,
|
|
65
|
-
[ts.factory.createIdentifier("input")],
|
|
66
|
-
),
|
|
67
|
-
),
|
|
68
|
-
ts.factory.createIfStatement(
|
|
69
|
-
ts.factory.createIdentifier("output.success"),
|
|
70
|
-
ts.factory.createExpressionStatement(
|
|
71
|
-
ts.factory.createCallExpression(
|
|
72
|
-
ts.factory.createIdentifier("prune"),
|
|
73
|
-
undefined,
|
|
74
|
-
[ts.factory.createIdentifier("input")],
|
|
75
|
-
),
|
|
76
|
-
),
|
|
77
|
-
),
|
|
78
|
-
ts.factory.createReturnStatement(
|
|
79
|
-
ts.factory.createIdentifier("output"),
|
|
80
|
-
),
|
|
81
|
-
]),
|
|
82
|
-
);
|
|
83
|
-
}
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
|
|
3
|
+
import { IdentifierFactory } from "../factories/IdentifierFactory";
|
|
4
|
+
import { StatementFactory } from "../factories/StatementFactory";
|
|
5
|
+
import { TypeFactory } from "../factories/TypeFactory";
|
|
6
|
+
|
|
7
|
+
import { IProject } from "../transformers/IProject";
|
|
8
|
+
|
|
9
|
+
import { PruneProgrammer } from "./PruneProgrammer";
|
|
10
|
+
import { ValidateProgrammer } from "./ValidateProgrammer";
|
|
11
|
+
|
|
12
|
+
export namespace ValidatePruneProgrammer {
|
|
13
|
+
export const generate =
|
|
14
|
+
(project: IProject, modulo: ts.LeftHandSideExpression) =>
|
|
15
|
+
(type: ts.Type, name?: string) =>
|
|
16
|
+
ts.factory.createArrowFunction(
|
|
17
|
+
undefined,
|
|
18
|
+
undefined,
|
|
19
|
+
[
|
|
20
|
+
IdentifierFactory.parameter(
|
|
21
|
+
"input",
|
|
22
|
+
TypeFactory.keyword("any"),
|
|
23
|
+
),
|
|
24
|
+
],
|
|
25
|
+
ts.factory.createTypeReferenceNode(
|
|
26
|
+
`typia.IValidation<${
|
|
27
|
+
name ?? TypeFactory.getFullName(project.checker, type)
|
|
28
|
+
}>`,
|
|
29
|
+
),
|
|
30
|
+
undefined,
|
|
31
|
+
ts.factory.createBlock([
|
|
32
|
+
StatementFactory.constant(
|
|
33
|
+
"validate",
|
|
34
|
+
ValidateProgrammer.generate(
|
|
35
|
+
{
|
|
36
|
+
...project,
|
|
37
|
+
options: {
|
|
38
|
+
...project.options,
|
|
39
|
+
functional: false,
|
|
40
|
+
numeric: true,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
modulo,
|
|
44
|
+
)(type, name),
|
|
45
|
+
),
|
|
46
|
+
StatementFactory.constant(
|
|
47
|
+
"prune",
|
|
48
|
+
PruneProgrammer.generate(
|
|
49
|
+
{
|
|
50
|
+
...project,
|
|
51
|
+
options: {
|
|
52
|
+
...project.options,
|
|
53
|
+
functional: false,
|
|
54
|
+
numeric: false,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
modulo,
|
|
58
|
+
)(type, name),
|
|
59
|
+
),
|
|
60
|
+
StatementFactory.constant(
|
|
61
|
+
"output",
|
|
62
|
+
ts.factory.createCallExpression(
|
|
63
|
+
ts.factory.createIdentifier("validate"),
|
|
64
|
+
undefined,
|
|
65
|
+
[ts.factory.createIdentifier("input")],
|
|
66
|
+
),
|
|
67
|
+
),
|
|
68
|
+
ts.factory.createIfStatement(
|
|
69
|
+
ts.factory.createIdentifier("output.success"),
|
|
70
|
+
ts.factory.createExpressionStatement(
|
|
71
|
+
ts.factory.createCallExpression(
|
|
72
|
+
ts.factory.createIdentifier("prune"),
|
|
73
|
+
undefined,
|
|
74
|
+
[ts.factory.createIdentifier("input")],
|
|
75
|
+
),
|
|
76
|
+
),
|
|
77
|
+
),
|
|
78
|
+
ts.factory.createReturnStatement(
|
|
79
|
+
ts.factory.createIdentifier("output"),
|
|
80
|
+
),
|
|
81
|
+
]),
|
|
82
|
+
);
|
|
83
|
+
}
|
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
|
|
3
|
-
import { IdentifierFactory } from "../factories/IdentifierFactory";
|
|
4
|
-
import { StatementFactory } from "../factories/StatementFactory";
|
|
5
|
-
import { TypeFactory } from "../factories/TypeFactory";
|
|
6
|
-
|
|
7
|
-
import { IProject } from "../transformers/IProject";
|
|
8
|
-
|
|
9
|
-
import { StringifyProgrammer } from "./StringifyProgrammer";
|
|
10
|
-
import { ValidateProgrammer } from "./ValidateProgrammer";
|
|
11
|
-
|
|
12
|
-
export namespace ValidateStringifyProgrammer {
|
|
13
|
-
export const generate =
|
|
14
|
-
(project: IProject, modulo: ts.LeftHandSideExpression) =>
|
|
15
|
-
(type: ts.Type, name?: string) =>
|
|
16
|
-
ts.factory.createArrowFunction(
|
|
17
|
-
undefined,
|
|
18
|
-
undefined,
|
|
19
|
-
[
|
|
20
|
-
IdentifierFactory.parameter(
|
|
21
|
-
"input",
|
|
22
|
-
ts.factory.createTypeReferenceNode(
|
|
23
|
-
name ??
|
|
24
|
-
TypeFactory.getFullName(project.checker, type),
|
|
25
|
-
),
|
|
26
|
-
),
|
|
27
|
-
],
|
|
28
|
-
ts.factory.createTypeReferenceNode("typia.IValidation<string>"),
|
|
29
|
-
undefined,
|
|
30
|
-
ts.factory.createBlock([
|
|
31
|
-
StatementFactory.constant(
|
|
32
|
-
"validate",
|
|
33
|
-
ValidateProgrammer.generate(
|
|
34
|
-
{
|
|
35
|
-
...project,
|
|
36
|
-
options: {
|
|
37
|
-
...project.options,
|
|
38
|
-
functional: false,
|
|
39
|
-
numeric: true,
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
modulo,
|
|
43
|
-
)(type, name),
|
|
44
|
-
),
|
|
45
|
-
StatementFactory.constant(
|
|
46
|
-
"stringify",
|
|
47
|
-
StringifyProgrammer.generate(
|
|
48
|
-
{
|
|
49
|
-
...project,
|
|
50
|
-
options: {
|
|
51
|
-
...project.options,
|
|
52
|
-
functional: false,
|
|
53
|
-
numeric: false,
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
modulo,
|
|
57
|
-
)(type, name),
|
|
58
|
-
),
|
|
59
|
-
StatementFactory.constant(
|
|
60
|
-
"output",
|
|
61
|
-
ts.factory.createAsExpression(
|
|
62
|
-
ts.factory.createCallExpression(
|
|
63
|
-
ts.factory.createIdentifier("validate"),
|
|
64
|
-
undefined,
|
|
65
|
-
[ts.factory.createIdentifier("input")],
|
|
66
|
-
),
|
|
67
|
-
TypeFactory.keyword("any"),
|
|
68
|
-
),
|
|
69
|
-
),
|
|
70
|
-
ts.factory.createIfStatement(
|
|
71
|
-
ts.factory.createIdentifier("output.success"),
|
|
72
|
-
ts.factory.createExpressionStatement(
|
|
73
|
-
ts.factory.createBinaryExpression(
|
|
74
|
-
ts.factory.createIdentifier("output.data"),
|
|
75
|
-
ts.SyntaxKind.EqualsToken,
|
|
76
|
-
ts.factory.createCallExpression(
|
|
77
|
-
ts.factory.createIdentifier("stringify"),
|
|
78
|
-
undefined,
|
|
79
|
-
[ts.factory.createIdentifier("input")],
|
|
80
|
-
),
|
|
81
|
-
),
|
|
82
|
-
),
|
|
83
|
-
),
|
|
84
|
-
ts.factory.createReturnStatement(
|
|
85
|
-
ts.factory.createIdentifier("output"),
|
|
86
|
-
),
|
|
87
|
-
]),
|
|
88
|
-
);
|
|
89
|
-
}
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
|
|
3
|
+
import { IdentifierFactory } from "../factories/IdentifierFactory";
|
|
4
|
+
import { StatementFactory } from "../factories/StatementFactory";
|
|
5
|
+
import { TypeFactory } from "../factories/TypeFactory";
|
|
6
|
+
|
|
7
|
+
import { IProject } from "../transformers/IProject";
|
|
8
|
+
|
|
9
|
+
import { StringifyProgrammer } from "./StringifyProgrammer";
|
|
10
|
+
import { ValidateProgrammer } from "./ValidateProgrammer";
|
|
11
|
+
|
|
12
|
+
export namespace ValidateStringifyProgrammer {
|
|
13
|
+
export const generate =
|
|
14
|
+
(project: IProject, modulo: ts.LeftHandSideExpression) =>
|
|
15
|
+
(type: ts.Type, name?: string) =>
|
|
16
|
+
ts.factory.createArrowFunction(
|
|
17
|
+
undefined,
|
|
18
|
+
undefined,
|
|
19
|
+
[
|
|
20
|
+
IdentifierFactory.parameter(
|
|
21
|
+
"input",
|
|
22
|
+
ts.factory.createTypeReferenceNode(
|
|
23
|
+
name ??
|
|
24
|
+
TypeFactory.getFullName(project.checker, type),
|
|
25
|
+
),
|
|
26
|
+
),
|
|
27
|
+
],
|
|
28
|
+
ts.factory.createTypeReferenceNode("typia.IValidation<string>"),
|
|
29
|
+
undefined,
|
|
30
|
+
ts.factory.createBlock([
|
|
31
|
+
StatementFactory.constant(
|
|
32
|
+
"validate",
|
|
33
|
+
ValidateProgrammer.generate(
|
|
34
|
+
{
|
|
35
|
+
...project,
|
|
36
|
+
options: {
|
|
37
|
+
...project.options,
|
|
38
|
+
functional: false,
|
|
39
|
+
numeric: true,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
modulo,
|
|
43
|
+
)(type, name),
|
|
44
|
+
),
|
|
45
|
+
StatementFactory.constant(
|
|
46
|
+
"stringify",
|
|
47
|
+
StringifyProgrammer.generate(
|
|
48
|
+
{
|
|
49
|
+
...project,
|
|
50
|
+
options: {
|
|
51
|
+
...project.options,
|
|
52
|
+
functional: false,
|
|
53
|
+
numeric: false,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
modulo,
|
|
57
|
+
)(type, name),
|
|
58
|
+
),
|
|
59
|
+
StatementFactory.constant(
|
|
60
|
+
"output",
|
|
61
|
+
ts.factory.createAsExpression(
|
|
62
|
+
ts.factory.createCallExpression(
|
|
63
|
+
ts.factory.createIdentifier("validate"),
|
|
64
|
+
undefined,
|
|
65
|
+
[ts.factory.createIdentifier("input")],
|
|
66
|
+
),
|
|
67
|
+
TypeFactory.keyword("any"),
|
|
68
|
+
),
|
|
69
|
+
),
|
|
70
|
+
ts.factory.createIfStatement(
|
|
71
|
+
ts.factory.createIdentifier("output.success"),
|
|
72
|
+
ts.factory.createExpressionStatement(
|
|
73
|
+
ts.factory.createBinaryExpression(
|
|
74
|
+
ts.factory.createIdentifier("output.data"),
|
|
75
|
+
ts.SyntaxKind.EqualsToken,
|
|
76
|
+
ts.factory.createCallExpression(
|
|
77
|
+
ts.factory.createIdentifier("stringify"),
|
|
78
|
+
undefined,
|
|
79
|
+
[ts.factory.createIdentifier("input")],
|
|
80
|
+
),
|
|
81
|
+
),
|
|
82
|
+
),
|
|
83
|
+
),
|
|
84
|
+
ts.factory.createReturnStatement(
|
|
85
|
+
ts.factory.createIdentifier("output"),
|
|
86
|
+
),
|
|
87
|
+
]),
|
|
88
|
+
);
|
|
89
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { AssertCloneProgrammer } from "../../../programmers/AssertCloneProgrammer";
|
|
2
|
-
|
|
3
|
-
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
|
-
|
|
5
|
-
export namespace AssertCloneTransformer {
|
|
6
|
-
export const transform = GenericTransformer.scalar("assertClone")(
|
|
7
|
-
(project, modulo) => AssertCloneProgrammer.generate(project, modulo),
|
|
8
|
-
);
|
|
9
|
-
}
|
|
1
|
+
import { AssertCloneProgrammer } from "../../../programmers/AssertCloneProgrammer";
|
|
2
|
+
|
|
3
|
+
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
|
+
|
|
5
|
+
export namespace AssertCloneTransformer {
|
|
6
|
+
export const transform = GenericTransformer.scalar("assertClone")(
|
|
7
|
+
(project, modulo) => AssertCloneProgrammer.generate(project, modulo),
|
|
8
|
+
);
|
|
9
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { AssertPruneProgrammer } from "../../../programmers/AssertPruneProgrammer";
|
|
2
|
-
|
|
3
|
-
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
|
-
|
|
5
|
-
export namespace AssertPruneTransformer {
|
|
6
|
-
export const transform = GenericTransformer.scalar("assertPrune")(
|
|
7
|
-
(project, modulo) => AssertPruneProgrammer.generate(project, modulo),
|
|
8
|
-
);
|
|
9
|
-
}
|
|
1
|
+
import { AssertPruneProgrammer } from "../../../programmers/AssertPruneProgrammer";
|
|
2
|
+
|
|
3
|
+
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
|
+
|
|
5
|
+
export namespace AssertPruneTransformer {
|
|
6
|
+
export const transform = GenericTransformer.scalar("assertPrune")(
|
|
7
|
+
(project, modulo) => AssertPruneProgrammer.generate(project, modulo),
|
|
8
|
+
);
|
|
9
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CloneProgrammer } from "../../../programmers/CloneProgrammer";
|
|
2
|
-
|
|
3
|
-
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
|
-
|
|
5
|
-
export namespace CloneTransformer {
|
|
6
|
-
export const transform = GenericTransformer.scalar("clone")(
|
|
7
|
-
(project, modulo) => CloneProgrammer.generate(project, modulo),
|
|
8
|
-
);
|
|
9
|
-
}
|
|
1
|
+
import { CloneProgrammer } from "../../../programmers/CloneProgrammer";
|
|
2
|
+
|
|
3
|
+
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
|
+
|
|
5
|
+
export namespace CloneTransformer {
|
|
6
|
+
export const transform = GenericTransformer.scalar("clone")(
|
|
7
|
+
(project, modulo) => CloneProgrammer.generate(project, modulo),
|
|
8
|
+
);
|
|
9
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { AssertCloneProgrammer } from "../../../programmers/AssertCloneProgrammer";
|
|
2
|
-
|
|
3
|
-
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
|
-
|
|
5
|
-
export namespace CreateAssertCloneTransformer {
|
|
6
|
-
export const transform = GenericTransformer.factory("createAssertClone")(
|
|
7
|
-
(project, modulo) => AssertCloneProgrammer.generate(project, modulo),
|
|
8
|
-
);
|
|
9
|
-
}
|
|
1
|
+
import { AssertCloneProgrammer } from "../../../programmers/AssertCloneProgrammer";
|
|
2
|
+
|
|
3
|
+
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
|
+
|
|
5
|
+
export namespace CreateAssertCloneTransformer {
|
|
6
|
+
export const transform = GenericTransformer.factory("createAssertClone")(
|
|
7
|
+
(project, modulo) => AssertCloneProgrammer.generate(project, modulo),
|
|
8
|
+
);
|
|
9
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { AssertPruneProgrammer } from "../../../programmers/AssertPruneProgrammer";
|
|
2
|
-
|
|
3
|
-
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
|
-
|
|
5
|
-
export namespace CreateAssertPruneTransformer {
|
|
6
|
-
export const transform = GenericTransformer.factory("createAssertPrune")(
|
|
7
|
-
(project, modulo) => AssertPruneProgrammer.generate(project, modulo),
|
|
8
|
-
);
|
|
9
|
-
}
|
|
1
|
+
import { AssertPruneProgrammer } from "../../../programmers/AssertPruneProgrammer";
|
|
2
|
+
|
|
3
|
+
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
|
+
|
|
5
|
+
export namespace CreateAssertPruneTransformer {
|
|
6
|
+
export const transform = GenericTransformer.factory("createAssertPrune")(
|
|
7
|
+
(project, modulo) => AssertPruneProgrammer.generate(project, modulo),
|
|
8
|
+
);
|
|
9
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CloneProgrammer } from "../../../programmers/CloneProgrammer";
|
|
2
|
-
|
|
3
|
-
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
|
-
|
|
5
|
-
export namespace CreateCloneTransformer {
|
|
6
|
-
export const transform = GenericTransformer.factory("createClone")(
|
|
7
|
-
(project, modulo) => CloneProgrammer.generate(project, modulo),
|
|
8
|
-
);
|
|
9
|
-
}
|
|
1
|
+
import { CloneProgrammer } from "../../../programmers/CloneProgrammer";
|
|
2
|
+
|
|
3
|
+
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
|
+
|
|
5
|
+
export namespace CreateCloneTransformer {
|
|
6
|
+
export const transform = GenericTransformer.factory("createClone")(
|
|
7
|
+
(project, modulo) => CloneProgrammer.generate(project, modulo),
|
|
8
|
+
);
|
|
9
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { IsCloneProgrammer } from "../../../programmers/IsCloneProgrammer";
|
|
2
|
-
|
|
3
|
-
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
|
-
|
|
5
|
-
export namespace CreateIsCloneTransformer {
|
|
6
|
-
export const transform = GenericTransformer.factory("createIsClone")(
|
|
7
|
-
(project, modulo) => IsCloneProgrammer.generate(project, modulo),
|
|
8
|
-
);
|
|
9
|
-
}
|
|
1
|
+
import { IsCloneProgrammer } from "../../../programmers/IsCloneProgrammer";
|
|
2
|
+
|
|
3
|
+
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
|
+
|
|
5
|
+
export namespace CreateIsCloneTransformer {
|
|
6
|
+
export const transform = GenericTransformer.factory("createIsClone")(
|
|
7
|
+
(project, modulo) => IsCloneProgrammer.generate(project, modulo),
|
|
8
|
+
);
|
|
9
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { IsPruneProgrammer } from "../../../programmers/IsPruneProgrammer";
|
|
2
|
-
|
|
3
|
-
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
|
-
|
|
5
|
-
export namespace CreateIsPruneTransformer {
|
|
6
|
-
export const transform = GenericTransformer.factory("createIsPrune")(
|
|
7
|
-
(project, modulo) => IsPruneProgrammer.generate(project, modulo),
|
|
8
|
-
);
|
|
9
|
-
}
|
|
1
|
+
import { IsPruneProgrammer } from "../../../programmers/IsPruneProgrammer";
|
|
2
|
+
|
|
3
|
+
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
|
+
|
|
5
|
+
export namespace CreateIsPruneTransformer {
|
|
6
|
+
export const transform = GenericTransformer.factory("createIsPrune")(
|
|
7
|
+
(project, modulo) => IsPruneProgrammer.generate(project, modulo),
|
|
8
|
+
);
|
|
9
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { PruneProgrammer } from "../../../programmers/PruneProgrammer";
|
|
2
|
-
|
|
3
|
-
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
|
-
|
|
5
|
-
export namespace CreatePruneTransformer {
|
|
6
|
-
export const transform = GenericTransformer.factory("createPrune")(
|
|
7
|
-
(project, modulo) => PruneProgrammer.generate(project, modulo),
|
|
8
|
-
);
|
|
9
|
-
}
|
|
1
|
+
import { PruneProgrammer } from "../../../programmers/PruneProgrammer";
|
|
2
|
+
|
|
3
|
+
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
|
+
|
|
5
|
+
export namespace CreatePruneTransformer {
|
|
6
|
+
export const transform = GenericTransformer.factory("createPrune")(
|
|
7
|
+
(project, modulo) => PruneProgrammer.generate(project, modulo),
|
|
8
|
+
);
|
|
9
|
+
}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
|
|
3
|
-
import { RandomProgrammer } from "../../../programmers/RandomProgrammer";
|
|
4
|
-
|
|
5
|
-
import { IProject } from "../../IProject";
|
|
6
|
-
|
|
7
|
-
export namespace CreateRandomTransformer {
|
|
8
|
-
export function transform(
|
|
9
|
-
project: IProject,
|
|
10
|
-
modulo: ts.LeftHandSideExpression,
|
|
11
|
-
expression: ts.CallExpression,
|
|
12
|
-
): ts.Expression {
|
|
13
|
-
// CHECK GENERIC ARGUMENT EXISTENCE
|
|
14
|
-
if (!expression.typeArguments?.[0])
|
|
15
|
-
throw new Error(ErrorMessages.NOT_SPECIFIED);
|
|
16
|
-
|
|
17
|
-
// GET TYPE INFO
|
|
18
|
-
const node: ts.TypeNode = expression.typeArguments[0];
|
|
19
|
-
const type: ts.Type = project.checker.getTypeFromTypeNode(node);
|
|
20
|
-
|
|
21
|
-
if (type.isTypeParameter())
|
|
22
|
-
throw new Error(ErrorMessages.NO_GENERIC_ARGUMENT);
|
|
23
|
-
|
|
24
|
-
// DO TRANSFORM
|
|
25
|
-
return RandomProgrammer.generate(
|
|
26
|
-
{
|
|
27
|
-
...project,
|
|
28
|
-
options: {
|
|
29
|
-
...project.options,
|
|
30
|
-
functional: false,
|
|
31
|
-
numeric: false,
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
modulo,
|
|
35
|
-
)(type, node.getText());
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const enum ErrorMessages {
|
|
40
|
-
NOT_SPECIFIED = "Error on typia.createRandom(): generic argument is not specified.",
|
|
41
|
-
NO_GENERIC_ARGUMENT = "Error on typia.createRandom(): non-specified generic argument.",
|
|
42
|
-
}
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
|
|
3
|
+
import { RandomProgrammer } from "../../../programmers/RandomProgrammer";
|
|
4
|
+
|
|
5
|
+
import { IProject } from "../../IProject";
|
|
6
|
+
|
|
7
|
+
export namespace CreateRandomTransformer {
|
|
8
|
+
export function transform(
|
|
9
|
+
project: IProject,
|
|
10
|
+
modulo: ts.LeftHandSideExpression,
|
|
11
|
+
expression: ts.CallExpression,
|
|
12
|
+
): ts.Expression {
|
|
13
|
+
// CHECK GENERIC ARGUMENT EXISTENCE
|
|
14
|
+
if (!expression.typeArguments?.[0])
|
|
15
|
+
throw new Error(ErrorMessages.NOT_SPECIFIED);
|
|
16
|
+
|
|
17
|
+
// GET TYPE INFO
|
|
18
|
+
const node: ts.TypeNode = expression.typeArguments[0];
|
|
19
|
+
const type: ts.Type = project.checker.getTypeFromTypeNode(node);
|
|
20
|
+
|
|
21
|
+
if (type.isTypeParameter())
|
|
22
|
+
throw new Error(ErrorMessages.NO_GENERIC_ARGUMENT);
|
|
23
|
+
|
|
24
|
+
// DO TRANSFORM
|
|
25
|
+
return RandomProgrammer.generate(
|
|
26
|
+
{
|
|
27
|
+
...project,
|
|
28
|
+
options: {
|
|
29
|
+
...project.options,
|
|
30
|
+
functional: false,
|
|
31
|
+
numeric: false,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
modulo,
|
|
35
|
+
)(type, node.getText());
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const enum ErrorMessages {
|
|
40
|
+
NOT_SPECIFIED = "Error on typia.createRandom(): generic argument is not specified.",
|
|
41
|
+
NO_GENERIC_ARGUMENT = "Error on typia.createRandom(): non-specified generic argument.",
|
|
42
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ValidateCloneProgrammer } from "../../../programmers/ValidateCloneProgrammer";
|
|
2
|
-
|
|
3
|
-
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
|
-
|
|
5
|
-
export namespace CreateValidateCloneTransformer {
|
|
6
|
-
export const transform = GenericTransformer.factory("createValidateClone")(
|
|
7
|
-
(project, modulo) => ValidateCloneProgrammer.generate(project, modulo),
|
|
8
|
-
);
|
|
9
|
-
}
|
|
1
|
+
import { ValidateCloneProgrammer } from "../../../programmers/ValidateCloneProgrammer";
|
|
2
|
+
|
|
3
|
+
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
|
+
|
|
5
|
+
export namespace CreateValidateCloneTransformer {
|
|
6
|
+
export const transform = GenericTransformer.factory("createValidateClone")(
|
|
7
|
+
(project, modulo) => ValidateCloneProgrammer.generate(project, modulo),
|
|
8
|
+
);
|
|
9
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ValidatePruneProgrammer } from "../../../programmers/ValidatePruneProgrammer";
|
|
2
|
-
|
|
3
|
-
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
|
-
|
|
5
|
-
export namespace CreateValidatePruneTransformer {
|
|
6
|
-
export const transform = GenericTransformer.factory("createValidatePrune")(
|
|
7
|
-
(project, modulo) => ValidatePruneProgrammer.generate(project, modulo),
|
|
8
|
-
);
|
|
9
|
-
}
|
|
1
|
+
import { ValidatePruneProgrammer } from "../../../programmers/ValidatePruneProgrammer";
|
|
2
|
+
|
|
3
|
+
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
|
+
|
|
5
|
+
export namespace CreateValidatePruneTransformer {
|
|
6
|
+
export const transform = GenericTransformer.factory("createValidatePrune")(
|
|
7
|
+
(project, modulo) => ValidatePruneProgrammer.generate(project, modulo),
|
|
8
|
+
);
|
|
9
|
+
}
|