typia 3.6.0 → 3.6.2
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 +14 -9
- package/lib/programmers/AssertCloneProgrammer.d.ts +1 -1
- package/lib/programmers/AssertCloneProgrammer.js +4 -4
- package/lib/programmers/AssertCloneProgrammer.js.map +1 -1
- package/lib/programmers/AssertParseProgrammer.d.ts +1 -1
- package/lib/programmers/AssertParseProgrammer.js +3 -3
- package/lib/programmers/AssertParseProgrammer.js.map +1 -1
- package/lib/programmers/AssertProgrammer.d.ts +1 -1
- package/lib/programmers/AssertProgrammer.js +3 -3
- package/lib/programmers/AssertProgrammer.js.map +1 -1
- package/lib/programmers/AssertPruneProgrammer.d.ts +1 -1
- package/lib/programmers/AssertPruneProgrammer.js +4 -4
- package/lib/programmers/AssertPruneProgrammer.js.map +1 -1
- package/lib/programmers/AssertStringifyProgrammer.d.ts +1 -1
- package/lib/programmers/AssertStringifyProgrammer.js +3 -3
- package/lib/programmers/AssertStringifyProgrammer.js.map +1 -1
- package/lib/programmers/CheckerProgrammer.d.ts +1 -1
- package/lib/programmers/CheckerProgrammer.js +2 -2
- package/lib/programmers/CheckerProgrammer.js.map +1 -1
- package/lib/programmers/CloneProgrammer.d.ts +1 -1
- package/lib/programmers/CloneProgrammer.js +4 -4
- package/lib/programmers/CloneProgrammer.js.map +1 -1
- package/lib/programmers/FeatureProgrammer.d.ts +3 -3
- package/lib/programmers/FeatureProgrammer.js +2 -2
- package/lib/programmers/FeatureProgrammer.js.map +1 -1
- package/lib/programmers/IsCloneProgrammer.d.ts +1 -1
- package/lib/programmers/IsCloneProgrammer.js +4 -4
- package/lib/programmers/IsCloneProgrammer.js.map +1 -1
- package/lib/programmers/IsParseProgrammer.d.ts +1 -1
- package/lib/programmers/IsParseProgrammer.js +3 -3
- package/lib/programmers/IsParseProgrammer.js.map +1 -1
- package/lib/programmers/IsProgrammer.d.ts +1 -1
- package/lib/programmers/IsPruneProgrammer.d.ts +1 -1
- package/lib/programmers/IsPruneProgrammer.js +4 -4
- package/lib/programmers/IsPruneProgrammer.js.map +1 -1
- package/lib/programmers/IsStringifyProgrammer.d.ts +1 -1
- package/lib/programmers/IsStringifyProgrammer.js +4 -4
- package/lib/programmers/IsStringifyProgrammer.js.map +1 -1
- package/lib/programmers/PruneProgrammer.d.ts +1 -1
- package/lib/programmers/PruneProgrammer.js +2 -2
- package/lib/programmers/PruneProgrammer.js.map +1 -1
- package/lib/programmers/RandomProgrammer.d.ts +1 -1
- package/lib/programmers/RandomProgrammer.js +2 -2
- package/lib/programmers/RandomProgrammer.js.map +1 -1
- package/lib/programmers/StringifyProgrammer.d.ts +1 -1
- package/lib/programmers/StringifyProgrammer.js +2 -2
- package/lib/programmers/StringifyProgrammer.js.map +1 -1
- package/lib/programmers/ValidateCloneProgrammer.d.ts +1 -1
- package/lib/programmers/ValidateCloneProgrammer.js +4 -4
- package/lib/programmers/ValidateCloneProgrammer.js.map +1 -1
- package/lib/programmers/ValidateParseProgrammer.d.ts +1 -1
- package/lib/programmers/ValidateParseProgrammer.js +3 -3
- package/lib/programmers/ValidateParseProgrammer.js.map +1 -1
- package/lib/programmers/ValidateProgrammer.d.ts +1 -1
- package/lib/programmers/ValidateProgrammer.js +3 -3
- package/lib/programmers/ValidateProgrammer.js.map +1 -1
- package/lib/programmers/ValidatePruneProgrammer.d.ts +1 -1
- package/lib/programmers/ValidatePruneProgrammer.js +4 -4
- package/lib/programmers/ValidatePruneProgrammer.js.map +1 -1
- package/lib/programmers/ValidateStringifyProgrammer.d.ts +1 -1
- package/lib/programmers/ValidateStringifyProgrammer.js +4 -4
- package/lib/programmers/ValidateStringifyProgrammer.js.map +1 -1
- package/lib/transformers/features/miscellaneous/AssertCloneTransformer.d.ts +1 -3
- package/lib/transformers/features/miscellaneous/AssertCloneTransformer.js +2 -15
- package/lib/transformers/features/miscellaneous/AssertCloneTransformer.js.map +1 -1
- package/lib/transformers/features/miscellaneous/AssertPruneTransformer.d.ts +1 -3
- package/lib/transformers/features/miscellaneous/AssertPruneTransformer.js +2 -15
- package/lib/transformers/features/miscellaneous/AssertPruneTransformer.js.map +1 -1
- package/lib/transformers/features/miscellaneous/CloneTransformer.d.ts +1 -3
- package/lib/transformers/features/miscellaneous/CloneTransformer.js +2 -26
- package/lib/transformers/features/miscellaneous/CloneTransformer.js.map +1 -1
- package/lib/transformers/features/miscellaneous/CreateAssertCloneTransformer.d.ts +1 -3
- package/lib/transformers/features/miscellaneous/CreateAssertCloneTransformer.js +2 -10
- package/lib/transformers/features/miscellaneous/CreateAssertCloneTransformer.js.map +1 -1
- package/lib/transformers/features/miscellaneous/CreateAssertPruneTransformer.d.ts +1 -3
- package/lib/transformers/features/miscellaneous/CreateAssertPruneTransformer.js +2 -10
- package/lib/transformers/features/miscellaneous/CreateAssertPruneTransformer.js.map +1 -1
- package/lib/transformers/features/miscellaneous/CreateCloneTransformer.d.ts +1 -3
- package/lib/transformers/features/miscellaneous/CreateCloneTransformer.js +2 -10
- package/lib/transformers/features/miscellaneous/CreateCloneTransformer.js.map +1 -1
- package/lib/transformers/features/miscellaneous/CreateIsCloneTransformer.d.ts +1 -3
- package/lib/transformers/features/miscellaneous/CreateIsCloneTransformer.js +2 -10
- package/lib/transformers/features/miscellaneous/CreateIsCloneTransformer.js.map +1 -1
- package/lib/transformers/features/miscellaneous/CreateIsPruneTransformer.d.ts +1 -3
- package/lib/transformers/features/miscellaneous/CreateIsPruneTransformer.js +2 -10
- package/lib/transformers/features/miscellaneous/CreateIsPruneTransformer.js.map +1 -1
- package/lib/transformers/features/miscellaneous/CreatePruneTransformer.d.ts +1 -3
- package/lib/transformers/features/miscellaneous/CreatePruneTransformer.js +2 -10
- package/lib/transformers/features/miscellaneous/CreatePruneTransformer.js.map +1 -1
- package/lib/transformers/features/miscellaneous/CreateRandomGenerator.js +3 -2
- package/lib/transformers/features/miscellaneous/CreateRandomGenerator.js.map +1 -1
- package/lib/transformers/features/miscellaneous/CreateValidateCloneTransformer.d.ts +1 -3
- package/lib/transformers/features/miscellaneous/CreateValidateCloneTransformer.js +2 -10
- package/lib/transformers/features/miscellaneous/CreateValidateCloneTransformer.js.map +1 -1
- package/lib/transformers/features/miscellaneous/CreateValidatePruneTransformer.d.ts +1 -3
- package/lib/transformers/features/miscellaneous/CreateValidatePruneTransformer.js +2 -10
- package/lib/transformers/features/miscellaneous/CreateValidatePruneTransformer.js.map +1 -1
- package/lib/transformers/features/miscellaneous/IsCloneTransformer.d.ts +1 -3
- package/lib/transformers/features/miscellaneous/IsCloneTransformer.js +2 -15
- package/lib/transformers/features/miscellaneous/IsCloneTransformer.js.map +1 -1
- package/lib/transformers/features/miscellaneous/IsPruneTransformer.d.ts +1 -3
- package/lib/transformers/features/miscellaneous/IsPruneTransformer.js +2 -15
- package/lib/transformers/features/miscellaneous/IsPruneTransformer.js.map +1 -1
- package/lib/transformers/features/miscellaneous/PruneTransformer.d.ts +1 -3
- package/lib/transformers/features/miscellaneous/PruneTransformer.js +2 -26
- package/lib/transformers/features/miscellaneous/PruneTransformer.js.map +1 -1
- package/lib/transformers/features/miscellaneous/RandomTransformer.js +3 -2
- package/lib/transformers/features/miscellaneous/RandomTransformer.js.map +1 -1
- package/lib/transformers/features/miscellaneous/ValidateCloneTransformer.d.ts +1 -3
- package/lib/transformers/features/miscellaneous/ValidateCloneTransformer.js +2 -15
- package/lib/transformers/features/miscellaneous/ValidateCloneTransformer.js.map +1 -1
- package/lib/transformers/features/miscellaneous/ValidatePruneTransformer.d.ts +1 -3
- package/lib/transformers/features/miscellaneous/ValidatePruneTransformer.js +2 -15
- package/lib/transformers/features/miscellaneous/ValidatePruneTransformer.js.map +1 -1
- package/lib/transformers/features/parsers/AssertParseTransformer.d.ts +1 -3
- package/lib/transformers/features/parsers/AssertParseTransformer.js +2 -14
- package/lib/transformers/features/parsers/AssertParseTransformer.js.map +1 -1
- package/lib/transformers/features/parsers/CreateAssertParseTransformer.d.ts +1 -3
- package/lib/transformers/features/parsers/CreateAssertParseTransformer.js +2 -10
- package/lib/transformers/features/parsers/CreateAssertParseTransformer.js.map +1 -1
- package/lib/transformers/features/parsers/CreateIsParseTransformer.d.ts +1 -3
- package/lib/transformers/features/parsers/CreateIsParseTransformer.js +2 -10
- package/lib/transformers/features/parsers/CreateIsParseTransformer.js.map +1 -1
- package/lib/transformers/features/parsers/CreateValidateParseTransformer.d.ts +1 -3
- package/lib/transformers/features/parsers/CreateValidateParseTransformer.js +2 -10
- package/lib/transformers/features/parsers/CreateValidateParseTransformer.js.map +1 -1
- package/lib/transformers/features/parsers/IsParseTransformer.d.ts +1 -3
- package/lib/transformers/features/parsers/IsParseTransformer.js +2 -14
- package/lib/transformers/features/parsers/IsParseTransformer.js.map +1 -1
- package/lib/transformers/features/parsers/ValidateParseTransformer.d.ts +1 -3
- package/lib/transformers/features/parsers/ValidateParseTransformer.js +2 -14
- package/lib/transformers/features/parsers/ValidateParseTransformer.js.map +1 -1
- package/lib/transformers/features/stringifiers/AssertStringifyTransformer.d.ts +1 -3
- package/lib/transformers/features/stringifiers/AssertStringifyTransformer.js +4 -15
- package/lib/transformers/features/stringifiers/AssertStringifyTransformer.js.map +1 -1
- package/lib/transformers/features/stringifiers/CreateAssertStringifyTransformer.d.ts +1 -3
- package/lib/transformers/features/stringifiers/CreateAssertStringifyTransformer.js +2 -10
- package/lib/transformers/features/stringifiers/CreateAssertStringifyTransformer.js.map +1 -1
- package/lib/transformers/features/stringifiers/CreateIsStringifyTransformer.d.ts +1 -3
- package/lib/transformers/features/stringifiers/CreateIsStringifyTransformer.js +2 -10
- package/lib/transformers/features/stringifiers/CreateIsStringifyTransformer.js.map +1 -1
- package/lib/transformers/features/stringifiers/CreateStringifyTransformer.d.ts +1 -3
- package/lib/transformers/features/stringifiers/CreateStringifyTransformer.js +2 -10
- package/lib/transformers/features/stringifiers/CreateStringifyTransformer.js.map +1 -1
- package/lib/transformers/features/stringifiers/CreateValidateStringifyProgrammer.d.ts +1 -3
- package/lib/transformers/features/stringifiers/CreateValidateStringifyProgrammer.js +4 -10
- package/lib/transformers/features/stringifiers/CreateValidateStringifyProgrammer.js.map +1 -1
- package/lib/transformers/features/stringifiers/IsStringifyTransformer.d.ts +1 -3
- package/lib/transformers/features/stringifiers/IsStringifyTransformer.js +2 -15
- package/lib/transformers/features/stringifiers/IsStringifyTransformer.js.map +1 -1
- package/lib/transformers/features/stringifiers/StringifyTransformer.d.ts +1 -3
- package/lib/transformers/features/stringifiers/StringifyTransformer.js +2 -26
- package/lib/transformers/features/stringifiers/StringifyTransformer.js.map +1 -1
- package/lib/transformers/features/stringifiers/ValidateStringifyTransformer.d.ts +1 -3
- package/lib/transformers/features/stringifiers/ValidateStringifyTransformer.js +4 -15
- package/lib/transformers/features/stringifiers/ValidateStringifyTransformer.js.map +1 -1
- package/lib/transformers/features/validators/AssertTransformer.d.ts +1 -3
- package/lib/transformers/features/validators/AssertTransformer.js +6 -22
- package/lib/transformers/features/validators/AssertTransformer.js.map +1 -1
- package/lib/transformers/features/validators/CreateAssertTransformer.d.ts +1 -3
- package/lib/transformers/features/validators/CreateAssertTransformer.js +6 -17
- package/lib/transformers/features/validators/CreateAssertTransformer.js.map +1 -1
- package/lib/transformers/features/validators/CreateIsTransformer.d.ts +1 -3
- package/lib/transformers/features/validators/CreateIsTransformer.js +4 -17
- package/lib/transformers/features/validators/CreateIsTransformer.js.map +1 -1
- package/lib/transformers/features/validators/CreateValidateTransformer.d.ts +1 -3
- package/lib/transformers/features/validators/CreateValidateTransformer.js +6 -17
- package/lib/transformers/features/validators/CreateValidateTransformer.js.map +1 -1
- package/lib/transformers/features/validators/IsTransformer.d.ts +1 -3
- package/lib/transformers/features/validators/IsTransformer.js +6 -22
- package/lib/transformers/features/validators/IsTransformer.js.map +1 -1
- package/lib/transformers/features/validators/ValidateTransformer.d.ts +1 -3
- package/lib/transformers/features/validators/ValidateTransformer.js +6 -22
- package/lib/transformers/features/validators/ValidateTransformer.js.map +1 -1
- package/lib/transformers/internal/GenericTransformer.d.ts +6 -0
- package/lib/transformers/internal/GenericTransformer.js +72 -0
- package/lib/transformers/internal/GenericTransformer.js.map +1 -0
- package/package.json +2 -1
- package/src/programmers/AssertCloneProgrammer.ts +6 -7
- package/src/programmers/AssertParseProgrammer.ts +5 -6
- package/src/programmers/AssertProgrammer.ts +3 -3
- package/src/programmers/AssertPruneProgrammer.ts +4 -4
- package/src/programmers/AssertStringifyProgrammer.ts +3 -3
- package/src/programmers/CheckerProgrammer.ts +3 -2
- package/src/programmers/CloneProgrammer.ts +6 -7
- package/src/programmers/FeatureProgrammer.ts +5 -5
- package/src/programmers/IsCloneProgrammer.ts +7 -7
- package/src/programmers/IsParseProgrammer.ts +5 -6
- package/src/programmers/IsPruneProgrammer.ts +4 -4
- package/src/programmers/IsStringifyProgrammer.ts +5 -4
- package/src/programmers/PruneProgrammer.ts +2 -2
- package/src/programmers/RandomProgrammer.ts +4 -5
- package/src/programmers/StringifyProgrammer.ts +2 -2
- package/src/programmers/ValidateCloneProgrammer.ts +6 -7
- package/src/programmers/ValidateParseProgrammer.ts +5 -6
- package/src/programmers/ValidateProgrammer.ts +5 -6
- package/src/programmers/ValidatePruneProgrammer.ts +6 -7
- package/src/programmers/ValidateStringifyProgrammer.ts +5 -4
- package/src/transformers/features/miscellaneous/AssertCloneTransformer.ts +4 -33
- package/src/transformers/features/miscellaneous/AssertPruneTransformer.ts +4 -33
- package/src/transformers/features/miscellaneous/CloneTransformer.ts +4 -41
- package/src/transformers/features/miscellaneous/CreateAssertCloneTransformer.ts +4 -27
- package/src/transformers/features/miscellaneous/CreateAssertPruneTransformer.ts +4 -27
- package/src/transformers/features/miscellaneous/CreateCloneTransformer.ts +4 -26
- package/src/transformers/features/miscellaneous/CreateIsCloneTransformer.ts +4 -27
- package/src/transformers/features/miscellaneous/CreateIsPruneTransformer.ts +4 -27
- package/src/transformers/features/miscellaneous/CreatePruneTransformer.ts +4 -26
- package/src/transformers/features/miscellaneous/CreateRandomGenerator.ts +7 -4
- package/src/transformers/features/miscellaneous/CreateValidateCloneTransformer.ts +4 -27
- package/src/transformers/features/miscellaneous/CreateValidatePruneTransformer.ts +4 -27
- package/src/transformers/features/miscellaneous/IsCloneTransformer.ts +4 -33
- package/src/transformers/features/miscellaneous/IsPruneTransformer.ts +4 -33
- package/src/transformers/features/miscellaneous/PruneTransformer.ts +4 -41
- package/src/transformers/features/miscellaneous/RandomTransformer.ts +7 -4
- package/src/transformers/features/miscellaneous/ValidateCloneTransformer.ts +4 -33
- package/src/transformers/features/miscellaneous/ValidatePruneTransformer.ts +4 -33
- package/src/transformers/features/parsers/AssertParseTransformer.ts +4 -31
- package/src/transformers/features/parsers/CreateAssertParseTransformer.ts +4 -27
- package/src/transformers/features/parsers/CreateIsParseTransformer.ts +4 -27
- package/src/transformers/features/parsers/CreateValidateParseTransformer.ts +4 -27
- package/src/transformers/features/parsers/IsParseTransformer.ts +4 -31
- package/src/transformers/features/parsers/ValidateParseTransformer.ts +4 -31
- package/src/transformers/features/stringifiers/AssertStringifyTransformer.ts +5 -33
- package/src/transformers/features/stringifiers/CreateAssertStringifyTransformer.ts +4 -27
- package/src/transformers/features/stringifiers/CreateIsStringifyTransformer.ts +4 -27
- package/src/transformers/features/stringifiers/CreateStringifyTransformer.ts +4 -26
- package/src/transformers/features/stringifiers/CreateValidateStringifyProgrammer.ts +6 -27
- package/src/transformers/features/stringifiers/IsStringifyTransformer.ts +4 -33
- package/src/transformers/features/stringifiers/StringifyTransformer.ts +4 -41
- package/src/transformers/features/stringifiers/ValidateStringifyTransformer.ts +5 -33
- package/src/transformers/features/validators/AssertTransformer.ts +6 -38
- package/src/transformers/features/validators/CreateAssertTransformer.ts +7 -30
- package/src/transformers/features/validators/CreateIsTransformer.ts +5 -30
- package/src/transformers/features/validators/CreateValidateTransformer.ts +7 -30
- package/src/transformers/features/validators/IsTransformer.ts +5 -38
- package/src/transformers/features/validators/ValidateTransformer.ts +6 -38
- package/src/transformers/internal/GenericTransformer.ts +99 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
+
if (!m) return o;
|
|
5
|
+
var i = m.call(o), r, ar = [], e;
|
|
6
|
+
try {
|
|
7
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
+
}
|
|
9
|
+
catch (error) { e = { error: error }; }
|
|
10
|
+
finally {
|
|
11
|
+
try {
|
|
12
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
+
}
|
|
14
|
+
finally { if (e) throw e.error; }
|
|
15
|
+
}
|
|
16
|
+
return ar;
|
|
17
|
+
};
|
|
18
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
19
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.GenericTransformer = void 0;
|
|
23
|
+
var typescript_1 = __importDefault(require("typescript"));
|
|
24
|
+
var GenericTransformer;
|
|
25
|
+
(function (GenericTransformer) {
|
|
26
|
+
GenericTransformer.scalar = function (method) {
|
|
27
|
+
return function (programmer) {
|
|
28
|
+
return function (project, modulo, expression) {
|
|
29
|
+
if (expression.arguments.length !== 1)
|
|
30
|
+
throw new Error("Error on typia.".concat(method, "(): no input value."));
|
|
31
|
+
var _a = __read(expression.typeArguments && expression.typeArguments[0]
|
|
32
|
+
? [
|
|
33
|
+
project.checker.getTypeFromTypeNode(expression.typeArguments[0]),
|
|
34
|
+
expression.typeArguments[0],
|
|
35
|
+
true,
|
|
36
|
+
]
|
|
37
|
+
: [
|
|
38
|
+
project.checker.getTypeAtLocation(expression.arguments[0]),
|
|
39
|
+
expression.arguments[0],
|
|
40
|
+
false,
|
|
41
|
+
], 3), type = _a[0], node = _a[1], generic = _a[2];
|
|
42
|
+
if (type.isTypeParameter())
|
|
43
|
+
throw new Error("Error on typia.".concat(method, "(): non-specified generic argument."));
|
|
44
|
+
return typescript_1.default.factory.createCallExpression(programmer(project, modulo)(type, generic
|
|
45
|
+
? node.getText()
|
|
46
|
+
: name(project.checker)(type)(node)), undefined, [expression.arguments[0]]);
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
GenericTransformer.factory = function (method) {
|
|
51
|
+
return function (programmer) {
|
|
52
|
+
return function (project, modulo, expression) {
|
|
53
|
+
var _a;
|
|
54
|
+
if (!((_a = expression.typeArguments) === null || _a === void 0 ? void 0 : _a[0]))
|
|
55
|
+
throw new Error("Error on typia.".concat(method, "(): generic argument is not specified."));
|
|
56
|
+
var node = expression.typeArguments[0];
|
|
57
|
+
var type = project.checker.getTypeFromTypeNode(node);
|
|
58
|
+
if (type.isTypeParameter())
|
|
59
|
+
throw new Error("Error on typia.".concat(method, "(): non-specified generic argument."));
|
|
60
|
+
return programmer(project, modulo)(type, node.getText());
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
var name = function (checker) {
|
|
65
|
+
return function (type) {
|
|
66
|
+
return function (node) {
|
|
67
|
+
return checker.typeToString(type, node, typescript_1.default.TypeFormatFlags.NodeBuilderFlagsMask);
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
})(GenericTransformer = exports.GenericTransformer || (exports.GenericTransformer = {}));
|
|
72
|
+
//# sourceMappingURL=GenericTransformer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GenericTransformer.js","sourceRoot":"","sources":["../../../src/transformers/internal/GenericTransformer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4B;AAI5B,IAAiB,kBAAkB,CA8FlC;AA9FD,WAAiB,kBAAkB;IAClB,yBAAM,GACf,UAAC,MAAc;QACf,OAAA,UACI,UAGsD;YAE1D,OAAA,UACI,OAAiB,EACjB,MAAiC,EACjC,UAA6B;gBAG7B,IAAI,UAAU,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC;oBACjC,MAAM,IAAI,KAAK,CAAC,yBAAkB,MAAM,wBAAqB,CAAC,CAAC;gBAG7D,IAAA,KAAA,OACF,UAAU,CAAC,aAAa,IAAI,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC;oBACnD,CAAC,CAAC;wBACI,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAC/B,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAC9B;wBACD,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC;wBAC3B,IAAI;qBACP;oBACH,CAAC,CAAC;wBACI,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAC7B,UAAU,CAAC,SAAS,CAAC,CAAC,CAAE,CAC3B;wBACD,UAAU,CAAC,SAAS,CAAC,CAAC,CAAE;wBACxB,KAAK;qBACR,IAAA,EAfJ,IAAI,QAAA,EAAE,IAAI,QAAA,EAAE,OAAO,QAef,CAAC;gBACZ,IAAI,IAAI,CAAC,eAAe,EAAE;oBACtB,MAAM,IAAI,KAAK,CACX,yBAAkB,MAAM,wCAAqC,CAChE,CAAC;gBAGN,OAAO,oBAAE,CAAC,OAAO,CAAC,oBAAoB,CAClC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CACvB,IAAI,EACJ,OAAO;oBACH,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE;oBAChB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAC1C,EACD,SAAS,EACT,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAE,CAAC,CAC7B,CAAC;YACN,CAAC;QA1CD,CA0CC;IAhDD,CAgDC,CAAC;IAEO,0BAAO,GAChB,UAAC,MAAc;QACf,OAAA,UACI,UAGsD;YAE1D,OAAA,UACI,OAAiB,EACjB,MAAiC,EACjC,UAA6B;;gBAG7B,IAAI,CAAC,CAAA,MAAA,UAAU,CAAC,aAAa,0CAAG,CAAC,CAAC,CAAA;oBAC9B,MAAM,IAAI,KAAK,CACX,yBAAkB,MAAM,2CAAwC,CACnE,CAAC;gBAGN,IAAM,IAAI,GAAgB,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;gBACtD,IAAM,IAAI,GAAY,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;gBAEhE,IAAI,IAAI,CAAC,eAAe,EAAE;oBACtB,MAAM,IAAI,KAAK,CACX,yBAAkB,MAAM,wCAAqC,CAChE,CAAC;gBAGN,OAAO,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;YAC7D,CAAC;QAtBD,CAsBC;IA5BD,CA4BC,CAAC;IAEN,IAAM,IAAI,GACN,UAAC,OAAuB;QACxB,OAAA,UAAC,IAAa;YACd,OAAA,UAAC,IAAa;gBACV,OAAA,OAAO,CAAC,YAAY,CAChB,IAAI,EACJ,IAAI,EACJ,oBAAE,CAAC,eAAe,CAAC,oBAAoB,CAC1C;YAJD,CAIC;QALL,CAKK;IANL,CAMK,CAAC;AACd,CAAC,EA9FgB,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QA8FlC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typia",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.2",
|
|
4
4
|
"description": "Superfast runtime validators with only one line",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"eslint": "eslint ./**/*.ts",
|
|
19
19
|
"eslint:fix": "eslint ./**/*.ts --fix",
|
|
20
20
|
"issue": "node test/issue",
|
|
21
|
+
"issue:generate": "ts-node src/executable/typia generate --input test/issues/input --output test/issues/output --project test/tsconfig.json",
|
|
21
22
|
"package:latest": "ts-node build/publish.ts latest",
|
|
22
23
|
"package:next": "ts-node build/publish.ts next",
|
|
23
24
|
"package:deprecate": "npm deprecate typescript-json \"Renamed to typia\"",
|
|
@@ -12,7 +12,7 @@ import { CloneProgrammer } from "./CloneProgrammer";
|
|
|
12
12
|
export namespace AssertCloneProgrammer {
|
|
13
13
|
export const generate =
|
|
14
14
|
(project: IProject, modulo: ts.LeftHandSideExpression) =>
|
|
15
|
-
(type: ts.Type) =>
|
|
15
|
+
(type: ts.Type, name?: string) =>
|
|
16
16
|
ts.factory.createArrowFunction(
|
|
17
17
|
undefined,
|
|
18
18
|
undefined,
|
|
@@ -23,16 +23,15 @@ export namespace AssertCloneProgrammer {
|
|
|
23
23
|
),
|
|
24
24
|
],
|
|
25
25
|
ts.factory.createTypeReferenceNode(
|
|
26
|
-
`typia.Primitive<${
|
|
27
|
-
project.checker,
|
|
28
|
-
|
|
29
|
-
)}>`,
|
|
26
|
+
`typia.Primitive<${
|
|
27
|
+
name ?? TypeFactory.getFullName(project.checker, type)
|
|
28
|
+
}>`,
|
|
30
29
|
),
|
|
31
30
|
undefined,
|
|
32
31
|
ts.factory.createBlock([
|
|
33
32
|
StatementFactory.constant(
|
|
34
33
|
"assert",
|
|
35
|
-
AssertProgrammer.generate(project, modulo)(type),
|
|
34
|
+
AssertProgrammer.generate(project, modulo)(type, name),
|
|
36
35
|
),
|
|
37
36
|
StatementFactory.constant(
|
|
38
37
|
"clone",
|
|
@@ -46,7 +45,7 @@ export namespace AssertCloneProgrammer {
|
|
|
46
45
|
},
|
|
47
46
|
},
|
|
48
47
|
modulo,
|
|
49
|
-
)(type),
|
|
48
|
+
)(type, name),
|
|
50
49
|
),
|
|
51
50
|
ts.factory.createExpressionStatement(
|
|
52
51
|
ts.factory.createCallExpression(
|
|
@@ -11,7 +11,7 @@ import { AssertProgrammer } from "./AssertProgrammer";
|
|
|
11
11
|
export namespace AssertParseProgrammer {
|
|
12
12
|
export const generate =
|
|
13
13
|
(project: IProject, modulo: ts.LeftHandSideExpression) =>
|
|
14
|
-
(type: ts.Type) =>
|
|
14
|
+
(type: ts.Type, name?: string) =>
|
|
15
15
|
ts.factory.createArrowFunction(
|
|
16
16
|
undefined,
|
|
17
17
|
undefined,
|
|
@@ -22,10 +22,9 @@ export namespace AssertParseProgrammer {
|
|
|
22
22
|
),
|
|
23
23
|
],
|
|
24
24
|
ts.factory.createTypeReferenceNode(
|
|
25
|
-
`typia.Primitive<${
|
|
26
|
-
project.checker,
|
|
27
|
-
|
|
28
|
-
)}>`,
|
|
25
|
+
`typia.Primitive<${
|
|
26
|
+
name ?? TypeFactory.getFullName(project.checker, type)
|
|
27
|
+
}>`,
|
|
29
28
|
),
|
|
30
29
|
undefined,
|
|
31
30
|
ts.factory.createBlock([
|
|
@@ -41,7 +40,7 @@ export namespace AssertParseProgrammer {
|
|
|
41
40
|
},
|
|
42
41
|
},
|
|
43
42
|
modulo,
|
|
44
|
-
)(type),
|
|
43
|
+
)(type, name),
|
|
45
44
|
),
|
|
46
45
|
ts.factory.createExpressionStatement(
|
|
47
46
|
ts.factory.createBinaryExpression(
|
|
@@ -19,7 +19,7 @@ export namespace AssertProgrammer {
|
|
|
19
19
|
modulo: ts.LeftHandSideExpression,
|
|
20
20
|
equals: boolean = false,
|
|
21
21
|
) =>
|
|
22
|
-
(type: ts.Type) => {
|
|
22
|
+
(type: ts.Type, name?: string) => {
|
|
23
23
|
const importer: FunctionImporter = new FunctionImporter();
|
|
24
24
|
const program: ts.ArrowFunction = CheckerProgrammer.generate(
|
|
25
25
|
project,
|
|
@@ -35,7 +35,7 @@ export namespace AssertProgrammer {
|
|
|
35
35
|
success: ts.factory.createTrue(),
|
|
36
36
|
},
|
|
37
37
|
importer,
|
|
38
|
-
)(type);
|
|
38
|
+
)(type, name);
|
|
39
39
|
|
|
40
40
|
return ts.factory.createArrowFunction(
|
|
41
41
|
undefined,
|
|
@@ -47,7 +47,7 @@ export namespace AssertProgrammer {
|
|
|
47
47
|
),
|
|
48
48
|
],
|
|
49
49
|
ts.factory.createTypeReferenceNode(
|
|
50
|
-
TypeFactory.getFullName(project.checker, type),
|
|
50
|
+
name ?? TypeFactory.getFullName(project.checker, type),
|
|
51
51
|
),
|
|
52
52
|
undefined,
|
|
53
53
|
ts.factory.createBlock(
|
|
@@ -12,7 +12,7 @@ import { PruneProgrammer } from "./PruneProgrammer";
|
|
|
12
12
|
export namespace AssertPruneProgrammer {
|
|
13
13
|
export const generate =
|
|
14
14
|
(project: IProject, modulo: ts.LeftHandSideExpression) =>
|
|
15
|
-
(type: ts.Type) =>
|
|
15
|
+
(type: ts.Type, name?: string) =>
|
|
16
16
|
ts.factory.createArrowFunction(
|
|
17
17
|
undefined,
|
|
18
18
|
undefined,
|
|
@@ -23,13 +23,13 @@ export namespace AssertPruneProgrammer {
|
|
|
23
23
|
),
|
|
24
24
|
],
|
|
25
25
|
ts.factory.createTypeReferenceNode(
|
|
26
|
-
TypeFactory.getFullName(project.checker, type),
|
|
26
|
+
name ?? TypeFactory.getFullName(project.checker, type),
|
|
27
27
|
),
|
|
28
28
|
undefined,
|
|
29
29
|
ts.factory.createBlock([
|
|
30
30
|
StatementFactory.constant(
|
|
31
31
|
"assert",
|
|
32
|
-
AssertProgrammer.generate(project, modulo)(type),
|
|
32
|
+
AssertProgrammer.generate(project, modulo)(type, name),
|
|
33
33
|
),
|
|
34
34
|
StatementFactory.constant(
|
|
35
35
|
"prune",
|
|
@@ -43,7 +43,7 @@ export namespace AssertPruneProgrammer {
|
|
|
43
43
|
},
|
|
44
44
|
},
|
|
45
45
|
modulo,
|
|
46
|
-
)(type),
|
|
46
|
+
)(type, name),
|
|
47
47
|
),
|
|
48
48
|
ts.factory.createExpressionStatement(
|
|
49
49
|
ts.factory.createCallExpression(
|
|
@@ -12,7 +12,7 @@ import { StringifyProgrammer } from "./StringifyProgrammer";
|
|
|
12
12
|
export namespace AssertStringifyProgrammer {
|
|
13
13
|
export const generate =
|
|
14
14
|
(project: IProject, modulo: ts.LeftHandSideExpression) =>
|
|
15
|
-
(type: ts.Type) =>
|
|
15
|
+
(type: ts.Type, name?: string) =>
|
|
16
16
|
ts.factory.createArrowFunction(
|
|
17
17
|
undefined,
|
|
18
18
|
undefined,
|
|
@@ -37,7 +37,7 @@ export namespace AssertStringifyProgrammer {
|
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
39
|
modulo,
|
|
40
|
-
)(type),
|
|
40
|
+
)(type, name),
|
|
41
41
|
),
|
|
42
42
|
StatementFactory.constant(
|
|
43
43
|
"stringify",
|
|
@@ -51,7 +51,7 @@ export namespace AssertStringifyProgrammer {
|
|
|
51
51
|
},
|
|
52
52
|
},
|
|
53
53
|
modulo,
|
|
54
|
-
)(type),
|
|
54
|
+
)(type, name),
|
|
55
55
|
),
|
|
56
56
|
ts.factory.createReturnStatement(
|
|
57
57
|
ts.factory.createCallExpression(
|
|
@@ -128,12 +128,13 @@ export namespace CheckerProgrammer {
|
|
|
128
128
|
const output: FeatureProgrammer.IConfig = {
|
|
129
129
|
types: {
|
|
130
130
|
input: () => TypeFactory.keyword("any"),
|
|
131
|
-
output: (type) =>
|
|
131
|
+
output: (type, name) =>
|
|
132
132
|
ts.factory.createTypePredicateNode(
|
|
133
133
|
undefined,
|
|
134
134
|
"input",
|
|
135
135
|
ts.factory.createTypeReferenceNode(
|
|
136
|
-
|
|
136
|
+
name ??
|
|
137
|
+
TypeFactory.getFullName(project.checker, type),
|
|
137
138
|
),
|
|
138
139
|
),
|
|
139
140
|
},
|
|
@@ -312,16 +312,15 @@ export namespace CloneProgrammer {
|
|
|
312
312
|
importer: FunctionImporter,
|
|
313
313
|
): FeatureProgrammer.IConfig => ({
|
|
314
314
|
types: {
|
|
315
|
-
input: (type) =>
|
|
315
|
+
input: (type, name) =>
|
|
316
316
|
ts.factory.createTypeReferenceNode(
|
|
317
|
-
TypeFactory.getFullName(project.checker, type),
|
|
317
|
+
name ?? TypeFactory.getFullName(project.checker, type),
|
|
318
318
|
),
|
|
319
|
-
output: (type) =>
|
|
319
|
+
output: (type, name) =>
|
|
320
320
|
ts.factory.createTypeReferenceNode(
|
|
321
|
-
`typia.Primitive<${
|
|
322
|
-
project.checker,
|
|
323
|
-
|
|
324
|
-
)}>`,
|
|
321
|
+
`typia.Primitive<${
|
|
322
|
+
name ?? TypeFactory.getFullName(project.checker, type)
|
|
323
|
+
}>`,
|
|
325
324
|
),
|
|
326
325
|
},
|
|
327
326
|
functors: FUNCTORS,
|
|
@@ -70,8 +70,8 @@ export namespace FeatureProgrammer {
|
|
|
70
70
|
}
|
|
71
71
|
export namespace IConfig {
|
|
72
72
|
export interface ITypes {
|
|
73
|
-
input: (type: ts.Type,
|
|
74
|
-
output: (type: ts.Type,
|
|
73
|
+
input: (type: ts.Type, name?: string) => ts.TypeNode;
|
|
74
|
+
output: (type: ts.Type, name?: string) => ts.TypeNode;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
export interface IObjector {
|
|
@@ -227,7 +227,7 @@ export namespace FeatureProgrammer {
|
|
|
227
227
|
collection: MetadataCollection,
|
|
228
228
|
) => ts.Statement[] | undefined,
|
|
229
229
|
) =>
|
|
230
|
-
(type: ts.Type,
|
|
230
|
+
(type: ts.Type, name?: string) => {
|
|
231
231
|
const [collection, meta] = config.initializer(project, type);
|
|
232
232
|
|
|
233
233
|
// ITERATE OVER ALL METADATA
|
|
@@ -257,10 +257,10 @@ export namespace FeatureProgrammer {
|
|
|
257
257
|
return ts.factory.createArrowFunction(
|
|
258
258
|
undefined,
|
|
259
259
|
undefined,
|
|
260
|
-
PARAMETERS(config)(config.types.input(type,
|
|
260
|
+
PARAMETERS(config)(config.types.input(type, name))(
|
|
261
261
|
ValueFactory.INPUT(),
|
|
262
262
|
),
|
|
263
|
-
config.types.output(type,
|
|
263
|
+
config.types.output(type, name),
|
|
264
264
|
undefined,
|
|
265
265
|
ts.factory.createBlock(
|
|
266
266
|
[
|
|
@@ -12,7 +12,7 @@ import { IsProgrammer } from "./IsProgrammer";
|
|
|
12
12
|
export namespace IsCloneProgrammer {
|
|
13
13
|
export const generate =
|
|
14
14
|
(project: IProject, modulo: ts.LeftHandSideExpression) =>
|
|
15
|
-
(type: ts.Type) =>
|
|
15
|
+
(type: ts.Type, name?: string) =>
|
|
16
16
|
ts.factory.createArrowFunction(
|
|
17
17
|
undefined,
|
|
18
18
|
undefined,
|
|
@@ -24,10 +24,10 @@ export namespace IsCloneProgrammer {
|
|
|
24
24
|
],
|
|
25
25
|
ts.factory.createUnionTypeNode([
|
|
26
26
|
ts.factory.createTypeReferenceNode(
|
|
27
|
-
`typia.Primitive<${
|
|
28
|
-
|
|
29
|
-
type
|
|
30
|
-
|
|
27
|
+
`typia.Primitive<${
|
|
28
|
+
name ??
|
|
29
|
+
TypeFactory.getFullName(project.checker, type)
|
|
30
|
+
}>`,
|
|
31
31
|
),
|
|
32
32
|
ts.factory.createLiteralTypeNode(ts.factory.createNull()),
|
|
33
33
|
]),
|
|
@@ -35,7 +35,7 @@ export namespace IsCloneProgrammer {
|
|
|
35
35
|
ts.factory.createBlock([
|
|
36
36
|
StatementFactory.constant(
|
|
37
37
|
"is",
|
|
38
|
-
IsProgrammer.generate(project, modulo)(type),
|
|
38
|
+
IsProgrammer.generate(project, modulo)(type, name),
|
|
39
39
|
),
|
|
40
40
|
StatementFactory.constant(
|
|
41
41
|
"clone",
|
|
@@ -49,7 +49,7 @@ export namespace IsCloneProgrammer {
|
|
|
49
49
|
},
|
|
50
50
|
},
|
|
51
51
|
modulo,
|
|
52
|
-
)(type),
|
|
52
|
+
)(type, name),
|
|
53
53
|
),
|
|
54
54
|
ts.factory.createIfStatement(
|
|
55
55
|
ts.factory.createPrefixUnaryExpression(
|
|
@@ -11,7 +11,7 @@ import { IsProgrammer } from "./IsProgrammer";
|
|
|
11
11
|
export namespace IsParseProgrammer {
|
|
12
12
|
export const generate =
|
|
13
13
|
(project: IProject, modulo: ts.LeftHandSideExpression) =>
|
|
14
|
-
(type: ts.Type) =>
|
|
14
|
+
(type: ts.Type, name?: string) =>
|
|
15
15
|
ts.factory.createArrowFunction(
|
|
16
16
|
undefined,
|
|
17
17
|
undefined,
|
|
@@ -22,10 +22,9 @@ export namespace IsParseProgrammer {
|
|
|
22
22
|
),
|
|
23
23
|
],
|
|
24
24
|
ts.factory.createTypeReferenceNode(
|
|
25
|
-
`typia.Primitive<${
|
|
26
|
-
project.checker,
|
|
27
|
-
|
|
28
|
-
)}>`,
|
|
25
|
+
`typia.Primitive<${
|
|
26
|
+
name ?? TypeFactory.getFullName(project.checker, type)
|
|
27
|
+
}>`,
|
|
29
28
|
),
|
|
30
29
|
undefined,
|
|
31
30
|
ts.factory.createBlock([
|
|
@@ -41,7 +40,7 @@ export namespace IsParseProgrammer {
|
|
|
41
40
|
},
|
|
42
41
|
},
|
|
43
42
|
modulo,
|
|
44
|
-
)(type),
|
|
43
|
+
)(type, name),
|
|
45
44
|
),
|
|
46
45
|
ts.factory.createExpressionStatement(
|
|
47
46
|
ts.factory.createBinaryExpression(
|
|
@@ -12,7 +12,7 @@ import { PruneProgrammer } from "./PruneProgrammer";
|
|
|
12
12
|
export namespace IsPruneProgrammer {
|
|
13
13
|
export const generate =
|
|
14
14
|
(project: IProject, modulo: ts.LeftHandSideExpression) =>
|
|
15
|
-
(type: ts.Type) =>
|
|
15
|
+
(type: ts.Type, name?: string) =>
|
|
16
16
|
ts.factory.createArrowFunction(
|
|
17
17
|
undefined,
|
|
18
18
|
undefined,
|
|
@@ -26,14 +26,14 @@ export namespace IsPruneProgrammer {
|
|
|
26
26
|
undefined,
|
|
27
27
|
"input",
|
|
28
28
|
ts.factory.createTypeReferenceNode(
|
|
29
|
-
TypeFactory.getFullName(project.checker, type),
|
|
29
|
+
name ?? TypeFactory.getFullName(project.checker, type),
|
|
30
30
|
),
|
|
31
31
|
),
|
|
32
32
|
undefined,
|
|
33
33
|
ts.factory.createBlock([
|
|
34
34
|
StatementFactory.constant(
|
|
35
35
|
"is",
|
|
36
|
-
IsProgrammer.generate(project, modulo)(type),
|
|
36
|
+
IsProgrammer.generate(project, modulo)(type, name),
|
|
37
37
|
),
|
|
38
38
|
StatementFactory.constant(
|
|
39
39
|
"prune",
|
|
@@ -47,7 +47,7 @@ export namespace IsPruneProgrammer {
|
|
|
47
47
|
},
|
|
48
48
|
},
|
|
49
49
|
modulo,
|
|
50
|
-
)(type),
|
|
50
|
+
)(type, name),
|
|
51
51
|
),
|
|
52
52
|
ts.factory.createIfStatement(
|
|
53
53
|
ts.factory.createPrefixUnaryExpression(
|
|
@@ -12,7 +12,7 @@ import { StringifyProgrammer } from "./StringifyProgrammer";
|
|
|
12
12
|
export namespace IsStringifyProgrammer {
|
|
13
13
|
export const generate =
|
|
14
14
|
(project: IProject, modulo: ts.LeftHandSideExpression) =>
|
|
15
|
-
(type: ts.Type) =>
|
|
15
|
+
(type: ts.Type, name?: string) =>
|
|
16
16
|
ts.factory.createArrowFunction(
|
|
17
17
|
undefined,
|
|
18
18
|
undefined,
|
|
@@ -20,7 +20,8 @@ export namespace IsStringifyProgrammer {
|
|
|
20
20
|
IdentifierFactory.parameter(
|
|
21
21
|
"input",
|
|
22
22
|
ts.factory.createTypeReferenceNode(
|
|
23
|
-
|
|
23
|
+
name ??
|
|
24
|
+
TypeFactory.getFullName(project.checker, type),
|
|
24
25
|
),
|
|
25
26
|
),
|
|
26
27
|
],
|
|
@@ -42,7 +43,7 @@ export namespace IsStringifyProgrammer {
|
|
|
42
43
|
},
|
|
43
44
|
},
|
|
44
45
|
modulo,
|
|
45
|
-
)(type),
|
|
46
|
+
)(type, name),
|
|
46
47
|
),
|
|
47
48
|
StatementFactory.constant(
|
|
48
49
|
"stringify",
|
|
@@ -56,7 +57,7 @@ export namespace IsStringifyProgrammer {
|
|
|
56
57
|
},
|
|
57
58
|
},
|
|
58
59
|
modulo,
|
|
59
|
-
)(type),
|
|
60
|
+
)(type, name),
|
|
60
61
|
),
|
|
61
62
|
ts.factory.createReturnStatement(
|
|
62
63
|
ts.factory.createConditionalExpression(
|
|
@@ -272,9 +272,9 @@ export namespace PruneProgrammer {
|
|
|
272
272
|
importer: FunctionImporter,
|
|
273
273
|
): FeatureProgrammer.IConfig => ({
|
|
274
274
|
types: {
|
|
275
|
-
input: (type) =>
|
|
275
|
+
input: (type, name) =>
|
|
276
276
|
ts.factory.createTypeReferenceNode(
|
|
277
|
-
TypeFactory.getFullName(project.checker, type),
|
|
277
|
+
name ?? TypeFactory.getFullName(project.checker, type),
|
|
278
278
|
),
|
|
279
279
|
output: () => TypeFactory.keyword("void"),
|
|
280
280
|
},
|
|
@@ -23,7 +23,7 @@ export namespace RandomProgrammer {
|
|
|
23
23
|
modulo: ts.LeftHandSideExpression,
|
|
24
24
|
) {
|
|
25
25
|
const importer: FunctionImporter = new FunctionImporter();
|
|
26
|
-
return (type: ts.Type) => {
|
|
26
|
+
return (type: ts.Type, name?: string) => {
|
|
27
27
|
// INITIALIZE METADATA
|
|
28
28
|
const collection: MetadataCollection = new MetadataCollection();
|
|
29
29
|
const meta: Metadata = MetadataFactory.generate(
|
|
@@ -65,10 +65,9 @@ export namespace RandomProgrammer {
|
|
|
65
65
|
),
|
|
66
66
|
],
|
|
67
67
|
ts.factory.createTypeReferenceNode(
|
|
68
|
-
`typia.Primitive<${
|
|
69
|
-
project.checker,
|
|
70
|
-
|
|
71
|
-
)}>`,
|
|
68
|
+
`typia.Primitive<${
|
|
69
|
+
name ?? TypeFactory.getFullName(project.checker, type)
|
|
70
|
+
}>`,
|
|
72
71
|
),
|
|
73
72
|
undefined,
|
|
74
73
|
ts.factory.createBlock(
|
|
@@ -708,9 +708,9 @@ export namespace StringifyProgrammer {
|
|
|
708
708
|
importer: FunctionImporter,
|
|
709
709
|
): FeatureProgrammer.IConfig => ({
|
|
710
710
|
types: {
|
|
711
|
-
input: (type) =>
|
|
711
|
+
input: (type, name) =>
|
|
712
712
|
ts.factory.createTypeReferenceNode(
|
|
713
|
-
TypeFactory.getFullName(project.checker, type),
|
|
713
|
+
name ?? TypeFactory.getFullName(project.checker, type),
|
|
714
714
|
),
|
|
715
715
|
output: () => TypeFactory.keyword("string"),
|
|
716
716
|
},
|
|
@@ -12,7 +12,7 @@ import { ValidateProgrammer } from "./ValidateProgrammer";
|
|
|
12
12
|
export namespace ValidateCloneProgrammer {
|
|
13
13
|
export const generate =
|
|
14
14
|
(project: IProject, modulo: ts.LeftHandSideExpression) =>
|
|
15
|
-
(type: ts.Type) =>
|
|
15
|
+
(type: ts.Type, name?: string) =>
|
|
16
16
|
ts.factory.createArrowFunction(
|
|
17
17
|
undefined,
|
|
18
18
|
undefined,
|
|
@@ -23,10 +23,9 @@ export namespace ValidateCloneProgrammer {
|
|
|
23
23
|
),
|
|
24
24
|
],
|
|
25
25
|
ts.factory.createTypeReferenceNode(
|
|
26
|
-
`typia.IValidation<typia.Primitive<${
|
|
27
|
-
project.checker,
|
|
28
|
-
|
|
29
|
-
)}>>`,
|
|
26
|
+
`typia.IValidation<typia.Primitive<${
|
|
27
|
+
name ?? TypeFactory.getFullName(project.checker, type)
|
|
28
|
+
}>>`,
|
|
30
29
|
),
|
|
31
30
|
undefined,
|
|
32
31
|
ts.factory.createBlock([
|
|
@@ -42,7 +41,7 @@ export namespace ValidateCloneProgrammer {
|
|
|
42
41
|
},
|
|
43
42
|
},
|
|
44
43
|
modulo,
|
|
45
|
-
)(type),
|
|
44
|
+
)(type, name),
|
|
46
45
|
),
|
|
47
46
|
StatementFactory.constant(
|
|
48
47
|
"clone",
|
|
@@ -56,7 +55,7 @@ export namespace ValidateCloneProgrammer {
|
|
|
56
55
|
},
|
|
57
56
|
},
|
|
58
57
|
modulo,
|
|
59
|
-
)(type),
|
|
58
|
+
)(type, name),
|
|
60
59
|
),
|
|
61
60
|
StatementFactory.constant(
|
|
62
61
|
"output",
|
|
@@ -11,7 +11,7 @@ import { ValidateProgrammer } from "./ValidateProgrammer";
|
|
|
11
11
|
export namespace ValidateParseProgrammer {
|
|
12
12
|
export const generate =
|
|
13
13
|
(project: IProject, modulo: ts.LeftHandSideExpression) =>
|
|
14
|
-
(type: ts.Type) =>
|
|
14
|
+
(type: ts.Type, name?: string) =>
|
|
15
15
|
ts.factory.createArrowFunction(
|
|
16
16
|
undefined,
|
|
17
17
|
undefined,
|
|
@@ -22,10 +22,9 @@ export namespace ValidateParseProgrammer {
|
|
|
22
22
|
),
|
|
23
23
|
],
|
|
24
24
|
ts.factory.createTypeReferenceNode(
|
|
25
|
-
`typia.IValidation<typia.Primitive<${
|
|
26
|
-
project.checker,
|
|
27
|
-
|
|
28
|
-
)}>>`,
|
|
25
|
+
`typia.IValidation<typia.Primitive<${
|
|
26
|
+
name ?? TypeFactory.getFullName(project.checker, type)
|
|
27
|
+
}>>`,
|
|
29
28
|
),
|
|
30
29
|
undefined,
|
|
31
30
|
ts.factory.createBlock([
|
|
@@ -41,7 +40,7 @@ export namespace ValidateParseProgrammer {
|
|
|
41
40
|
},
|
|
42
41
|
},
|
|
43
42
|
modulo,
|
|
44
|
-
)(type),
|
|
43
|
+
)(type, name),
|
|
45
44
|
),
|
|
46
45
|
ts.factory.createExpressionStatement(
|
|
47
46
|
ts.factory.createBinaryExpression(
|
|
@@ -20,7 +20,7 @@ export namespace ValidateProgrammer {
|
|
|
20
20
|
modulo: ts.LeftHandSideExpression,
|
|
21
21
|
equals: boolean = false,
|
|
22
22
|
) =>
|
|
23
|
-
(type: ts.Type) => {
|
|
23
|
+
(type: ts.Type, name?: string) => {
|
|
24
24
|
const importer: FunctionImporter = new FunctionImporter();
|
|
25
25
|
const program: ts.ArrowFunction = CheckerProgrammer.generate(
|
|
26
26
|
project,
|
|
@@ -36,7 +36,7 @@ export namespace ValidateProgrammer {
|
|
|
36
36
|
success: ts.factory.createTrue(),
|
|
37
37
|
},
|
|
38
38
|
importer,
|
|
39
|
-
)(type);
|
|
39
|
+
)(type, name);
|
|
40
40
|
|
|
41
41
|
return ts.factory.createArrowFunction(
|
|
42
42
|
undefined,
|
|
@@ -48,10 +48,9 @@ export namespace ValidateProgrammer {
|
|
|
48
48
|
),
|
|
49
49
|
],
|
|
50
50
|
ts.factory.createTypeReferenceNode(
|
|
51
|
-
`typia.IValidation<${
|
|
52
|
-
project.checker,
|
|
53
|
-
|
|
54
|
-
)}>`,
|
|
51
|
+
`typia.IValidation<${
|
|
52
|
+
name ?? TypeFactory.getFullName(project.checker, type)
|
|
53
|
+
}>`,
|
|
55
54
|
),
|
|
56
55
|
undefined,
|
|
57
56
|
ts.factory.createBlock(
|