typia 5.2.2 → 5.2.3

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.
Files changed (74) hide show
  1. package/lib/Primitive.d.ts +1 -1
  2. package/lib/executable/setup/CommandExecutor.js +2 -2
  3. package/lib/executable/setup/CommandExecutor.js.map +1 -1
  4. package/package.json +1 -2
  5. package/src/CamelCase.ts +116 -116
  6. package/src/PascalCase.ts +116 -116
  7. package/src/Primitive.ts +135 -135
  8. package/src/Resolved.ts +116 -116
  9. package/src/SnakeCase.ts +156 -156
  10. package/src/executable/TypiaSetupWizard.ts +142 -142
  11. package/src/executable/setup/CommandExecutor.ts +2 -2
  12. package/src/factories/JsonMetadataFactory.ts +50 -50
  13. package/src/factories/MetadataCollection.ts +282 -282
  14. package/src/functional/$convention.ts +40 -40
  15. package/src/functional/Namespace.ts +164 -164
  16. package/src/module.ts +662 -662
  17. package/src/notations.ts +855 -855
  18. package/src/programmers/helpers/AtomicPredicator.ts +31 -31
  19. package/src/programmers/helpers/NotationJoiner.ts +146 -146
  20. package/src/programmers/misc/MiscCloneProgrammer.ts +790 -790
  21. package/src/programmers/misc/MiscPruneProgrammer.ts +552 -552
  22. package/src/programmers/notations/NotationAssertGeneralProgrammer.ts +72 -72
  23. package/src/programmers/notations/NotationGeneralProgrammer.ts +720 -720
  24. package/src/programmers/notations/NotationIsGeneralProgrammer.ts +79 -79
  25. package/src/programmers/notations/NotationValidateGeneralProgrammer.ts +88 -88
  26. package/src/transformers/CallExpressionTransformer.ts +380 -380
  27. package/src/transformers/features/json/JsonAssertParseTransformer.ts +10 -10
  28. package/src/transformers/features/json/JsonAssertStringifyTransformer.ts +10 -10
  29. package/src/transformers/features/json/JsonCreateAssertParseTransformer.ts +12 -12
  30. package/src/transformers/features/json/JsonCreateAssertStringifyTransformer.ts +12 -12
  31. package/src/transformers/features/json/JsonCreateIsParseTransformer.ts +9 -9
  32. package/src/transformers/features/json/JsonCreateIsStringifyTransformer.ts +12 -12
  33. package/src/transformers/features/json/JsonCreateStringifyTransformer.ts +9 -9
  34. package/src/transformers/features/json/JsonCreateValidateParseTransformer.ts +12 -12
  35. package/src/transformers/features/json/JsonCreateValidateStringifyProgrammer.ts +12 -12
  36. package/src/transformers/features/json/JsonIsParseTransformer.ts +9 -9
  37. package/src/transformers/features/json/JsonIsStringifyTransformer.ts +10 -10
  38. package/src/transformers/features/json/JsonStringifyTransformer.ts +9 -9
  39. package/src/transformers/features/json/JsonValidateParseTransformer.ts +10 -10
  40. package/src/transformers/features/json/JsonValidateStringifyTransformer.ts +10 -10
  41. package/src/transformers/features/misc/MiscAssertCloneTransformer.ts +10 -10
  42. package/src/transformers/features/misc/MiscAssertPruneTransformer.ts +10 -10
  43. package/src/transformers/features/misc/MiscCloneTransformer.ts +9 -9
  44. package/src/transformers/features/misc/MiscCreateAssertCloneTransformer.ts +12 -12
  45. package/src/transformers/features/misc/MiscCreateAssertPruneTransformer.ts +12 -12
  46. package/src/transformers/features/misc/MiscCreateCloneTransformer.ts +9 -9
  47. package/src/transformers/features/misc/MiscCreateIsCloneTransformer.ts +9 -9
  48. package/src/transformers/features/misc/MiscCreateIsPruneTransformer.ts +9 -9
  49. package/src/transformers/features/misc/MiscCreatePruneTransformer.ts +9 -9
  50. package/src/transformers/features/misc/MiscCreateValidateCloneTransformer.ts +12 -12
  51. package/src/transformers/features/misc/MiscCreateValidatePruneTransformer.ts +12 -12
  52. package/src/transformers/features/misc/MiscIsCloneTransformer.ts +9 -9
  53. package/src/transformers/features/misc/MiscIsPruneTransformer.ts +9 -9
  54. package/src/transformers/features/misc/MiscPruneTransformer.ts +9 -9
  55. package/src/transformers/features/misc/MiscValidateCloneTransformer.ts +10 -10
  56. package/src/transformers/features/misc/MiscValidatePruneTransformer.ts +10 -10
  57. package/src/transformers/features/notations/NotationAssertGeneralTransformer.ts +15 -15
  58. package/src/transformers/features/notations/NotationCreateAssertGeneralTransformer.ts +15 -15
  59. package/src/transformers/features/notations/NotationCreateGeneralTransformer.ts +15 -15
  60. package/src/transformers/features/notations/NotationCreateIsGeneralTransformer.ts +15 -15
  61. package/src/transformers/features/notations/NotationCreateValidateGeneralTransformer.ts +17 -17
  62. package/src/transformers/features/notations/NotationGeneralTransformer.ts +11 -11
  63. package/src/transformers/features/notations/NotationIsGeneralTransformer.ts +15 -15
  64. package/src/transformers/features/notations/NotationValidateGeneralTransformer.ts +17 -17
  65. package/src/transformers/features/protobuf/ProtobufCreateAssertDecodeTransformer.ts +12 -12
  66. package/src/transformers/features/protobuf/ProtobufCreateAssertEncodeTransformer.ts +12 -12
  67. package/src/transformers/features/protobuf/ProtobufCreateDecodeTransformer.ts +9 -9
  68. package/src/transformers/features/protobuf/ProtobufCreateEncodeTransformer.ts +9 -9
  69. package/src/transformers/features/protobuf/ProtobufCreateIsDecodeTransformer.ts +12 -12
  70. package/src/transformers/features/protobuf/ProtobufCreateIsEncodeTransformer.ts +12 -12
  71. package/src/transformers/features/protobuf/ProtobufCreateValidateDecodeTransformer.ts +12 -12
  72. package/src/transformers/features/protobuf/ProtobufCreateValidateEncodeTransformer.ts +12 -12
  73. package/src/utils/NamingConvention.ts +91 -91
  74. package/src/utils/StringUtil.ts +4 -4
