Skip to content

Commit

Permalink
revert wrong changes from 63fe421
Browse files Browse the repository at this point in the history
(replaced too many Long.toString with Long.toValue)
  • Loading branch information
christians committed Nov 22, 2021
1 parent 63fe421 commit 787327a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions integration/simple-long/google/protobuf/wrappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export const Int64Value = {

fromJSON(object: any): Int64Value {
const message = { ...baseInt64Value } as Int64Value;
message.value = object.value !== undefined && object.value !== null ? Long.fromValue(object.value) : Long.ZERO;
message.value = object.value !== undefined && object.value !== null ? Long.fromString(object.value) : Long.ZERO;
return message;
},

Expand Down Expand Up @@ -265,7 +265,7 @@ export const UInt64Value = {

fromJSON(object: any): UInt64Value {
const message = { ...baseUInt64Value } as UInt64Value;
message.value = object.value !== undefined && object.value !== null ? Long.fromValue(object.value) : Long.UZERO;
message.value = object.value !== undefined && object.value !== null ? Long.fromString(object.value) : Long.UZERO;
return message;
},

Expand Down
14 changes: 7 additions & 7 deletions integration/simple-long/simple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ export const SimpleWithMap_LongLookupEntry = {
fromJSON(object: any): SimpleWithMap_LongLookupEntry {
const message = { ...baseSimpleWithMap_LongLookupEntry } as SimpleWithMap_LongLookupEntry;
message.key = object.key !== undefined && object.key !== null ? String(object.key) : '';
message.value = object.value !== undefined && object.value !== null ? Long.fromValue(object.value) : Long.ZERO;
message.value = object.value !== undefined && object.value !== null ? Long.fromString(object.value) : Long.ZERO;
return message;
},

Expand Down Expand Up @@ -582,19 +582,19 @@ export const Numbers = {
message.double = object.double !== undefined && object.double !== null ? Number(object.double) : 0;
message.float = object.float !== undefined && object.float !== null ? Number(object.float) : 0;
message.int32 = object.int32 !== undefined && object.int32 !== null ? Number(object.int32) : 0;
message.int64 = object.int64 !== undefined && object.int64 !== null ? Long.fromValue(object.int64) : Long.ZERO;
message.int64 = object.int64 !== undefined && object.int64 !== null ? Long.fromString(object.int64) : Long.ZERO;
message.uint32 = object.uint32 !== undefined && object.uint32 !== null ? Number(object.uint32) : 0;
message.uint64 =
object.uint64 !== undefined && object.uint64 !== null ? Long.fromValue(object.uint64) : Long.UZERO;
object.uint64 !== undefined && object.uint64 !== null ? Long.fromString(object.uint64) : Long.UZERO;
message.sint32 = object.sint32 !== undefined && object.sint32 !== null ? Number(object.sint32) : 0;
message.sint64 = object.sint64 !== undefined && object.sint64 !== null ? Long.fromValue(object.sint64) : Long.ZERO;
message.sint64 = object.sint64 !== undefined && object.sint64 !== null ? Long.fromString(object.sint64) : Long.ZERO;
message.fixed32 = object.fixed32 !== undefined && object.fixed32 !== null ? Number(object.fixed32) : 0;
message.fixed64 =
object.fixed64 !== undefined && object.fixed64 !== null ? Long.fromValue(object.fixed64) : Long.UZERO;
object.fixed64 !== undefined && object.fixed64 !== null ? Long.fromString(object.fixed64) : Long.UZERO;
message.sfixed32 = object.sfixed32 !== undefined && object.sfixed32 !== null ? Number(object.sfixed32) : 0;
message.sfixed64 =
object.sfixed64 !== undefined && object.sfixed64 !== null ? Long.fromValue(object.sfixed64) : Long.ZERO;
message.manyUint64 = (object.manyUint64 ?? []).map((e: any) => Long.fromValue(e));
object.sfixed64 !== undefined && object.sfixed64 !== null ? Long.fromString(object.sfixed64) : Long.ZERO;
message.manyUint64 = (object.manyUint64 ?? []).map((e: any) => Long.fromString(e));
return message;
},

Expand Down

0 comments on commit 787327a

Please sign in to comment.