diff --git a/benchmark/package.json b/benchmark/package.json index 1b148c327b..f162e068bb 100644 --- a/benchmark/package.json +++ b/benchmark/package.json @@ -72,6 +72,6 @@ "suppress-warnings": "^1.0.2", "tstl": "^3.0.0", "uuid": "^9.0.1", - "typia": "../typia-6.10.4-dev.20240925.tgz" + "typia": "../typia-6.11.1.tgz" } } \ No newline at end of file diff --git a/debug/package.json b/debug/package.json index 31bf134b56..51198ef52c 100644 --- a/debug/package.json +++ b/debug/package.json @@ -17,7 +17,7 @@ }, "dependencies": { "tstl": "^3.0.0", - "typia": "../typia-6.11.0.tgz", + "typia": "../typia-6.11.1.tgz", "uuid": "^10.0.0" } } \ No newline at end of file diff --git a/debug/src/protobuf.ts b/debug/src/protobuf.ts new file mode 100644 index 0000000000..e65cb56800 --- /dev/null +++ b/debug/src/protobuf.ts @@ -0,0 +1,12 @@ +import typia from "typia"; + +interface MyObj { + private: boolean | null; +} + +const encode = typia.protobuf.createEncode(); +console.log( + encode({ + private: true, + }), +); diff --git a/errors/package.json b/errors/package.json index 988d0631b2..212373f969 100644 --- a/errors/package.json +++ b/errors/package.json @@ -32,6 +32,6 @@ "typescript": "^5.3.2" }, "dependencies": { - "typia": "../typia-6.10.4-dev.20240925.tgz" + "typia": "../typia-6.11.1.tgz" } } \ No newline at end of file diff --git a/src/factories/ProtobufFactory.ts b/src/factories/ProtobufFactory.ts index 8eb4fc58db..f97731e0aa 100644 --- a/src/factories/ProtobufFactory.ts +++ b/src/factories/ProtobufFactory.ts @@ -9,8 +9,6 @@ import { TransformerError } from "../transformers/TransformerError"; import { ValidationPipe } from "../typings/ValidationPipe"; -import { Escaper } from "../utils/Escaper"; - import { MetadataCollection } from "./MetadataCollection"; import { MetadataFactory } from "./MetadataFactory"; @@ -167,18 +165,6 @@ export namespace ProtobufFactory { noSupport( "object type with mixed static and dynamic key typed properties. Keep statics or dynamic only.", ); - // STATIC PROPERTY, BUT INVALID KEY NAME - if ( - meta.objects.length && - meta.objects.some((obj) => - obj.properties.some( - (p) => - p.key.isSoleLiteral() === true && - Escaper.variable(p.key.getSoleLiteral()!) === false, - ), - ) - ) - noSupport(`object type with invalid static key name.`); // DYNAMIC OBJECT, BUT PROPERTY VALUE TYPE IS ARRAY if ( meta.objects.length && diff --git a/test-esm/package.json b/test-esm/package.json index aed685e238..5855452a43 100644 --- a/test-esm/package.json +++ b/test-esm/package.json @@ -36,6 +36,6 @@ "typescript": "^5.4.5" }, "dependencies": { - "typia": "../typia-6.10.4-dev.20240925.tgz" + "typia": "../typia-6.11.1.tgz" } } \ No newline at end of file diff --git a/test/package.json b/test/package.json index 554ba147dc..c5e6816f4e 100644 --- a/test/package.json +++ b/test/package.json @@ -52,6 +52,6 @@ "suppress-warnings": "^1.0.2", "tstl": "^3.0.0", "uuid": "^9.0.1", - "typia": "../typia-6.10.4-dev.20240925.tgz" + "typia": "../typia-6.11.1.tgz" } } \ No newline at end of file diff --git a/test/src/features/issues/test_issue_1321_private_key_in_protobuf.ts b/test/src/features/issues/test_issue_1321_private_key_in_protobuf.ts new file mode 100644 index 0000000000..d7064d1457 --- /dev/null +++ b/test/src/features/issues/test_issue_1321_private_key_in_protobuf.ts @@ -0,0 +1,16 @@ +import typia from "typia"; + +import { TestValidator } from "../../helpers/TestValidator"; + +type MyObj = { + private: boolean | null; +}; + +export const test_issue_1321_private_key_in_protobuf = (): void => { + const input: MyObj = { + private: true, + }; + const encoded: Uint8Array = typia.protobuf.encode(input); + const decoded: MyObj = typia.protobuf.decode(encoded); + TestValidator.equals("decoded")(decoded)(input); +};