@@ -1,79 +1,79 @@
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 { IsProgrammer } from "../IsProgrammer";
10
- import { NotationGeneralProgrammer } from "./NotationGeneralProgrammer";
11
-
12
- export namespace NotationIsGeneralProgrammer {
13
- export const write =
14
- (rename: (str: string) => string) =>
15
- (project: IProject) =>
16
- (modulo: ts.LeftHandSideExpression) =>
17
- (type: ts.Type, name?: string) =>
18
- ts.factory.createArrowFunction(
19
- undefined,
20
- undefined,
21
- [
22
- IdentifierFactory.parameter(
23
- "input",
24
- TypeFactory.keyword("any"),
25
- ),
26
- ],
27
- ts.factory.createUnionTypeNode([
28
- ts.factory.createTypeReferenceNode(
29
- NotationGeneralProgrammer.returnType(rename)(
30
- name ??
31
- TypeFactory.getFullName(project.checker)(type),
32
- ),
33
- ),
34
- ts.factory.createLiteralTypeNode(ts.factory.createNull()),
35
- ]),
36
- undefined,
37
- ts.factory.createBlock([
38
- StatementFactory.constant(
39
- "is",
40
- IsProgrammer.write(project)(modulo)(false)(type, name),
41
- ),
42
- StatementFactory.constant(
43
- "general",
44
- NotationGeneralProgrammer.write(rename)({
45
- ...project,
46
- options: {
47
- ...project.options,
48
- functional: false,
49
- numeric: false,
50
- },
51
- })(modulo)(type, name),
52
- ),
53
- ts.factory.createIfStatement(
54
- ts.factory.createPrefixUnaryExpression(
55
- ts.SyntaxKind.ExclamationToken,
56
- ts.factory.createCallExpression(
57
- ts.factory.createIdentifier("is"),
58
- undefined,
59
- [ts.factory.createIdentifier("input")],
60
- ),
61
- ),
62
- ts.factory.createReturnStatement(
63
- ts.factory.createNull(),
64
- ),
65
- ),
66
- StatementFactory.constant(
67
- "output",
68
- ts.factory.createCallExpression(
69
- ts.factory.createIdentifier("general"),
70
- undefined,
71
- [ts.factory.createIdentifier("input")],
72
- ),
73
- ),
74
- ts.factory.createReturnStatement(
75
- ts.factory.createIdentifier("output"),
76
- ),
77
- ]),
78
- );
79
- }
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 { IsProgrammer } from "../IsProgrammer";
10
+ import { NotationGeneralProgrammer } from "./NotationGeneralProgrammer";
11
+
12
+ export namespace NotationIsGeneralProgrammer {
13
+ export const write =
14
+ (rename: (str: string) => string) =>
15
+ (project: IProject) =>
16
+ (modulo: ts.LeftHandSideExpression) =>
17
+ (type: ts.Type, name?: string) =>
18
+ ts.factory.createArrowFunction(
19
+ undefined,
20
+ undefined,
21
+ [
22
+ IdentifierFactory.parameter(
23
+ "input",
24
+ TypeFactory.keyword("any"),
25
+ ),
26
+ ],
27
+ ts.factory.createUnionTypeNode([
28
+ ts.factory.createTypeReferenceNode(
29
+ NotationGeneralProgrammer.returnType(rename)(
30
+ name ??
31
+ TypeFactory.getFullName(project.checker)(type),
32
+ ),
33
+ ),
34
+ ts.factory.createLiteralTypeNode(ts.factory.createNull()),
35
+ ]),
36
+ undefined,
37
+ ts.factory.createBlock([
38
+ StatementFactory.constant(
39
+ "is",
40
+ IsProgrammer.write(project)(modulo)(false)(type, name),
41
+ ),
42
+ StatementFactory.constant(
43
+ "general",
44
+ NotationGeneralProgrammer.write(rename)({
45
+ ...project,
46
+ options: {
47
+ ...project.options,
48
+ functional: false,
49
+ numeric: false,
50
+ },
51
+ })(modulo)(type, name),
52
+ ),
53
+ ts.factory.createIfStatement(
54
+ ts.factory.createPrefixUnaryExpression(
55
+ ts.SyntaxKind.ExclamationToken,
56
+ ts.factory.createCallExpression(
57
+ ts.factory.createIdentifier("is"),
58
+ undefined,
59
+ [ts.factory.createIdentifier("input")],
60
+ ),
61
+ ),
62
+ ts.factory.createReturnStatement(
63
+ ts.factory.createNull(),
64
+ ),
65
+ ),
66
+ StatementFactory.constant(
67
+ "output",
68
+ ts.factory.createCallExpression(
69
+ ts.factory.createIdentifier("general"),
70
+ undefined,
71
+ [ts.factory.createIdentifier("input")],
72
+ ),
73
+ ),
74
+ ts.factory.createReturnStatement(
75
+ ts.factory.createIdentifier("output"),
76
+ ),
77
+ ]),
78
+ );
79
+ }
@@ -1,88 +1,88 @@
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 { ValidateProgrammer } from "../ValidateProgrammer";
10
- import { NotationGeneralProgrammer } from "./NotationGeneralProgrammer";
11
-
12
- export namespace NotationValidateGeneralProgrammer {
13
- export const write =
14
- (rename: (str: string) => string) =>
15
- (project: IProject) =>
16
- (modulo: ts.LeftHandSideExpression) =>
17
- (type: ts.Type, name?: string) =>
18
- ts.factory.createArrowFunction(
19
- undefined,
20
- undefined,
21
- [
22
- IdentifierFactory.parameter(
23
- "input",
24
- TypeFactory.keyword("any"),
25
- ),
26
- ],
27
- ts.factory.createTypeReferenceNode(
28
- `typia.IValidation<${NotationGeneralProgrammer.returnType(
29
- rename,
30
- )(
31
- name ?? TypeFactory.getFullName(project.checker)(type),
32
- )}>`,
33
- ),
34
- undefined,
35
- ts.factory.createBlock([
36
- StatementFactory.constant(
37
- "validate",
38
- ValidateProgrammer.write({
39
- ...project,
40
- options: {
41
- ...project.options,
42
- functional: false,
43
- numeric: true,
44
- },
45
- })(modulo)(false)(type, name),
46
- ),
47
- StatementFactory.constant(
48
- "general",
49
- NotationGeneralProgrammer.write(rename)({
50
- ...project,
51
- options: {
52
- ...project.options,
53
- functional: false,
54
- numeric: false,
55
- },
56
- })(modulo)(type, name),
57
- ),
58
- StatementFactory.constant(
59
- "output",
60
- ts.factory.createAsExpression(
61
- ts.factory.createCallExpression(
62
- ts.factory.createIdentifier("validate"),
63
- undefined,
64
- [ts.factory.createIdentifier("input")],
65
- ),
66
- TypeFactory.keyword("any"),
67
- ),
68
- ),
69
- ts.factory.createIfStatement(
70
- ts.factory.createIdentifier("output.success"),
71
- ts.factory.createExpressionStatement(
72
- ts.factory.createBinaryExpression(
73
- ts.factory.createIdentifier("output.data"),
74
- ts.SyntaxKind.EqualsToken,
75
- ts.factory.createCallExpression(
76
- ts.factory.createIdentifier("general"),
77
- undefined,
78
- [ts.factory.createIdentifier("input")],
79
- ),
80
- ),
81
- ),
82
- ),
83
- ts.factory.createReturnStatement(
84
- ts.factory.createIdentifier("output"),
85
- ),
86
- ]),
87
- );
88
- }
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 { ValidateProgrammer } from "../ValidateProgrammer";
10
+ import { NotationGeneralProgrammer } from "./NotationGeneralProgrammer";
11
+
12
+ export namespace NotationValidateGeneralProgrammer {
13
+ export const write =
14
+ (rename: (str: string) => string) =>
15
+ (project: IProject) =>
16
+ (modulo: ts.LeftHandSideExpression) =>
17
+ (type: ts.Type, name?: string) =>
18
+ ts.factory.createArrowFunction(
19
+ undefined,
20
+ undefined,
21
+ [
22
+ IdentifierFactory.parameter(
23
+ "input",
24
+ TypeFactory.keyword("any"),
25
+ ),
26
+ ],
27
+ ts.factory.createTypeReferenceNode(
28
+ `typia.IValidation<${NotationGeneralProgrammer.returnType(
29
+ rename,
30
+ )(
31
+ name ?? TypeFactory.getFullName(project.checker)(type),
32
+ )}>`,
33
+ ),
34
+ undefined,
35
+ ts.factory.createBlock([
36
+ StatementFactory.constant(
37
+ "validate",
38
+ ValidateProgrammer.write({
39
+ ...project,
40
+ options: {
41
+ ...project.options,
42
+ functional: false,
43
+ numeric: true,
44
+ },
45
+ })(modulo)(false)(type, name),
46
+ ),
47
+ StatementFactory.constant(
48
+ "general",
49
+ NotationGeneralProgrammer.write(rename)({
50
+ ...project,
51
+ options: {
52
+ ...project.options,
53
+ functional: false,
54
+ numeric: false,
55
+ },
56
+ })(modulo)(type, name),
57
+ ),
58
+ StatementFactory.constant(
59
+ "output",
60
+ ts.factory.createAsExpression(
61
+ ts.factory.createCallExpression(
62
+ ts.factory.createIdentifier("validate"),
63
+ undefined,
64
+ [ts.factory.createIdentifier("input")],
65
+ ),
66
+ TypeFactory.keyword("any"),
67
+ ),
68
+ ),
69
+ ts.factory.createIfStatement(
70
+ ts.factory.createIdentifier("output.success"),
71
+ ts.factory.createExpressionStatement(
72
+ ts.factory.createBinaryExpression(
73
+ ts.factory.createIdentifier("output.data"),
74
+ ts.SyntaxKind.EqualsToken,
75
+ ts.factory.createCallExpression(
76
+ ts.factory.createIdentifier("general"),
77
+ undefined,
78
+ [ts.factory.createIdentifier("input")],
79
+ ),
80
+ ),
81
+ ),
82
+ ),
83
+ ts.factory.createReturnStatement(
84
+ ts.factory.createIdentifier("output"),
85
+ ),
86
+ ]),
87
+ );
88
+ }