typia 5.1.6 → 5.2.0-dev.20231007
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/lib/CamelCase.d.ts +22 -0
- package/lib/CamelCase.js +3 -0
- package/lib/CamelCase.js.map +1 -0
- package/lib/PascalCase.d.ts +22 -0
- package/lib/PascalCase.js +3 -0
- package/lib/PascalCase.js.map +1 -0
- package/lib/Resolved.d.ts +4 -4
- package/lib/SnakeCase.d.ts +24 -0
- package/lib/SnakeCase.js +3 -0
- package/lib/SnakeCase.js.map +1 -0
- package/lib/functional/$convention.d.ts +1 -0
- package/lib/functional/$convention.js +63 -0
- package/lib/functional/$convention.js.map +1 -0
- package/lib/functional/Namespace.js +9 -0
- package/lib/functional/Namespace.js.map +1 -1
- package/lib/module.d.ts +5 -1
- package/lib/module.js +6 -2
- package/lib/module.js.map +1 -1
- package/lib/notations.d.ts +538 -0
- package/lib/notations.js +146 -0
- package/lib/notations.js.map +1 -0
- package/lib/programmers/helpers/NotationJoiner.d.ts +7 -0
- package/lib/programmers/helpers/NotationJoiner.js +85 -0
- package/lib/programmers/helpers/NotationJoiner.js.map +1 -0
- package/lib/programmers/misc/MiscCloneProgrammer.js +12 -1
- package/lib/programmers/misc/MiscCloneProgrammer.js.map +1 -1
- package/lib/programmers/misc/MiscPruneProgrammer.js +2 -1
- package/lib/programmers/misc/MiscPruneProgrammer.js.map +1 -1
- package/lib/programmers/notations/NotationAssertGeneralProgrammer.d.ts +5 -0
- package/lib/programmers/notations/NotationAssertGeneralProgrammer.js +44 -0
- package/lib/programmers/notations/NotationAssertGeneralProgrammer.js.map +1 -0
- package/lib/programmers/notations/NotationGeneralProgrammer.d.ts +6 -0
- package/lib/programmers/notations/NotationGeneralProgrammer.js +490 -0
- package/lib/programmers/notations/NotationGeneralProgrammer.js.map +1 -0
- package/lib/programmers/notations/NotationIsGeneralProgrammer.d.ts +5 -0
- package/lib/programmers/notations/NotationIsGeneralProgrammer.js +47 -0
- package/lib/programmers/notations/NotationIsGeneralProgrammer.js.map +1 -0
- package/lib/programmers/notations/NotationValidateGeneralProgrammer.d.ts +5 -0
- package/lib/programmers/notations/NotationValidateGeneralProgrammer.js +44 -0
- package/lib/programmers/notations/NotationValidateGeneralProgrammer.js.map +1 -0
- package/lib/transformers/CallExpressionTransformer.js +99 -16
- package/lib/transformers/CallExpressionTransformer.js.map +1 -1
- package/lib/transformers/features/json/JsonAssertParseTransformer.js +1 -1
- package/lib/transformers/features/json/JsonAssertParseTransformer.js.map +1 -1
- package/lib/transformers/features/json/JsonAssertStringifyTransformer.js +1 -1
- package/lib/transformers/features/json/JsonAssertStringifyTransformer.js.map +1 -1
- package/lib/transformers/features/json/JsonCreateAssertParseTransformer.js +1 -1
- package/lib/transformers/features/json/JsonCreateAssertParseTransformer.js.map +1 -1
- package/lib/transformers/features/json/JsonCreateAssertStringifyTransformer.js +1 -1
- package/lib/transformers/features/json/JsonCreateAssertStringifyTransformer.js.map +1 -1
- package/lib/transformers/features/json/JsonCreateIsParseTransformer.js +1 -1
- package/lib/transformers/features/json/JsonCreateIsParseTransformer.js.map +1 -1
- package/lib/transformers/features/json/JsonCreateIsStringifyTransformer.js +1 -1
- package/lib/transformers/features/json/JsonCreateIsStringifyTransformer.js.map +1 -1
- package/lib/transformers/features/json/JsonCreateStringifyTransformer.js +1 -1
- package/lib/transformers/features/json/JsonCreateStringifyTransformer.js.map +1 -1
- package/lib/transformers/features/json/JsonCreateValidateParseTransformer.js +1 -1
- package/lib/transformers/features/json/JsonCreateValidateParseTransformer.js.map +1 -1
- package/lib/transformers/features/json/JsonCreateValidateStringifyProgrammer.js +1 -1
- package/lib/transformers/features/json/JsonCreateValidateStringifyProgrammer.js.map +1 -1
- package/lib/transformers/features/json/JsonIsParseTransformer.js +1 -1
- package/lib/transformers/features/json/JsonIsParseTransformer.js.map +1 -1
- package/lib/transformers/features/json/JsonIsStringifyTransformer.js +1 -1
- package/lib/transformers/features/json/JsonIsStringifyTransformer.js.map +1 -1
- package/lib/transformers/features/json/JsonStringifyTransformer.js +1 -1
- package/lib/transformers/features/json/JsonStringifyTransformer.js.map +1 -1
- package/lib/transformers/features/json/JsonValidateParseTransformer.js +1 -1
- package/lib/transformers/features/json/JsonValidateParseTransformer.js.map +1 -1
- package/lib/transformers/features/json/JsonValidateStringifyTransformer.js +1 -1
- package/lib/transformers/features/json/JsonValidateStringifyTransformer.js.map +1 -1
- package/lib/transformers/features/misc/MiscAssertCloneTransformer.js +1 -1
- package/lib/transformers/features/misc/MiscAssertCloneTransformer.js.map +1 -1
- package/lib/transformers/features/misc/MiscAssertPruneTransformer.js +1 -1
- package/lib/transformers/features/misc/MiscAssertPruneTransformer.js.map +1 -1
- package/lib/transformers/features/misc/MiscCloneTransformer.js +1 -1
- package/lib/transformers/features/misc/MiscCloneTransformer.js.map +1 -1
- package/lib/transformers/features/misc/MiscCreateAssertCloneTransformer.js +1 -1
- package/lib/transformers/features/misc/MiscCreateAssertCloneTransformer.js.map +1 -1
- package/lib/transformers/features/misc/MiscCreateAssertPruneTransformer.js +1 -1
- package/lib/transformers/features/misc/MiscCreateAssertPruneTransformer.js.map +1 -1
- package/lib/transformers/features/misc/MiscCreateCloneTransformer.js +1 -1
- package/lib/transformers/features/misc/MiscCreateCloneTransformer.js.map +1 -1
- package/lib/transformers/features/misc/MiscCreateIsCloneTransformer.js +1 -1
- package/lib/transformers/features/misc/MiscCreateIsCloneTransformer.js.map +1 -1
- package/lib/transformers/features/misc/MiscCreateIsPruneTransformer.js +1 -1
- package/lib/transformers/features/misc/MiscCreateIsPruneTransformer.js.map +1 -1
- package/lib/transformers/features/misc/MiscCreatePruneTransformer.js +1 -1
- package/lib/transformers/features/misc/MiscCreatePruneTransformer.js.map +1 -1
- package/lib/transformers/features/misc/MiscCreateValidateCloneTransformer.js +1 -1
- package/lib/transformers/features/misc/MiscCreateValidateCloneTransformer.js.map +1 -1
- package/lib/transformers/features/misc/MiscCreateValidatePruneTransformer.js +1 -1
- package/lib/transformers/features/misc/MiscCreateValidatePruneTransformer.js.map +1 -1
- package/lib/transformers/features/misc/MiscIsCloneTransformer.js +1 -1
- package/lib/transformers/features/misc/MiscIsCloneTransformer.js.map +1 -1
- package/lib/transformers/features/misc/MiscIsPruneTransformer.js +1 -1
- package/lib/transformers/features/misc/MiscIsPruneTransformer.js.map +1 -1
- package/lib/transformers/features/misc/MiscPruneTransformer.js +1 -1
- package/lib/transformers/features/misc/MiscPruneTransformer.js.map +1 -1
- package/lib/transformers/features/misc/MiscValidateCloneTransformer.js +1 -1
- package/lib/transformers/features/misc/MiscValidateCloneTransformer.js.map +1 -1
- package/lib/transformers/features/misc/MiscValidatePruneTransformer.js +1 -1
- package/lib/transformers/features/misc/MiscValidatePruneTransformer.js.map +1 -1
- package/lib/transformers/features/notations/NotationAssertGeneralTransformer.d.ts +4 -0
- package/lib/transformers/features/notations/NotationAssertGeneralTransformer.js +15 -0
- package/lib/transformers/features/notations/NotationAssertGeneralTransformer.js.map +1 -0
- package/lib/transformers/features/notations/NotationCreateAssertGeneralTransformer.d.ts +4 -0
- package/lib/transformers/features/notations/NotationCreateAssertGeneralTransformer.js +15 -0
- package/lib/transformers/features/notations/NotationCreateAssertGeneralTransformer.js.map +1 -0
- package/lib/transformers/features/notations/NotationCreateGeneralTransformer.d.ts +4 -0
- package/lib/transformers/features/notations/NotationCreateGeneralTransformer.js +15 -0
- package/lib/transformers/features/notations/NotationCreateGeneralTransformer.js.map +1 -0
- package/lib/transformers/features/notations/NotationCreateIsGeneralTransformer.d.ts +4 -0
- package/lib/transformers/features/notations/NotationCreateIsGeneralTransformer.js +15 -0
- package/lib/transformers/features/notations/NotationCreateIsGeneralTransformer.js.map +1 -0
- package/lib/transformers/features/notations/NotationCreateValidateGeneralTransformer.d.ts +4 -0
- package/lib/transformers/features/notations/NotationCreateValidateGeneralTransformer.js +15 -0
- package/lib/transformers/features/notations/NotationCreateValidateGeneralTransformer.js.map +1 -0
- package/lib/transformers/features/notations/NotationGeneralTransformer.d.ts +4 -0
- package/lib/transformers/features/notations/NotationGeneralTransformer.js +14 -0
- package/lib/transformers/features/notations/NotationGeneralTransformer.js.map +1 -0
- package/lib/transformers/features/notations/NotationIsGeneralTransformer.d.ts +4 -0
- package/lib/transformers/features/notations/NotationIsGeneralTransformer.js +15 -0
- package/lib/transformers/features/notations/NotationIsGeneralTransformer.js.map +1 -0
- package/lib/transformers/features/notations/NotationValidateGeneralTransformer.d.ts +4 -0
- package/lib/transformers/features/notations/NotationValidateGeneralTransformer.js +15 -0
- package/lib/transformers/features/notations/NotationValidateGeneralTransformer.js.map +1 -0
- package/lib/transformers/features/protobuf/{CreateProtobufAssertDecodeTransformer.d.ts → ProtobufCreateAssertDecodeTransformer.d.ts} +1 -1
- package/lib/transformers/features/protobuf/{CreateProtobufAssertDecodeTransformer.js → ProtobufCreateAssertDecodeTransformer.js} +6 -6
- package/lib/transformers/features/protobuf/{CreateProtobufAssertEncodeTransformer.js.map → ProtobufCreateAssertDecodeTransformer.js.map} +1 -1
- package/lib/transformers/features/protobuf/{CreateProtobufAssertEncodeTransformer.d.ts → ProtobufCreateAssertEncodeTransformer.d.ts} +1 -1
- package/lib/transformers/features/protobuf/{CreateProtobufAssertEncodeTransformer.js → ProtobufCreateAssertEncodeTransformer.js} +6 -6
- package/lib/transformers/features/protobuf/{CreateProtobufAssertDecodeTransformer.js.map → ProtobufCreateAssertEncodeTransformer.js.map} +1 -1
- package/lib/transformers/features/protobuf/{CreateProtobufDecodeTransformer.d.ts → ProtobufCreateDecodeTransformer.d.ts} +1 -1
- package/lib/transformers/features/protobuf/{CreateProtobufDecodeTransformer.js → ProtobufCreateDecodeTransformer.js} +6 -6
- package/lib/transformers/features/protobuf/{CreateProtobufDecodeTransformer.js.map → ProtobufCreateDecodeTransformer.js.map} +1 -1
- package/lib/transformers/features/protobuf/{CreateProtobufEncodeTransformer.d.ts → ProtobufCreateEncodeTransformer.d.ts} +1 -1
- package/lib/transformers/features/protobuf/{CreateProtobufEncodeTransformer.js → ProtobufCreateEncodeTransformer.js} +6 -6
- package/lib/transformers/features/protobuf/{CreateProtobufEncodeTransformer.js.map → ProtobufCreateEncodeTransformer.js.map} +1 -1
- package/lib/transformers/features/protobuf/{CreateProtobufIsDecodeTransformer.d.ts → ProtobufCreateIsDecodeTransformer.d.ts} +1 -1
- package/lib/transformers/features/protobuf/{CreateProtobufIsDecodeTransformer.js → ProtobufCreateIsDecodeTransformer.js} +6 -6
- package/lib/transformers/features/protobuf/{CreateProtobufIsDecodeTransformer.js.map → ProtobufCreateIsDecodeTransformer.js.map} +1 -1
- package/lib/transformers/features/protobuf/{CreateProtobufIsEncodeTransformer.d.ts → ProtobufCreateIsEncodeTransformer.d.ts} +1 -1
- package/lib/transformers/features/protobuf/{CreateProtobufIsEncodeTransformer.js → ProtobufCreateIsEncodeTransformer.js} +6 -6
- package/lib/transformers/features/protobuf/{CreateProtobufIsEncodeTransformer.js.map → ProtobufCreateIsEncodeTransformer.js.map} +1 -1
- package/lib/transformers/features/protobuf/{CreateProtobufValidateDecodeTransformer.d.ts → ProtobufCreateValidateDecodeTransformer.d.ts} +1 -1
- package/lib/transformers/features/protobuf/{CreateProtobufValidateDecodeTransformer.js → ProtobufCreateValidateDecodeTransformer.js} +6 -6
- package/lib/transformers/features/protobuf/{CreateProtobufValidateDecodeTransformer.js.map → ProtobufCreateValidateDecodeTransformer.js.map} +1 -1
- package/lib/transformers/features/protobuf/{CreateProtobufValidateEncodeTransformer.d.ts → ProtobufCreateValidateEncodeTransformer.d.ts} +1 -1
- package/lib/transformers/features/protobuf/{CreateProtobufValidateEncodeTransformer.js → ProtobufCreateValidateEncodeTransformer.js} +6 -6
- package/lib/transformers/features/protobuf/{CreateProtobufValidateEncodeTransformer.js.map → ProtobufCreateValidateEncodeTransformer.js.map} +1 -1
- package/lib/utils/NamingConvention.d.ts +5 -0
- package/lib/utils/NamingConvention.js +115 -0
- package/lib/utils/NamingConvention.js.map +1 -0
- package/lib/utils/StringUtil.d.ts +3 -0
- package/lib/utils/StringUtil.js +10 -0
- package/lib/utils/StringUtil.js.map +1 -0
- package/package.json +2 -1
- package/src/CamelCase.ts +116 -0
- package/src/PascalCase.ts +106 -0
- package/src/Primitive.ts +1 -1
- package/src/Resolved.ts +26 -26
- package/src/SnakeCase.ts +156 -0
- package/src/functional/$convention.ts +40 -0
- package/src/functional/Namespace.ts +22 -0
- package/src/module.ts +6 -1
- package/src/notations.ts +855 -0
- package/src/programmers/helpers/NotationJoiner.ts +146 -0
- package/src/programmers/misc/MiscCloneProgrammer.ts +17 -1
- package/src/programmers/misc/MiscPruneProgrammer.ts +4 -2
- package/src/programmers/notations/NotationAssertGeneralProgrammer.ts +72 -0
- package/src/programmers/notations/NotationGeneralProgrammer.ts +720 -0
- package/src/programmers/notations/NotationIsGeneralProgrammer.ts +79 -0
- package/src/programmers/notations/NotationValidateGeneralProgrammer.ts +88 -0
- package/src/transformers/CallExpressionTransformer.ts +107 -16
- package/src/transformers/features/json/JsonAssertParseTransformer.ts +1 -1
- package/src/transformers/features/json/JsonAssertStringifyTransformer.ts +1 -1
- package/src/transformers/features/json/JsonCreateAssertParseTransformer.ts +3 -1
- package/src/transformers/features/json/JsonCreateAssertStringifyTransformer.ts +1 -1
- package/src/transformers/features/json/JsonCreateIsParseTransformer.ts +1 -1
- package/src/transformers/features/json/JsonCreateIsStringifyTransformer.ts +3 -1
- package/src/transformers/features/json/JsonCreateStringifyTransformer.ts +1 -1
- package/src/transformers/features/json/JsonCreateValidateParseTransformer.ts +3 -1
- package/src/transformers/features/json/JsonCreateValidateStringifyProgrammer.ts +1 -1
- package/src/transformers/features/json/JsonIsParseTransformer.ts +1 -1
- package/src/transformers/features/json/JsonIsStringifyTransformer.ts +1 -1
- package/src/transformers/features/json/JsonStringifyTransformer.ts +1 -1
- package/src/transformers/features/json/JsonValidateParseTransformer.ts +1 -1
- package/src/transformers/features/json/JsonValidateStringifyTransformer.ts +1 -1
- package/src/transformers/features/misc/MiscAssertCloneTransformer.ts +1 -1
- package/src/transformers/features/misc/MiscAssertPruneTransformer.ts +1 -1
- package/src/transformers/features/misc/MiscCloneTransformer.ts +1 -1
- package/src/transformers/features/misc/MiscCreateAssertCloneTransformer.ts +3 -1
- package/src/transformers/features/misc/MiscCreateAssertPruneTransformer.ts +3 -1
- package/src/transformers/features/misc/MiscCreateCloneTransformer.ts +1 -1
- package/src/transformers/features/misc/MiscCreateIsCloneTransformer.ts +1 -1
- package/src/transformers/features/misc/MiscCreateIsPruneTransformer.ts +1 -1
- package/src/transformers/features/misc/MiscCreatePruneTransformer.ts +1 -1
- package/src/transformers/features/misc/MiscCreateValidateCloneTransformer.ts +3 -1
- package/src/transformers/features/misc/MiscCreateValidatePruneTransformer.ts +3 -1
- package/src/transformers/features/misc/MiscIsCloneTransformer.ts +1 -1
- package/src/transformers/features/misc/MiscIsPruneTransformer.ts +1 -1
- package/src/transformers/features/misc/MiscPruneTransformer.ts +1 -1
- package/src/transformers/features/misc/MiscValidateCloneTransformer.ts +1 -1
- package/src/transformers/features/misc/MiscValidatePruneTransformer.ts +1 -1
- package/src/transformers/features/notations/NotationAssertGeneralTransformer.ts +15 -0
- package/src/transformers/features/notations/NotationCreateAssertGeneralTransformer.ts +15 -0
- package/src/transformers/features/notations/NotationCreateGeneralTransformer.ts +15 -0
- package/src/transformers/features/notations/NotationCreateIsGeneralTransformer.ts +15 -0
- package/src/transformers/features/notations/NotationCreateValidateGeneralTransformer.ts +17 -0
- package/src/transformers/features/notations/NotationGeneralTransformer.ts +11 -0
- package/src/transformers/features/notations/NotationIsGeneralTransformer.ts +15 -0
- package/src/transformers/features/notations/NotationValidateGeneralTransformer.ts +17 -0
- package/src/transformers/features/protobuf/{CreateProtobufAssertDecodeTransformer.ts → ProtobufCreateAssertDecodeTransformer.ts} +1 -1
- package/src/transformers/features/protobuf/{CreateProtobufAssertEncodeTransformer.ts → ProtobufCreateAssertEncodeTransformer.ts} +1 -1
- package/src/transformers/features/protobuf/{CreateProtobufDecodeTransformer.ts → ProtobufCreateDecodeTransformer.ts} +1 -1
- package/src/transformers/features/protobuf/{CreateProtobufEncodeTransformer.ts → ProtobufCreateEncodeTransformer.ts} +1 -1
- package/src/transformers/features/protobuf/{CreateProtobufIsDecodeTransformer.ts → ProtobufCreateIsDecodeTransformer.ts} +1 -1
- package/src/transformers/features/protobuf/{CreateProtobufIsEncodeTransformer.ts → ProtobufCreateIsEncodeTransformer.ts} +1 -1
- package/src/transformers/features/protobuf/{CreateProtobufValidateDecodeTransformer.ts → ProtobufCreateValidateDecodeTransformer.ts} +1 -1
- package/src/transformers/features/protobuf/{CreateProtobufValidateEncodeTransformer.ts → ProtobufCreateValidateEncodeTransformer.ts} +1 -1
- package/src/utils/NamingConvention.ts +91 -0
- package/src/utils/StringUtil.ts +4 -0
|
@@ -3,7 +3,7 @@ import { MiscValidatePruneProgrammer } from "../../../programmers/misc/MiscValid
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
5
|
export namespace MiscValidatePruneTransformer {
|
|
6
|
-
export const transform = GenericTransformer.scalar("validatPrune")(
|
|
6
|
+
export const transform = GenericTransformer.scalar("misc.validatPrune")(
|
|
7
7
|
(project) => (modulo) =>
|
|
8
8
|
MiscValidatePruneProgrammer.write(project)(modulo),
|
|
9
9
|
);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NotationAssertGeneralProgrammer } from "../../../programmers/notations/NotationAssertGeneralProgrammer";
|
|
2
|
+
|
|
3
|
+
import { StringUtil } from "../../../utils/StringUtil";
|
|
4
|
+
|
|
5
|
+
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
6
|
+
|
|
7
|
+
export namespace NotationAssertGeneralTransformer {
|
|
8
|
+
export const transform = (rename: (str: string) => string) =>
|
|
9
|
+
GenericTransformer.scalar(
|
|
10
|
+
`notations.assert${StringUtil.capitalize(rename.name)}`,
|
|
11
|
+
)(
|
|
12
|
+
(project) => (modulo) =>
|
|
13
|
+
NotationAssertGeneralProgrammer.write(rename)(project)(modulo),
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NotationAssertGeneralProgrammer } from "../../../programmers/notations/NotationAssertGeneralProgrammer";
|
|
2
|
+
|
|
3
|
+
import { StringUtil } from "../../../utils/StringUtil";
|
|
4
|
+
|
|
5
|
+
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
6
|
+
|
|
7
|
+
export namespace NotationCreateAssertGeneralTransformer {
|
|
8
|
+
export const transform = (rename: (str: string) => string) =>
|
|
9
|
+
GenericTransformer.factory(
|
|
10
|
+
`notations.createAssert${StringUtil.capitalize(rename.name)}`,
|
|
11
|
+
)(
|
|
12
|
+
(project) => (modulo) =>
|
|
13
|
+
NotationAssertGeneralProgrammer.write(rename)(project)(modulo),
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NotationGeneralProgrammer } from "../../../programmers/notations/NotationGeneralProgrammer";
|
|
2
|
+
|
|
3
|
+
import { StringUtil } from "../../../utils/StringUtil";
|
|
4
|
+
|
|
5
|
+
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
6
|
+
|
|
7
|
+
export namespace NotationCreateGeneralTransformer {
|
|
8
|
+
export const transform = (rename: (str: string) => string) =>
|
|
9
|
+
GenericTransformer.factory(
|
|
10
|
+
`notations.create${StringUtil.capitalize(rename.name)}`,
|
|
11
|
+
)(
|
|
12
|
+
(project) => (modulo) =>
|
|
13
|
+
NotationGeneralProgrammer.write(rename)(project)(modulo),
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NotationIsGeneralProgrammer } from "../../../programmers/notations/NotationIsGeneralProgrammer";
|
|
2
|
+
|
|
3
|
+
import { StringUtil } from "../../../utils/StringUtil";
|
|
4
|
+
|
|
5
|
+
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
6
|
+
|
|
7
|
+
export namespace NotationCreateIsGeneralTransformer {
|
|
8
|
+
export const transform = (rename: (str: string) => string) =>
|
|
9
|
+
GenericTransformer.factory(
|
|
10
|
+
`notations.createIs${StringUtil.capitalize(rename.name)}`,
|
|
11
|
+
)(
|
|
12
|
+
(project) => (modulo) =>
|
|
13
|
+
NotationIsGeneralProgrammer.write(rename)(project)(modulo),
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { NotationValidateGeneralProgrammer } from "../../../programmers/notations/NotationValidateGeneralProgrammer";
|
|
2
|
+
|
|
3
|
+
import { StringUtil } from "../../../utils/StringUtil";
|
|
4
|
+
|
|
5
|
+
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
6
|
+
|
|
7
|
+
export namespace NotationCreateValidateGeneralTransformer {
|
|
8
|
+
export const transform = (rename: (str: string) => string) =>
|
|
9
|
+
GenericTransformer.factory(
|
|
10
|
+
`notations.createValidate${StringUtil.capitalize(rename.name)}`,
|
|
11
|
+
)(
|
|
12
|
+
(project) => (modulo) =>
|
|
13
|
+
NotationValidateGeneralProgrammer.write(rename)(project)(
|
|
14
|
+
modulo,
|
|
15
|
+
),
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NotationGeneralProgrammer } from "../../../programmers/notations/NotationGeneralProgrammer";
|
|
2
|
+
|
|
3
|
+
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
|
+
|
|
5
|
+
export namespace NotationGeneralTransformer {
|
|
6
|
+
export const transform = (rename: (str: string) => string) =>
|
|
7
|
+
GenericTransformer.scalar(`notations.${rename.name}`)(
|
|
8
|
+
(project) => (modulo) =>
|
|
9
|
+
NotationGeneralProgrammer.write(rename)(project)(modulo),
|
|
10
|
+
);
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NotationIsGeneralProgrammer } from "../../../programmers/notations/NotationIsGeneralProgrammer";
|
|
2
|
+
|
|
3
|
+
import { StringUtil } from "../../../utils/StringUtil";
|
|
4
|
+
|
|
5
|
+
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
6
|
+
|
|
7
|
+
export namespace NotationIsGeneralTransformer {
|
|
8
|
+
export const transform = (rename: (str: string) => string) =>
|
|
9
|
+
GenericTransformer.scalar(
|
|
10
|
+
`notations.is${StringUtil.capitalize(rename.name)}`,
|
|
11
|
+
)(
|
|
12
|
+
(project) => (modulo) =>
|
|
13
|
+
NotationIsGeneralProgrammer.write(rename)(project)(modulo),
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { NotationValidateGeneralProgrammer } from "../../../programmers/notations/NotationValidateGeneralProgrammer";
|
|
2
|
+
|
|
3
|
+
import { StringUtil } from "../../../utils/StringUtil";
|
|
4
|
+
|
|
5
|
+
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
6
|
+
|
|
7
|
+
export namespace NotationValidateGeneralTransformer {
|
|
8
|
+
export const transform = (rename: (str: string) => string) =>
|
|
9
|
+
GenericTransformer.scalar(
|
|
10
|
+
`notations.validate${StringUtil.capitalize(rename.name)}`,
|
|
11
|
+
)(
|
|
12
|
+
(project) => (modulo) =>
|
|
13
|
+
NotationValidateGeneralProgrammer.write(rename)(project)(
|
|
14
|
+
modulo,
|
|
15
|
+
),
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -2,7 +2,7 @@ import { ProtobufAssertDecodeProgrammer } from "../../../programmers/protobuf/Pr
|
|
|
2
2
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
|
-
export namespace
|
|
5
|
+
export namespace ProtobufCreateAssertDecodeTransformer {
|
|
6
6
|
export const transform = GenericTransformer.factory(
|
|
7
7
|
"protobuf.createAssertDecode",
|
|
8
8
|
)(
|
|
@@ -2,7 +2,7 @@ import { ProtobufAssertEncodeProgrammer } from "../../../programmers/protobuf/Pr
|
|
|
2
2
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
|
-
export namespace
|
|
5
|
+
export namespace ProtobufCreateAssertEncodeTransformer {
|
|
6
6
|
export const transform = GenericTransformer.factory(
|
|
7
7
|
"protobuf.createAssertEncode",
|
|
8
8
|
)(
|
|
@@ -2,7 +2,7 @@ import { ProtobufDecodeProgrammer } from "../../../programmers/protobuf/Protobuf
|
|
|
2
2
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
|
-
export namespace
|
|
5
|
+
export namespace ProtobufCreateDecodeTransformer {
|
|
6
6
|
export const transform = GenericTransformer.factory(
|
|
7
7
|
"protobuf.createDecode",
|
|
8
8
|
)((project) => (modulo) => ProtobufDecodeProgrammer.write(project)(modulo));
|
|
@@ -2,7 +2,7 @@ import { ProtobufEncodeProgrammer } from "../../../programmers/protobuf/Protobuf
|
|
|
2
2
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
|
-
export namespace
|
|
5
|
+
export namespace ProtobufCreateEncodeTransformer {
|
|
6
6
|
export const transform = GenericTransformer.factory(
|
|
7
7
|
"protobuf.createEncode",
|
|
8
8
|
)((project) => (modulo) => ProtobufEncodeProgrammer.write(project)(modulo));
|
|
@@ -2,7 +2,7 @@ import { ProtobufIsDecodeProgrammer } from "../../../programmers/protobuf/Protob
|
|
|
2
2
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
|
-
export namespace
|
|
5
|
+
export namespace ProtobufCreateIsDecodeTransformer {
|
|
6
6
|
export const transform = GenericTransformer.factory(
|
|
7
7
|
"protobuf.createIsDecode",
|
|
8
8
|
)(
|
|
@@ -2,7 +2,7 @@ import { ProtobufIsEncodeProgrammer } from "../../../programmers/protobuf/Protob
|
|
|
2
2
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
|
-
export namespace
|
|
5
|
+
export namespace ProtobufCreateIsEncodeTransformer {
|
|
6
6
|
export const transform = GenericTransformer.factory(
|
|
7
7
|
"protobuf.createIsEncode",
|
|
8
8
|
)(
|
|
@@ -2,7 +2,7 @@ import { ProtobufValidateDecodeProgrammer } from "../../../programmers/protobuf/
|
|
|
2
2
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
|
-
export namespace
|
|
5
|
+
export namespace ProtobufCreateValidateDecodeTransformer {
|
|
6
6
|
export const transform = GenericTransformer.factory(
|
|
7
7
|
"protobuf.createValidateDecode",
|
|
8
8
|
)(
|
|
@@ -2,7 +2,7 @@ import { ProtobufValidateEncodeProgrammer } from "../../../programmers/protobuf/
|
|
|
2
2
|
|
|
3
3
|
import { GenericTransformer } from "../../internal/GenericTransformer";
|
|
4
4
|
|
|
5
|
-
export namespace
|
|
5
|
+
export namespace ProtobufCreateValidateEncodeTransformer {
|
|
6
6
|
export const transform = GenericTransformer.factory(
|
|
7
7
|
"protobuf.createValidateEncode",
|
|
8
8
|
)(
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { StringUtil } from "./StringUtil";
|
|
2
|
+
|
|
3
|
+
export namespace NamingConvention {
|
|
4
|
+
export function snake(str: string): string {
|
|
5
|
+
const indexes: number[] = [];
|
|
6
|
+
for (let i: number = 0; i < str.length; i++) {
|
|
7
|
+
const code: number = str.charCodeAt(i);
|
|
8
|
+
if (65 <= code && code <= 90) indexes.push(i);
|
|
9
|
+
}
|
|
10
|
+
for (let i: number = indexes.length - 1; i > 0; --i) {
|
|
11
|
+
const now: number = indexes[i]!;
|
|
12
|
+
const prev: number = indexes[i - 1]!;
|
|
13
|
+
if (now - prev === 1) indexes.splice(i, 1);
|
|
14
|
+
}
|
|
15
|
+
if (indexes.length !== 0 && indexes[0] === 0) indexes.splice(0, 1);
|
|
16
|
+
if (indexes.length === 0) return str.toLowerCase();
|
|
17
|
+
|
|
18
|
+
let ret: string = "";
|
|
19
|
+
for (let i: number = 0; i < indexes.length; i++) {
|
|
20
|
+
const first: number = i === 0 ? 0 : indexes[i - 1]!;
|
|
21
|
+
const last: number = indexes[i]!;
|
|
22
|
+
|
|
23
|
+
ret += str.substring(first, last).toLowerCase();
|
|
24
|
+
ret += "_";
|
|
25
|
+
}
|
|
26
|
+
ret += str.substring(indexes[indexes.length - 1]!).toLowerCase();
|
|
27
|
+
return ret;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function camel(str: string): string {
|
|
31
|
+
str = removeSnake(str);
|
|
32
|
+
if (str.length === 0) return str;
|
|
33
|
+
else if (str[0] === str[0]!.toUpperCase())
|
|
34
|
+
return str[0]!.toLowerCase() + str.substring(1);
|
|
35
|
+
else if (
|
|
36
|
+
str[0] === "_" &&
|
|
37
|
+
str.length > 1 &&
|
|
38
|
+
str[1] === str[1]!.toLowerCase()
|
|
39
|
+
)
|
|
40
|
+
return "_" + str[1]!.toUpperCase() + str.substring(2);
|
|
41
|
+
else return str;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function pascal(str: string): string {
|
|
45
|
+
str = removeSnake(str);
|
|
46
|
+
if (str.length === 0) return str;
|
|
47
|
+
else if (str[0] === str[0]!.toLowerCase())
|
|
48
|
+
return str[0]!.toUpperCase() + str.substring(1);
|
|
49
|
+
else if (
|
|
50
|
+
str[0] === "_" &&
|
|
51
|
+
str.length > 1 &&
|
|
52
|
+
str[1] === str[1]!.toLowerCase()
|
|
53
|
+
)
|
|
54
|
+
return "_" + str[1]!.toUpperCase() + str.substring(2);
|
|
55
|
+
else return str;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const removeSnake = (str: string): string => {
|
|
59
|
+
const indexes: [number, number][] = [];
|
|
60
|
+
for (let i: number = 0; i < str.length; i++) {
|
|
61
|
+
const ch: string = str[i]!;
|
|
62
|
+
if (ch !== "_") continue;
|
|
63
|
+
|
|
64
|
+
const last = indexes[indexes.length - 1];
|
|
65
|
+
if (last === undefined || last[0] + last[1] !== i)
|
|
66
|
+
indexes.push([i, 1]);
|
|
67
|
+
else ++last[1];
|
|
68
|
+
}
|
|
69
|
+
if (indexes.length === 0) return str;
|
|
70
|
+
|
|
71
|
+
let ret: string = "";
|
|
72
|
+
for (let i: number = 0; i < indexes.length; i++) {
|
|
73
|
+
const [first] = indexes[i]!;
|
|
74
|
+
if (i === 0)
|
|
75
|
+
if (first === 0) ret += "_";
|
|
76
|
+
else ret += str.substring(0, first);
|
|
77
|
+
else {
|
|
78
|
+
const [prevFirst, prevLength] = indexes[i - 1]!;
|
|
79
|
+
const piece: string = str.substring(
|
|
80
|
+
prevFirst + prevLength,
|
|
81
|
+
first,
|
|
82
|
+
);
|
|
83
|
+
if (piece.length) ret += StringUtil.capitalize(piece);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const last = indexes[indexes.length - 1]!;
|
|
87
|
+
const piece: string = str.substring(last[0] + last[1]);
|
|
88
|
+
if (last.length) ret += StringUtil.capitalize(piece);
|
|
89
|
+
return ret;
|
|
90
|
+
};
|
|
91
|
+
}
|