-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(ts-proto-#859): added encode-only options to toJSON methods * feat(ts-proto-#859): fixed error in implementation * feat(ts-proto#859): inverted fromJSON and toJSON methods to avoid changing all tests * feat(ts-proto#859): ran yarn format * feat(ts-proto-#859): updated docs and renamed methods to toOnly and fromOnly * feat: removed toJson/fromJSON enums when not used * feat(#909): ran format --------- Co-authored-by: Francesco Battista <[email protected]>
- Loading branch information
Showing
5 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
Binary file not shown.
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,9 @@ | ||
message Test { | ||
enum TestType { | ||
TEST_TYPE_UNSPECIFIED = 0; | ||
TEST_TYPE_EVENT = 1; | ||
TEST_TYPE_METRIC = 2; | ||
TEST_TYPE_DERIVED = 3; | ||
} | ||
|
||
} |
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,37 @@ | ||
/* eslint-disable */ | ||
|
||
export const protobufPackage = ""; | ||
|
||
export interface Test { | ||
} | ||
|
||
export enum Test_TestType { | ||
TEST_TYPE_UNSPECIFIED = 0, | ||
TEST_TYPE_EVENT = 1, | ||
TEST_TYPE_METRIC = 2, | ||
TEST_TYPE_DERIVED = 3, | ||
UNRECOGNIZED = -1, | ||
} | ||
|
||
export function test_TestTypeToJSON(object: Test_TestType): string { | ||
switch (object) { | ||
case Test_TestType.TEST_TYPE_UNSPECIFIED: | ||
return "TEST_TYPE_UNSPECIFIED"; | ||
case Test_TestType.TEST_TYPE_EVENT: | ||
return "TEST_TYPE_EVENT"; | ||
case Test_TestType.TEST_TYPE_METRIC: | ||
return "TEST_TYPE_METRIC"; | ||
case Test_TestType.TEST_TYPE_DERIVED: | ||
return "TEST_TYPE_DERIVED"; | ||
case Test_TestType.UNRECOGNIZED: | ||
default: | ||
return "UNRECOGNIZED"; | ||
} | ||
} | ||
|
||
export const Test = { | ||
toJSON(_: Test): unknown { | ||
const obj: any = {}; | ||
return obj; | ||
}, | ||
}; |
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 @@ | ||
outputEncodeMethods=false,outputPartialMethods=false,outputJsonMethods=to-only,nestJs=false |
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