-
-
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 #1334 from samchon/feat/protobuf
Close #1234: completed `Sequence<N>` implementation for Protocol Buffer.
- Loading branch information
Showing
87 changed files
with
2,494 additions
and
602 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
27 changes: 27 additions & 0 deletions
27
errors/src/protobuf/error_protobuf_sequence_property_duplicated.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,27 @@ | ||
import typia, { tags } from "typia"; | ||
|
||
interface IPointer<T> { | ||
value: T; | ||
} | ||
interface Something { | ||
id: string & tags.Sequence<1>; | ||
age: number & tags.Sequence<1>; | ||
} | ||
|
||
// MESSAGE | ||
typia.protobuf.message<Something>(); | ||
typia.protobuf.message<IPointer<Something>>(); | ||
typia.protobuf.message<IPointer<Something[]>>(); | ||
typia.protobuf.message<IPointer<Map<string, Something>>>(); | ||
|
||
// DECODE | ||
typia.protobuf.createDecode<Something>(); | ||
typia.protobuf.createDecode<IPointer<Something>>(); | ||
typia.protobuf.createDecode<IPointer<Something[]>>(); | ||
typia.protobuf.createDecode<IPointer<Map<string, Something>>>(); | ||
|
||
// ENCODE | ||
typia.protobuf.createEncode<Something>(); | ||
typia.protobuf.createEncode<IPointer<Something>>(); | ||
typia.protobuf.createEncode<IPointer<Something[]>>(); | ||
typia.protobuf.createEncode<IPointer<Map<string, Something>>>(); |
32 changes: 32 additions & 0 deletions
32
errors/src/protobuf/error_protobuf_sequence_union_duplicated.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,32 @@ | ||
import typia, { tags } from "typia"; | ||
|
||
interface IPointer<T> { | ||
value: T; | ||
} | ||
interface Something { | ||
id: | ||
| (number & tags.Type<"uint32"> & tags.Sequence<1>) | ||
| (number & tags.Type<"double"> & tags.Sequence<2>) | ||
| (string & tags.Sequence<3>); | ||
sex: | ||
| (number & tags.Type<"uint32"> & tags.Sequence<4>) | ||
| (string & tags.Sequence<3>); | ||
} | ||
|
||
// MESSAGE | ||
typia.protobuf.message<Something>(); | ||
typia.protobuf.message<IPointer<Something>>(); | ||
typia.protobuf.message<IPointer<Something[]>>(); | ||
typia.protobuf.message<IPointer<Map<string, Something>>>(); | ||
|
||
// DECODE | ||
typia.protobuf.createDecode<Something>(); | ||
typia.protobuf.createDecode<IPointer<Something>>(); | ||
typia.protobuf.createDecode<IPointer<Something[]>>(); | ||
typia.protobuf.createDecode<IPointer<Map<string, Something>>>(); | ||
|
||
// ENCODE | ||
typia.protobuf.createEncode<Something>(); | ||
typia.protobuf.createEncode<IPointer<Something>>(); | ||
typia.protobuf.createEncode<IPointer<Something[]>>(); | ||
typia.protobuf.createEncode<IPointer<Map<string, Something>>>(); |
29 changes: 29 additions & 0 deletions
29
errors/src/protobuf/error_protobuf_sequence_union_omitted.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,29 @@ | ||
import typia, { tags } from "typia"; | ||
|
||
interface IPointer<T> { | ||
value: T; | ||
} | ||
interface Something { | ||
id: | ||
| (number & tags.Type<"uint32"> & tags.Sequence<1>) | ||
| (number & tags.Type<"double"> & tags.Sequence<2>) | ||
| string; | ||
} | ||
|
||
// MESSAGE | ||
typia.protobuf.message<Something>(); | ||
typia.protobuf.message<IPointer<Something>>(); | ||
typia.protobuf.message<IPointer<Something[]>>(); | ||
typia.protobuf.message<IPointer<Map<string, Something>>>(); | ||
|
||
// DECODE | ||
typia.protobuf.createDecode<Something>(); | ||
typia.protobuf.createDecode<IPointer<Something>>(); | ||
typia.protobuf.createDecode<IPointer<Something[]>>(); | ||
typia.protobuf.createDecode<IPointer<Map<string, Something>>>(); | ||
|
||
// ENCODE | ||
typia.protobuf.createEncode<Something>(); | ||
typia.protobuf.createEncode<IPointer<Something>>(); | ||
typia.protobuf.createEncode<IPointer<Something[]>>(); | ||
typia.protobuf.createEncode<IPointer<Map<string, Something>>>(); |
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
Oops, something went wrong.