-
-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1323 from samchon/feat/protobuf
Fix #1321: `private` key in the `protobuf` functions
- Loading branch information
Showing
8 changed files
with
33 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import typia from "typia"; | ||
|
||
interface MyObj { | ||
private: boolean | null; | ||
} | ||
|
||
const encode = typia.protobuf.createEncode<MyObj>(); | ||
console.log( | ||
encode({ | ||
private: true, | ||
}), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
test/src/features/issues/test_issue_1321_private_key_in_protobuf.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<MyObj>(input); | ||
const decoded: MyObj = typia.protobuf.decode<MyObj>(encoded); | ||
TestValidator.equals("decoded")(decoded)(input); | ||
}; |