Skip to content

Commit

Permalink
use bigint for int64 types (#118)
Browse files Browse the repository at this point in the history
Co-authored-by: Tate <tate@transcriptic.com>
  • Loading branch information
tatethurston and Tate authored Feb 2, 2022
1 parent 2fbed59 commit 8349813
Show file tree
Hide file tree
Showing 19 changed files with 8,486 additions and 6,571 deletions.
20 changes: 10 additions & 10 deletions clientcompat/src/clientcompat.pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export const Req = {
_writeMessageJSON: function (msg: Partial<Req>): Record<string, unknown> {
const json: Record<string, unknown> = {};
if (msg.v) {
json["v"] = msg.v;
json.v = msg.v;
}
return json;
},
Expand Down Expand Up @@ -263,7 +263,7 @@ export const Req = {
* @private
*/
_readMessageJSON: function (msg: Req, json: any): Req {
const v = json["v"] ?? json.v;
const v = json.v ?? json.v;
if (v) {
msg.v = v;
}
Expand Down Expand Up @@ -328,7 +328,7 @@ export const Resp = {
_writeMessageJSON: function (msg: Partial<Resp>): Record<string, unknown> {
const json: Record<string, unknown> = {};
if (msg.v) {
json["v"] = msg.v;
json.v = msg.v;
}
return json;
},
Expand Down Expand Up @@ -357,7 +357,7 @@ export const Resp = {
* @private
*/
_readMessageJSON: function (msg: Resp, json: any): Resp {
const v = json["v"] ?? json.v;
const v = json.v ?? json.v;
if (v) {
msg.v = v;
}
Expand Down Expand Up @@ -447,13 +447,13 @@ export const ClientCompatMessage = {
): Record<string, unknown> {
const json: Record<string, unknown> = {};
if (msg.serviceAddress) {
json["serviceAddress"] = msg.serviceAddress;
json.serviceAddress = msg.serviceAddress;
}
if (msg.method) {
json["method"] = msg.method;
json.method = msg.method;
}
if (msg.request) {
json["request"] = msg.request;
json.request = msg.request;
}
return json;
},
Expand Down Expand Up @@ -497,15 +497,15 @@ export const ClientCompatMessage = {
msg: ClientCompatMessage,
json: any
): ClientCompatMessage {
const serviceAddress = json["serviceAddress"] ?? json.service_address;
const serviceAddress = json.serviceAddress ?? json.service_address;
if (serviceAddress) {
msg.serviceAddress = serviceAddress;
}
const method = json["method"] ?? json.method;
const method = json.method ?? json.method;
if (method) {
msg.method = method;
}
const request = json["request"] ?? json.request;
const request = json.request ?? json.request;
if (request) {
msg.request = request;
}
Expand Down
16 changes: 8 additions & 8 deletions examples/authentication/src/protos/authentication.pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ export const CurrentUser = {
): Record<string, unknown> {
const json: Record<string, unknown> = {};
if (msg.username) {
json["username"] = msg.username;
json.username = msg.username;
}
if (msg.token) {
json["token"] = msg.token;
json.token = msg.token;
}
return json;
},
Expand Down Expand Up @@ -207,11 +207,11 @@ export const CurrentUser = {
* @private
*/
_readMessageJSON: function (msg: CurrentUser, json: any): CurrentUser {
const username = json["username"] ?? json.username;
const username = json.username ?? json.username;
if (username) {
msg.username = username;
}
const token = json["token"] ?? json.token;
const token = json.token ?? json.token;
if (token) {
msg.token = token;
}
Expand Down Expand Up @@ -291,10 +291,10 @@ export const Credentials = {
): Record<string, unknown> {
const json: Record<string, unknown> = {};
if (msg.username) {
json["username"] = msg.username;
json.username = msg.username;
}
if (msg.password) {
json["password"] = msg.password;
json.password = msg.password;
}
return json;
},
Expand Down Expand Up @@ -327,11 +327,11 @@ export const Credentials = {
* @private
*/
_readMessageJSON: function (msg: Credentials, json: any): Credentials {
const username = json["username"] ?? json.username;
const username = json.username ?? json.username;
if (username) {
msg.username = username;
}
const password = json["password"] ?? json.password;
const password = json.password ?? json.password;
if (password) {
msg.password = password;
}
Expand Down
16 changes: 8 additions & 8 deletions examples/authentication/src/protos/haberdasher.pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export const Size = {
_writeMessageJSON: function (msg: Partial<Size>): Record<string, unknown> {
const json: Record<string, unknown> = {};
if (msg.inches) {
json["inches"] = msg.inches;
json.inches = msg.inches;
}
return json;
},
Expand Down Expand Up @@ -196,7 +196,7 @@ export const Size = {
* @private
*/
_readMessageJSON: function (msg: Size, json: any): Size {
const inches = json["inches"] ?? json.inches;
const inches = json.inches ?? json.inches;
if (inches) {
msg.inches = inches;
}
Expand Down Expand Up @@ -269,13 +269,13 @@ export const Hat = {
_writeMessageJSON: function (msg: Partial<Hat>): Record<string, unknown> {
const json: Record<string, unknown> = {};
if (msg.inches) {
json["inches"] = msg.inches;
json.inches = msg.inches;
}
if (msg.color) {
json["color"] = msg.color;
json.color = msg.color;
}
if (msg.name) {
json["name"] = msg.name;
json.name = msg.name;
}
return json;
},
Expand Down Expand Up @@ -312,15 +312,15 @@ export const Hat = {
* @private
*/
_readMessageJSON: function (msg: Hat, json: any): Hat {
const inches = json["inches"] ?? json.inches;
const inches = json.inches ?? json.inches;
if (inches) {
msg.inches = inches;
}
const color = json["color"] ?? json.color;
const color = json.color ?? json.color;
if (color) {
msg.color = color;
}
const name = json["name"] ?? json.name;
const name = json.name ?? json.name;
if (name) {
msg.name = name;
}
Expand Down
16 changes: 8 additions & 8 deletions examples/aws-lambda/src/haberdasher.pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export const Size = {
_writeMessageJSON: function (msg: Partial<Size>): Record<string, unknown> {
const json: Record<string, unknown> = {};
if (msg.inches) {
json["inches"] = msg.inches;
json.inches = msg.inches;
}
return json;
},
Expand Down Expand Up @@ -196,7 +196,7 @@ export const Size = {
* @private
*/
_readMessageJSON: function (msg: Size, json: any): Size {
const inches = json["inches"] ?? json.inches;
const inches = json.inches ?? json.inches;
if (inches) {
msg.inches = inches;
}
Expand Down Expand Up @@ -269,13 +269,13 @@ export const Hat = {
_writeMessageJSON: function (msg: Partial<Hat>): Record<string, unknown> {
const json: Record<string, unknown> = {};
if (msg.inches) {
json["inches"] = msg.inches;
json.inches = msg.inches;
}
if (msg.color) {
json["color"] = msg.color;
json.color = msg.color;
}
if (msg.name) {
json["name"] = msg.name;
json.name = msg.name;
}
return json;
},
Expand Down Expand Up @@ -312,15 +312,15 @@ export const Hat = {
* @private
*/
_readMessageJSON: function (msg: Hat, json: any): Hat {
const inches = json["inches"] ?? json.inches;
const inches = json.inches ?? json.inches;
if (inches) {
msg.inches = inches;
}
const color = json["color"] ?? json.color;
const color = json.color ?? json.color;
if (color) {
msg.color = color;
}
const name = json["name"] ?? json.name;
const name = json.name ?? json.name;
if (name) {
msg.name = name;
}
Expand Down
4 changes: 2 additions & 2 deletions examples/config-dest/out/A.pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const Foo = {
_writeMessageJSON: function (msg: Partial<Foo>): Record<string, unknown> {
const json: Record<string, unknown> = {};
if (msg.name) {
json["name"] = msg.name;
json.name = msg.name;
}
return json;
},
Expand Down Expand Up @@ -102,7 +102,7 @@ export const Foo = {
* @private
*/
_readMessageJSON: function (msg: Foo, json: any): Foo {
const name = json["name"] ?? json.name;
const name = json.name ?? json.name;
if (name) {
msg.name = name;
}
Expand Down
4 changes: 2 additions & 2 deletions examples/config-dest/out/B.pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const Bar = {
if (msg.foo) {
const foo = Foo._writeMessageJSON(msg.foo);
if (Object.keys(foo).length > 0) {
json["foo"] = foo;
json.foo = foo;
}
}
return json;
Expand Down Expand Up @@ -107,7 +107,7 @@ export const Bar = {
* @private
*/
_readMessageJSON: function (msg: Bar, json: any): Bar {
const foo = json["foo"] ?? json.foo;
const foo = json.foo ?? json.foo;
if (foo) {
const m = Foo.initialize();
Foo._readMessageJSON(m, foo);
Expand Down
4 changes: 2 additions & 2 deletions examples/config-root/src/A.pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const Foo = {
_writeMessageJSON: function (msg: Partial<Foo>): Record<string, unknown> {
const json: Record<string, unknown> = {};
if (msg.name) {
json["name"] = msg.name;
json.name = msg.name;
}
return json;
},
Expand Down Expand Up @@ -102,7 +102,7 @@ export const Foo = {
* @private
*/
_readMessageJSON: function (msg: Foo, json: any): Foo {
const name = json["name"] ?? json.name;
const name = json.name ?? json.name;
if (name) {
msg.name = name;
}
Expand Down
4 changes: 2 additions & 2 deletions examples/config-root/src/B.pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const Bar = {
if (msg.foo) {
const foo = Foo._writeMessageJSON(msg.foo);
if (Object.keys(foo).length > 0) {
json["foo"] = foo;
json.foo = foo;
}
}
return json;
Expand Down Expand Up @@ -107,7 +107,7 @@ export const Bar = {
* @private
*/
_readMessageJSON: function (msg: Bar, json: any): Bar {
const foo = json["foo"] ?? json.foo;
const foo = json.foo ?? json.foo;
if (foo) {
const m = Foo.initialize();
Foo._readMessageJSON(m, foo);
Expand Down
20 changes: 10 additions & 10 deletions examples/javascript-fullstack/src/protos/haberdasher.pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ export const Size = {
* @private
*/
_writeMessageJSON: function (msg) {
const json: Record<string, unknown> = {};
const json = {};
if (msg.inches) {
json["inches"] = msg.inches;
json.inches = msg.inches;
}
return json;
},
Expand Down Expand Up @@ -141,7 +141,7 @@ export const Size = {
* @private
*/
_readMessageJSON: function (msg, json) {
const inches = json["inches"] ?? json.inches;
const inches = json.inches ?? json.inches;
if (inches) {
msg.inches = inches;
}
Expand Down Expand Up @@ -209,15 +209,15 @@ export const Hat = {
* @private
*/
_writeMessageJSON: function (msg) {
const json: Record<string, unknown> = {};
const json = {};
if (msg.inches) {
json["inches"] = msg.inches;
json.inches = msg.inches;
}
if (msg.color) {
json["color"] = msg.color;
json.color = msg.color;
}
if (msg.name) {
json["name"] = msg.name;
json.name = msg.name;
}
return json;
},
Expand Down Expand Up @@ -254,15 +254,15 @@ export const Hat = {
* @private
*/
_readMessageJSON: function (msg, json) {
const inches = json["inches"] ?? json.inches;
const inches = json.inches ?? json.inches;
if (inches) {
msg.inches = inches;
}
const color = json["color"] ?? json.color;
const color = json.color ?? json.color;
if (color) {
msg.color = color;
}
const name = json["name"] ?? json.name;
const name = json.name ?? json.name;
if (name) {
msg.name = name;
}
Expand Down
Loading

0 comments on commit 8349813

Please sign in to comment.