typia 3.5.0-dev.20230212 → 3.5.0-dev.20230214
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 +15 -1
- package/lib/IRandomGenerator.d.ts +15 -0
- package/lib/IRandomGenerator.js +3 -0
- package/lib/IRandomGenerator.js.map +1 -0
- package/lib/factories/ExpressionFactory.d.ts +1 -0
- package/lib/factories/ExpressionFactory.js +4 -0
- package/lib/factories/ExpressionFactory.js.map +1 -1
- package/lib/factories/MetadataFactory.js +15 -5
- package/lib/factories/MetadataFactory.js.map +1 -1
- package/lib/factories/MetadataTagFactory.js +11 -101
- package/lib/factories/MetadataTagFactory.js.map +1 -1
- package/lib/functional/$any.d.ts +1 -0
- package/lib/functional/$any.js +8 -0
- package/lib/functional/$any.js.map +1 -0
- package/lib/{programmers/internal/check_length.d.ts → functional/Namespace.d.ts} +0 -0
- package/lib/functional/Namespace.js +80 -0
- package/lib/functional/Namespace.js.map +1 -0
- package/lib/metadata/IMetadataTag.d.ts +3 -10
- package/lib/module.d.ts +255 -0
- package/lib/module.js +77 -234
- package/lib/module.js.map +1 -1
- package/lib/programmers/AssertCloneProgrammer.d.ts +5 -0
- package/lib/programmers/AssertCloneProgrammer.js +37 -0
- package/lib/programmers/AssertCloneProgrammer.js.map +1 -0
- package/lib/programmers/CloneProgrammer.d.ts +5 -0
- package/lib/programmers/CloneProgrammer.js +285 -0
- package/lib/programmers/CloneProgrammer.js.map +1 -0
- package/lib/programmers/IsCloneProgrammer.d.ts +5 -0
- package/lib/programmers/IsCloneProgrammer.js +37 -0
- package/lib/programmers/IsCloneProgrammer.js.map +1 -0
- package/lib/programmers/IsProgrammer.d.ts +1 -1
- package/lib/programmers/IsProgrammer.js +5 -2
- package/lib/programmers/IsProgrammer.js.map +1 -1
- package/lib/programmers/RandomProgrammer.d.ts +5 -0
- package/lib/programmers/RandomProgrammer.js +338 -0
- package/lib/programmers/RandomProgrammer.js.map +1 -0
- package/lib/programmers/StringifyProgrammer.js +1 -1
- package/lib/programmers/StringifyProgrammer.js.map +1 -1
- package/lib/programmers/ValidateCloneProgrammer.d.ts +5 -0
- package/lib/programmers/ValidateCloneProgrammer.js +37 -0
- package/lib/programmers/ValidateCloneProgrammer.js.map +1 -0
- package/lib/programmers/ValidateStringifyProgrammer.js +1 -1
- package/lib/programmers/ValidateStringifyProgrammer.js.map +1 -1
- package/lib/programmers/helpers/CloneJoiner.d.ts +8 -0
- package/lib/programmers/helpers/CloneJoiner.js +80 -0
- package/lib/programmers/helpers/CloneJoiner.js.map +1 -0
- package/lib/programmers/helpers/RandomJoiner.d.ts +10 -0
- package/lib/programmers/helpers/RandomJoiner.js +93 -0
- package/lib/programmers/helpers/RandomJoiner.js.map +1 -0
- package/lib/programmers/helpers/RandomRanger.d.ts +25 -0
- package/lib/programmers/helpers/RandomRanger.js +138 -0
- package/lib/programmers/helpers/RandomRanger.js.map +1 -0
- package/lib/programmers/helpers/StringifyJoinder.js +2 -2
- package/lib/programmers/helpers/StringifyJoinder.js.map +1 -1
- package/lib/programmers/internal/application_array.js +0 -10
- package/lib/programmers/internal/application_array.js.map +1 -1
- package/lib/programmers/internal/application_number.js +4 -12
- package/lib/programmers/internal/application_number.js.map +1 -1
- package/lib/programmers/internal/application_string.js +0 -8
- package/lib/programmers/internal/application_string.js.map +1 -1
- package/lib/programmers/internal/check_array_length.js +3 -4
- package/lib/programmers/internal/check_array_length.js.map +1 -1
- package/lib/programmers/internal/check_bigint.js +0 -12
- package/lib/programmers/internal/check_bigint.js.map +1 -1
- package/lib/programmers/internal/check_number.js +7 -25
- package/lib/programmers/internal/check_number.js.map +1 -1
- package/lib/programmers/internal/check_string_tags.js +2 -3
- package/lib/programmers/internal/check_string_tags.js.map +1 -1
- package/lib/schemas/IJsonSchema.d.ts +36 -2
- package/lib/transformers/CallExpressionTransformer.js +21 -1
- package/lib/transformers/CallExpressionTransformer.js.map +1 -1
- package/lib/transformers/features/miscellaneous/AssertCloneTransformer.d.ts +5 -0
- package/lib/transformers/features/miscellaneous/AssertCloneTransformer.js +23 -0
- package/lib/transformers/features/miscellaneous/AssertCloneTransformer.js.map +1 -0
- package/lib/transformers/features/miscellaneous/CloneTransformer.d.ts +5 -0
- package/lib/transformers/features/miscellaneous/CloneTransformer.js +34 -0
- package/lib/transformers/features/miscellaneous/CloneTransformer.js.map +1 -0
- package/lib/transformers/features/miscellaneous/CreateAssertCloneTransformer.d.ts +5 -0
- package/lib/transformers/features/miscellaneous/CreateAssertCloneTransformer.js +18 -0
- package/lib/transformers/features/miscellaneous/CreateAssertCloneTransformer.js.map +1 -0
- package/lib/transformers/features/miscellaneous/CreateAssertPruneTransformer.js +2 -1
- package/lib/transformers/features/miscellaneous/CreateAssertPruneTransformer.js.map +1 -1
- package/lib/transformers/features/miscellaneous/CreateCloneTransformer.d.ts +5 -0
- package/lib/transformers/features/miscellaneous/CreateCloneTransformer.js +18 -0
- package/lib/transformers/features/miscellaneous/CreateCloneTransformer.js.map +1 -0
- package/lib/transformers/features/miscellaneous/CreateIsCloneTransformer.d.ts +5 -0
- package/lib/transformers/features/miscellaneous/CreateIsCloneTransformer.js +18 -0
- package/lib/transformers/features/miscellaneous/CreateIsCloneTransformer.js.map +1 -0
- package/lib/transformers/features/miscellaneous/CreateIsPruneTransformer.js +2 -1
- package/lib/transformers/features/miscellaneous/CreateIsPruneTransformer.js.map +1 -1
- package/lib/transformers/features/miscellaneous/CreatePruneTransformer.js +2 -1
- package/lib/transformers/features/miscellaneous/CreatePruneTransformer.js.map +1 -1
- package/lib/transformers/features/miscellaneous/CreateRandomGenerator.d.ts +5 -0
- package/lib/transformers/features/miscellaneous/CreateRandomGenerator.js +29 -0
- package/lib/transformers/features/miscellaneous/CreateRandomGenerator.js.map +1 -0
- package/lib/transformers/features/miscellaneous/CreateValidateCloneTransformer.d.ts +5 -0
- package/lib/transformers/features/miscellaneous/CreateValidateCloneTransformer.js +18 -0
- package/lib/transformers/features/miscellaneous/CreateValidateCloneTransformer.js.map +1 -0
- package/lib/transformers/features/miscellaneous/CreateValidatePruneTransformer.js +2 -1
- package/lib/transformers/features/miscellaneous/CreateValidatePruneTransformer.js.map +1 -1
- package/lib/transformers/features/miscellaneous/IsCloneTransformer.d.ts +5 -0
- package/lib/transformers/features/miscellaneous/IsCloneTransformer.js +23 -0
- package/lib/transformers/features/miscellaneous/IsCloneTransformer.js.map +1 -0
- package/lib/transformers/features/miscellaneous/RandomTransformer.d.ts +5 -0
- package/lib/transformers/features/miscellaneous/RandomTransformer.js +35 -0
- package/lib/transformers/features/miscellaneous/RandomTransformer.js.map +1 -0
- package/lib/transformers/features/miscellaneous/ValidateCloneTransformer.d.ts +5 -0
- package/lib/transformers/features/miscellaneous/ValidateCloneTransformer.js +23 -0
- package/lib/transformers/features/miscellaneous/ValidateCloneTransformer.js.map +1 -0
- package/lib/transformers/features/parsers/AssertParseTransformer.js +2 -1
- package/lib/transformers/features/parsers/AssertParseTransformer.js.map +1 -1
- package/lib/transformers/features/parsers/CreateAssertParseTransformer.js +2 -1
- package/lib/transformers/features/parsers/CreateAssertParseTransformer.js.map +1 -1
- package/lib/transformers/features/parsers/CreateIsParseTransformer.js +2 -1
- package/lib/transformers/features/parsers/CreateIsParseTransformer.js.map +1 -1
- package/lib/transformers/features/parsers/CreateValidateParseTransformer.js +2 -1
- package/lib/transformers/features/parsers/CreateValidateParseTransformer.js.map +1 -1
- package/lib/transformers/features/parsers/IsParseTransformer.js +2 -1
- package/lib/transformers/features/parsers/IsParseTransformer.js.map +1 -1
- package/lib/transformers/features/parsers/ValidateParseTransformer.js +2 -1
- package/lib/transformers/features/parsers/ValidateParseTransformer.js.map +1 -1
- package/lib/transformers/features/stringifiers/CreateAssertStringifyTransformer.js +2 -1
- package/lib/transformers/features/stringifiers/CreateAssertStringifyTransformer.js.map +1 -1
- package/lib/transformers/features/stringifiers/CreateIsStringifyTransformer.js +2 -1
- package/lib/transformers/features/stringifiers/CreateIsStringifyTransformer.js.map +1 -1
- package/lib/transformers/features/stringifiers/CreateStringifyTransformer.js +2 -1
- package/lib/transformers/features/stringifiers/CreateStringifyTransformer.js.map +1 -1
- package/lib/transformers/features/stringifiers/CreateValidateStringifyProgrammer.js +2 -1
- package/lib/transformers/features/stringifiers/CreateValidateStringifyProgrammer.js.map +1 -1
- package/lib/transformers/features/validators/CreateAssertTransformer.js +2 -1
- package/lib/transformers/features/validators/CreateAssertTransformer.js.map +1 -1
- package/lib/transformers/features/validators/CreateIsTransformer.js +2 -1
- package/lib/transformers/features/validators/CreateIsTransformer.js.map +1 -1
- package/lib/transformers/features/validators/CreateValidateTransformer.js +2 -1
- package/lib/transformers/features/validators/CreateValidateTransformer.js.map +1 -1
- package/lib/utils/RandomGenerator.d.ts +1 -0
- package/lib/utils/RandomGenerator.js +85 -0
- package/lib/utils/RandomGenerator.js.map +1 -0
- package/package.json +8 -3
- package/src/IRandomGenerator.ts +16 -0
- package/src/factories/ExpressionFactory.ts +11 -0
- package/src/factories/MetadataFactory.ts +18 -14
- package/src/factories/MetadataTagFactory.ts +11 -97
- package/src/functional/$any.ts +3 -0
- package/src/functional/Namespace.ts +121 -0
- package/src/metadata/IMetadataTag.ts +2 -11
- package/src/module.ts +390 -350
- package/src/programmers/AssertCloneProgrammer.ts +60 -0
- package/src/programmers/CloneProgrammer.ts +351 -0
- package/src/programmers/IsCloneProgrammer.ts +66 -0
- package/src/programmers/IsProgrammer.ts +8 -5
- package/src/programmers/RandomProgrammer.ts +367 -0
- package/src/programmers/StringifyProgrammer.ts +2 -4
- package/src/programmers/ValidateCloneProgrammer.ts +77 -0
- package/src/programmers/ValidateStringifyProgrammer.ts +1 -4
- package/src/programmers/helpers/CloneJoiner.ts +124 -0
- package/src/programmers/helpers/RandomJoiner.ts +140 -0
- package/src/programmers/helpers/RandomRanger.ts +215 -0
- package/src/programmers/helpers/StringifyJoinder.ts +4 -4
- package/src/programmers/internal/application_array.ts +0 -10
- package/src/programmers/internal/application_number.ts +7 -13
- package/src/programmers/internal/application_string.ts +0 -8
- package/src/programmers/internal/check_array_length.ts +8 -9
- package/src/programmers/internal/check_bigint.ts +0 -21
- package/src/programmers/internal/check_number.ts +0 -30
- package/src/programmers/internal/check_string_tags.ts +7 -7
- package/src/schemas/IJsonSchema.ts +36 -1
- package/src/transformers/CallExpressionTransformer.ts +24 -1
- package/src/transformers/features/miscellaneous/AssertCloneTransformer.ts +38 -0
- package/src/transformers/features/miscellaneous/CloneTransformer.ts +46 -0
- package/src/transformers/features/miscellaneous/CreateAssertCloneTransformer.ts +32 -0
- package/src/transformers/features/miscellaneous/CreateAssertPruneTransformer.ts +1 -1
- package/src/transformers/features/miscellaneous/CreateCloneTransformer.ts +31 -0
- package/src/transformers/features/miscellaneous/CreateIsCloneTransformer.ts +32 -0
- package/src/transformers/features/miscellaneous/CreateIsPruneTransformer.ts +1 -1
- package/src/transformers/features/miscellaneous/CreatePruneTransformer.ts +1 -1
- package/src/transformers/features/miscellaneous/CreateRandomGenerator.ts +39 -0
- package/src/transformers/features/miscellaneous/CreateValidateCloneTransformer.ts +32 -0
- package/src/transformers/features/miscellaneous/CreateValidatePruneTransformer.ts +1 -1
- package/src/transformers/features/miscellaneous/IsCloneTransformer.ts +38 -0
- package/src/transformers/features/miscellaneous/RandomTransformer.ts +45 -0
- package/src/transformers/features/miscellaneous/ValidateCloneTransformer.ts +38 -0
- package/src/transformers/features/parsers/AssertParseTransformer.ts +1 -1
- package/src/transformers/features/parsers/CreateAssertParseTransformer.ts +1 -1
- package/src/transformers/features/parsers/CreateIsParseTransformer.ts +1 -1
- package/src/transformers/features/parsers/CreateValidateParseTransformer.ts +1 -1
- package/src/transformers/features/parsers/IsParseTransformer.ts +1 -1
- package/src/transformers/features/parsers/ValidateParseTransformer.ts +1 -1
- package/src/transformers/features/stringifiers/CreateAssertStringifyTransformer.ts +1 -1
- package/src/transformers/features/stringifiers/CreateIsStringifyTransformer.ts +1 -1
- package/src/transformers/features/stringifiers/CreateStringifyTransformer.ts +1 -1
- package/src/transformers/features/stringifiers/CreateValidateStringifyProgrammer.ts +1 -1
- package/src/transformers/features/validators/CreateAssertTransformer.ts +1 -1
- package/src/transformers/features/validators/CreateIsTransformer.ts +1 -1
- package/src/transformers/features/validators/CreateValidateTransformer.ts +1 -1
- package/src/utils/RandomGenerator.ts +90 -0
- package/lib/programmers/internal/check_length.js +0 -28
- package/lib/programmers/internal/check_length.js.map +0 -1
- package/src/programmers/internal/check_length.ts +0 -46
|
@@ -3,14 +3,24 @@ import ts from "typescript";
|
|
|
3
3
|
|
|
4
4
|
import { IProject } from "./IProject";
|
|
5
5
|
import { ApplicationTransformer } from "./features/miscellaneous/ApplicationTransformer";
|
|
6
|
+
import { AssertCloneTransformer } from "./features/miscellaneous/AssertCloneTransformer";
|
|
6
7
|
import { AssertPruneTransformer } from "./features/miscellaneous/AssertPruneTransformer";
|
|
8
|
+
import { CloneTransformer } from "./features/miscellaneous/CloneTransformer";
|
|
9
|
+
import { CreateAssertCloneTransformer } from "./features/miscellaneous/CreateAssertCloneTransformer";
|
|
7
10
|
import { CreateAssertPruneTransformer } from "./features/miscellaneous/CreateAssertPruneTransformer";
|
|
11
|
+
import { CreateCloneTransformer } from "./features/miscellaneous/CreateCloneTransformer";
|
|
12
|
+
import { CreateIsCloneTransformer } from "./features/miscellaneous/CreateIsCloneTransformer";
|
|
8
13
|
import { CreateIsPruneTransformer } from "./features/miscellaneous/CreateIsPruneTransformer";
|
|
9
14
|
import { CreatePruneTransformer } from "./features/miscellaneous/CreatePruneTransformer";
|
|
15
|
+
import { CreateRandomTransformer } from "./features/miscellaneous/CreateRandomGenerator";
|
|
16
|
+
import { CreateValidateCloneTransformer } from "./features/miscellaneous/CreateValidateCloneTransformer";
|
|
10
17
|
import { CreateValidatePruneTransformer } from "./features/miscellaneous/CreateValidatePruneTransformer";
|
|
18
|
+
import { IsCloneTransformer } from "./features/miscellaneous/IsCloneTransformer";
|
|
11
19
|
import { IsPruneTransformer } from "./features/miscellaneous/IsPruneTransformer";
|
|
12
20
|
import { MetadataTransformer } from "./features/miscellaneous/MetadataTransformer";
|
|
13
21
|
import { PruneTransformer } from "./features/miscellaneous/PruneTransformer";
|
|
22
|
+
import { RandomTransformer } from "./features/miscellaneous/RandomTransformer";
|
|
23
|
+
import { ValidateCloneTransformer } from "./features/miscellaneous/ValidateCloneTransformer";
|
|
14
24
|
import { ValidatePruneTransformer } from "./features/miscellaneous/ValidatePruneTransformer";
|
|
15
25
|
import { AssertParseTransformer } from "./features/parsers/AssertParseTransformer";
|
|
16
26
|
import { CreateAssertParseTransformer } from "./features/parsers/CreateAssertParseTransformer";
|
|
@@ -96,14 +106,21 @@ const FUNCTORS: Record<string, () => Task> = {
|
|
|
96
106
|
validateParse: () => ValidateParseTransformer.transform,
|
|
97
107
|
|
|
98
108
|
// STRINGIFY FUNCTIONS
|
|
109
|
+
application: () => ApplicationTransformer.transform,
|
|
99
110
|
stringify: () => StringifyTransformer.transform,
|
|
100
111
|
assertStringify: () => AssertStringifyTransformer.transform,
|
|
101
112
|
isStringify: () => IsStringifyTransformer.transform,
|
|
102
113
|
validateStringify: () => ValidateStringifyTransformer.transform,
|
|
103
114
|
|
|
104
115
|
// MISC
|
|
105
|
-
application: () => ApplicationTransformer.transform,
|
|
106
116
|
metadata: () => MetadataTransformer.transform,
|
|
117
|
+
random: () => RandomTransformer.transform,
|
|
118
|
+
|
|
119
|
+
clone: () => CloneTransformer.transform,
|
|
120
|
+
assertClone: () => AssertCloneTransformer.transform,
|
|
121
|
+
isClone: () => IsCloneTransformer.transform,
|
|
122
|
+
validateClone: () => ValidateCloneTransformer.transform,
|
|
123
|
+
|
|
107
124
|
prune: () => PruneTransformer.transform,
|
|
108
125
|
assertPrune: () => AssertPruneTransformer.transform,
|
|
109
126
|
isPrune: () => IsPruneTransformer.transform,
|
|
@@ -135,6 +152,12 @@ const FUNCTORS: Record<string, () => Task> = {
|
|
|
135
152
|
createValidateStringify: () => CreateValidateStringifyTransformer.transform,
|
|
136
153
|
|
|
137
154
|
// MISC
|
|
155
|
+
createRandom: () => CreateRandomTransformer.transform,
|
|
156
|
+
createClone: () => CreateCloneTransformer.transform,
|
|
157
|
+
createAssertClone: () => CreateAssertCloneTransformer.transform,
|
|
158
|
+
createIsClone: () => CreateIsCloneTransformer.transform,
|
|
159
|
+
createValidateClone: () => CreateValidateCloneTransformer.transform,
|
|
160
|
+
|
|
138
161
|
createPrune: () => CreatePruneTransformer.transform,
|
|
139
162
|
createAssertPrune: () => CreateAssertPruneTransformer.transform,
|
|
140
163
|
createIsPrune: () => CreateIsPruneTransformer.transform,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
|
|
3
|
+
import { AssertCloneProgrammer } from "../../../programmers/AssertCloneProgrammer";
|
|
4
|
+
|
|
5
|
+
import { IProject } from "../../IProject";
|
|
6
|
+
|
|
7
|
+
export namespace AssertCloneTransformer {
|
|
8
|
+
export function transform(
|
|
9
|
+
project: IProject,
|
|
10
|
+
modulo: ts.LeftHandSideExpression,
|
|
11
|
+
expression: ts.CallExpression,
|
|
12
|
+
): ts.Expression {
|
|
13
|
+
if (expression.arguments.length !== 1)
|
|
14
|
+
throw new Error(ErrorMessages.NO_INPUT_VALUE);
|
|
15
|
+
|
|
16
|
+
// GET TYPE INFO
|
|
17
|
+
const type: ts.Type =
|
|
18
|
+
expression.typeArguments && expression.typeArguments[0]
|
|
19
|
+
? project.checker.getTypeFromTypeNode(
|
|
20
|
+
expression.typeArguments[0],
|
|
21
|
+
)
|
|
22
|
+
: project.checker.getTypeAtLocation(expression.arguments[0]!);
|
|
23
|
+
if (type.isTypeParameter())
|
|
24
|
+
throw new Error(ErrorMessages.GENERIC_ARGUMENT);
|
|
25
|
+
|
|
26
|
+
// DO TRANSFORM
|
|
27
|
+
return ts.factory.createCallExpression(
|
|
28
|
+
AssertCloneProgrammer.generate(project, modulo)(type),
|
|
29
|
+
undefined,
|
|
30
|
+
[expression.arguments[0]!],
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const enum ErrorMessages {
|
|
36
|
+
NO_INPUT_VALUE = "Error on typia.assertClone(): no input value.",
|
|
37
|
+
GENERIC_ARGUMENT = "Error on typia.assertClone(): non-specified generic argument.",
|
|
38
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
|
|
3
|
+
import { CloneProgrammer } from "../../../programmers/CloneProgrammer";
|
|
4
|
+
|
|
5
|
+
import { IProject } from "../../IProject";
|
|
6
|
+
|
|
7
|
+
export namespace CloneTransformer {
|
|
8
|
+
export function transform(
|
|
9
|
+
project: IProject,
|
|
10
|
+
modulo: ts.LeftHandSideExpression,
|
|
11
|
+
expression: ts.CallExpression,
|
|
12
|
+
): ts.Expression {
|
|
13
|
+
if (expression.arguments.length !== 1)
|
|
14
|
+
throw new Error(ErrorMessages.NO_INPUT_VALUE);
|
|
15
|
+
|
|
16
|
+
const type: ts.Type =
|
|
17
|
+
expression.typeArguments && expression.typeArguments[0]
|
|
18
|
+
? project.checker.getTypeFromTypeNode(
|
|
19
|
+
expression.typeArguments[0],
|
|
20
|
+
)
|
|
21
|
+
: project.checker.getTypeAtLocation(expression.arguments[0]!);
|
|
22
|
+
if (type.isTypeParameter())
|
|
23
|
+
throw new Error(ErrorMessages.GENERIC_ARGUMENT);
|
|
24
|
+
|
|
25
|
+
return ts.factory.createCallExpression(
|
|
26
|
+
CloneProgrammer.generate(
|
|
27
|
+
{
|
|
28
|
+
...project,
|
|
29
|
+
options: {
|
|
30
|
+
...project.options,
|
|
31
|
+
functional: false,
|
|
32
|
+
numeric: false,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
modulo,
|
|
36
|
+
)(type),
|
|
37
|
+
undefined,
|
|
38
|
+
[expression.arguments[0]!],
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const enum ErrorMessages {
|
|
44
|
+
NO_INPUT_VALUE = "Error on typia.clone(): no input value.",
|
|
45
|
+
GENERIC_ARGUMENT = "Error on typia.clone(): non-specified generic argument.",
|
|
46
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
|
|
3
|
+
import { AssertCloneProgrammer } from "../../../programmers/AssertCloneProgrammer";
|
|
4
|
+
|
|
5
|
+
import { IProject } from "../../IProject";
|
|
6
|
+
|
|
7
|
+
export namespace CreateAssertCloneTransformer {
|
|
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 type: ts.Type = project.checker.getTypeFromTypeNode(
|
|
19
|
+
expression.typeArguments[0],
|
|
20
|
+
);
|
|
21
|
+
if (type.isTypeParameter())
|
|
22
|
+
throw new Error(ErrorMessages.GENERIC_ARGUMENT);
|
|
23
|
+
|
|
24
|
+
// DO TRANSFORM
|
|
25
|
+
return AssertCloneProgrammer.generate(project, modulo)(type);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const enum ErrorMessages {
|
|
30
|
+
NOT_SPECIFIED = "Error on typia.assertClone(): generic argument is not specified.",
|
|
31
|
+
GENERIC_ARGUMENT = "Error on typia.assertClone(): non-specified generic argument.",
|
|
32
|
+
}
|
|
@@ -11,7 +11,7 @@ export namespace CreateAssertPruneTransformer {
|
|
|
11
11
|
expression: ts.CallExpression,
|
|
12
12
|
): ts.Expression {
|
|
13
13
|
// CHECK GENERIC ARGUMENT EXISTENCE
|
|
14
|
-
if (!expression.typeArguments
|
|
14
|
+
if (!expression.typeArguments?.[0])
|
|
15
15
|
throw new Error(ErrorMessages.NOT_SPECIFIED);
|
|
16
16
|
|
|
17
17
|
// GET TYPE INFO
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
|
|
3
|
+
import { CloneProgrammer } from "../../../programmers/CloneProgrammer";
|
|
4
|
+
|
|
5
|
+
import { IProject } from "../../IProject";
|
|
6
|
+
|
|
7
|
+
export namespace CreateCloneTransformer {
|
|
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 type: ts.Type = project.checker.getTypeFromTypeNode(
|
|
19
|
+
expression.typeArguments[0],
|
|
20
|
+
);
|
|
21
|
+
if (type.isTypeParameter())
|
|
22
|
+
throw new Error(ErrorMessages.GENERIC_ARGUMENT);
|
|
23
|
+
|
|
24
|
+
return CloneProgrammer.generate(project, modulo)(type);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const enum ErrorMessages {
|
|
29
|
+
NOT_SPECIFIED = "Error on typia.clone(): generic argument is not specified.",
|
|
30
|
+
GENERIC_ARGUMENT = "Error on typia.clone(): non-specified generic argument.",
|
|
31
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
|
|
3
|
+
import { IsCloneProgrammer } from "../../../programmers/IsCloneProgrammer";
|
|
4
|
+
|
|
5
|
+
import { IProject } from "../../IProject";
|
|
6
|
+
|
|
7
|
+
export namespace CreateIsCloneTransformer {
|
|
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 type: ts.Type = project.checker.getTypeFromTypeNode(
|
|
19
|
+
expression.typeArguments[0],
|
|
20
|
+
);
|
|
21
|
+
if (type.isTypeParameter())
|
|
22
|
+
throw new Error(ErrorMessages.GENERIC_ARGUMENT);
|
|
23
|
+
|
|
24
|
+
// DO TRANSFORM
|
|
25
|
+
return IsCloneProgrammer.generate(project, modulo)(type);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const enum ErrorMessages {
|
|
30
|
+
NOT_SPECIFIED = "Error on typia.isClone(): generic argument is not specified.",
|
|
31
|
+
GENERIC_ARGUMENT = "Error on typia.isClone(): non-specified generic argument.",
|
|
32
|
+
}
|
|
@@ -11,7 +11,7 @@ export namespace CreateIsPruneTransformer {
|
|
|
11
11
|
expression: ts.CallExpression,
|
|
12
12
|
): ts.Expression {
|
|
13
13
|
// CHECK GENERIC ARGUMENT EXISTENCE
|
|
14
|
-
if (!expression.typeArguments
|
|
14
|
+
if (!expression.typeArguments?.[0])
|
|
15
15
|
throw new Error(ErrorMessages.NOT_SPECIFIED);
|
|
16
16
|
|
|
17
17
|
// GET TYPE INFO
|
|
@@ -11,7 +11,7 @@ export namespace CreatePruneTransformer {
|
|
|
11
11
|
expression: ts.CallExpression,
|
|
12
12
|
): ts.Expression {
|
|
13
13
|
// CHECK GENERIC ARGUMENT EXISTENCE
|
|
14
|
-
if (!expression.typeArguments
|
|
14
|
+
if (!expression.typeArguments?.[0])
|
|
15
15
|
throw new Error(ErrorMessages.NOT_SPECIFIED);
|
|
16
16
|
|
|
17
17
|
// GET TYPE INFO
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
if (!expression.typeArguments?.[0])
|
|
14
|
+
throw new Error(ErrorMessages.NOT_SPECIFIED);
|
|
15
|
+
|
|
16
|
+
const type: ts.Type | undefined = project.checker.getTypeFromTypeNode(
|
|
17
|
+
expression.typeArguments[0],
|
|
18
|
+
);
|
|
19
|
+
if (type.isTypeParameter())
|
|
20
|
+
throw new Error(ErrorMessages.NO_GENERIC_ARGUMENT);
|
|
21
|
+
|
|
22
|
+
return RandomProgrammer.generate(
|
|
23
|
+
{
|
|
24
|
+
...project,
|
|
25
|
+
options: {
|
|
26
|
+
...project.options,
|
|
27
|
+
functional: false,
|
|
28
|
+
numeric: false,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
modulo,
|
|
32
|
+
)(type);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const enum ErrorMessages {
|
|
37
|
+
NOT_SPECIFIED = "Error on typia.createRandom(): generic argument is not specified.",
|
|
38
|
+
NO_GENERIC_ARGUMENT = "Error on typia.createRandom(): non-specified generic argument.",
|
|
39
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
|
|
3
|
+
import { ValidateCloneProgrammer } from "../../../programmers/ValidateCloneProgrammer";
|
|
4
|
+
|
|
5
|
+
import { IProject } from "../../IProject";
|
|
6
|
+
|
|
7
|
+
export namespace CreateValidateCloneTransformer {
|
|
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 type: ts.Type = project.checker.getTypeFromTypeNode(
|
|
19
|
+
expression.typeArguments[0],
|
|
20
|
+
);
|
|
21
|
+
if (type.isTypeParameter())
|
|
22
|
+
throw new Error(ErrorMessages.GENERIC_ARGUMENT);
|
|
23
|
+
|
|
24
|
+
// DO TRANSFORM
|
|
25
|
+
return ValidateCloneProgrammer.generate(project, modulo)(type);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const enum ErrorMessages {
|
|
30
|
+
NOT_SPECIFIED = "Error on typia.validateClone(): generic argument is not specified.",
|
|
31
|
+
GENERIC_ARGUMENT = "Error on typia.validateClone(): non-specified generic argument.",
|
|
32
|
+
}
|
|
@@ -11,7 +11,7 @@ export namespace CreateValidatePruneTransformer {
|
|
|
11
11
|
expression: ts.CallExpression,
|
|
12
12
|
): ts.Expression {
|
|
13
13
|
// CHECK GENERIC ARGUMENT EXISTENCE
|
|
14
|
-
if (!expression.typeArguments
|
|
14
|
+
if (!expression.typeArguments?.[0])
|
|
15
15
|
throw new Error(ErrorMessages.NOT_SPECIFIED);
|
|
16
16
|
|
|
17
17
|
// GET TYPE INFO
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
|
|
3
|
+
import { IsCloneProgrammer } from "../../../programmers/IsCloneProgrammer";
|
|
4
|
+
|
|
5
|
+
import { IProject } from "../../IProject";
|
|
6
|
+
|
|
7
|
+
export namespace IsCloneTransformer {
|
|
8
|
+
export function transform(
|
|
9
|
+
project: IProject,
|
|
10
|
+
modulo: ts.LeftHandSideExpression,
|
|
11
|
+
expression: ts.CallExpression,
|
|
12
|
+
): ts.Expression {
|
|
13
|
+
if (expression.arguments.length !== 1)
|
|
14
|
+
throw new Error(ErrorMessages.NO_INPUT_VALUE);
|
|
15
|
+
|
|
16
|
+
// GET TYPE INFO
|
|
17
|
+
const type: ts.Type =
|
|
18
|
+
expression.typeArguments && expression.typeArguments[0]
|
|
19
|
+
? project.checker.getTypeFromTypeNode(
|
|
20
|
+
expression.typeArguments[0],
|
|
21
|
+
)
|
|
22
|
+
: project.checker.getTypeAtLocation(expression.arguments[0]!);
|
|
23
|
+
if (type.isTypeParameter())
|
|
24
|
+
throw new Error(ErrorMessages.GENERIC_ARGUMENT);
|
|
25
|
+
|
|
26
|
+
// DO TRANSFORM
|
|
27
|
+
return ts.factory.createCallExpression(
|
|
28
|
+
IsCloneProgrammer.generate(project, modulo)(type),
|
|
29
|
+
undefined,
|
|
30
|
+
[expression.arguments[0]!],
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const enum ErrorMessages {
|
|
36
|
+
NO_INPUT_VALUE = "Error on typia.isClone(): no input value.",
|
|
37
|
+
GENERIC_ARGUMENT = "Error on typia.isClone(): non-specified generic argument.",
|
|
38
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
|
|
3
|
+
import { RandomProgrammer } from "../../../programmers/RandomProgrammer";
|
|
4
|
+
|
|
5
|
+
import { IProject } from "../../IProject";
|
|
6
|
+
|
|
7
|
+
export namespace RandomTransformer {
|
|
8
|
+
export function transform(
|
|
9
|
+
project: IProject,
|
|
10
|
+
modulo: ts.LeftHandSideExpression,
|
|
11
|
+
expression: ts.CallExpression,
|
|
12
|
+
): ts.Expression {
|
|
13
|
+
if (!expression.typeArguments?.[0])
|
|
14
|
+
throw new Error(ErrorMessages.NOT_SPECIFIED);
|
|
15
|
+
|
|
16
|
+
const type: ts.Type | undefined = project.checker.getTypeFromTypeNode(
|
|
17
|
+
expression.typeArguments[0],
|
|
18
|
+
);
|
|
19
|
+
if (type.isTypeParameter())
|
|
20
|
+
throw new Error(ErrorMessages.NO_GENERIC_ARGUMENT);
|
|
21
|
+
|
|
22
|
+
return ts.factory.createCallExpression(
|
|
23
|
+
RandomProgrammer.generate(
|
|
24
|
+
{
|
|
25
|
+
...project,
|
|
26
|
+
options: {
|
|
27
|
+
...project.options,
|
|
28
|
+
functional: false,
|
|
29
|
+
numeric: false,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
modulo,
|
|
33
|
+
)(type),
|
|
34
|
+
undefined,
|
|
35
|
+
expression.arguments.length
|
|
36
|
+
? [expression.arguments[0]!]
|
|
37
|
+
: undefined,
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const enum ErrorMessages {
|
|
43
|
+
NOT_SPECIFIED = "Error on typia.random(): generic argument is not specified.",
|
|
44
|
+
NO_GENERIC_ARGUMENT = "Error on typia.random(): non-specified generic argument.",
|
|
45
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
|
|
3
|
+
import { ValidateCloneProgrammer } from "../../../programmers/ValidateCloneProgrammer";
|
|
4
|
+
|
|
5
|
+
import { IProject } from "../../IProject";
|
|
6
|
+
|
|
7
|
+
export namespace ValidateCloneTransformer {
|
|
8
|
+
export function transform(
|
|
9
|
+
project: IProject,
|
|
10
|
+
modulo: ts.LeftHandSideExpression,
|
|
11
|
+
expression: ts.CallExpression,
|
|
12
|
+
): ts.Expression {
|
|
13
|
+
if (expression.arguments.length !== 1)
|
|
14
|
+
throw new Error(ErrorMessages.NO_INPUT_VALUE);
|
|
15
|
+
|
|
16
|
+
// GET TYPE INFO
|
|
17
|
+
const type: ts.Type =
|
|
18
|
+
expression.typeArguments && expression.typeArguments[0]
|
|
19
|
+
? project.checker.getTypeFromTypeNode(
|
|
20
|
+
expression.typeArguments[0],
|
|
21
|
+
)
|
|
22
|
+
: project.checker.getTypeAtLocation(expression.arguments[0]!);
|
|
23
|
+
if (type.isTypeParameter())
|
|
24
|
+
throw new Error(ErrorMessages.GENERIC_ARGUMENT);
|
|
25
|
+
|
|
26
|
+
// DO TRANSFORM
|
|
27
|
+
return ts.factory.createCallExpression(
|
|
28
|
+
ValidateCloneProgrammer.generate(project, modulo)(type),
|
|
29
|
+
undefined,
|
|
30
|
+
[expression.arguments[0]!],
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const enum ErrorMessages {
|
|
36
|
+
NO_INPUT_VALUE = "Error on typia.validateClone(): no input value.",
|
|
37
|
+
GENERIC_ARGUMENT = "Error on typia.validateClone(): non-specified generic argument.",
|
|
38
|
+
}
|
|
@@ -11,7 +11,7 @@ export namespace AssertParseTransformer {
|
|
|
11
11
|
expression: ts.CallExpression,
|
|
12
12
|
): ts.Expression {
|
|
13
13
|
// CHECK GENERIC ARGUMENT EXVALIDATETENCE
|
|
14
|
-
if (!expression.typeArguments
|
|
14
|
+
if (!expression.typeArguments?.[0])
|
|
15
15
|
throw new Error(ErrorMessages.NOT_SPECIFIED);
|
|
16
16
|
|
|
17
17
|
// GET TYPE INFO
|
|
@@ -11,7 +11,7 @@ export namespace CreateAssertParseTransformer {
|
|
|
11
11
|
expression: ts.CallExpression,
|
|
12
12
|
): ts.Expression {
|
|
13
13
|
// CHECK GENERIC ARGUMENT EXASSERTTENCE
|
|
14
|
-
if (!expression.typeArguments
|
|
14
|
+
if (!expression.typeArguments?.[0])
|
|
15
15
|
throw new Error(ErrorMessages.NOT_SPECIFIED);
|
|
16
16
|
|
|
17
17
|
// GET TYPE INFO
|
|
@@ -11,7 +11,7 @@ export namespace CreateIsParseTransformer {
|
|
|
11
11
|
expression: ts.CallExpression,
|
|
12
12
|
): ts.Expression {
|
|
13
13
|
// CHECK GENERIC ARGUMENT EXISTENCE
|
|
14
|
-
if (!expression.typeArguments
|
|
14
|
+
if (!expression.typeArguments?.[0])
|
|
15
15
|
throw new Error(ErrorMessages.NOT_SPECIFIED);
|
|
16
16
|
|
|
17
17
|
// GET TYPE INFO
|
|
@@ -11,7 +11,7 @@ export namespace CreateValidateParseTransformer {
|
|
|
11
11
|
expression: ts.CallExpression,
|
|
12
12
|
): ts.Expression {
|
|
13
13
|
// CHECK GENERIC ARGUMENT EXVALIDATETENCE
|
|
14
|
-
if (!expression.typeArguments
|
|
14
|
+
if (!expression.typeArguments?.[0])
|
|
15
15
|
throw new Error(ErrorMessages.NOT_SPECIFIED);
|
|
16
16
|
|
|
17
17
|
// GET TYPE INFO
|
|
@@ -11,7 +11,7 @@ export namespace IsParseTransformer {
|
|
|
11
11
|
expression: ts.CallExpression,
|
|
12
12
|
): ts.Expression {
|
|
13
13
|
// CHECK GENERIC ARGUMENT EXVALIDATETENCE
|
|
14
|
-
if (!expression.typeArguments
|
|
14
|
+
if (!expression.typeArguments?.[0])
|
|
15
15
|
throw new Error(ErrorMessages.NOT_SPECIFIED);
|
|
16
16
|
|
|
17
17
|
// GET TYPE INFO
|
|
@@ -11,7 +11,7 @@ export namespace ValidateParseTransformer {
|
|
|
11
11
|
expression: ts.CallExpression,
|
|
12
12
|
): ts.Expression {
|
|
13
13
|
// CHECK GENERIC ARGUMENT EXVALIDATETENCE
|
|
14
|
-
if (!expression.typeArguments
|
|
14
|
+
if (!expression.typeArguments?.[0])
|
|
15
15
|
throw new Error(ErrorMessages.NOT_SPECIFIED);
|
|
16
16
|
|
|
17
17
|
// GET TYPE INFO
|
|
@@ -11,7 +11,7 @@ export namespace CreateAssertStringifyTransformer {
|
|
|
11
11
|
expression: ts.CallExpression,
|
|
12
12
|
): ts.Expression {
|
|
13
13
|
// CHECK GENERIC ARGUMENT EXISTENCE
|
|
14
|
-
if (!expression.typeArguments
|
|
14
|
+
if (!expression.typeArguments?.[0])
|
|
15
15
|
throw new Error(ErrorMessages.NOT_SPECIFIED);
|
|
16
16
|
|
|
17
17
|
// GET TYPE INFO
|
|
@@ -11,7 +11,7 @@ export namespace CreateIsStringifyTransformer {
|
|
|
11
11
|
expression: ts.CallExpression,
|
|
12
12
|
): ts.Expression {
|
|
13
13
|
// CHECK GENERIC ARGUMENT EXISTENCE
|
|
14
|
-
if (!expression.typeArguments
|
|
14
|
+
if (!expression.typeArguments?.[0])
|
|
15
15
|
throw new Error(ErrorMessages.NOT_SPECIFIED);
|
|
16
16
|
|
|
17
17
|
// GET TYPE INFO
|
|
@@ -11,7 +11,7 @@ export namespace CreateStringifyTransformer {
|
|
|
11
11
|
expression: ts.CallExpression,
|
|
12
12
|
): ts.Expression {
|
|
13
13
|
// CHECK GENERIC ARGUMENT EXISTENCE
|
|
14
|
-
if (!expression.typeArguments
|
|
14
|
+
if (!expression.typeArguments?.[0])
|
|
15
15
|
throw new Error(ErrorMessages.NOT_SPECIFIED);
|
|
16
16
|
|
|
17
17
|
// GET TYPE INFO
|
|
@@ -11,7 +11,7 @@ export namespace CreateValidateStringifyTransformer {
|
|
|
11
11
|
expression: ts.CallExpression,
|
|
12
12
|
): ts.Expression {
|
|
13
13
|
// CHECK GENERIC ARGUMENT EXISTENCE
|
|
14
|
-
if (!expression.typeArguments
|
|
14
|
+
if (!expression.typeArguments?.[0])
|
|
15
15
|
throw new Error(ErrorMessages.NOT_SPECIFIED);
|
|
16
16
|
|
|
17
17
|
// GET TYPE INFO
|
|
@@ -18,7 +18,7 @@ export namespace CreateAssertTransformer {
|
|
|
18
18
|
expression: ts.CallExpression,
|
|
19
19
|
): ts.Expression {
|
|
20
20
|
// CHECK GENERIC ARGUMENT EXISTENCE
|
|
21
|
-
if (!expression.typeArguments
|
|
21
|
+
if (!expression.typeArguments?.[0])
|
|
22
22
|
throw new Error(MESSAGES.NOT_SPECIFIED);
|
|
23
23
|
|
|
24
24
|
// GET TYPE INFO
|
|
@@ -18,7 +18,7 @@ export namespace CreateIsTransformer {
|
|
|
18
18
|
expression: ts.CallExpression,
|
|
19
19
|
): ts.Expression {
|
|
20
20
|
// CHECK GENERIC ARGUMENT EXISTENCE
|
|
21
|
-
if (!expression.typeArguments
|
|
21
|
+
if (!expression.typeArguments?.[0])
|
|
22
22
|
throw new Error(MESSAGES.NOT_SPECIFIED);
|
|
23
23
|
|
|
24
24
|
// GET TYPE INFO
|
|
@@ -18,7 +18,7 @@ export namespace CreateValidateTransformer {
|
|
|
18
18
|
expression: ts.CallExpression,
|
|
19
19
|
): ts.Expression {
|
|
20
20
|
// CHECK GENERIC ARGUMENT EXISTENCE
|
|
21
|
-
if (!expression.typeArguments
|
|
21
|
+
if (!expression.typeArguments?.[0])
|
|
22
22
|
throw new Error(MESSAGES.NOT_SPECIFIED);
|
|
23
23
|
|
|
24
24
|
// GET TYPE INFO
|