diff --git a/clientcompat/src/clientcompat.pb.ts b/clientcompat/src/clientcompat.pb.ts index c5241ba7..fac1763c 100644 --- a/clientcompat/src/clientcompat.pb.ts +++ b/clientcompat/src/clientcompat.pb.ts @@ -234,7 +234,7 @@ export const Req = { _writeMessageJSON: function (msg: Partial): Record { const json: Record = {}; if (msg.v) { - json["v"] = msg.v; + json.v = msg.v; } return json; }, @@ -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; } @@ -328,7 +328,7 @@ export const Resp = { _writeMessageJSON: function (msg: Partial): Record { const json: Record = {}; if (msg.v) { - json["v"] = msg.v; + json.v = msg.v; } return json; }, @@ -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; } @@ -447,13 +447,13 @@ export const ClientCompatMessage = { ): Record { const json: Record = {}; 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; }, @@ -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; } diff --git a/examples/authentication/src/protos/authentication.pb.ts b/examples/authentication/src/protos/authentication.pb.ts index 95258ad9..f782c240 100644 --- a/examples/authentication/src/protos/authentication.pb.ts +++ b/examples/authentication/src/protos/authentication.pb.ts @@ -171,10 +171,10 @@ export const CurrentUser = { ): Record { const json: Record = {}; if (msg.username) { - json["username"] = msg.username; + json.username = msg.username; } if (msg.token) { - json["token"] = msg.token; + json.token = msg.token; } return json; }, @@ -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; } @@ -291,10 +291,10 @@ export const Credentials = { ): Record { const json: Record = {}; if (msg.username) { - json["username"] = msg.username; + json.username = msg.username; } if (msg.password) { - json["password"] = msg.password; + json.password = msg.password; } return json; }, @@ -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; } diff --git a/examples/authentication/src/protos/haberdasher.pb.ts b/examples/authentication/src/protos/haberdasher.pb.ts index e3f685a3..8a869792 100644 --- a/examples/authentication/src/protos/haberdasher.pb.ts +++ b/examples/authentication/src/protos/haberdasher.pb.ts @@ -167,7 +167,7 @@ export const Size = { _writeMessageJSON: function (msg: Partial): Record { const json: Record = {}; if (msg.inches) { - json["inches"] = msg.inches; + json.inches = msg.inches; } return json; }, @@ -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; } @@ -269,13 +269,13 @@ export const Hat = { _writeMessageJSON: function (msg: Partial): Record { const json: Record = {}; 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; }, @@ -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; } diff --git a/examples/aws-lambda/src/haberdasher.pb.ts b/examples/aws-lambda/src/haberdasher.pb.ts index d947e5a9..3df21307 100644 --- a/examples/aws-lambda/src/haberdasher.pb.ts +++ b/examples/aws-lambda/src/haberdasher.pb.ts @@ -167,7 +167,7 @@ export const Size = { _writeMessageJSON: function (msg: Partial): Record { const json: Record = {}; if (msg.inches) { - json["inches"] = msg.inches; + json.inches = msg.inches; } return json; }, @@ -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; } @@ -269,13 +269,13 @@ export const Hat = { _writeMessageJSON: function (msg: Partial): Record { const json: Record = {}; 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; }, @@ -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; } diff --git a/examples/config-dest/out/A.pb.ts b/examples/config-dest/out/A.pb.ts index 48f4c7e3..42926e15 100644 --- a/examples/config-dest/out/A.pb.ts +++ b/examples/config-dest/out/A.pb.ts @@ -73,7 +73,7 @@ export const Foo = { _writeMessageJSON: function (msg: Partial): Record { const json: Record = {}; if (msg.name) { - json["name"] = msg.name; + json.name = msg.name; } return json; }, @@ -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; } diff --git a/examples/config-dest/out/B.pb.ts b/examples/config-dest/out/B.pb.ts index d43455ce..04e8655a 100644 --- a/examples/config-dest/out/B.pb.ts +++ b/examples/config-dest/out/B.pb.ts @@ -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; @@ -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); diff --git a/examples/config-root/src/A.pb.ts b/examples/config-root/src/A.pb.ts index 48f4c7e3..42926e15 100644 --- a/examples/config-root/src/A.pb.ts +++ b/examples/config-root/src/A.pb.ts @@ -73,7 +73,7 @@ export const Foo = { _writeMessageJSON: function (msg: Partial): Record { const json: Record = {}; if (msg.name) { - json["name"] = msg.name; + json.name = msg.name; } return json; }, @@ -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; } diff --git a/examples/config-root/src/B.pb.ts b/examples/config-root/src/B.pb.ts index d43455ce..04e8655a 100644 --- a/examples/config-root/src/B.pb.ts +++ b/examples/config-root/src/B.pb.ts @@ -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; @@ -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); diff --git a/examples/javascript-fullstack/src/protos/haberdasher.pb.js b/examples/javascript-fullstack/src/protos/haberdasher.pb.js index 917aa6d9..23d93b75 100644 --- a/examples/javascript-fullstack/src/protos/haberdasher.pb.js +++ b/examples/javascript-fullstack/src/protos/haberdasher.pb.js @@ -110,9 +110,9 @@ export const Size = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.inches) { - json["inches"] = msg.inches; + json.inches = msg.inches; } return json; }, @@ -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; } @@ -209,15 +209,15 @@ export const Hat = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + 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; }, @@ -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; } diff --git a/examples/server-to-server/src/protos/haberdasher.pb.ts b/examples/server-to-server/src/protos/haberdasher.pb.ts index e3f685a3..8a869792 100644 --- a/examples/server-to-server/src/protos/haberdasher.pb.ts +++ b/examples/server-to-server/src/protos/haberdasher.pb.ts @@ -167,7 +167,7 @@ export const Size = { _writeMessageJSON: function (msg: Partial): Record { const json: Record = {}; if (msg.inches) { - json["inches"] = msg.inches; + json.inches = msg.inches; } return json; }, @@ -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; } @@ -269,13 +269,13 @@ export const Hat = { _writeMessageJSON: function (msg: Partial): Record { const json: Record = {}; 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; }, @@ -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; } diff --git a/examples/typescript-fullstack/src/protos/haberdasher.pb.ts b/examples/typescript-fullstack/src/protos/haberdasher.pb.ts index e3f685a3..8a869792 100644 --- a/examples/typescript-fullstack/src/protos/haberdasher.pb.ts +++ b/examples/typescript-fullstack/src/protos/haberdasher.pb.ts @@ -167,7 +167,7 @@ export const Size = { _writeMessageJSON: function (msg: Partial): Record { const json: Record = {}; if (msg.inches) { - json["inches"] = msg.inches; + json.inches = msg.inches; } return json; }, @@ -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; } @@ -269,13 +269,13 @@ export const Hat = { _writeMessageJSON: function (msg: Partial): Record { const json: Record = {}; 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; }, @@ -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; } diff --git a/package.json b/package.json index 09757ab1..dd767b80 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "dist/**/*" ], "scripts": { - "build": "yarn clean && yarn build:module && yarn build:commonjs && chmod +x dist/compiler.js dist/cli/index.js dist/test-protos/gen-test-input.js && cp src/compiler.cmd dist/compiler.cmd", + "build": "yarn clean && yarn build:commonjs && yarn build:module && chmod +x dist/compiler.js dist/cli/index.js dist/test-protos/gen-test-input.js && cp src/compiler.cmd dist/compiler.cmd", "build:commonjs": "yarn tsc", "build:module": "yarn tsc --module esnext --outDir dist/module", "build:watch": "yarn build:commonjs --watch", diff --git a/src/autogenerate/index.ts b/src/autogenerate/index.ts index 406abd76..50e22cb6 100644 --- a/src/autogenerate/index.ts +++ b/src/autogenerate/index.ts @@ -222,20 +222,30 @@ function writeSerializers(types: ProtoTypes[], isTopLevel = true): string { const map = node.children.find( (c) => c.content.fullyQualifiedName === field.tsType ) as MessageType; - res += `for (const key in msg.${field.name}) { - writer.writeMessage(${field.index}, {}, (_, mapWriter) => { - mapWriter.${ - map.content.fields[0].write - }(1, key${printIfTypescript( - ` as unknown as ${map.content.fields[0].tsType} ` - )}); - mapWriter.${map.content.fields[1].write}(2, msg.${ - field.name - }${printIfTypescript("!")}[key]); - }); - }`; + res += `for (const [key, value] of Object.entries(msg.${field.name})) { + if (key && value) { + writer.writeMessage(${field.index}, {}, (_, mapWriter) => { + `; + const [key, value] = map.content.fields; + res += `mapWriter.${key.write}(1, key ${printIfTypescript( + `as any` + )});`; + if (value.read === "readMessage") { + res += `mapWriter.${value.write}(2, value, ${value.tsType}._writeMessage);`; + } else if (value.read === "readEnum") { + res += `mapWriter.${value.write}(2, value ${printIfTypescript( + `as ${value.tsType}` + )});`; + } else if (value.tsType === "bigint") { + res += `mapWriter.${value.write}(2, value.toString());`; + } else { + res += `mapWriter.${value.write}(2, value);`; + } + res += "})\n}}"; } else { - res += `writer.${field.write}(${field.index}, msg.${field.name});`; + res += `writer.${field.write}(${field.index}, msg.${ + field.name + }${printIf(field.tsType === "bigint", ".toString()")});`; } res += "}"; @@ -253,13 +263,14 @@ function writeSerializers(types: ProtoTypes[], isTopLevel = true): string { _writeMessageJSON: function(msg ${printIfTypescript( `: Partial<${node.content.fullyQualifiedName}>` )})${printIfTypescript(`: Record`)} { - const json: Record = {}; + const json${printIfTypescript(": Record")} = {}; ${node.content.fields .map((field) => { let res = ""; - const setField = field.jsonName - ? `json["${field.jsonName}"]` - : `json.${field.name}`; + const setField = + field.jsonName !== field.name + ? `json["${field.jsonName}"]` + : `json.${field.name}`; if (field.repeated) { res += `if (msg.${field.name}?.length) {`; @@ -279,9 +290,35 @@ function writeSerializers(types: ProtoTypes[], isTopLevel = true): string { res += `}`; } } else if (field.read === "map") { - res += `if (Object.keys(msg.${field.name}).length > 0) {`; - res += `${setField} = msg.${field.name};`; + res += `if (msg.${field.name}) {`; + const map = node.children.find( + (c) => c.content.fullyQualifiedName === field.tsType + ) as MessageType; + res += `const map${printIfTypescript( + `: Record` + )} = {};`; + res += `for (const [key, value] of Object.entries(msg.${field.name})) { + if (key && value) {`; + const [_key, value] = map.content.fields; + res += `map[key] =`; + if (value.read === "readMessage") { + res += `${value.tsType}._writeMessageJSON(value);`; + } else if (value.read === "readEnum") { + res += `value;`; + } else if (value.tsType === "bigint") { + res += `value.toString();`; + } else { + res += `value;`; + } + res += `${setField} = map`; + res += "}\n}"; res += `}`; + } else if (field.tsType === "bigint") { + if (field.repeated) { + res += `${setField} = msg.${field.name}.map(x => x.toString());`; + } else { + res += `${setField} = msg.${field.name}.toString();`; + } } else { res += `${setField} = msg.${field.name};`; } @@ -313,21 +350,34 @@ function writeSerializers(types: ProtoTypes[], isTopLevel = true): string { const map = node.children.find( (c) => c.content.fullyQualifiedName === field.tsType ) as MessageType; + const [key, value] = map.content.fields; res += `reader.readMessage(undefined, () => { let key${printIfTypescript( - `: ${map.content.fields[0].tsType} | undefined` + `: ${key.tsType} | undefined` )}; - let value = ${map.content.fields[1].defaultValue}; + let value = ${value.defaultValue}; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { case 1: { - key = reader.${map.content.fields[0].read}(); + key = reader.${key.read}(); break; } case 2: { - value = reader.${map.content.fields[1].read}(); - break; + `; + if (value.read === "readMessage") { + res += `reader.readMessage(${value.tsType}.initialize(), ${value.tsType}._readMessage);`; + } else if (value.read === "readEnum") { + res += `value = reader.${value.read}()${printIfTypescript( + ` as ${value.tsType}` + )};`; + } else if (value.tsType === "bigint") { + res += `value = BigInt(reader.${value.read}());`; + } else { + res += `value = reader.${value.read}();`; + } + + res += `break; } } } @@ -345,19 +395,27 @@ function writeSerializers(types: ProtoTypes[], isTopLevel = true): string { reader.readMessage(msg.${field.name}, ${field.tsType}._readMessage); `; } + } else if (field.read === "readEnum") { + if (field.repeated) { + res += `msg.${field.name}.push(reader.${ + field.read + }() ${printIfTypescript(`as ${field.tsType}`)});`; + } else { + res += `msg.${field.name} = reader.${ + field.read + }() ${printIfTypescript(`as ${field.tsType}`)};`; + } + } else if (field.tsType === "bigint") { + if (field.repeated) { + res += `msg.${field.name} = reader.${field.read}().map(BigInt);`; + } else { + res += `msg.${field.name} = BigInt(reader.${field.read}());`; + } } else { if (field.repeated) { - res += `msg.${field.name}.push(reader.${field.read}() ${ - field.read === "readEnum" - ? printIfTypescript(`as ${field.tsType}`) - : "" - });`; + res += `msg.${field.name}.push(reader.${field.read}());`; } else { - res += `msg.${field.name} = reader.${field.read}() ${ - field.read === "readEnum" - ? printIfTypescript(`as ${field.tsType}`) - : "" - };`; + res += `msg.${field.name} = reader.${field.read}();`; } } res += "break;\n}"; @@ -386,14 +444,30 @@ function writeSerializers(types: ProtoTypes[], isTopLevel = true): string { .map((field) => { let res = ""; const name = field.name; - let getField = field.jsonName - ? `json["${field.jsonName}"] ?? json.${field.protoName}` - : `json.${field.name} ?? json.${field.protoName}`; + let getField = + field.jsonName !== field.name + ? `json["${field.jsonName}"] ?? json.${field.protoName}` + : `json.${field.name} ?? json.${field.protoName}`; res += `const ${name} = ${getField};`; res += `if (${name}) {`; if (field.read == "map") { - res += `msg.${name} = ${name}`; + const map = node.children.find( + (c) => c.content.fullyQualifiedName === field.tsType + ) as MessageType; + const [_key, value] = map.content.fields; + res += `for (const [key, value] of Object.entries(${name})) {`; + res += `msg.${name}[key] =`; + if (value.read === "readMessage") { + res += `${value.tsType}._readMessageJSON(${value.tsType}.initialize(), value);`; + } else if (value.read === "readEnum") { + res += `value${printIfTypescript(` as ${value.tsType}`)};`; + } else if (value.tsType === "bigint") { + res += `BigInt(value${printIfTypescript(" as string")});`; + } else { + res += `value;`; + } + res += "}"; } else if (field.read === "readMessage") { if (field.repeated) { res += `for (const item of ${name}) {`; @@ -406,8 +480,14 @@ function writeSerializers(types: ProtoTypes[], isTopLevel = true): string { res += `${field.tsType}._readMessageJSON(m, ${name});`; res += `msg.${name} = m;`; } + } else if (field.tsType === "bigint") { + if (field.repeated) { + res += `msg.${name} = ${name}.map(BigInt);`; + } else { + res += `msg.${name} = BigInt(${name});`; + } } else { - res += `msg.${name} = ${name}`; + res += `msg.${name} = ${name};`; } res += "}"; return res; diff --git a/src/test-protos/__snapshots__/test.ts.snap b/src/test-protos/__snapshots__/test.ts.snap index f53d732a..21518edd 100644 --- a/src/test-protos/__snapshots__/test.ts.snap +++ b/src/test-protos/__snapshots__/test.ts.snap @@ -105,9 +105,9 @@ export const PublicImportMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.e) { - json[\\"e\\"] = msg.e; + json.e = msg.e; } return json; }, @@ -136,7 +136,7 @@ export const PublicImportMessage = { * @private */ _readMessageJSON: function (msg, json) { - const e = json[\\"e\\"] ?? json.e; + const e = json.e ?? json.e; if (e) { msg.e = e; } @@ -234,9 +234,9 @@ export const ImportMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.d) { - json[\\"d\\"] = msg.d; + json.d = msg.d; } return json; }, @@ -265,7 +265,7 @@ export const ImportMessage = { * @private */ _readMessageJSON: function (msg, json) { - const d = json[\\"d\\"] ?? json.d; + const d = json.d ?? json.d; if (d) { msg.d = d; } @@ -542,15 +542,15 @@ export const TestAllTypes = { initialize: function () { return { optionalInt32: 0, - optionalInt64: \\"\\", + optionalInt64: 0n, optionalUint32: 0, - optionalUint64: \\"\\", + optionalUint64: 0n, optionalSint32: 0, - optionalSint64: \\"\\", + optionalSint64: 0n, optionalFixed32: 0, - optionalFixed64: \\"\\", + optionalFixed64: 0n, optionalSfixed32: 0, - optionalSfixed64: \\"\\", + optionalSfixed64: 0n, optionalFloat: 0, optionalDouble: 0, optionalBool: false, @@ -591,15 +591,15 @@ export const TestAllTypes = { repeatedCord: [], repeatedLazyMessage: [], defaultInt32: 0, - defaultInt64: \\"\\", + defaultInt64: 0n, defaultUint32: 0, - defaultUint64: \\"\\", + defaultUint64: 0n, defaultSint32: 0, - defaultSint64: \\"\\", + defaultSint64: 0n, defaultFixed32: 0, - defaultFixed64: \\"\\", + defaultFixed64: 0n, defaultSfixed32: 0, - defaultSfixed64: \\"\\", + defaultSfixed64: 0n, defaultFloat: 0, defaultDouble: 0, defaultBool: false, @@ -622,31 +622,31 @@ export const TestAllTypes = { writer.writeInt32(1, msg.optionalInt32); } if (msg.optionalInt64) { - writer.writeInt64String(2, msg.optionalInt64); + writer.writeInt64String(2, msg.optionalInt64.toString()); } if (msg.optionalUint32) { writer.writeUint32(3, msg.optionalUint32); } if (msg.optionalUint64) { - writer.writeUint64String(4, msg.optionalUint64); + writer.writeUint64String(4, msg.optionalUint64.toString()); } if (msg.optionalSint32) { writer.writeSint32(5, msg.optionalSint32); } if (msg.optionalSint64) { - writer.writeSint64String(6, msg.optionalSint64); + writer.writeSint64String(6, msg.optionalSint64.toString()); } if (msg.optionalFixed32) { writer.writeFixed32(7, msg.optionalFixed32); } if (msg.optionalFixed64) { - writer.writeFixed64String(8, msg.optionalFixed64); + writer.writeFixed64String(8, msg.optionalFixed64.toString()); } if (msg.optionalSfixed32) { writer.writeSfixed32(9, msg.optionalSfixed32); } if (msg.optionalSfixed64) { - writer.writeSfixed64(10, msg.optionalSfixed64); + writer.writeSfixed64(10, msg.optionalSfixed64.toString()); } if (msg.optionalFloat) { writer.writeFloat(11, msg.optionalFloat); @@ -717,31 +717,31 @@ export const TestAllTypes = { writer.writeRepeatedInt32(31, msg.repeatedInt32); } if (msg.repeatedInt64?.length) { - writer.writeRepeatedInt64String(32, msg.repeatedInt64); + writer.writeRepeatedInt64String(32, msg.repeatedInt64.toString()); } if (msg.repeatedUint32?.length) { writer.writeRepeatedUint32(33, msg.repeatedUint32); } if (msg.repeatedUint64?.length) { - writer.writeRepeatedUint64String(34, msg.repeatedUint64); + writer.writeRepeatedUint64String(34, msg.repeatedUint64.toString()); } if (msg.repeatedSint32?.length) { writer.writeRepeatedSint32(35, msg.repeatedSint32); } if (msg.repeatedSint64?.length) { - writer.writeRepeatedSint64String(36, msg.repeatedSint64); + writer.writeRepeatedSint64String(36, msg.repeatedSint64.toString()); } if (msg.repeatedFixed32?.length) { writer.writeRepeatedFixed32(37, msg.repeatedFixed32); } if (msg.repeatedFixed64?.length) { - writer.writeRepeatedFixed64String(38, msg.repeatedFixed64); + writer.writeRepeatedFixed64String(38, msg.repeatedFixed64.toString()); } if (msg.repeatedSfixed32?.length) { writer.writeRepeatedSfixed32(39, msg.repeatedSfixed32); } if (msg.repeatedSfixed64?.length) { - writer.writeRepeatedSfixed64(40, msg.repeatedSfixed64); + writer.writeRepeatedSfixed64(40, msg.repeatedSfixed64.toString()); } if (msg.repeatedFloat?.length) { writer.writeRepeatedFloat(41, msg.repeatedFloat); @@ -805,31 +805,31 @@ export const TestAllTypes = { writer.writeInt32(61, msg.defaultInt32); } if (msg.defaultInt64) { - writer.writeInt64String(62, msg.defaultInt64); + writer.writeInt64String(62, msg.defaultInt64.toString()); } if (msg.defaultUint32) { writer.writeUint32(63, msg.defaultUint32); } if (msg.defaultUint64) { - writer.writeUint64String(64, msg.defaultUint64); + writer.writeUint64String(64, msg.defaultUint64.toString()); } if (msg.defaultSint32) { writer.writeSint32(65, msg.defaultSint32); } if (msg.defaultSint64) { - writer.writeSint64String(66, msg.defaultSint64); + writer.writeSint64String(66, msg.defaultSint64.toString()); } if (msg.defaultFixed32) { writer.writeFixed32(67, msg.defaultFixed32); } if (msg.defaultFixed64) { - writer.writeFixed64String(68, msg.defaultFixed64); + writer.writeFixed64String(68, msg.defaultFixed64.toString()); } if (msg.defaultSfixed32) { writer.writeSfixed32(69, msg.defaultSfixed32); } if (msg.defaultSfixed64) { - writer.writeSfixed64(70, msg.defaultSfixed64); + writer.writeSfixed64(70, msg.defaultSfixed64.toString()); } if (msg.defaultFloat) { writer.writeFloat(71, msg.defaultFloat); @@ -884,57 +884,57 @@ export const TestAllTypes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.optionalInt32) { - json[\\"optionalInt32\\"] = msg.optionalInt32; + json.optionalInt32 = msg.optionalInt32; } if (msg.optionalInt64) { - json[\\"optionalInt64\\"] = msg.optionalInt64; + json.optionalInt64 = msg.optionalInt64.toString(); } if (msg.optionalUint32) { - json[\\"optionalUint32\\"] = msg.optionalUint32; + json.optionalUint32 = msg.optionalUint32; } if (msg.optionalUint64) { - json[\\"optionalUint64\\"] = msg.optionalUint64; + json.optionalUint64 = msg.optionalUint64.toString(); } if (msg.optionalSint32) { - json[\\"optionalSint32\\"] = msg.optionalSint32; + json.optionalSint32 = msg.optionalSint32; } if (msg.optionalSint64) { - json[\\"optionalSint64\\"] = msg.optionalSint64; + json.optionalSint64 = msg.optionalSint64.toString(); } if (msg.optionalFixed32) { - json[\\"optionalFixed32\\"] = msg.optionalFixed32; + json.optionalFixed32 = msg.optionalFixed32; } if (msg.optionalFixed64) { - json[\\"optionalFixed64\\"] = msg.optionalFixed64; + json.optionalFixed64 = msg.optionalFixed64.toString(); } if (msg.optionalSfixed32) { - json[\\"optionalSfixed32\\"] = msg.optionalSfixed32; + json.optionalSfixed32 = msg.optionalSfixed32; } if (msg.optionalSfixed64) { - json[\\"optionalSfixed64\\"] = msg.optionalSfixed64; + json.optionalSfixed64 = msg.optionalSfixed64.toString(); } if (msg.optionalFloat) { - json[\\"optionalFloat\\"] = msg.optionalFloat; + json.optionalFloat = msg.optionalFloat; } if (msg.optionalDouble) { - json[\\"optionalDouble\\"] = msg.optionalDouble; + json.optionalDouble = msg.optionalDouble; } if (msg.optionalBool) { - json[\\"optionalBool\\"] = msg.optionalBool; + json.optionalBool = msg.optionalBool; } if (msg.optionalString) { - json[\\"optionalString\\"] = msg.optionalString; + json.optionalString = msg.optionalString; } if (msg.optionalBytes) { - json[\\"optionalBytes\\"] = msg.optionalBytes; + json.optionalBytes = msg.optionalBytes; } if (msg.optionalNestedMessage) { const optionalNestedMessage = TestAllTypes.NestedMessage._writeMessageJSON(msg.optionalNestedMessage); if (Object.keys(optionalNestedMessage).length > 0) { - json[\\"optionalNestedMessage\\"] = optionalNestedMessage; + json.optionalNestedMessage = optionalNestedMessage; } } if (msg.optionalForeignMessage) { @@ -942,7 +942,7 @@ export const TestAllTypes = { msg.optionalForeignMessage ); if (Object.keys(optionalForeignMessage).length > 0) { - json[\\"optionalForeignMessage\\"] = optionalForeignMessage; + json.optionalForeignMessage = optionalForeignMessage; } } if (msg.optionalImportMessage) { @@ -950,30 +950,30 @@ export const TestAllTypes = { msg.optionalImportMessage ); if (Object.keys(optionalImportMessage).length > 0) { - json[\\"optionalImportMessage\\"] = optionalImportMessage; + json.optionalImportMessage = optionalImportMessage; } } if (msg.optionalNestedEnum) { - json[\\"optionalNestedEnum\\"] = msg.optionalNestedEnum; + json.optionalNestedEnum = msg.optionalNestedEnum; } if (msg.optionalForeignEnum) { - json[\\"optionalForeignEnum\\"] = msg.optionalForeignEnum; + json.optionalForeignEnum = msg.optionalForeignEnum; } if (msg.optionalImportEnum) { - json[\\"optionalImportEnum\\"] = msg.optionalImportEnum; + json.optionalImportEnum = msg.optionalImportEnum; } if (msg.optionalStringPiece) { - json[\\"optionalStringPiece\\"] = msg.optionalStringPiece; + json.optionalStringPiece = msg.optionalStringPiece; } if (msg.optionalCord) { - json[\\"optionalCord\\"] = msg.optionalCord; + json.optionalCord = msg.optionalCord; } if (msg.optionalPublicImportMessage) { const optionalPublicImportMessage = PublicImportMessage._writeMessageJSON( msg.optionalPublicImportMessage ); if (Object.keys(optionalPublicImportMessage).length > 0) { - json[\\"optionalPublicImportMessage\\"] = optionalPublicImportMessage; + json.optionalPublicImportMessage = optionalPublicImportMessage; } } if (msg.optionalLazyMessage) { @@ -981,165 +981,165 @@ export const TestAllTypes = { msg.optionalLazyMessage ); if (Object.keys(optionalLazyMessage).length > 0) { - json[\\"optionalLazyMessage\\"] = optionalLazyMessage; + json.optionalLazyMessage = optionalLazyMessage; } } if (msg.repeatedInt32?.length) { - json[\\"repeatedInt32\\"] = msg.repeatedInt32; + json.repeatedInt32 = msg.repeatedInt32; } if (msg.repeatedInt64?.length) { - json[\\"repeatedInt64\\"] = msg.repeatedInt64; + json.repeatedInt64 = msg.repeatedInt64.map((x) => x.toString()); } if (msg.repeatedUint32?.length) { - json[\\"repeatedUint32\\"] = msg.repeatedUint32; + json.repeatedUint32 = msg.repeatedUint32; } if (msg.repeatedUint64?.length) { - json[\\"repeatedUint64\\"] = msg.repeatedUint64; + json.repeatedUint64 = msg.repeatedUint64.map((x) => x.toString()); } if (msg.repeatedSint32?.length) { - json[\\"repeatedSint32\\"] = msg.repeatedSint32; + json.repeatedSint32 = msg.repeatedSint32; } if (msg.repeatedSint64?.length) { - json[\\"repeatedSint64\\"] = msg.repeatedSint64; + json.repeatedSint64 = msg.repeatedSint64.map((x) => x.toString()); } if (msg.repeatedFixed32?.length) { - json[\\"repeatedFixed32\\"] = msg.repeatedFixed32; + json.repeatedFixed32 = msg.repeatedFixed32; } if (msg.repeatedFixed64?.length) { - json[\\"repeatedFixed64\\"] = msg.repeatedFixed64; + json.repeatedFixed64 = msg.repeatedFixed64.map((x) => x.toString()); } if (msg.repeatedSfixed32?.length) { - json[\\"repeatedSfixed32\\"] = msg.repeatedSfixed32; + json.repeatedSfixed32 = msg.repeatedSfixed32; } if (msg.repeatedSfixed64?.length) { - json[\\"repeatedSfixed64\\"] = msg.repeatedSfixed64; + json.repeatedSfixed64 = msg.repeatedSfixed64.map((x) => x.toString()); } if (msg.repeatedFloat?.length) { - json[\\"repeatedFloat\\"] = msg.repeatedFloat; + json.repeatedFloat = msg.repeatedFloat; } if (msg.repeatedDouble?.length) { - json[\\"repeatedDouble\\"] = msg.repeatedDouble; + json.repeatedDouble = msg.repeatedDouble; } if (msg.repeatedBool?.length) { - json[\\"repeatedBool\\"] = msg.repeatedBool; + json.repeatedBool = msg.repeatedBool; } if (msg.repeatedString?.length) { - json[\\"repeatedString\\"] = msg.repeatedString; + json.repeatedString = msg.repeatedString; } if (msg.repeatedBytes?.length) { - json[\\"repeatedBytes\\"] = msg.repeatedBytes; + json.repeatedBytes = msg.repeatedBytes; } if (msg.repeatedNestedMessage?.length) { - json[\\"repeatedNestedMessage\\"] = msg.repeatedNestedMessage.map( + json.repeatedNestedMessage = msg.repeatedNestedMessage.map( TestAllTypes.NestedMessage._writeMessageJSON ); } if (msg.repeatedForeignMessage?.length) { - json[\\"repeatedForeignMessage\\"] = msg.repeatedForeignMessage.map( + json.repeatedForeignMessage = msg.repeatedForeignMessage.map( ForeignMessage._writeMessageJSON ); } if (msg.repeatedImportMessage?.length) { - json[\\"repeatedImportMessage\\"] = msg.repeatedImportMessage.map( + json.repeatedImportMessage = msg.repeatedImportMessage.map( ImportMessage._writeMessageJSON ); } if (msg.repeatedNestedEnum?.length) { - json[\\"repeatedNestedEnum\\"] = msg.repeatedNestedEnum; + json.repeatedNestedEnum = msg.repeatedNestedEnum; } if (msg.repeatedForeignEnum?.length) { - json[\\"repeatedForeignEnum\\"] = msg.repeatedForeignEnum; + json.repeatedForeignEnum = msg.repeatedForeignEnum; } if (msg.repeatedImportEnum?.length) { - json[\\"repeatedImportEnum\\"] = msg.repeatedImportEnum; + json.repeatedImportEnum = msg.repeatedImportEnum; } if (msg.repeatedStringPiece?.length) { - json[\\"repeatedStringPiece\\"] = msg.repeatedStringPiece; + json.repeatedStringPiece = msg.repeatedStringPiece; } if (msg.repeatedCord?.length) { - json[\\"repeatedCord\\"] = msg.repeatedCord; + json.repeatedCord = msg.repeatedCord; } if (msg.repeatedLazyMessage?.length) { - json[\\"repeatedLazyMessage\\"] = msg.repeatedLazyMessage.map( + json.repeatedLazyMessage = msg.repeatedLazyMessage.map( TestAllTypes.NestedMessage._writeMessageJSON ); } if (msg.defaultInt32) { - json[\\"defaultInt32\\"] = msg.defaultInt32; + json.defaultInt32 = msg.defaultInt32; } if (msg.defaultInt64) { - json[\\"defaultInt64\\"] = msg.defaultInt64; + json.defaultInt64 = msg.defaultInt64.toString(); } if (msg.defaultUint32) { - json[\\"defaultUint32\\"] = msg.defaultUint32; + json.defaultUint32 = msg.defaultUint32; } if (msg.defaultUint64) { - json[\\"defaultUint64\\"] = msg.defaultUint64; + json.defaultUint64 = msg.defaultUint64.toString(); } if (msg.defaultSint32) { - json[\\"defaultSint32\\"] = msg.defaultSint32; + json.defaultSint32 = msg.defaultSint32; } if (msg.defaultSint64) { - json[\\"defaultSint64\\"] = msg.defaultSint64; + json.defaultSint64 = msg.defaultSint64.toString(); } if (msg.defaultFixed32) { - json[\\"defaultFixed32\\"] = msg.defaultFixed32; + json.defaultFixed32 = msg.defaultFixed32; } if (msg.defaultFixed64) { - json[\\"defaultFixed64\\"] = msg.defaultFixed64; + json.defaultFixed64 = msg.defaultFixed64.toString(); } if (msg.defaultSfixed32) { - json[\\"defaultSfixed32\\"] = msg.defaultSfixed32; + json.defaultSfixed32 = msg.defaultSfixed32; } if (msg.defaultSfixed64) { - json[\\"defaultSfixed64\\"] = msg.defaultSfixed64; + json.defaultSfixed64 = msg.defaultSfixed64.toString(); } if (msg.defaultFloat) { - json[\\"defaultFloat\\"] = msg.defaultFloat; + json.defaultFloat = msg.defaultFloat; } if (msg.defaultDouble) { - json[\\"defaultDouble\\"] = msg.defaultDouble; + json.defaultDouble = msg.defaultDouble; } if (msg.defaultBool) { - json[\\"defaultBool\\"] = msg.defaultBool; + json.defaultBool = msg.defaultBool; } if (msg.defaultString) { - json[\\"defaultString\\"] = msg.defaultString; + json.defaultString = msg.defaultString; } if (msg.defaultBytes) { - json[\\"defaultBytes\\"] = msg.defaultBytes; + json.defaultBytes = msg.defaultBytes; } if (msg.defaultNestedEnum) { - json[\\"defaultNestedEnum\\"] = msg.defaultNestedEnum; + json.defaultNestedEnum = msg.defaultNestedEnum; } if (msg.defaultForeignEnum) { - json[\\"defaultForeignEnum\\"] = msg.defaultForeignEnum; + json.defaultForeignEnum = msg.defaultForeignEnum; } if (msg.defaultImportEnum) { - json[\\"defaultImportEnum\\"] = msg.defaultImportEnum; + json.defaultImportEnum = msg.defaultImportEnum; } if (msg.defaultStringPiece) { - json[\\"defaultStringPiece\\"] = msg.defaultStringPiece; + json.defaultStringPiece = msg.defaultStringPiece; } if (msg.defaultCord) { - json[\\"defaultCord\\"] = msg.defaultCord; + json.defaultCord = msg.defaultCord; } if (msg.oneofUint32 != undefined) { - json[\\"oneofUint32\\"] = msg.oneofUint32; + json.oneofUint32 = msg.oneofUint32; } if (msg.oneofNestedMessage != undefined) { const oneofNestedMessage = TestAllTypes.NestedMessage._writeMessageJSON( msg.oneofNestedMessage ); if (Object.keys(oneofNestedMessage).length > 0) { - json[\\"oneofNestedMessage\\"] = oneofNestedMessage; + json.oneofNestedMessage = oneofNestedMessage; } } if (msg.oneofString != undefined) { - json[\\"oneofString\\"] = msg.oneofString; + json.oneofString = msg.oneofString; } if (msg.oneofBytes != undefined) { - json[\\"oneofBytes\\"] = msg.oneofBytes; + json.oneofBytes = msg.oneofBytes; } return json; }, @@ -1156,7 +1156,7 @@ export const TestAllTypes = { break; } case 2: { - msg.optionalInt64 = reader.readInt64String(); + msg.optionalInt64 = BigInt(reader.readInt64String()); break; } case 3: { @@ -1164,7 +1164,7 @@ export const TestAllTypes = { break; } case 4: { - msg.optionalUint64 = reader.readUint64String(); + msg.optionalUint64 = BigInt(reader.readUint64String()); break; } case 5: { @@ -1172,7 +1172,7 @@ export const TestAllTypes = { break; } case 6: { - msg.optionalSint64 = reader.readSint64(); + msg.optionalSint64 = BigInt(reader.readSint64()); break; } case 7: { @@ -1180,7 +1180,7 @@ export const TestAllTypes = { break; } case 8: { - msg.optionalFixed64 = reader.readFixed64String(); + msg.optionalFixed64 = BigInt(reader.readFixed64String()); break; } case 9: { @@ -1188,7 +1188,7 @@ export const TestAllTypes = { break; } case 10: { - msg.optionalSfixed64 = reader.readSfixed64(); + msg.optionalSfixed64 = BigInt(reader.readSfixed64()); break; } case 11: { @@ -1271,7 +1271,7 @@ export const TestAllTypes = { break; } case 32: { - msg.repeatedInt64.push(reader.readInt64String()); + msg.repeatedInt64 = reader.readInt64String().map(BigInt); break; } case 33: { @@ -1279,7 +1279,7 @@ export const TestAllTypes = { break; } case 34: { - msg.repeatedUint64.push(reader.readUint64String()); + msg.repeatedUint64 = reader.readUint64String().map(BigInt); break; } case 35: { @@ -1287,7 +1287,7 @@ export const TestAllTypes = { break; } case 36: { - msg.repeatedSint64.push(reader.readSint64()); + msg.repeatedSint64 = reader.readSint64().map(BigInt); break; } case 37: { @@ -1295,7 +1295,7 @@ export const TestAllTypes = { break; } case 38: { - msg.repeatedFixed64.push(reader.readFixed64String()); + msg.repeatedFixed64 = reader.readFixed64String().map(BigInt); break; } case 39: { @@ -1303,7 +1303,7 @@ export const TestAllTypes = { break; } case 40: { - msg.repeatedSfixed64.push(reader.readSfixed64()); + msg.repeatedSfixed64 = reader.readSfixed64().map(BigInt); break; } case 41: { @@ -1375,7 +1375,7 @@ export const TestAllTypes = { break; } case 62: { - msg.defaultInt64 = reader.readInt64String(); + msg.defaultInt64 = BigInt(reader.readInt64String()); break; } case 63: { @@ -1383,7 +1383,7 @@ export const TestAllTypes = { break; } case 64: { - msg.defaultUint64 = reader.readUint64String(); + msg.defaultUint64 = BigInt(reader.readUint64String()); break; } case 65: { @@ -1391,7 +1391,7 @@ export const TestAllTypes = { break; } case 66: { - msg.defaultSint64 = reader.readSint64(); + msg.defaultSint64 = BigInt(reader.readSint64()); break; } case 67: { @@ -1399,7 +1399,7 @@ export const TestAllTypes = { break; } case 68: { - msg.defaultFixed64 = reader.readFixed64String(); + msg.defaultFixed64 = BigInt(reader.readFixed64String()); break; } case 69: { @@ -1407,7 +1407,7 @@ export const TestAllTypes = { break; } case 70: { - msg.defaultSfixed64 = reader.readSfixed64(); + msg.defaultSfixed64 = BigInt(reader.readSfixed64()); break; } case 71: { @@ -1482,188 +1482,187 @@ export const TestAllTypes = { * @private */ _readMessageJSON: function (msg, json) { - const optionalInt32 = json[\\"optionalInt32\\"] ?? json.optional_int32; + const optionalInt32 = json.optionalInt32 ?? json.optional_int32; if (optionalInt32) { msg.optionalInt32 = optionalInt32; } - const optionalInt64 = json[\\"optionalInt64\\"] ?? json.optional_int64; + const optionalInt64 = json.optionalInt64 ?? json.optional_int64; if (optionalInt64) { - msg.optionalInt64 = optionalInt64; + msg.optionalInt64 = BigInt(optionalInt64); } - const optionalUint32 = json[\\"optionalUint32\\"] ?? json.optional_uint32; + const optionalUint32 = json.optionalUint32 ?? json.optional_uint32; if (optionalUint32) { msg.optionalUint32 = optionalUint32; } - const optionalUint64 = json[\\"optionalUint64\\"] ?? json.optional_uint64; + const optionalUint64 = json.optionalUint64 ?? json.optional_uint64; if (optionalUint64) { - msg.optionalUint64 = optionalUint64; + msg.optionalUint64 = BigInt(optionalUint64); } - const optionalSint32 = json[\\"optionalSint32\\"] ?? json.optional_sint32; + const optionalSint32 = json.optionalSint32 ?? json.optional_sint32; if (optionalSint32) { msg.optionalSint32 = optionalSint32; } - const optionalSint64 = json[\\"optionalSint64\\"] ?? json.optional_sint64; + const optionalSint64 = json.optionalSint64 ?? json.optional_sint64; if (optionalSint64) { - msg.optionalSint64 = optionalSint64; + msg.optionalSint64 = BigInt(optionalSint64); } - const optionalFixed32 = json[\\"optionalFixed32\\"] ?? json.optional_fixed32; + const optionalFixed32 = json.optionalFixed32 ?? json.optional_fixed32; if (optionalFixed32) { msg.optionalFixed32 = optionalFixed32; } - const optionalFixed64 = json[\\"optionalFixed64\\"] ?? json.optional_fixed64; + const optionalFixed64 = json.optionalFixed64 ?? json.optional_fixed64; if (optionalFixed64) { - msg.optionalFixed64 = optionalFixed64; + msg.optionalFixed64 = BigInt(optionalFixed64); } - const optionalSfixed32 = json[\\"optionalSfixed32\\"] ?? json.optional_sfixed32; + const optionalSfixed32 = json.optionalSfixed32 ?? json.optional_sfixed32; if (optionalSfixed32) { msg.optionalSfixed32 = optionalSfixed32; } - const optionalSfixed64 = json[\\"optionalSfixed64\\"] ?? json.optional_sfixed64; + const optionalSfixed64 = json.optionalSfixed64 ?? json.optional_sfixed64; if (optionalSfixed64) { - msg.optionalSfixed64 = optionalSfixed64; + msg.optionalSfixed64 = BigInt(optionalSfixed64); } - const optionalFloat = json[\\"optionalFloat\\"] ?? json.optional_float; + const optionalFloat = json.optionalFloat ?? json.optional_float; if (optionalFloat) { msg.optionalFloat = optionalFloat; } - const optionalDouble = json[\\"optionalDouble\\"] ?? json.optional_double; + const optionalDouble = json.optionalDouble ?? json.optional_double; if (optionalDouble) { msg.optionalDouble = optionalDouble; } - const optionalBool = json[\\"optionalBool\\"] ?? json.optional_bool; + const optionalBool = json.optionalBool ?? json.optional_bool; if (optionalBool) { msg.optionalBool = optionalBool; } - const optionalString = json[\\"optionalString\\"] ?? json.optional_string; + const optionalString = json.optionalString ?? json.optional_string; if (optionalString) { msg.optionalString = optionalString; } - const optionalBytes = json[\\"optionalBytes\\"] ?? json.optional_bytes; + const optionalBytes = json.optionalBytes ?? json.optional_bytes; if (optionalBytes) { msg.optionalBytes = optionalBytes; } const optionalNestedMessage = - json[\\"optionalNestedMessage\\"] ?? json.optional_nested_message; + json.optionalNestedMessage ?? json.optional_nested_message; if (optionalNestedMessage) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, optionalNestedMessage); msg.optionalNestedMessage = m; } const optionalForeignMessage = - json[\\"optionalForeignMessage\\"] ?? json.optional_foreign_message; + json.optionalForeignMessage ?? json.optional_foreign_message; if (optionalForeignMessage) { const m = ForeignMessage.initialize(); ForeignMessage._readMessageJSON(m, optionalForeignMessage); msg.optionalForeignMessage = m; } const optionalImportMessage = - json[\\"optionalImportMessage\\"] ?? json.optional_import_message; + json.optionalImportMessage ?? json.optional_import_message; if (optionalImportMessage) { const m = ImportMessage.initialize(); ImportMessage._readMessageJSON(m, optionalImportMessage); msg.optionalImportMessage = m; } const optionalNestedEnum = - json[\\"optionalNestedEnum\\"] ?? json.optional_nested_enum; + json.optionalNestedEnum ?? json.optional_nested_enum; if (optionalNestedEnum) { msg.optionalNestedEnum = optionalNestedEnum; } const optionalForeignEnum = - json[\\"optionalForeignEnum\\"] ?? json.optional_foreign_enum; + json.optionalForeignEnum ?? json.optional_foreign_enum; if (optionalForeignEnum) { msg.optionalForeignEnum = optionalForeignEnum; } const optionalImportEnum = - json[\\"optionalImportEnum\\"] ?? json.optional_import_enum; + json.optionalImportEnum ?? json.optional_import_enum; if (optionalImportEnum) { msg.optionalImportEnum = optionalImportEnum; } const optionalStringPiece = - json[\\"optionalStringPiece\\"] ?? json.optional_string_piece; + json.optionalStringPiece ?? json.optional_string_piece; if (optionalStringPiece) { msg.optionalStringPiece = optionalStringPiece; } - const optionalCord = json[\\"optionalCord\\"] ?? json.optional_cord; + const optionalCord = json.optionalCord ?? json.optional_cord; if (optionalCord) { msg.optionalCord = optionalCord; } const optionalPublicImportMessage = - json[\\"optionalPublicImportMessage\\"] ?? - json.optional_public_import_message; + json.optionalPublicImportMessage ?? json.optional_public_import_message; if (optionalPublicImportMessage) { const m = PublicImportMessage.initialize(); PublicImportMessage._readMessageJSON(m, optionalPublicImportMessage); msg.optionalPublicImportMessage = m; } const optionalLazyMessage = - json[\\"optionalLazyMessage\\"] ?? json.optional_lazy_message; + json.optionalLazyMessage ?? json.optional_lazy_message; if (optionalLazyMessage) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, optionalLazyMessage); msg.optionalLazyMessage = m; } - const repeatedInt32 = json[\\"repeatedInt32\\"] ?? json.repeated_int32; + const repeatedInt32 = json.repeatedInt32 ?? json.repeated_int32; if (repeatedInt32) { msg.repeatedInt32 = repeatedInt32; } - const repeatedInt64 = json[\\"repeatedInt64\\"] ?? json.repeated_int64; + const repeatedInt64 = json.repeatedInt64 ?? json.repeated_int64; if (repeatedInt64) { - msg.repeatedInt64 = repeatedInt64; + msg.repeatedInt64 = repeatedInt64.map(BigInt); } - const repeatedUint32 = json[\\"repeatedUint32\\"] ?? json.repeated_uint32; + const repeatedUint32 = json.repeatedUint32 ?? json.repeated_uint32; if (repeatedUint32) { msg.repeatedUint32 = repeatedUint32; } - const repeatedUint64 = json[\\"repeatedUint64\\"] ?? json.repeated_uint64; + const repeatedUint64 = json.repeatedUint64 ?? json.repeated_uint64; if (repeatedUint64) { - msg.repeatedUint64 = repeatedUint64; + msg.repeatedUint64 = repeatedUint64.map(BigInt); } - const repeatedSint32 = json[\\"repeatedSint32\\"] ?? json.repeated_sint32; + const repeatedSint32 = json.repeatedSint32 ?? json.repeated_sint32; if (repeatedSint32) { msg.repeatedSint32 = repeatedSint32; } - const repeatedSint64 = json[\\"repeatedSint64\\"] ?? json.repeated_sint64; + const repeatedSint64 = json.repeatedSint64 ?? json.repeated_sint64; if (repeatedSint64) { - msg.repeatedSint64 = repeatedSint64; + msg.repeatedSint64 = repeatedSint64.map(BigInt); } - const repeatedFixed32 = json[\\"repeatedFixed32\\"] ?? json.repeated_fixed32; + const repeatedFixed32 = json.repeatedFixed32 ?? json.repeated_fixed32; if (repeatedFixed32) { msg.repeatedFixed32 = repeatedFixed32; } - const repeatedFixed64 = json[\\"repeatedFixed64\\"] ?? json.repeated_fixed64; + const repeatedFixed64 = json.repeatedFixed64 ?? json.repeated_fixed64; if (repeatedFixed64) { - msg.repeatedFixed64 = repeatedFixed64; + msg.repeatedFixed64 = repeatedFixed64.map(BigInt); } - const repeatedSfixed32 = json[\\"repeatedSfixed32\\"] ?? json.repeated_sfixed32; + const repeatedSfixed32 = json.repeatedSfixed32 ?? json.repeated_sfixed32; if (repeatedSfixed32) { msg.repeatedSfixed32 = repeatedSfixed32; } - const repeatedSfixed64 = json[\\"repeatedSfixed64\\"] ?? json.repeated_sfixed64; + const repeatedSfixed64 = json.repeatedSfixed64 ?? json.repeated_sfixed64; if (repeatedSfixed64) { - msg.repeatedSfixed64 = repeatedSfixed64; + msg.repeatedSfixed64 = repeatedSfixed64.map(BigInt); } - const repeatedFloat = json[\\"repeatedFloat\\"] ?? json.repeated_float; + const repeatedFloat = json.repeatedFloat ?? json.repeated_float; if (repeatedFloat) { msg.repeatedFloat = repeatedFloat; } - const repeatedDouble = json[\\"repeatedDouble\\"] ?? json.repeated_double; + const repeatedDouble = json.repeatedDouble ?? json.repeated_double; if (repeatedDouble) { msg.repeatedDouble = repeatedDouble; } - const repeatedBool = json[\\"repeatedBool\\"] ?? json.repeated_bool; + const repeatedBool = json.repeatedBool ?? json.repeated_bool; if (repeatedBool) { msg.repeatedBool = repeatedBool; } - const repeatedString = json[\\"repeatedString\\"] ?? json.repeated_string; + const repeatedString = json.repeatedString ?? json.repeated_string; if (repeatedString) { msg.repeatedString = repeatedString; } - const repeatedBytes = json[\\"repeatedBytes\\"] ?? json.repeated_bytes; + const repeatedBytes = json.repeatedBytes ?? json.repeated_bytes; if (repeatedBytes) { msg.repeatedBytes = repeatedBytes; } const repeatedNestedMessage = - json[\\"repeatedNestedMessage\\"] ?? json.repeated_nested_message; + json.repeatedNestedMessage ?? json.repeated_nested_message; if (repeatedNestedMessage) { for (const item of repeatedNestedMessage) { const m = TestAllTypes.NestedMessage.initialize(); @@ -1672,7 +1671,7 @@ export const TestAllTypes = { } } const repeatedForeignMessage = - json[\\"repeatedForeignMessage\\"] ?? json.repeated_foreign_message; + json.repeatedForeignMessage ?? json.repeated_foreign_message; if (repeatedForeignMessage) { for (const item of repeatedForeignMessage) { const m = ForeignMessage.initialize(); @@ -1681,7 +1680,7 @@ export const TestAllTypes = { } } const repeatedImportMessage = - json[\\"repeatedImportMessage\\"] ?? json.repeated_import_message; + json.repeatedImportMessage ?? json.repeated_import_message; if (repeatedImportMessage) { for (const item of repeatedImportMessage) { const m = ImportMessage.initialize(); @@ -1690,31 +1689,31 @@ export const TestAllTypes = { } } const repeatedNestedEnum = - json[\\"repeatedNestedEnum\\"] ?? json.repeated_nested_enum; + json.repeatedNestedEnum ?? json.repeated_nested_enum; if (repeatedNestedEnum) { msg.repeatedNestedEnum = repeatedNestedEnum; } const repeatedForeignEnum = - json[\\"repeatedForeignEnum\\"] ?? json.repeated_foreign_enum; + json.repeatedForeignEnum ?? json.repeated_foreign_enum; if (repeatedForeignEnum) { msg.repeatedForeignEnum = repeatedForeignEnum; } const repeatedImportEnum = - json[\\"repeatedImportEnum\\"] ?? json.repeated_import_enum; + json.repeatedImportEnum ?? json.repeated_import_enum; if (repeatedImportEnum) { msg.repeatedImportEnum = repeatedImportEnum; } const repeatedStringPiece = - json[\\"repeatedStringPiece\\"] ?? json.repeated_string_piece; + json.repeatedStringPiece ?? json.repeated_string_piece; if (repeatedStringPiece) { msg.repeatedStringPiece = repeatedStringPiece; } - const repeatedCord = json[\\"repeatedCord\\"] ?? json.repeated_cord; + const repeatedCord = json.repeatedCord ?? json.repeated_cord; if (repeatedCord) { msg.repeatedCord = repeatedCord; } const repeatedLazyMessage = - json[\\"repeatedLazyMessage\\"] ?? json.repeated_lazy_message; + json.repeatedLazyMessage ?? json.repeated_lazy_message; if (repeatedLazyMessage) { for (const item of repeatedLazyMessage) { const m = TestAllTypes.NestedMessage.initialize(); @@ -1722,106 +1721,106 @@ export const TestAllTypes = { msg.repeatedLazyMessage.push(m); } } - const defaultInt32 = json[\\"defaultInt32\\"] ?? json.default_int32; + const defaultInt32 = json.defaultInt32 ?? json.default_int32; if (defaultInt32) { msg.defaultInt32 = defaultInt32; } - const defaultInt64 = json[\\"defaultInt64\\"] ?? json.default_int64; + const defaultInt64 = json.defaultInt64 ?? json.default_int64; if (defaultInt64) { - msg.defaultInt64 = defaultInt64; + msg.defaultInt64 = BigInt(defaultInt64); } - const defaultUint32 = json[\\"defaultUint32\\"] ?? json.default_uint32; + const defaultUint32 = json.defaultUint32 ?? json.default_uint32; if (defaultUint32) { msg.defaultUint32 = defaultUint32; } - const defaultUint64 = json[\\"defaultUint64\\"] ?? json.default_uint64; + const defaultUint64 = json.defaultUint64 ?? json.default_uint64; if (defaultUint64) { - msg.defaultUint64 = defaultUint64; + msg.defaultUint64 = BigInt(defaultUint64); } - const defaultSint32 = json[\\"defaultSint32\\"] ?? json.default_sint32; + const defaultSint32 = json.defaultSint32 ?? json.default_sint32; if (defaultSint32) { msg.defaultSint32 = defaultSint32; } - const defaultSint64 = json[\\"defaultSint64\\"] ?? json.default_sint64; + const defaultSint64 = json.defaultSint64 ?? json.default_sint64; if (defaultSint64) { - msg.defaultSint64 = defaultSint64; + msg.defaultSint64 = BigInt(defaultSint64); } - const defaultFixed32 = json[\\"defaultFixed32\\"] ?? json.default_fixed32; + const defaultFixed32 = json.defaultFixed32 ?? json.default_fixed32; if (defaultFixed32) { msg.defaultFixed32 = defaultFixed32; } - const defaultFixed64 = json[\\"defaultFixed64\\"] ?? json.default_fixed64; + const defaultFixed64 = json.defaultFixed64 ?? json.default_fixed64; if (defaultFixed64) { - msg.defaultFixed64 = defaultFixed64; + msg.defaultFixed64 = BigInt(defaultFixed64); } - const defaultSfixed32 = json[\\"defaultSfixed32\\"] ?? json.default_sfixed32; + const defaultSfixed32 = json.defaultSfixed32 ?? json.default_sfixed32; if (defaultSfixed32) { msg.defaultSfixed32 = defaultSfixed32; } - const defaultSfixed64 = json[\\"defaultSfixed64\\"] ?? json.default_sfixed64; + const defaultSfixed64 = json.defaultSfixed64 ?? json.default_sfixed64; if (defaultSfixed64) { - msg.defaultSfixed64 = defaultSfixed64; + msg.defaultSfixed64 = BigInt(defaultSfixed64); } - const defaultFloat = json[\\"defaultFloat\\"] ?? json.default_float; + const defaultFloat = json.defaultFloat ?? json.default_float; if (defaultFloat) { msg.defaultFloat = defaultFloat; } - const defaultDouble = json[\\"defaultDouble\\"] ?? json.default_double; + const defaultDouble = json.defaultDouble ?? json.default_double; if (defaultDouble) { msg.defaultDouble = defaultDouble; } - const defaultBool = json[\\"defaultBool\\"] ?? json.default_bool; + const defaultBool = json.defaultBool ?? json.default_bool; if (defaultBool) { msg.defaultBool = defaultBool; } - const defaultString = json[\\"defaultString\\"] ?? json.default_string; + const defaultString = json.defaultString ?? json.default_string; if (defaultString) { msg.defaultString = defaultString; } - const defaultBytes = json[\\"defaultBytes\\"] ?? json.default_bytes; + const defaultBytes = json.defaultBytes ?? json.default_bytes; if (defaultBytes) { msg.defaultBytes = defaultBytes; } const defaultNestedEnum = - json[\\"defaultNestedEnum\\"] ?? json.default_nested_enum; + json.defaultNestedEnum ?? json.default_nested_enum; if (defaultNestedEnum) { msg.defaultNestedEnum = defaultNestedEnum; } const defaultForeignEnum = - json[\\"defaultForeignEnum\\"] ?? json.default_foreign_enum; + json.defaultForeignEnum ?? json.default_foreign_enum; if (defaultForeignEnum) { msg.defaultForeignEnum = defaultForeignEnum; } const defaultImportEnum = - json[\\"defaultImportEnum\\"] ?? json.default_import_enum; + json.defaultImportEnum ?? json.default_import_enum; if (defaultImportEnum) { msg.defaultImportEnum = defaultImportEnum; } const defaultStringPiece = - json[\\"defaultStringPiece\\"] ?? json.default_string_piece; + json.defaultStringPiece ?? json.default_string_piece; if (defaultStringPiece) { msg.defaultStringPiece = defaultStringPiece; } - const defaultCord = json[\\"defaultCord\\"] ?? json.default_cord; + const defaultCord = json.defaultCord ?? json.default_cord; if (defaultCord) { msg.defaultCord = defaultCord; } - const oneofUint32 = json[\\"oneofUint32\\"] ?? json.oneof_uint32; + const oneofUint32 = json.oneofUint32 ?? json.oneof_uint32; if (oneofUint32) { msg.oneofUint32 = oneofUint32; } const oneofNestedMessage = - json[\\"oneofNestedMessage\\"] ?? json.oneof_nested_message; + json.oneofNestedMessage ?? json.oneof_nested_message; if (oneofNestedMessage) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, oneofNestedMessage); msg.oneofNestedMessage = m; } - const oneofString = json[\\"oneofString\\"] ?? json.oneof_string; + const oneofString = json.oneofString ?? json.oneof_string; if (oneofString) { msg.oneofString = oneofString; } - const oneofBytes = json[\\"oneofBytes\\"] ?? json.oneof_bytes; + const oneofBytes = json.oneofBytes ?? json.oneof_bytes; if (oneofBytes) { msg.oneofBytes = oneofBytes; } @@ -1893,9 +1892,9 @@ export const TestAllTypes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.bb) { - json[\\"bb\\"] = msg.bb; + json.bb = msg.bb; } return json; }, @@ -1924,7 +1923,7 @@ export const TestAllTypes = { * @private */ _readMessageJSON: function (msg, json) { - const bb = json[\\"bb\\"] ?? json.bb; + const bb = json.bb ?? json.bb; if (bb) { msg.bb = bb; } @@ -1995,9 +1994,9 @@ export const TestAllTypes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -2026,7 +2025,7 @@ export const TestAllTypes = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -2097,9 +2096,9 @@ export const TestAllTypes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -2128,7 +2127,7 @@ export const TestAllTypes = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -2212,21 +2211,21 @@ export const NestedTestAllTypes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.child) { const child = NestedTestAllTypes._writeMessageJSON(msg.child); if (Object.keys(child).length > 0) { - json[\\"child\\"] = child; + json.child = child; } } if (msg.payload) { const payload = TestAllTypes._writeMessageJSON(msg.payload); if (Object.keys(payload).length > 0) { - json[\\"payload\\"] = payload; + json.payload = payload; } } if (msg.repeatedChild?.length) { - json[\\"repeatedChild\\"] = msg.repeatedChild.map( + json.repeatedChild = msg.repeatedChild.map( NestedTestAllTypes._writeMessageJSON ); } @@ -2267,19 +2266,19 @@ export const NestedTestAllTypes = { * @private */ _readMessageJSON: function (msg, json) { - const child = json[\\"child\\"] ?? json.child; + const child = json.child ?? json.child; if (child) { const m = NestedTestAllTypes.initialize(); NestedTestAllTypes._readMessageJSON(m, child); msg.child = m; } - const payload = json[\\"payload\\"] ?? json.payload; + const payload = json.payload ?? json.payload; if (payload) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, payload); msg.payload = m; } - const repeatedChild = json[\\"repeatedChild\\"] ?? json.repeated_child; + const repeatedChild = json.repeatedChild ?? json.repeated_child; if (repeatedChild) { for (const item of repeatedChild) { const m = NestedTestAllTypes.initialize(); @@ -2357,12 +2356,12 @@ export const TestDeprecatedFields = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.deprecatedInt32) { - json[\\"deprecatedInt32\\"] = msg.deprecatedInt32; + json.deprecatedInt32 = msg.deprecatedInt32; } if (msg.deprecatedInt32InOneof != undefined) { - json[\\"deprecatedInt32InOneof\\"] = msg.deprecatedInt32InOneof; + json.deprecatedInt32InOneof = msg.deprecatedInt32InOneof; } return json; }, @@ -2395,12 +2394,12 @@ export const TestDeprecatedFields = { * @private */ _readMessageJSON: function (msg, json) { - const deprecatedInt32 = json[\\"deprecatedInt32\\"] ?? json.deprecated_int32; + const deprecatedInt32 = json.deprecatedInt32 ?? json.deprecated_int32; if (deprecatedInt32) { msg.deprecatedInt32 = deprecatedInt32; } const deprecatedInt32InOneof = - json[\\"deprecatedInt32InOneof\\"] ?? json.deprecated_int32_in_oneof; + json.deprecatedInt32InOneof ?? json.deprecated_int32_in_oneof; if (deprecatedInt32InOneof) { msg.deprecatedInt32InOneof = deprecatedInt32InOneof; } @@ -2521,12 +2520,12 @@ export const ForeignMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.c) { - json[\\"c\\"] = msg.c; + json.c = msg.c; } if (msg.d) { - json[\\"d\\"] = msg.d; + json.d = msg.d; } return json; }, @@ -2559,11 +2558,11 @@ export const ForeignMessage = { * @private */ _readMessageJSON: function (msg, json) { - const c = json[\\"c\\"] ?? json.c; + const c = json.c ?? json.c; if (c) { msg.c = c; } - const d = json[\\"d\\"] ?? json.d; + const d = json.d ?? json.d; if (d) { msg.d = d; } @@ -2730,9 +2729,9 @@ export const OptionalGroup_extension = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -2761,7 +2760,7 @@ export const OptionalGroup_extension = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -2832,9 +2831,9 @@ export const RepeatedGroup_extension = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -2863,7 +2862,7 @@ export const RepeatedGroup_extension = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -2929,9 +2928,9 @@ export const TestGroup = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.optionalForeignEnum) { - json[\\"optionalForeignEnum\\"] = msg.optionalForeignEnum; + json.optionalForeignEnum = msg.optionalForeignEnum; } return json; }, @@ -2961,7 +2960,7 @@ export const TestGroup = { */ _readMessageJSON: function (msg, json) { const optionalForeignEnum = - json[\\"optionalForeignEnum\\"] ?? json.optional_foreign_enum; + json.optionalForeignEnum ?? json.optional_foreign_enum; if (optionalForeignEnum) { msg.optionalForeignEnum = optionalForeignEnum; } @@ -3031,9 +3030,9 @@ export const TestGroup = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -3062,7 +3061,7 @@ export const TestGroup = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -3231,9 +3230,9 @@ export const TestNestedExtension = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -3262,7 +3261,7 @@ export const TestNestedExtension = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -3346,19 +3345,19 @@ export const TestChildExtension = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } if (msg.b) { - json[\\"b\\"] = msg.b; + json.b = msg.b; } if (msg.optionalExtension) { const optionalExtension = TestAllExtensions._writeMessageJSON( msg.optionalExtension ); if (Object.keys(optionalExtension).length > 0) { - json[\\"optionalExtension\\"] = optionalExtension; + json.optionalExtension = optionalExtension; } } return json; @@ -3399,16 +3398,15 @@ export const TestChildExtension = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } - const b = json[\\"b\\"] ?? json.b; + const b = json.b ?? json.b; if (b) { msg.b = b; } - const optionalExtension = - json[\\"optionalExtension\\"] ?? json.optional_extension; + const optionalExtension = json.optionalExtension ?? json.optional_extension; if (optionalExtension) { const m = TestAllExtensions.initialize(); TestAllExtensions._readMessageJSON(m, optionalExtension); @@ -3607,105 +3605,105 @@ export const TestRequired = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } if (msg.dummy2) { - json[\\"dummy2\\"] = msg.dummy2; + json.dummy2 = msg.dummy2; } if (msg.b) { - json[\\"b\\"] = msg.b; + json.b = msg.b; } if (msg.dummy4) { - json[\\"dummy4\\"] = msg.dummy4; + json.dummy4 = msg.dummy4; } if (msg.dummy5) { - json[\\"dummy5\\"] = msg.dummy5; + json.dummy5 = msg.dummy5; } if (msg.dummy6) { - json[\\"dummy6\\"] = msg.dummy6; + json.dummy6 = msg.dummy6; } if (msg.dummy7) { - json[\\"dummy7\\"] = msg.dummy7; + json.dummy7 = msg.dummy7; } if (msg.dummy8) { - json[\\"dummy8\\"] = msg.dummy8; + json.dummy8 = msg.dummy8; } if (msg.dummy9) { - json[\\"dummy9\\"] = msg.dummy9; + json.dummy9 = msg.dummy9; } if (msg.dummy10) { - json[\\"dummy10\\"] = msg.dummy10; + json.dummy10 = msg.dummy10; } if (msg.dummy11) { - json[\\"dummy11\\"] = msg.dummy11; + json.dummy11 = msg.dummy11; } if (msg.dummy12) { - json[\\"dummy12\\"] = msg.dummy12; + json.dummy12 = msg.dummy12; } if (msg.dummy13) { - json[\\"dummy13\\"] = msg.dummy13; + json.dummy13 = msg.dummy13; } if (msg.dummy14) { - json[\\"dummy14\\"] = msg.dummy14; + json.dummy14 = msg.dummy14; } if (msg.dummy15) { - json[\\"dummy15\\"] = msg.dummy15; + json.dummy15 = msg.dummy15; } if (msg.dummy16) { - json[\\"dummy16\\"] = msg.dummy16; + json.dummy16 = msg.dummy16; } if (msg.dummy17) { - json[\\"dummy17\\"] = msg.dummy17; + json.dummy17 = msg.dummy17; } if (msg.dummy18) { - json[\\"dummy18\\"] = msg.dummy18; + json.dummy18 = msg.dummy18; } if (msg.dummy19) { - json[\\"dummy19\\"] = msg.dummy19; + json.dummy19 = msg.dummy19; } if (msg.dummy20) { - json[\\"dummy20\\"] = msg.dummy20; + json.dummy20 = msg.dummy20; } if (msg.dummy21) { - json[\\"dummy21\\"] = msg.dummy21; + json.dummy21 = msg.dummy21; } if (msg.dummy22) { - json[\\"dummy22\\"] = msg.dummy22; + json.dummy22 = msg.dummy22; } if (msg.dummy23) { - json[\\"dummy23\\"] = msg.dummy23; + json.dummy23 = msg.dummy23; } if (msg.dummy24) { - json[\\"dummy24\\"] = msg.dummy24; + json.dummy24 = msg.dummy24; } if (msg.dummy25) { - json[\\"dummy25\\"] = msg.dummy25; + json.dummy25 = msg.dummy25; } if (msg.dummy26) { - json[\\"dummy26\\"] = msg.dummy26; + json.dummy26 = msg.dummy26; } if (msg.dummy27) { - json[\\"dummy27\\"] = msg.dummy27; + json.dummy27 = msg.dummy27; } if (msg.dummy28) { - json[\\"dummy28\\"] = msg.dummy28; + json.dummy28 = msg.dummy28; } if (msg.dummy29) { - json[\\"dummy29\\"] = msg.dummy29; + json.dummy29 = msg.dummy29; } if (msg.dummy30) { - json[\\"dummy30\\"] = msg.dummy30; + json.dummy30 = msg.dummy30; } if (msg.dummy31) { - json[\\"dummy31\\"] = msg.dummy31; + json.dummy31 = msg.dummy31; } if (msg.dummy32) { - json[\\"dummy32\\"] = msg.dummy32; + json.dummy32 = msg.dummy32; } if (msg.c) { - json[\\"c\\"] = msg.c; + json.c = msg.c; } return json; }, @@ -3862,135 +3860,135 @@ export const TestRequired = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } - const dummy2 = json[\\"dummy2\\"] ?? json.dummy2; + const dummy2 = json.dummy2 ?? json.dummy2; if (dummy2) { msg.dummy2 = dummy2; } - const b = json[\\"b\\"] ?? json.b; + const b = json.b ?? json.b; if (b) { msg.b = b; } - const dummy4 = json[\\"dummy4\\"] ?? json.dummy4; + const dummy4 = json.dummy4 ?? json.dummy4; if (dummy4) { msg.dummy4 = dummy4; } - const dummy5 = json[\\"dummy5\\"] ?? json.dummy5; + const dummy5 = json.dummy5 ?? json.dummy5; if (dummy5) { msg.dummy5 = dummy5; } - const dummy6 = json[\\"dummy6\\"] ?? json.dummy6; + const dummy6 = json.dummy6 ?? json.dummy6; if (dummy6) { msg.dummy6 = dummy6; } - const dummy7 = json[\\"dummy7\\"] ?? json.dummy7; + const dummy7 = json.dummy7 ?? json.dummy7; if (dummy7) { msg.dummy7 = dummy7; } - const dummy8 = json[\\"dummy8\\"] ?? json.dummy8; + const dummy8 = json.dummy8 ?? json.dummy8; if (dummy8) { msg.dummy8 = dummy8; } - const dummy9 = json[\\"dummy9\\"] ?? json.dummy9; + const dummy9 = json.dummy9 ?? json.dummy9; if (dummy9) { msg.dummy9 = dummy9; } - const dummy10 = json[\\"dummy10\\"] ?? json.dummy10; + const dummy10 = json.dummy10 ?? json.dummy10; if (dummy10) { msg.dummy10 = dummy10; } - const dummy11 = json[\\"dummy11\\"] ?? json.dummy11; + const dummy11 = json.dummy11 ?? json.dummy11; if (dummy11) { msg.dummy11 = dummy11; } - const dummy12 = json[\\"dummy12\\"] ?? json.dummy12; + const dummy12 = json.dummy12 ?? json.dummy12; if (dummy12) { msg.dummy12 = dummy12; } - const dummy13 = json[\\"dummy13\\"] ?? json.dummy13; + const dummy13 = json.dummy13 ?? json.dummy13; if (dummy13) { msg.dummy13 = dummy13; } - const dummy14 = json[\\"dummy14\\"] ?? json.dummy14; + const dummy14 = json.dummy14 ?? json.dummy14; if (dummy14) { msg.dummy14 = dummy14; } - const dummy15 = json[\\"dummy15\\"] ?? json.dummy15; + const dummy15 = json.dummy15 ?? json.dummy15; if (dummy15) { msg.dummy15 = dummy15; } - const dummy16 = json[\\"dummy16\\"] ?? json.dummy16; + const dummy16 = json.dummy16 ?? json.dummy16; if (dummy16) { msg.dummy16 = dummy16; } - const dummy17 = json[\\"dummy17\\"] ?? json.dummy17; + const dummy17 = json.dummy17 ?? json.dummy17; if (dummy17) { msg.dummy17 = dummy17; } - const dummy18 = json[\\"dummy18\\"] ?? json.dummy18; + const dummy18 = json.dummy18 ?? json.dummy18; if (dummy18) { msg.dummy18 = dummy18; } - const dummy19 = json[\\"dummy19\\"] ?? json.dummy19; + const dummy19 = json.dummy19 ?? json.dummy19; if (dummy19) { msg.dummy19 = dummy19; } - const dummy20 = json[\\"dummy20\\"] ?? json.dummy20; + const dummy20 = json.dummy20 ?? json.dummy20; if (dummy20) { msg.dummy20 = dummy20; } - const dummy21 = json[\\"dummy21\\"] ?? json.dummy21; + const dummy21 = json.dummy21 ?? json.dummy21; if (dummy21) { msg.dummy21 = dummy21; } - const dummy22 = json[\\"dummy22\\"] ?? json.dummy22; + const dummy22 = json.dummy22 ?? json.dummy22; if (dummy22) { msg.dummy22 = dummy22; } - const dummy23 = json[\\"dummy23\\"] ?? json.dummy23; + const dummy23 = json.dummy23 ?? json.dummy23; if (dummy23) { msg.dummy23 = dummy23; } - const dummy24 = json[\\"dummy24\\"] ?? json.dummy24; + const dummy24 = json.dummy24 ?? json.dummy24; if (dummy24) { msg.dummy24 = dummy24; } - const dummy25 = json[\\"dummy25\\"] ?? json.dummy25; + const dummy25 = json.dummy25 ?? json.dummy25; if (dummy25) { msg.dummy25 = dummy25; } - const dummy26 = json[\\"dummy26\\"] ?? json.dummy26; + const dummy26 = json.dummy26 ?? json.dummy26; if (dummy26) { msg.dummy26 = dummy26; } - const dummy27 = json[\\"dummy27\\"] ?? json.dummy27; + const dummy27 = json.dummy27 ?? json.dummy27; if (dummy27) { msg.dummy27 = dummy27; } - const dummy28 = json[\\"dummy28\\"] ?? json.dummy28; + const dummy28 = json.dummy28 ?? json.dummy28; if (dummy28) { msg.dummy28 = dummy28; } - const dummy29 = json[\\"dummy29\\"] ?? json.dummy29; + const dummy29 = json.dummy29 ?? json.dummy29; if (dummy29) { msg.dummy29 = dummy29; } - const dummy30 = json[\\"dummy30\\"] ?? json.dummy30; + const dummy30 = json.dummy30 ?? json.dummy30; if (dummy30) { msg.dummy30 = dummy30; } - const dummy31 = json[\\"dummy31\\"] ?? json.dummy31; + const dummy31 = json.dummy31 ?? json.dummy31; if (dummy31) { msg.dummy31 = dummy31; } - const dummy32 = json[\\"dummy32\\"] ?? json.dummy32; + const dummy32 = json.dummy32 ?? json.dummy32; if (dummy32) { msg.dummy32 = dummy32; } - const c = json[\\"c\\"] ?? json.c; + const c = json.c ?? json.c; if (c) { msg.c = c; } @@ -4073,22 +4071,22 @@ export const TestRequiredForeign = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.optionalMessage) { const optionalMessage = TestRequired._writeMessageJSON( msg.optionalMessage ); if (Object.keys(optionalMessage).length > 0) { - json[\\"optionalMessage\\"] = optionalMessage; + json.optionalMessage = optionalMessage; } } if (msg.repeatedMessage?.length) { - json[\\"repeatedMessage\\"] = msg.repeatedMessage.map( + json.repeatedMessage = msg.repeatedMessage.map( TestRequired._writeMessageJSON ); } if (msg.dummy) { - json[\\"dummy\\"] = msg.dummy; + json.dummy = msg.dummy; } return json; }, @@ -4127,13 +4125,13 @@ export const TestRequiredForeign = { * @private */ _readMessageJSON: function (msg, json) { - const optionalMessage = json[\\"optionalMessage\\"] ?? json.optional_message; + const optionalMessage = json.optionalMessage ?? json.optional_message; if (optionalMessage) { const m = TestRequired.initialize(); TestRequired._readMessageJSON(m, optionalMessage); msg.optionalMessage = m; } - const repeatedMessage = json[\\"repeatedMessage\\"] ?? json.repeated_message; + const repeatedMessage = json.repeatedMessage ?? json.repeated_message; if (repeatedMessage) { for (const item of repeatedMessage) { const m = TestRequired.initialize(); @@ -4141,7 +4139,7 @@ export const TestRequiredForeign = { msg.repeatedMessage.push(m); } } - const dummy = json[\\"dummy\\"] ?? json.dummy; + const dummy = json.dummy ?? json.dummy; if (dummy) { msg.dummy = dummy; } @@ -4224,17 +4222,17 @@ export const TestRequiredMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.optionalMessage) { const optionalMessage = TestRequired._writeMessageJSON( msg.optionalMessage ); if (Object.keys(optionalMessage).length > 0) { - json[\\"optionalMessage\\"] = optionalMessage; + json.optionalMessage = optionalMessage; } } if (msg.repeatedMessage?.length) { - json[\\"repeatedMessage\\"] = msg.repeatedMessage.map( + json.repeatedMessage = msg.repeatedMessage.map( TestRequired._writeMessageJSON ); } @@ -4243,7 +4241,7 @@ export const TestRequiredMessage = { msg.requiredMessage ); if (Object.keys(requiredMessage).length > 0) { - json[\\"requiredMessage\\"] = requiredMessage; + json.requiredMessage = requiredMessage; } } return json; @@ -4283,13 +4281,13 @@ export const TestRequiredMessage = { * @private */ _readMessageJSON: function (msg, json) { - const optionalMessage = json[\\"optionalMessage\\"] ?? json.optional_message; + const optionalMessage = json.optionalMessage ?? json.optional_message; if (optionalMessage) { const m = TestRequired.initialize(); TestRequired._readMessageJSON(m, optionalMessage); msg.optionalMessage = m; } - const repeatedMessage = json[\\"repeatedMessage\\"] ?? json.repeated_message; + const repeatedMessage = json.repeatedMessage ?? json.repeated_message; if (repeatedMessage) { for (const item of repeatedMessage) { const m = TestRequired.initialize(); @@ -4297,7 +4295,7 @@ export const TestRequiredMessage = { msg.repeatedMessage.push(m); } } - const requiredMessage = json[\\"requiredMessage\\"] ?? json.required_message; + const requiredMessage = json.requiredMessage ?? json.required_message; if (requiredMessage) { const m = TestRequired.initialize(); TestRequired._readMessageJSON(m, requiredMessage); @@ -4374,13 +4372,13 @@ export const TestForeignNested = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.foreignNested) { const foreignNested = TestAllTypes.NestedMessage._writeMessageJSON( msg.foreignNested ); if (Object.keys(foreignNested).length > 0) { - json[\\"foreignNested\\"] = foreignNested; + json.foreignNested = foreignNested; } } return json; @@ -4413,7 +4411,7 @@ export const TestForeignNested = { * @private */ _readMessageJSON: function (msg, json) { - const foreignNested = json[\\"foreignNested\\"] ?? json.foreign_nested; + const foreignNested = json.foreignNested ?? json.foreign_nested; if (foreignNested) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, foreignNested); @@ -4629,9 +4627,9 @@ export const TestPickleNestedMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.bb) { - json[\\"bb\\"] = msg.bb; + json.bb = msg.bb; } return json; }, @@ -4660,7 +4658,7 @@ export const TestPickleNestedMessage = { * @private */ _readMessageJSON: function (msg, json) { - const bb = json[\\"bb\\"] ?? json.bb; + const bb = json.bb ?? json.bb; if (bb) { msg.bb = bb; } @@ -4732,9 +4730,9 @@ export const TestPickleNestedMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.cc) { - json[\\"cc\\"] = msg.cc; + json.cc = msg.cc; } return json; }, @@ -4763,7 +4761,7 @@ export const TestPickleNestedMessage = { * @private */ _readMessageJSON: function (msg, json) { - const cc = json[\\"cc\\"] ?? json.cc; + const cc = json.cc ?? json.cc; if (cc) { msg.cc = cc; } @@ -4888,12 +4886,12 @@ export const TestReallyLargeTagNumber = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } if (msg.bb) { - json[\\"bb\\"] = msg.bb; + json.bb = msg.bb; } return json; }, @@ -4926,11 +4924,11 @@ export const TestReallyLargeTagNumber = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } - const bb = json[\\"bb\\"] ?? json.bb; + const bb = json.bb ?? json.bb; if (bb) { msg.bb = bb; } @@ -5005,15 +5003,15 @@ export const TestRecursiveMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { const a = TestRecursiveMessage._writeMessageJSON(msg.a); if (Object.keys(a).length > 0) { - json[\\"a\\"] = a; + json.a = a; } } if (msg.i) { - json[\\"i\\"] = msg.i; + json.i = msg.i; } return json; }, @@ -5046,13 +5044,13 @@ export const TestRecursiveMessage = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { const m = TestRecursiveMessage.initialize(); TestRecursiveMessage._readMessageJSON(m, a); msg.a = m; } - const i = json[\\"i\\"] ?? json.i; + const i = json.i ?? json.i; if (i) { msg.i = i; } @@ -5123,11 +5121,11 @@ export const TestMutualRecursionA = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.bb) { const bb = TestMutualRecursionB._writeMessageJSON(msg.bb); if (Object.keys(bb).length > 0) { - json[\\"bb\\"] = bb; + json.bb = bb; } } return json; @@ -5157,7 +5155,7 @@ export const TestMutualRecursionA = { * @private */ _readMessageJSON: function (msg, json) { - const bb = json[\\"bb\\"] ?? json.bb; + const bb = json.bb ?? json.bb; if (bb) { const m = TestMutualRecursionB.initialize(); TestMutualRecursionB._readMessageJSON(m, bb); @@ -5229,11 +5227,11 @@ export const TestMutualRecursionA = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.b) { const b = TestMutualRecursionB._writeMessageJSON(msg.b); if (Object.keys(b).length > 0) { - json[\\"b\\"] = b; + json.b = b; } } return json; @@ -5263,7 +5261,7 @@ export const TestMutualRecursionA = { * @private */ _readMessageJSON: function (msg, json) { - const b = json[\\"b\\"] ?? json.b; + const b = json.b ?? json.b; if (b) { const m = TestMutualRecursionB.initialize(); TestMutualRecursionB._readMessageJSON(m, b); @@ -5344,19 +5342,19 @@ export const TestMutualRecursionA = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.subMessage) { const subMessage = TestMutualRecursionA.SubMessage._writeMessageJSON( msg.subMessage ); if (Object.keys(subMessage).length > 0) { - json[\\"subMessage\\"] = subMessage; + json.subMessage = subMessage; } } if (msg.notInThisScc) { const notInThisScc = TestAllTypes._writeMessageJSON(msg.notInThisScc); if (Object.keys(notInThisScc).length > 0) { - json[\\"notInThisScc\\"] = notInThisScc; + json.notInThisScc = notInThisScc; } } return json; @@ -5393,13 +5391,13 @@ export const TestMutualRecursionA = { * @private */ _readMessageJSON: function (msg, json) { - const subMessage = json[\\"subMessage\\"] ?? json.sub_message; + const subMessage = json.subMessage ?? json.sub_message; if (subMessage) { const m = TestMutualRecursionA.SubMessage.initialize(); TestMutualRecursionA.SubMessage._readMessageJSON(m, subMessage); msg.subMessage = m; } - const notInThisScc = json[\\"notInThisScc\\"] ?? json.not_in_this_scc; + const notInThisScc = json.notInThisScc ?? json.not_in_this_scc; if (notInThisScc) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, notInThisScc); @@ -5477,15 +5475,15 @@ export const TestMutualRecursionB = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { const a = TestMutualRecursionA._writeMessageJSON(msg.a); if (Object.keys(a).length > 0) { - json[\\"a\\"] = a; + json.a = a; } } if (msg.optionalInt32) { - json[\\"optionalInt32\\"] = msg.optionalInt32; + json.optionalInt32 = msg.optionalInt32; } return json; }, @@ -5518,13 +5516,13 @@ export const TestMutualRecursionB = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { const m = TestMutualRecursionA.initialize(); TestMutualRecursionA._readMessageJSON(m, a); msg.a = m; } - const optionalInt32 = json[\\"optionalInt32\\"] ?? json.optional_int32; + const optionalInt32 = json.optionalInt32 ?? json.optional_int32; if (optionalInt32) { msg.optionalInt32 = optionalInt32; } @@ -5599,13 +5597,13 @@ export const TestIsInitialized = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.subMessage) { const subMessage = TestIsInitialized.SubMessage._writeMessageJSON( msg.subMessage ); if (Object.keys(subMessage).length > 0) { - json[\\"subMessage\\"] = subMessage; + json.subMessage = subMessage; } } return json; @@ -5638,7 +5636,7 @@ export const TestIsInitialized = { * @private */ _readMessageJSON: function (msg, json) { - const subMessage = json[\\"subMessage\\"] ?? json.sub_message; + const subMessage = json.subMessage ?? json.sub_message; if (subMessage) { const m = TestIsInitialized.SubMessage.initialize(); TestIsInitialized.SubMessage._readMessageJSON(m, subMessage); @@ -5757,9 +5755,9 @@ export const TestIsInitialized = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.i) { - json[\\"i\\"] = msg.i; + json.i = msg.i; } return json; }, @@ -5788,7 +5786,7 @@ export const TestIsInitialized = { * @private */ _readMessageJSON: function (msg, json) { - const i = json[\\"i\\"] ?? json.i; + const i = json.i ?? json.i; if (i) { msg.i = i; } @@ -5861,9 +5859,9 @@ export const TestDupFieldNumber = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -5892,7 +5890,7 @@ export const TestDupFieldNumber = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -5960,9 +5958,9 @@ export const TestDupFieldNumber = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -5991,7 +5989,7 @@ export const TestDupFieldNumber = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -6060,9 +6058,9 @@ export const TestDupFieldNumber = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -6091,7 +6089,7 @@ export const TestDupFieldNumber = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -6161,11 +6159,11 @@ export const TestEagerMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.subMessage) { const subMessage = TestAllTypes._writeMessageJSON(msg.subMessage); if (Object.keys(subMessage).length > 0) { - json[\\"subMessage\\"] = subMessage; + json.subMessage = subMessage; } } return json; @@ -6195,7 +6193,7 @@ export const TestEagerMessage = { * @private */ _readMessageJSON: function (msg, json) { - const subMessage = json[\\"subMessage\\"] ?? json.sub_message; + const subMessage = json.subMessage ?? json.sub_message; if (subMessage) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, subMessage); @@ -6266,11 +6264,11 @@ export const TestLazyMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.subMessage) { const subMessage = TestAllTypes._writeMessageJSON(msg.subMessage); if (Object.keys(subMessage).length > 0) { - json[\\"subMessage\\"] = subMessage; + json.subMessage = subMessage; } } return json; @@ -6300,7 +6298,7 @@ export const TestLazyMessage = { * @private */ _readMessageJSON: function (msg, json) { - const subMessage = json[\\"subMessage\\"] ?? json.sub_message; + const subMessage = json.subMessage ?? json.sub_message; if (subMessage) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, subMessage); @@ -6378,14 +6376,14 @@ export const TestNestedMessageHasBits = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.optionalNestedMessage) { const optionalNestedMessage = TestNestedMessageHasBits.NestedMessage._writeMessageJSON( msg.optionalNestedMessage ); if (Object.keys(optionalNestedMessage).length > 0) { - json[\\"optionalNestedMessage\\"] = optionalNestedMessage; + json.optionalNestedMessage = optionalNestedMessage; } } return json; @@ -6419,7 +6417,7 @@ export const TestNestedMessageHasBits = { */ _readMessageJSON: function (msg, json) { const optionalNestedMessage = - json[\\"optionalNestedMessage\\"] ?? json.optional_nested_message; + json.optionalNestedMessage ?? json.optional_nested_message; if (optionalNestedMessage) { const m = TestNestedMessageHasBits.NestedMessage.initialize(); TestNestedMessageHasBits.NestedMessage._readMessageJSON( @@ -6502,12 +6500,12 @@ export const TestNestedMessageHasBits = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.nestedmessageRepeatedInt32?.length) { - json[\\"nestedmessageRepeatedInt32\\"] = msg.nestedmessageRepeatedInt32; + json.nestedmessageRepeatedInt32 = msg.nestedmessageRepeatedInt32; } if (msg.nestedmessageRepeatedForeignmessage?.length) { - json[\\"nestedmessageRepeatedForeignmessage\\"] = + json.nestedmessageRepeatedForeignmessage = msg.nestedmessageRepeatedForeignmessage.map( ForeignMessage._writeMessageJSON ); @@ -6546,12 +6544,12 @@ export const TestNestedMessageHasBits = { */ _readMessageJSON: function (msg, json) { const nestedmessageRepeatedInt32 = - json[\\"nestedmessageRepeatedInt32\\"] ?? json.nestedmessage_repeated_int32; + json.nestedmessageRepeatedInt32 ?? json.nestedmessage_repeated_int32; if (nestedmessageRepeatedInt32) { msg.nestedmessageRepeatedInt32 = nestedmessageRepeatedInt32; } const nestedmessageRepeatedForeignmessage = - json[\\"nestedmessageRepeatedForeignmessage\\"] ?? + json.nestedmessageRepeatedForeignmessage ?? json.nestedmessage_repeated_foreignmessage; if (nestedmessageRepeatedForeignmessage) { for (const item of nestedmessageRepeatedForeignmessage) { @@ -6676,47 +6674,47 @@ export const TestCamelCaseFieldNames = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.PrimitiveField) { - json[\\"PrimitiveField\\"] = msg.PrimitiveField; + json.PrimitiveField = msg.PrimitiveField; } if (msg.StringField) { - json[\\"StringField\\"] = msg.StringField; + json.StringField = msg.StringField; } if (msg.EnumField) { - json[\\"EnumField\\"] = msg.EnumField; + json.EnumField = msg.EnumField; } if (msg.MessageField) { const MessageField = ForeignMessage._writeMessageJSON(msg.MessageField); if (Object.keys(MessageField).length > 0) { - json[\\"MessageField\\"] = MessageField; + json.MessageField = MessageField; } } if (msg.StringPieceField) { - json[\\"StringPieceField\\"] = msg.StringPieceField; + json.StringPieceField = msg.StringPieceField; } if (msg.CordField) { - json[\\"CordField\\"] = msg.CordField; + json.CordField = msg.CordField; } if (msg.RepeatedPrimitiveField?.length) { - json[\\"RepeatedPrimitiveField\\"] = msg.RepeatedPrimitiveField; + json.RepeatedPrimitiveField = msg.RepeatedPrimitiveField; } if (msg.RepeatedStringField?.length) { - json[\\"RepeatedStringField\\"] = msg.RepeatedStringField; + json.RepeatedStringField = msg.RepeatedStringField; } if (msg.RepeatedEnumField?.length) { - json[\\"RepeatedEnumField\\"] = msg.RepeatedEnumField; + json.RepeatedEnumField = msg.RepeatedEnumField; } if (msg.RepeatedMessageField?.length) { - json[\\"RepeatedMessageField\\"] = msg.RepeatedMessageField.map( + json.RepeatedMessageField = msg.RepeatedMessageField.map( ForeignMessage._writeMessageJSON ); } if (msg.RepeatedStringPieceField?.length) { - json[\\"RepeatedStringPieceField\\"] = msg.RepeatedStringPieceField; + json.RepeatedStringPieceField = msg.RepeatedStringPieceField; } if (msg.RepeatedCordField?.length) { - json[\\"RepeatedCordField\\"] = msg.RepeatedCordField; + json.RepeatedCordField = msg.RepeatedCordField; } return json; }, @@ -6791,49 +6789,48 @@ export const TestCamelCaseFieldNames = { * @private */ _readMessageJSON: function (msg, json) { - const PrimitiveField = json[\\"PrimitiveField\\"] ?? json.PrimitiveField; + const PrimitiveField = json.PrimitiveField ?? json.PrimitiveField; if (PrimitiveField) { msg.PrimitiveField = PrimitiveField; } - const StringField = json[\\"StringField\\"] ?? json.StringField; + const StringField = json.StringField ?? json.StringField; if (StringField) { msg.StringField = StringField; } - const EnumField = json[\\"EnumField\\"] ?? json.EnumField; + const EnumField = json.EnumField ?? json.EnumField; if (EnumField) { msg.EnumField = EnumField; } - const MessageField = json[\\"MessageField\\"] ?? json.MessageField; + const MessageField = json.MessageField ?? json.MessageField; if (MessageField) { const m = ForeignMessage.initialize(); ForeignMessage._readMessageJSON(m, MessageField); msg.MessageField = m; } - const StringPieceField = json[\\"StringPieceField\\"] ?? json.StringPieceField; + const StringPieceField = json.StringPieceField ?? json.StringPieceField; if (StringPieceField) { msg.StringPieceField = StringPieceField; } - const CordField = json[\\"CordField\\"] ?? json.CordField; + const CordField = json.CordField ?? json.CordField; if (CordField) { msg.CordField = CordField; } const RepeatedPrimitiveField = - json[\\"RepeatedPrimitiveField\\"] ?? json.RepeatedPrimitiveField; + json.RepeatedPrimitiveField ?? json.RepeatedPrimitiveField; if (RepeatedPrimitiveField) { msg.RepeatedPrimitiveField = RepeatedPrimitiveField; } const RepeatedStringField = - json[\\"RepeatedStringField\\"] ?? json.RepeatedStringField; + json.RepeatedStringField ?? json.RepeatedStringField; if (RepeatedStringField) { msg.RepeatedStringField = RepeatedStringField; } - const RepeatedEnumField = - json[\\"RepeatedEnumField\\"] ?? json.RepeatedEnumField; + const RepeatedEnumField = json.RepeatedEnumField ?? json.RepeatedEnumField; if (RepeatedEnumField) { msg.RepeatedEnumField = RepeatedEnumField; } const RepeatedMessageField = - json[\\"RepeatedMessageField\\"] ?? json.RepeatedMessageField; + json.RepeatedMessageField ?? json.RepeatedMessageField; if (RepeatedMessageField) { for (const item of RepeatedMessageField) { const m = ForeignMessage.initialize(); @@ -6842,12 +6839,11 @@ export const TestCamelCaseFieldNames = { } } const RepeatedStringPieceField = - json[\\"RepeatedStringPieceField\\"] ?? json.RepeatedStringPieceField; + json.RepeatedStringPieceField ?? json.RepeatedStringPieceField; if (RepeatedStringPieceField) { msg.RepeatedStringPieceField = RepeatedStringPieceField; } - const RepeatedCordField = - json[\\"RepeatedCordField\\"] ?? json.RepeatedCordField; + const RepeatedCordField = json.RepeatedCordField ?? json.RepeatedCordField; if (RepeatedCordField) { msg.RepeatedCordField = RepeatedCordField; } @@ -6901,7 +6897,7 @@ export const TestFieldOrderings = { initialize: function () { return { myString: \\"\\", - myInt: \\"\\", + myInt: 0n, myFloat: 0, optionalNestedMessage: TestFieldOrderings.NestedMessage.initialize(), }; @@ -6915,7 +6911,7 @@ export const TestFieldOrderings = { writer.writeString(11, msg.myString); } if (msg.myInt) { - writer.writeInt64String(1, msg.myInt); + writer.writeInt64String(1, msg.myInt.toString()); } if (msg.myFloat) { writer.writeFloat(101, msg.myFloat); @@ -6934,15 +6930,15 @@ export const TestFieldOrderings = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.myString) { - json[\\"myString\\"] = msg.myString; + json.myString = msg.myString; } if (msg.myInt) { - json[\\"myInt\\"] = msg.myInt; + json.myInt = msg.myInt.toString(); } if (msg.myFloat) { - json[\\"myFloat\\"] = msg.myFloat; + json.myFloat = msg.myFloat; } if (msg.optionalNestedMessage) { const optionalNestedMessage = @@ -6950,7 +6946,7 @@ export const TestFieldOrderings = { msg.optionalNestedMessage ); if (Object.keys(optionalNestedMessage).length > 0) { - json[\\"optionalNestedMessage\\"] = optionalNestedMessage; + json.optionalNestedMessage = optionalNestedMessage; } } return json; @@ -6968,7 +6964,7 @@ export const TestFieldOrderings = { break; } case 1: { - msg.myInt = reader.readInt64String(); + msg.myInt = BigInt(reader.readInt64String()); break; } case 101: { @@ -6995,20 +6991,20 @@ export const TestFieldOrderings = { * @private */ _readMessageJSON: function (msg, json) { - const myString = json[\\"myString\\"] ?? json.my_string; + const myString = json.myString ?? json.my_string; if (myString) { msg.myString = myString; } - const myInt = json[\\"myInt\\"] ?? json.my_int; + const myInt = json.myInt ?? json.my_int; if (myInt) { - msg.myInt = myInt; + msg.myInt = BigInt(myInt); } - const myFloat = json[\\"myFloat\\"] ?? json.my_float; + const myFloat = json.myFloat ?? json.my_float; if (myFloat) { msg.myFloat = myFloat; } const optionalNestedMessage = - json[\\"optionalNestedMessage\\"] ?? json.optional_nested_message; + json.optionalNestedMessage ?? json.optional_nested_message; if (optionalNestedMessage) { const m = TestFieldOrderings.NestedMessage.initialize(); TestFieldOrderings.NestedMessage._readMessageJSON( @@ -7065,7 +7061,7 @@ export const TestFieldOrderings = { */ initialize: function () { return { - oo: \\"\\", + oo: 0n, bb: 0, }; }, @@ -7075,7 +7071,7 @@ export const TestFieldOrderings = { */ _writeMessage: function (msg, writer) { if (msg.oo) { - writer.writeInt64String(2, msg.oo); + writer.writeInt64String(2, msg.oo.toString()); } if (msg.bb) { writer.writeInt32(1, msg.bb); @@ -7087,12 +7083,12 @@ export const TestFieldOrderings = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.oo) { - json[\\"oo\\"] = msg.oo; + json.oo = msg.oo.toString(); } if (msg.bb) { - json[\\"bb\\"] = msg.bb; + json.bb = msg.bb; } return json; }, @@ -7105,7 +7101,7 @@ export const TestFieldOrderings = { const field = reader.getFieldNumber(); switch (field) { case 2: { - msg.oo = reader.readInt64String(); + msg.oo = BigInt(reader.readInt64String()); break; } case 1: { @@ -7125,11 +7121,11 @@ export const TestFieldOrderings = { * @private */ _readMessageJSON: function (msg, json) { - const oo = json[\\"oo\\"] ?? json.oo; + const oo = json.oo ?? json.oo; if (oo) { - msg.oo = oo; + msg.oo = BigInt(oo); } - const bb = json[\\"bb\\"] ?? json.bb; + const bb = json.bb ?? json.bb; if (bb) { msg.bb = bb; } @@ -7201,9 +7197,9 @@ export const TestExtensionOrderings1 = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.myString) { - json[\\"myString\\"] = msg.myString; + json.myString = msg.myString; } return json; }, @@ -7232,7 +7228,7 @@ export const TestExtensionOrderings1 = { * @private */ _readMessageJSON: function (msg, json) { - const myString = json[\\"myString\\"] ?? json.my_string; + const myString = json.myString ?? json.my_string; if (myString) { msg.myString = myString; } @@ -7303,9 +7299,9 @@ export const TestExtensionOrderings2 = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.myString) { - json[\\"myString\\"] = msg.myString; + json.myString = msg.myString; } return json; }, @@ -7334,7 +7330,7 @@ export const TestExtensionOrderings2 = { * @private */ _readMessageJSON: function (msg, json) { - const myString = json[\\"myString\\"] ?? json.my_string; + const myString = json.myString ?? json.my_string; if (myString) { msg.myString = myString; } @@ -7406,9 +7402,9 @@ export const TestExtensionOrderings2 = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.myString) { - json[\\"myString\\"] = msg.myString; + json.myString = msg.myString; } return json; }, @@ -7437,7 +7433,7 @@ export const TestExtensionOrderings2 = { * @private */ _readMessageJSON: function (msg, json) { - const myString = json[\\"myString\\"] ?? json.my_string; + const myString = json.myString ?? json.my_string; if (myString) { msg.myString = myString; } @@ -7493,11 +7489,11 @@ export const TestExtremeDefaultValues = { return { escapedBytes: new Uint8Array(), largeUint32: 0, - largeUint64: \\"\\", + largeUint64: 0n, smallInt32: 0, - smallInt64: \\"\\", + smallInt64: 0n, reallySmallInt32: 0, - reallySmallInt64: \\"\\", + reallySmallInt64: 0n, utf8String: \\"\\", zeroFloat: 0, oneFloat: 0, @@ -7532,19 +7528,19 @@ export const TestExtremeDefaultValues = { writer.writeUint32(2, msg.largeUint32); } if (msg.largeUint64) { - writer.writeUint64String(3, msg.largeUint64); + writer.writeUint64String(3, msg.largeUint64.toString()); } if (msg.smallInt32) { writer.writeInt32(4, msg.smallInt32); } if (msg.smallInt64) { - writer.writeInt64String(5, msg.smallInt64); + writer.writeInt64String(5, msg.smallInt64.toString()); } if (msg.reallySmallInt32) { writer.writeInt32(21, msg.reallySmallInt32); } if (msg.reallySmallInt64) { - writer.writeInt64String(22, msg.reallySmallInt64); + writer.writeInt64String(22, msg.reallySmallInt64.toString()); } if (msg.utf8String) { writer.writeString(6, msg.utf8String); @@ -7613,87 +7609,87 @@ export const TestExtremeDefaultValues = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.escapedBytes) { - json[\\"escapedBytes\\"] = msg.escapedBytes; + json.escapedBytes = msg.escapedBytes; } if (msg.largeUint32) { - json[\\"largeUint32\\"] = msg.largeUint32; + json.largeUint32 = msg.largeUint32; } if (msg.largeUint64) { - json[\\"largeUint64\\"] = msg.largeUint64; + json.largeUint64 = msg.largeUint64.toString(); } if (msg.smallInt32) { - json[\\"smallInt32\\"] = msg.smallInt32; + json.smallInt32 = msg.smallInt32; } if (msg.smallInt64) { - json[\\"smallInt64\\"] = msg.smallInt64; + json.smallInt64 = msg.smallInt64.toString(); } if (msg.reallySmallInt32) { - json[\\"reallySmallInt32\\"] = msg.reallySmallInt32; + json.reallySmallInt32 = msg.reallySmallInt32; } if (msg.reallySmallInt64) { - json[\\"reallySmallInt64\\"] = msg.reallySmallInt64; + json.reallySmallInt64 = msg.reallySmallInt64.toString(); } if (msg.utf8String) { - json[\\"utf8String\\"] = msg.utf8String; + json.utf8String = msg.utf8String; } if (msg.zeroFloat) { - json[\\"zeroFloat\\"] = msg.zeroFloat; + json.zeroFloat = msg.zeroFloat; } if (msg.oneFloat) { - json[\\"oneFloat\\"] = msg.oneFloat; + json.oneFloat = msg.oneFloat; } if (msg.smallFloat) { - json[\\"smallFloat\\"] = msg.smallFloat; + json.smallFloat = msg.smallFloat; } if (msg.negativeOneFloat) { - json[\\"negativeOneFloat\\"] = msg.negativeOneFloat; + json.negativeOneFloat = msg.negativeOneFloat; } if (msg.negativeFloat) { - json[\\"negativeFloat\\"] = msg.negativeFloat; + json.negativeFloat = msg.negativeFloat; } if (msg.largeFloat) { - json[\\"largeFloat\\"] = msg.largeFloat; + json.largeFloat = msg.largeFloat; } if (msg.smallNegativeFloat) { - json[\\"smallNegativeFloat\\"] = msg.smallNegativeFloat; + json.smallNegativeFloat = msg.smallNegativeFloat; } if (msg.infDouble) { - json[\\"infDouble\\"] = msg.infDouble; + json.infDouble = msg.infDouble; } if (msg.negInfDouble) { - json[\\"negInfDouble\\"] = msg.negInfDouble; + json.negInfDouble = msg.negInfDouble; } if (msg.nanDouble) { - json[\\"nanDouble\\"] = msg.nanDouble; + json.nanDouble = msg.nanDouble; } if (msg.infFloat) { - json[\\"infFloat\\"] = msg.infFloat; + json.infFloat = msg.infFloat; } if (msg.negInfFloat) { - json[\\"negInfFloat\\"] = msg.negInfFloat; + json.negInfFloat = msg.negInfFloat; } if (msg.nanFloat) { - json[\\"nanFloat\\"] = msg.nanFloat; + json.nanFloat = msg.nanFloat; } if (msg.cppTrigraph) { - json[\\"cppTrigraph\\"] = msg.cppTrigraph; + json.cppTrigraph = msg.cppTrigraph; } if (msg.stringWithZero) { - json[\\"stringWithZero\\"] = msg.stringWithZero; + json.stringWithZero = msg.stringWithZero; } if (msg.bytesWithZero) { - json[\\"bytesWithZero\\"] = msg.bytesWithZero; + json.bytesWithZero = msg.bytesWithZero; } if (msg.stringPieceWithZero) { - json[\\"stringPieceWithZero\\"] = msg.stringPieceWithZero; + json.stringPieceWithZero = msg.stringPieceWithZero; } if (msg.cordWithZero) { - json[\\"cordWithZero\\"] = msg.cordWithZero; + json.cordWithZero = msg.cordWithZero; } if (msg.replacementString) { - json[\\"replacementString\\"] = msg.replacementString; + json.replacementString = msg.replacementString; } return json; }, @@ -7714,7 +7710,7 @@ export const TestExtremeDefaultValues = { break; } case 3: { - msg.largeUint64 = reader.readUint64String(); + msg.largeUint64 = BigInt(reader.readUint64String()); break; } case 4: { @@ -7722,7 +7718,7 @@ export const TestExtremeDefaultValues = { break; } case 5: { - msg.smallInt64 = reader.readInt64String(); + msg.smallInt64 = BigInt(reader.readInt64String()); break; } case 21: { @@ -7730,7 +7726,7 @@ export const TestExtremeDefaultValues = { break; } case 22: { - msg.reallySmallInt64 = reader.readInt64String(); + msg.reallySmallInt64 = BigInt(reader.readInt64String()); break; } case 6: { @@ -7826,117 +7822,113 @@ export const TestExtremeDefaultValues = { * @private */ _readMessageJSON: function (msg, json) { - const escapedBytes = json[\\"escapedBytes\\"] ?? json.escaped_bytes; + const escapedBytes = json.escapedBytes ?? json.escaped_bytes; if (escapedBytes) { msg.escapedBytes = escapedBytes; } - const largeUint32 = json[\\"largeUint32\\"] ?? json.large_uint32; + const largeUint32 = json.largeUint32 ?? json.large_uint32; if (largeUint32) { msg.largeUint32 = largeUint32; } - const largeUint64 = json[\\"largeUint64\\"] ?? json.large_uint64; + const largeUint64 = json.largeUint64 ?? json.large_uint64; if (largeUint64) { - msg.largeUint64 = largeUint64; + msg.largeUint64 = BigInt(largeUint64); } - const smallInt32 = json[\\"smallInt32\\"] ?? json.small_int32; + const smallInt32 = json.smallInt32 ?? json.small_int32; if (smallInt32) { msg.smallInt32 = smallInt32; } - const smallInt64 = json[\\"smallInt64\\"] ?? json.small_int64; + const smallInt64 = json.smallInt64 ?? json.small_int64; if (smallInt64) { - msg.smallInt64 = smallInt64; + msg.smallInt64 = BigInt(smallInt64); } - const reallySmallInt32 = - json[\\"reallySmallInt32\\"] ?? json.really_small_int32; + const reallySmallInt32 = json.reallySmallInt32 ?? json.really_small_int32; if (reallySmallInt32) { msg.reallySmallInt32 = reallySmallInt32; } - const reallySmallInt64 = - json[\\"reallySmallInt64\\"] ?? json.really_small_int64; + const reallySmallInt64 = json.reallySmallInt64 ?? json.really_small_int64; if (reallySmallInt64) { - msg.reallySmallInt64 = reallySmallInt64; + msg.reallySmallInt64 = BigInt(reallySmallInt64); } - const utf8String = json[\\"utf8String\\"] ?? json.utf8_string; + const utf8String = json.utf8String ?? json.utf8_string; if (utf8String) { msg.utf8String = utf8String; } - const zeroFloat = json[\\"zeroFloat\\"] ?? json.zero_float; + const zeroFloat = json.zeroFloat ?? json.zero_float; if (zeroFloat) { msg.zeroFloat = zeroFloat; } - const oneFloat = json[\\"oneFloat\\"] ?? json.one_float; + const oneFloat = json.oneFloat ?? json.one_float; if (oneFloat) { msg.oneFloat = oneFloat; } - const smallFloat = json[\\"smallFloat\\"] ?? json.small_float; + const smallFloat = json.smallFloat ?? json.small_float; if (smallFloat) { msg.smallFloat = smallFloat; } - const negativeOneFloat = - json[\\"negativeOneFloat\\"] ?? json.negative_one_float; + const negativeOneFloat = json.negativeOneFloat ?? json.negative_one_float; if (negativeOneFloat) { msg.negativeOneFloat = negativeOneFloat; } - const negativeFloat = json[\\"negativeFloat\\"] ?? json.negative_float; + const negativeFloat = json.negativeFloat ?? json.negative_float; if (negativeFloat) { msg.negativeFloat = negativeFloat; } - const largeFloat = json[\\"largeFloat\\"] ?? json.large_float; + const largeFloat = json.largeFloat ?? json.large_float; if (largeFloat) { msg.largeFloat = largeFloat; } const smallNegativeFloat = - json[\\"smallNegativeFloat\\"] ?? json.small_negative_float; + json.smallNegativeFloat ?? json.small_negative_float; if (smallNegativeFloat) { msg.smallNegativeFloat = smallNegativeFloat; } - const infDouble = json[\\"infDouble\\"] ?? json.inf_double; + const infDouble = json.infDouble ?? json.inf_double; if (infDouble) { msg.infDouble = infDouble; } - const negInfDouble = json[\\"negInfDouble\\"] ?? json.neg_inf_double; + const negInfDouble = json.negInfDouble ?? json.neg_inf_double; if (negInfDouble) { msg.negInfDouble = negInfDouble; } - const nanDouble = json[\\"nanDouble\\"] ?? json.nan_double; + const nanDouble = json.nanDouble ?? json.nan_double; if (nanDouble) { msg.nanDouble = nanDouble; } - const infFloat = json[\\"infFloat\\"] ?? json.inf_float; + const infFloat = json.infFloat ?? json.inf_float; if (infFloat) { msg.infFloat = infFloat; } - const negInfFloat = json[\\"negInfFloat\\"] ?? json.neg_inf_float; + const negInfFloat = json.negInfFloat ?? json.neg_inf_float; if (negInfFloat) { msg.negInfFloat = negInfFloat; } - const nanFloat = json[\\"nanFloat\\"] ?? json.nan_float; + const nanFloat = json.nanFloat ?? json.nan_float; if (nanFloat) { msg.nanFloat = nanFloat; } - const cppTrigraph = json[\\"cppTrigraph\\"] ?? json.cpp_trigraph; + const cppTrigraph = json.cppTrigraph ?? json.cpp_trigraph; if (cppTrigraph) { msg.cppTrigraph = cppTrigraph; } - const stringWithZero = json[\\"stringWithZero\\"] ?? json.string_with_zero; + const stringWithZero = json.stringWithZero ?? json.string_with_zero; if (stringWithZero) { msg.stringWithZero = stringWithZero; } - const bytesWithZero = json[\\"bytesWithZero\\"] ?? json.bytes_with_zero; + const bytesWithZero = json.bytesWithZero ?? json.bytes_with_zero; if (bytesWithZero) { msg.bytesWithZero = bytesWithZero; } const stringPieceWithZero = - json[\\"stringPieceWithZero\\"] ?? json.string_piece_with_zero; + json.stringPieceWithZero ?? json.string_piece_with_zero; if (stringPieceWithZero) { msg.stringPieceWithZero = stringPieceWithZero; } - const cordWithZero = json[\\"cordWithZero\\"] ?? json.cord_with_zero; + const cordWithZero = json.cordWithZero ?? json.cord_with_zero; if (cordWithZero) { msg.cordWithZero = cordWithZero; } - const replacementString = - json[\\"replacementString\\"] ?? json.replacement_string; + const replacementString = json.replacementString ?? json.replacement_string; if (replacementString) { msg.replacementString = replacementString; } @@ -8007,9 +7999,9 @@ export const SparseEnumMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.sparseEnum) { - json[\\"sparseEnum\\"] = msg.sparseEnum; + json.sparseEnum = msg.sparseEnum; } return json; }, @@ -8038,7 +8030,7 @@ export const SparseEnumMessage = { * @private */ _readMessageJSON: function (msg, json) { - const sparseEnum = json[\\"sparseEnum\\"] ?? json.sparse_enum; + const sparseEnum = json.sparseEnum ?? json.sparse_enum; if (sparseEnum) { msg.sparseEnum = sparseEnum; } @@ -8104,9 +8096,9 @@ export const OneString = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -8135,7 +8127,7 @@ export const OneString = { * @private */ _readMessageJSON: function (msg, json) { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -8204,9 +8196,9 @@ export const MoreString = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.data?.length) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -8235,7 +8227,7 @@ export const MoreString = { * @private */ _readMessageJSON: function (msg, json) { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -8301,9 +8293,9 @@ export const OneBytes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -8332,7 +8324,7 @@ export const OneBytes = { * @private */ _readMessageJSON: function (msg, json) { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -8398,9 +8390,9 @@ export const MoreBytes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.data?.length) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -8429,7 +8421,7 @@ export const MoreBytes = { * @private */ _readMessageJSON: function (msg, json) { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -8498,9 +8490,9 @@ export const Int32Message = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -8529,7 +8521,7 @@ export const Int32Message = { * @private */ _readMessageJSON: function (msg, json) { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -8598,9 +8590,9 @@ export const Uint32Message = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -8629,7 +8621,7 @@ export const Uint32Message = { * @private */ _readMessageJSON: function (msg, json) { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -8680,7 +8672,7 @@ export const Int64Message = { */ initialize: function () { return { - data: \\"\\", + data: 0n, }; }, @@ -8689,7 +8681,7 @@ export const Int64Message = { */ _writeMessage: function (msg, writer) { if (msg.data) { - writer.writeInt64String(1, msg.data); + writer.writeInt64String(1, msg.data.toString()); } return writer; }, @@ -8698,9 +8690,9 @@ export const Int64Message = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data.toString(); } return json; }, @@ -8713,7 +8705,7 @@ export const Int64Message = { const field = reader.getFieldNumber(); switch (field) { case 1: { - msg.data = reader.readInt64String(); + msg.data = BigInt(reader.readInt64String()); break; } default: { @@ -8729,9 +8721,9 @@ export const Int64Message = { * @private */ _readMessageJSON: function (msg, json) { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { - msg.data = data; + msg.data = BigInt(data); } return msg; }, @@ -8780,7 +8772,7 @@ export const Uint64Message = { */ initialize: function () { return { - data: \\"\\", + data: 0n, }; }, @@ -8789,7 +8781,7 @@ export const Uint64Message = { */ _writeMessage: function (msg, writer) { if (msg.data) { - writer.writeUint64String(1, msg.data); + writer.writeUint64String(1, msg.data.toString()); } return writer; }, @@ -8798,9 +8790,9 @@ export const Uint64Message = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data.toString(); } return json; }, @@ -8813,7 +8805,7 @@ export const Uint64Message = { const field = reader.getFieldNumber(); switch (field) { case 1: { - msg.data = reader.readUint64String(); + msg.data = BigInt(reader.readUint64String()); break; } default: { @@ -8829,9 +8821,9 @@ export const Uint64Message = { * @private */ _readMessageJSON: function (msg, json) { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { - msg.data = data; + msg.data = BigInt(data); } return msg; }, @@ -8898,9 +8890,9 @@ export const BoolMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -8929,7 +8921,7 @@ export const BoolMessage = { * @private */ _readMessageJSON: function (msg, json) { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -9001,17 +8993,17 @@ export const TestOneof = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.fooInt != undefined) { - json[\\"fooInt\\"] = msg.fooInt; + json.fooInt = msg.fooInt; } if (msg.fooString != undefined) { - json[\\"fooString\\"] = msg.fooString; + json.fooString = msg.fooString; } if (msg.fooMessage != undefined) { const fooMessage = TestAllTypes._writeMessageJSON(msg.fooMessage); if (Object.keys(fooMessage).length > 0) { - json[\\"fooMessage\\"] = fooMessage; + json.fooMessage = fooMessage; } } return json; @@ -9049,15 +9041,15 @@ export const TestOneof = { * @private */ _readMessageJSON: function (msg, json) { - const fooInt = json[\\"fooInt\\"] ?? json.foo_int; + const fooInt = json.fooInt ?? json.foo_int; if (fooInt) { msg.fooInt = fooInt; } - const fooString = json[\\"fooString\\"] ?? json.foo_string; + const fooString = json.fooString ?? json.foo_string; if (fooString) { msg.fooString = fooString; } - const fooMessage = json[\\"fooMessage\\"] ?? json.foo_message; + const fooMessage = json.fooMessage ?? json.foo_message; if (fooMessage) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, fooMessage); @@ -9131,12 +9123,12 @@ export const TestOneof = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } if (msg.b) { - json[\\"b\\"] = msg.b; + json.b = msg.b; } return json; }, @@ -9169,11 +9161,11 @@ export const TestOneof = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } - const b = json[\\"b\\"] ?? json.b; + const b = json.b ?? json.b; if (b) { msg.b = b; } @@ -9255,17 +9247,17 @@ export const TestOneofBackwardsCompatible = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.fooInt) { - json[\\"fooInt\\"] = msg.fooInt; + json.fooInt = msg.fooInt; } if (msg.fooString) { - json[\\"fooString\\"] = msg.fooString; + json.fooString = msg.fooString; } if (msg.fooMessage) { const fooMessage = TestAllTypes._writeMessageJSON(msg.fooMessage); if (Object.keys(fooMessage).length > 0) { - json[\\"fooMessage\\"] = fooMessage; + json.fooMessage = fooMessage; } } return json; @@ -9303,15 +9295,15 @@ export const TestOneofBackwardsCompatible = { * @private */ _readMessageJSON: function (msg, json) { - const fooInt = json[\\"fooInt\\"] ?? json.foo_int; + const fooInt = json.fooInt ?? json.foo_int; if (fooInt) { msg.fooInt = fooInt; } - const fooString = json[\\"fooString\\"] ?? json.foo_string; + const fooString = json.fooString ?? json.foo_string; if (fooString) { msg.fooString = fooString; } - const fooMessage = json[\\"fooMessage\\"] ?? json.foo_message; + const fooMessage = json.fooMessage ?? json.foo_message; if (fooMessage) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, fooMessage); @@ -9387,12 +9379,12 @@ export const TestOneofBackwardsCompatible = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } if (msg.b) { - json[\\"b\\"] = msg.b; + json.b = msg.b; } return json; }, @@ -9425,11 +9417,11 @@ export const TestOneofBackwardsCompatible = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } - const b = json[\\"b\\"] ?? json.b; + const b = json.b ?? json.b; if (b) { msg.b = b; } @@ -9567,31 +9559,31 @@ export const TestOneof2 = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.fooInt != undefined) { - json[\\"fooInt\\"] = msg.fooInt; + json.fooInt = msg.fooInt; } if (msg.fooString != undefined) { - json[\\"fooString\\"] = msg.fooString; + json.fooString = msg.fooString; } if (msg.fooCord != undefined) { - json[\\"fooCord\\"] = msg.fooCord; + json.fooCord = msg.fooCord; } if (msg.fooStringPiece != undefined) { - json[\\"fooStringPiece\\"] = msg.fooStringPiece; + json.fooStringPiece = msg.fooStringPiece; } if (msg.fooBytes != undefined) { - json[\\"fooBytes\\"] = msg.fooBytes; + json.fooBytes = msg.fooBytes; } if (msg.fooEnum != undefined) { - json[\\"fooEnum\\"] = msg.fooEnum; + json.fooEnum = msg.fooEnum; } if (msg.fooMessage != undefined) { const fooMessage = TestOneof2.NestedMessage._writeMessageJSON( msg.fooMessage ); if (Object.keys(fooMessage).length > 0) { - json[\\"fooMessage\\"] = fooMessage; + json.fooMessage = fooMessage; } } if (msg.fooLazyMessage != undefined) { @@ -9599,45 +9591,44 @@ export const TestOneof2 = { msg.fooLazyMessage ); if (Object.keys(fooLazyMessage).length > 0) { - json[\\"fooLazyMessage\\"] = fooLazyMessage; + json.fooLazyMessage = fooLazyMessage; } } if (msg.barInt != undefined) { - json[\\"barInt\\"] = msg.barInt; + json.barInt = msg.barInt; } if (msg.barString != undefined) { - json[\\"barString\\"] = msg.barString; + json.barString = msg.barString; } if (msg.barCord != undefined) { - json[\\"barCord\\"] = msg.barCord; + json.barCord = msg.barCord; } if (msg.barStringPiece != undefined) { - json[\\"barStringPiece\\"] = msg.barStringPiece; + json.barStringPiece = msg.barStringPiece; } if (msg.barBytes != undefined) { - json[\\"barBytes\\"] = msg.barBytes; + json.barBytes = msg.barBytes; } if (msg.barEnum != undefined) { - json[\\"barEnum\\"] = msg.barEnum; + json.barEnum = msg.barEnum; } if (msg.barStringWithEmptyDefault != undefined) { - json[\\"barStringWithEmptyDefault\\"] = msg.barStringWithEmptyDefault; + json.barStringWithEmptyDefault = msg.barStringWithEmptyDefault; } if (msg.barCordWithEmptyDefault != undefined) { - json[\\"barCordWithEmptyDefault\\"] = msg.barCordWithEmptyDefault; + json.barCordWithEmptyDefault = msg.barCordWithEmptyDefault; } if (msg.barStringPieceWithEmptyDefault != undefined) { - json[\\"barStringPieceWithEmptyDefault\\"] = - msg.barStringPieceWithEmptyDefault; + json.barStringPieceWithEmptyDefault = msg.barStringPieceWithEmptyDefault; } if (msg.barBytesWithEmptyDefault != undefined) { - json[\\"barBytesWithEmptyDefault\\"] = msg.barBytesWithEmptyDefault; + json.barBytesWithEmptyDefault = msg.barBytesWithEmptyDefault; } if (msg.bazInt) { - json[\\"bazInt\\"] = msg.bazInt; + json.bazInt = msg.bazInt; } if (msg.bazString) { - json[\\"bazString\\"] = msg.bazString; + json.bazString = msg.bazString; } return json; }, @@ -9748,92 +9739,92 @@ export const TestOneof2 = { * @private */ _readMessageJSON: function (msg, json) { - const fooInt = json[\\"fooInt\\"] ?? json.foo_int; + const fooInt = json.fooInt ?? json.foo_int; if (fooInt) { msg.fooInt = fooInt; } - const fooString = json[\\"fooString\\"] ?? json.foo_string; + const fooString = json.fooString ?? json.foo_string; if (fooString) { msg.fooString = fooString; } - const fooCord = json[\\"fooCord\\"] ?? json.foo_cord; + const fooCord = json.fooCord ?? json.foo_cord; if (fooCord) { msg.fooCord = fooCord; } - const fooStringPiece = json[\\"fooStringPiece\\"] ?? json.foo_string_piece; + const fooStringPiece = json.fooStringPiece ?? json.foo_string_piece; if (fooStringPiece) { msg.fooStringPiece = fooStringPiece; } - const fooBytes = json[\\"fooBytes\\"] ?? json.foo_bytes; + const fooBytes = json.fooBytes ?? json.foo_bytes; if (fooBytes) { msg.fooBytes = fooBytes; } - const fooEnum = json[\\"fooEnum\\"] ?? json.foo_enum; + const fooEnum = json.fooEnum ?? json.foo_enum; if (fooEnum) { msg.fooEnum = fooEnum; } - const fooMessage = json[\\"fooMessage\\"] ?? json.foo_message; + const fooMessage = json.fooMessage ?? json.foo_message; if (fooMessage) { const m = TestOneof2.NestedMessage.initialize(); TestOneof2.NestedMessage._readMessageJSON(m, fooMessage); msg.fooMessage = m; } - const fooLazyMessage = json[\\"fooLazyMessage\\"] ?? json.foo_lazy_message; + const fooLazyMessage = json.fooLazyMessage ?? json.foo_lazy_message; if (fooLazyMessage) { const m = TestOneof2.NestedMessage.initialize(); TestOneof2.NestedMessage._readMessageJSON(m, fooLazyMessage); msg.fooLazyMessage = m; } - const barInt = json[\\"barInt\\"] ?? json.bar_int; + const barInt = json.barInt ?? json.bar_int; if (barInt) { msg.barInt = barInt; } - const barString = json[\\"barString\\"] ?? json.bar_string; + const barString = json.barString ?? json.bar_string; if (barString) { msg.barString = barString; } - const barCord = json[\\"barCord\\"] ?? json.bar_cord; + const barCord = json.barCord ?? json.bar_cord; if (barCord) { msg.barCord = barCord; } - const barStringPiece = json[\\"barStringPiece\\"] ?? json.bar_string_piece; + const barStringPiece = json.barStringPiece ?? json.bar_string_piece; if (barStringPiece) { msg.barStringPiece = barStringPiece; } - const barBytes = json[\\"barBytes\\"] ?? json.bar_bytes; + const barBytes = json.barBytes ?? json.bar_bytes; if (barBytes) { msg.barBytes = barBytes; } - const barEnum = json[\\"barEnum\\"] ?? json.bar_enum; + const barEnum = json.barEnum ?? json.bar_enum; if (barEnum) { msg.barEnum = barEnum; } const barStringWithEmptyDefault = - json[\\"barStringWithEmptyDefault\\"] ?? json.bar_string_with_empty_default; + json.barStringWithEmptyDefault ?? json.bar_string_with_empty_default; if (barStringWithEmptyDefault) { msg.barStringWithEmptyDefault = barStringWithEmptyDefault; } const barCordWithEmptyDefault = - json[\\"barCordWithEmptyDefault\\"] ?? json.bar_cord_with_empty_default; + json.barCordWithEmptyDefault ?? json.bar_cord_with_empty_default; if (barCordWithEmptyDefault) { msg.barCordWithEmptyDefault = barCordWithEmptyDefault; } const barStringPieceWithEmptyDefault = - json[\\"barStringPieceWithEmptyDefault\\"] ?? + json.barStringPieceWithEmptyDefault ?? json.bar_string_piece_with_empty_default; if (barStringPieceWithEmptyDefault) { msg.barStringPieceWithEmptyDefault = barStringPieceWithEmptyDefault; } const barBytesWithEmptyDefault = - json[\\"barBytesWithEmptyDefault\\"] ?? json.bar_bytes_with_empty_default; + json.barBytesWithEmptyDefault ?? json.bar_bytes_with_empty_default; if (barBytesWithEmptyDefault) { msg.barBytesWithEmptyDefault = barBytesWithEmptyDefault; } - const bazInt = json[\\"bazInt\\"] ?? json.baz_int; + const bazInt = json.bazInt ?? json.baz_int; if (bazInt) { msg.bazInt = bazInt; } - const bazString = json[\\"bazString\\"] ?? json.baz_string; + const bazString = json.bazString ?? json.baz_string; if (bazString) { msg.bazString = bazString; } @@ -9907,12 +9898,12 @@ export const TestOneof2 = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } if (msg.b) { - json[\\"b\\"] = msg.b; + json.b = msg.b; } return json; }, @@ -9945,11 +9936,11 @@ export const TestOneof2 = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } - const b = json[\\"b\\"] ?? json.b; + const b = json.b ?? json.b; if (b) { msg.b = b; } @@ -10002,7 +9993,7 @@ export const TestOneof2 = { */ initialize: function () { return { - quxInt: \\"\\", + quxInt: 0n, corgeInt: [], }; }, @@ -10012,7 +10003,7 @@ export const TestOneof2 = { */ _writeMessage: function (msg, writer) { if (msg.quxInt) { - writer.writeInt64String(1, msg.quxInt); + writer.writeInt64String(1, msg.quxInt.toString()); } if (msg.corgeInt?.length) { writer.writeRepeatedInt32(2, msg.corgeInt); @@ -10024,12 +10015,12 @@ export const TestOneof2 = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.quxInt) { - json[\\"quxInt\\"] = msg.quxInt; + json.quxInt = msg.quxInt.toString(); } if (msg.corgeInt?.length) { - json[\\"corgeInt\\"] = msg.corgeInt; + json.corgeInt = msg.corgeInt; } return json; }, @@ -10042,7 +10033,7 @@ export const TestOneof2 = { const field = reader.getFieldNumber(); switch (field) { case 1: { - msg.quxInt = reader.readInt64String(); + msg.quxInt = BigInt(reader.readInt64String()); break; } case 2: { @@ -10062,11 +10053,11 @@ export const TestOneof2 = { * @private */ _readMessageJSON: function (msg, json) { - const quxInt = json[\\"quxInt\\"] ?? json.qux_int; + const quxInt = json.quxInt ?? json.qux_int; if (quxInt) { - msg.quxInt = quxInt; + msg.quxInt = BigInt(quxInt); } - const corgeInt = json[\\"corgeInt\\"] ?? json.corge_int; + const corgeInt = json.corgeInt ?? json.corge_int; if (corgeInt) { msg.corgeInt = corgeInt; } @@ -10148,19 +10139,19 @@ export const TestRequiredOneof = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.fooInt != undefined) { - json[\\"fooInt\\"] = msg.fooInt; + json.fooInt = msg.fooInt; } if (msg.fooString != undefined) { - json[\\"fooString\\"] = msg.fooString; + json.fooString = msg.fooString; } if (msg.fooMessage != undefined) { const fooMessage = TestRequiredOneof.NestedMessage._writeMessageJSON( msg.fooMessage ); if (Object.keys(fooMessage).length > 0) { - json[\\"fooMessage\\"] = fooMessage; + json.fooMessage = fooMessage; } } return json; @@ -10201,15 +10192,15 @@ export const TestRequiredOneof = { * @private */ _readMessageJSON: function (msg, json) { - const fooInt = json[\\"fooInt\\"] ?? json.foo_int; + const fooInt = json.fooInt ?? json.foo_int; if (fooInt) { msg.fooInt = fooInt; } - const fooString = json[\\"fooString\\"] ?? json.foo_string; + const fooString = json.fooString ?? json.foo_string; if (fooString) { msg.fooString = fooString; } - const fooMessage = json[\\"fooMessage\\"] ?? json.foo_message; + const fooMessage = json.fooMessage ?? json.foo_message; if (fooMessage) { const m = TestRequiredOneof.NestedMessage.initialize(); TestRequiredOneof.NestedMessage._readMessageJSON(m, fooMessage); @@ -10281,9 +10272,9 @@ export const TestRequiredOneof = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.requiredDouble) { - json[\\"requiredDouble\\"] = msg.requiredDouble; + json.requiredDouble = msg.requiredDouble; } return json; }, @@ -10312,7 +10303,7 @@ export const TestRequiredOneof = { * @private */ _readMessageJSON: function (msg, json) { - const requiredDouble = json[\\"requiredDouble\\"] ?? json.required_double; + const requiredDouble = json.requiredDouble ?? json.required_double; if (requiredDouble) { msg.requiredDouble = requiredDouble; } @@ -10389,31 +10380,31 @@ export const TestPackedTypes = { writer.writeRepeatedInt32(90, msg.packedInt32); } if (msg.packedInt64?.length) { - writer.writeRepeatedInt64String(91, msg.packedInt64); + writer.writeRepeatedInt64String(91, msg.packedInt64.toString()); } if (msg.packedUint32?.length) { writer.writeRepeatedUint32(92, msg.packedUint32); } if (msg.packedUint64?.length) { - writer.writeRepeatedUint64String(93, msg.packedUint64); + writer.writeRepeatedUint64String(93, msg.packedUint64.toString()); } if (msg.packedSint32?.length) { writer.writeRepeatedSint32(94, msg.packedSint32); } if (msg.packedSint64?.length) { - writer.writeRepeatedSint64String(95, msg.packedSint64); + writer.writeRepeatedSint64String(95, msg.packedSint64.toString()); } if (msg.packedFixed32?.length) { writer.writeRepeatedFixed32(96, msg.packedFixed32); } if (msg.packedFixed64?.length) { - writer.writeRepeatedFixed64String(97, msg.packedFixed64); + writer.writeRepeatedFixed64String(97, msg.packedFixed64.toString()); } if (msg.packedSfixed32?.length) { writer.writeRepeatedSfixed32(98, msg.packedSfixed32); } if (msg.packedSfixed64?.length) { - writer.writeRepeatedSfixed64(99, msg.packedSfixed64); + writer.writeRepeatedSfixed64(99, msg.packedSfixed64.toString()); } if (msg.packedFloat?.length) { writer.writeRepeatedFloat(100, msg.packedFloat); @@ -10434,48 +10425,48 @@ export const TestPackedTypes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.packedInt32?.length) { - json[\\"packedInt32\\"] = msg.packedInt32; + json.packedInt32 = msg.packedInt32; } if (msg.packedInt64?.length) { - json[\\"packedInt64\\"] = msg.packedInt64; + json.packedInt64 = msg.packedInt64.map((x) => x.toString()); } if (msg.packedUint32?.length) { - json[\\"packedUint32\\"] = msg.packedUint32; + json.packedUint32 = msg.packedUint32; } if (msg.packedUint64?.length) { - json[\\"packedUint64\\"] = msg.packedUint64; + json.packedUint64 = msg.packedUint64.map((x) => x.toString()); } if (msg.packedSint32?.length) { - json[\\"packedSint32\\"] = msg.packedSint32; + json.packedSint32 = msg.packedSint32; } if (msg.packedSint64?.length) { - json[\\"packedSint64\\"] = msg.packedSint64; + json.packedSint64 = msg.packedSint64.map((x) => x.toString()); } if (msg.packedFixed32?.length) { - json[\\"packedFixed32\\"] = msg.packedFixed32; + json.packedFixed32 = msg.packedFixed32; } if (msg.packedFixed64?.length) { - json[\\"packedFixed64\\"] = msg.packedFixed64; + json.packedFixed64 = msg.packedFixed64.map((x) => x.toString()); } if (msg.packedSfixed32?.length) { - json[\\"packedSfixed32\\"] = msg.packedSfixed32; + json.packedSfixed32 = msg.packedSfixed32; } if (msg.packedSfixed64?.length) { - json[\\"packedSfixed64\\"] = msg.packedSfixed64; + json.packedSfixed64 = msg.packedSfixed64.map((x) => x.toString()); } if (msg.packedFloat?.length) { - json[\\"packedFloat\\"] = msg.packedFloat; + json.packedFloat = msg.packedFloat; } if (msg.packedDouble?.length) { - json[\\"packedDouble\\"] = msg.packedDouble; + json.packedDouble = msg.packedDouble; } if (msg.packedBool?.length) { - json[\\"packedBool\\"] = msg.packedBool; + json.packedBool = msg.packedBool; } if (msg.packedEnum?.length) { - json[\\"packedEnum\\"] = msg.packedEnum; + json.packedEnum = msg.packedEnum; } return json; }, @@ -10492,7 +10483,7 @@ export const TestPackedTypes = { break; } case 91: { - msg.packedInt64.push(reader.readInt64String()); + msg.packedInt64 = reader.readInt64String().map(BigInt); break; } case 92: { @@ -10500,7 +10491,7 @@ export const TestPackedTypes = { break; } case 93: { - msg.packedUint64.push(reader.readUint64String()); + msg.packedUint64 = reader.readUint64String().map(BigInt); break; } case 94: { @@ -10508,7 +10499,7 @@ export const TestPackedTypes = { break; } case 95: { - msg.packedSint64.push(reader.readSint64()); + msg.packedSint64 = reader.readSint64().map(BigInt); break; } case 96: { @@ -10516,7 +10507,7 @@ export const TestPackedTypes = { break; } case 97: { - msg.packedFixed64.push(reader.readFixed64String()); + msg.packedFixed64 = reader.readFixed64String().map(BigInt); break; } case 98: { @@ -10524,7 +10515,7 @@ export const TestPackedTypes = { break; } case 99: { - msg.packedSfixed64.push(reader.readSfixed64()); + msg.packedSfixed64 = reader.readSfixed64().map(BigInt); break; } case 100: { @@ -10556,59 +10547,59 @@ export const TestPackedTypes = { * @private */ _readMessageJSON: function (msg, json) { - const packedInt32 = json[\\"packedInt32\\"] ?? json.packed_int32; + const packedInt32 = json.packedInt32 ?? json.packed_int32; if (packedInt32) { msg.packedInt32 = packedInt32; } - const packedInt64 = json[\\"packedInt64\\"] ?? json.packed_int64; + const packedInt64 = json.packedInt64 ?? json.packed_int64; if (packedInt64) { - msg.packedInt64 = packedInt64; + msg.packedInt64 = packedInt64.map(BigInt); } - const packedUint32 = json[\\"packedUint32\\"] ?? json.packed_uint32; + const packedUint32 = json.packedUint32 ?? json.packed_uint32; if (packedUint32) { msg.packedUint32 = packedUint32; } - const packedUint64 = json[\\"packedUint64\\"] ?? json.packed_uint64; + const packedUint64 = json.packedUint64 ?? json.packed_uint64; if (packedUint64) { - msg.packedUint64 = packedUint64; + msg.packedUint64 = packedUint64.map(BigInt); } - const packedSint32 = json[\\"packedSint32\\"] ?? json.packed_sint32; + const packedSint32 = json.packedSint32 ?? json.packed_sint32; if (packedSint32) { msg.packedSint32 = packedSint32; } - const packedSint64 = json[\\"packedSint64\\"] ?? json.packed_sint64; + const packedSint64 = json.packedSint64 ?? json.packed_sint64; if (packedSint64) { - msg.packedSint64 = packedSint64; + msg.packedSint64 = packedSint64.map(BigInt); } - const packedFixed32 = json[\\"packedFixed32\\"] ?? json.packed_fixed32; + const packedFixed32 = json.packedFixed32 ?? json.packed_fixed32; if (packedFixed32) { msg.packedFixed32 = packedFixed32; } - const packedFixed64 = json[\\"packedFixed64\\"] ?? json.packed_fixed64; + const packedFixed64 = json.packedFixed64 ?? json.packed_fixed64; if (packedFixed64) { - msg.packedFixed64 = packedFixed64; + msg.packedFixed64 = packedFixed64.map(BigInt); } - const packedSfixed32 = json[\\"packedSfixed32\\"] ?? json.packed_sfixed32; + const packedSfixed32 = json.packedSfixed32 ?? json.packed_sfixed32; if (packedSfixed32) { msg.packedSfixed32 = packedSfixed32; } - const packedSfixed64 = json[\\"packedSfixed64\\"] ?? json.packed_sfixed64; + const packedSfixed64 = json.packedSfixed64 ?? json.packed_sfixed64; if (packedSfixed64) { - msg.packedSfixed64 = packedSfixed64; + msg.packedSfixed64 = packedSfixed64.map(BigInt); } - const packedFloat = json[\\"packedFloat\\"] ?? json.packed_float; + const packedFloat = json.packedFloat ?? json.packed_float; if (packedFloat) { msg.packedFloat = packedFloat; } - const packedDouble = json[\\"packedDouble\\"] ?? json.packed_double; + const packedDouble = json.packedDouble ?? json.packed_double; if (packedDouble) { msg.packedDouble = packedDouble; } - const packedBool = json[\\"packedBool\\"] ?? json.packed_bool; + const packedBool = json.packedBool ?? json.packed_bool; if (packedBool) { msg.packedBool = packedBool; } - const packedEnum = json[\\"packedEnum\\"] ?? json.packed_enum; + const packedEnum = json.packedEnum ?? json.packed_enum; if (packedEnum) { msg.packedEnum = packedEnum; } @@ -10686,31 +10677,31 @@ export const TestUnpackedTypes = { writer.writeRepeatedInt32(90, msg.unpackedInt32); } if (msg.unpackedInt64?.length) { - writer.writeRepeatedInt64String(91, msg.unpackedInt64); + writer.writeRepeatedInt64String(91, msg.unpackedInt64.toString()); } if (msg.unpackedUint32?.length) { writer.writeRepeatedUint32(92, msg.unpackedUint32); } if (msg.unpackedUint64?.length) { - writer.writeRepeatedUint64String(93, msg.unpackedUint64); + writer.writeRepeatedUint64String(93, msg.unpackedUint64.toString()); } if (msg.unpackedSint32?.length) { writer.writeRepeatedSint32(94, msg.unpackedSint32); } if (msg.unpackedSint64?.length) { - writer.writeRepeatedSint64String(95, msg.unpackedSint64); + writer.writeRepeatedSint64String(95, msg.unpackedSint64.toString()); } if (msg.unpackedFixed32?.length) { writer.writeRepeatedFixed32(96, msg.unpackedFixed32); } if (msg.unpackedFixed64?.length) { - writer.writeRepeatedFixed64String(97, msg.unpackedFixed64); + writer.writeRepeatedFixed64String(97, msg.unpackedFixed64.toString()); } if (msg.unpackedSfixed32?.length) { writer.writeRepeatedSfixed32(98, msg.unpackedSfixed32); } if (msg.unpackedSfixed64?.length) { - writer.writeRepeatedSfixed64(99, msg.unpackedSfixed64); + writer.writeRepeatedSfixed64(99, msg.unpackedSfixed64.toString()); } if (msg.unpackedFloat?.length) { writer.writeRepeatedFloat(100, msg.unpackedFloat); @@ -10731,48 +10722,48 @@ export const TestUnpackedTypes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.unpackedInt32?.length) { - json[\\"unpackedInt32\\"] = msg.unpackedInt32; + json.unpackedInt32 = msg.unpackedInt32; } if (msg.unpackedInt64?.length) { - json[\\"unpackedInt64\\"] = msg.unpackedInt64; + json.unpackedInt64 = msg.unpackedInt64.map((x) => x.toString()); } if (msg.unpackedUint32?.length) { - json[\\"unpackedUint32\\"] = msg.unpackedUint32; + json.unpackedUint32 = msg.unpackedUint32; } if (msg.unpackedUint64?.length) { - json[\\"unpackedUint64\\"] = msg.unpackedUint64; + json.unpackedUint64 = msg.unpackedUint64.map((x) => x.toString()); } if (msg.unpackedSint32?.length) { - json[\\"unpackedSint32\\"] = msg.unpackedSint32; + json.unpackedSint32 = msg.unpackedSint32; } if (msg.unpackedSint64?.length) { - json[\\"unpackedSint64\\"] = msg.unpackedSint64; + json.unpackedSint64 = msg.unpackedSint64.map((x) => x.toString()); } if (msg.unpackedFixed32?.length) { - json[\\"unpackedFixed32\\"] = msg.unpackedFixed32; + json.unpackedFixed32 = msg.unpackedFixed32; } if (msg.unpackedFixed64?.length) { - json[\\"unpackedFixed64\\"] = msg.unpackedFixed64; + json.unpackedFixed64 = msg.unpackedFixed64.map((x) => x.toString()); } if (msg.unpackedSfixed32?.length) { - json[\\"unpackedSfixed32\\"] = msg.unpackedSfixed32; + json.unpackedSfixed32 = msg.unpackedSfixed32; } if (msg.unpackedSfixed64?.length) { - json[\\"unpackedSfixed64\\"] = msg.unpackedSfixed64; + json.unpackedSfixed64 = msg.unpackedSfixed64.map((x) => x.toString()); } if (msg.unpackedFloat?.length) { - json[\\"unpackedFloat\\"] = msg.unpackedFloat; + json.unpackedFloat = msg.unpackedFloat; } if (msg.unpackedDouble?.length) { - json[\\"unpackedDouble\\"] = msg.unpackedDouble; + json.unpackedDouble = msg.unpackedDouble; } if (msg.unpackedBool?.length) { - json[\\"unpackedBool\\"] = msg.unpackedBool; + json.unpackedBool = msg.unpackedBool; } if (msg.unpackedEnum?.length) { - json[\\"unpackedEnum\\"] = msg.unpackedEnum; + json.unpackedEnum = msg.unpackedEnum; } return json; }, @@ -10789,7 +10780,7 @@ export const TestUnpackedTypes = { break; } case 91: { - msg.unpackedInt64.push(reader.readInt64String()); + msg.unpackedInt64 = reader.readInt64String().map(BigInt); break; } case 92: { @@ -10797,7 +10788,7 @@ export const TestUnpackedTypes = { break; } case 93: { - msg.unpackedUint64.push(reader.readUint64String()); + msg.unpackedUint64 = reader.readUint64String().map(BigInt); break; } case 94: { @@ -10805,7 +10796,7 @@ export const TestUnpackedTypes = { break; } case 95: { - msg.unpackedSint64.push(reader.readSint64()); + msg.unpackedSint64 = reader.readSint64().map(BigInt); break; } case 96: { @@ -10813,7 +10804,7 @@ export const TestUnpackedTypes = { break; } case 97: { - msg.unpackedFixed64.push(reader.readFixed64String()); + msg.unpackedFixed64 = reader.readFixed64String().map(BigInt); break; } case 98: { @@ -10821,7 +10812,7 @@ export const TestUnpackedTypes = { break; } case 99: { - msg.unpackedSfixed64.push(reader.readSfixed64()); + msg.unpackedSfixed64 = reader.readSfixed64().map(BigInt); break; } case 100: { @@ -10853,59 +10844,59 @@ export const TestUnpackedTypes = { * @private */ _readMessageJSON: function (msg, json) { - const unpackedInt32 = json[\\"unpackedInt32\\"] ?? json.unpacked_int32; + const unpackedInt32 = json.unpackedInt32 ?? json.unpacked_int32; if (unpackedInt32) { msg.unpackedInt32 = unpackedInt32; } - const unpackedInt64 = json[\\"unpackedInt64\\"] ?? json.unpacked_int64; + const unpackedInt64 = json.unpackedInt64 ?? json.unpacked_int64; if (unpackedInt64) { - msg.unpackedInt64 = unpackedInt64; + msg.unpackedInt64 = unpackedInt64.map(BigInt); } - const unpackedUint32 = json[\\"unpackedUint32\\"] ?? json.unpacked_uint32; + const unpackedUint32 = json.unpackedUint32 ?? json.unpacked_uint32; if (unpackedUint32) { msg.unpackedUint32 = unpackedUint32; } - const unpackedUint64 = json[\\"unpackedUint64\\"] ?? json.unpacked_uint64; + const unpackedUint64 = json.unpackedUint64 ?? json.unpacked_uint64; if (unpackedUint64) { - msg.unpackedUint64 = unpackedUint64; + msg.unpackedUint64 = unpackedUint64.map(BigInt); } - const unpackedSint32 = json[\\"unpackedSint32\\"] ?? json.unpacked_sint32; + const unpackedSint32 = json.unpackedSint32 ?? json.unpacked_sint32; if (unpackedSint32) { msg.unpackedSint32 = unpackedSint32; } - const unpackedSint64 = json[\\"unpackedSint64\\"] ?? json.unpacked_sint64; + const unpackedSint64 = json.unpackedSint64 ?? json.unpacked_sint64; if (unpackedSint64) { - msg.unpackedSint64 = unpackedSint64; + msg.unpackedSint64 = unpackedSint64.map(BigInt); } - const unpackedFixed32 = json[\\"unpackedFixed32\\"] ?? json.unpacked_fixed32; + const unpackedFixed32 = json.unpackedFixed32 ?? json.unpacked_fixed32; if (unpackedFixed32) { msg.unpackedFixed32 = unpackedFixed32; } - const unpackedFixed64 = json[\\"unpackedFixed64\\"] ?? json.unpacked_fixed64; + const unpackedFixed64 = json.unpackedFixed64 ?? json.unpacked_fixed64; if (unpackedFixed64) { - msg.unpackedFixed64 = unpackedFixed64; + msg.unpackedFixed64 = unpackedFixed64.map(BigInt); } - const unpackedSfixed32 = json[\\"unpackedSfixed32\\"] ?? json.unpacked_sfixed32; + const unpackedSfixed32 = json.unpackedSfixed32 ?? json.unpacked_sfixed32; if (unpackedSfixed32) { msg.unpackedSfixed32 = unpackedSfixed32; } - const unpackedSfixed64 = json[\\"unpackedSfixed64\\"] ?? json.unpacked_sfixed64; + const unpackedSfixed64 = json.unpackedSfixed64 ?? json.unpacked_sfixed64; if (unpackedSfixed64) { - msg.unpackedSfixed64 = unpackedSfixed64; + msg.unpackedSfixed64 = unpackedSfixed64.map(BigInt); } - const unpackedFloat = json[\\"unpackedFloat\\"] ?? json.unpacked_float; + const unpackedFloat = json.unpackedFloat ?? json.unpacked_float; if (unpackedFloat) { msg.unpackedFloat = unpackedFloat; } - const unpackedDouble = json[\\"unpackedDouble\\"] ?? json.unpacked_double; + const unpackedDouble = json.unpackedDouble ?? json.unpacked_double; if (unpackedDouble) { msg.unpackedDouble = unpackedDouble; } - const unpackedBool = json[\\"unpackedBool\\"] ?? json.unpacked_bool; + const unpackedBool = json.unpackedBool ?? json.unpacked_bool; if (unpackedBool) { msg.unpackedBool = unpackedBool; } - const unpackedEnum = json[\\"unpackedEnum\\"] ?? json.unpacked_enum; + const unpackedEnum = json.unpackedEnum ?? json.unpacked_enum; if (unpackedEnum) { msg.unpackedEnum = unpackedEnum; } @@ -11105,22 +11096,22 @@ export const TestDynamicExtensions = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.scalarExtension) { - json[\\"scalarExtension\\"] = msg.scalarExtension; + json.scalarExtension = msg.scalarExtension; } if (msg.enumExtension) { - json[\\"enumExtension\\"] = msg.enumExtension; + json.enumExtension = msg.enumExtension; } if (msg.dynamicEnumExtension) { - json[\\"dynamicEnumExtension\\"] = msg.dynamicEnumExtension; + json.dynamicEnumExtension = msg.dynamicEnumExtension; } if (msg.messageExtension) { const messageExtension = ForeignMessage._writeMessageJSON( msg.messageExtension ); if (Object.keys(messageExtension).length > 0) { - json[\\"messageExtension\\"] = messageExtension; + json.messageExtension = messageExtension; } } if (msg.dynamicMessageExtension) { @@ -11129,14 +11120,14 @@ export const TestDynamicExtensions = { msg.dynamicMessageExtension ); if (Object.keys(dynamicMessageExtension).length > 0) { - json[\\"dynamicMessageExtension\\"] = dynamicMessageExtension; + json.dynamicMessageExtension = dynamicMessageExtension; } } if (msg.repeatedExtension?.length) { - json[\\"repeatedExtension\\"] = msg.repeatedExtension; + json.repeatedExtension = msg.repeatedExtension; } if (msg.packedExtension?.length) { - json[\\"packedExtension\\"] = msg.packedExtension; + json.packedExtension = msg.packedExtension; } return json; }, @@ -11192,27 +11183,27 @@ export const TestDynamicExtensions = { * @private */ _readMessageJSON: function (msg, json) { - const scalarExtension = json[\\"scalarExtension\\"] ?? json.scalar_extension; + const scalarExtension = json.scalarExtension ?? json.scalar_extension; if (scalarExtension) { msg.scalarExtension = scalarExtension; } - const enumExtension = json[\\"enumExtension\\"] ?? json.enum_extension; + const enumExtension = json.enumExtension ?? json.enum_extension; if (enumExtension) { msg.enumExtension = enumExtension; } const dynamicEnumExtension = - json[\\"dynamicEnumExtension\\"] ?? json.dynamic_enum_extension; + json.dynamicEnumExtension ?? json.dynamic_enum_extension; if (dynamicEnumExtension) { msg.dynamicEnumExtension = dynamicEnumExtension; } - const messageExtension = json[\\"messageExtension\\"] ?? json.message_extension; + const messageExtension = json.messageExtension ?? json.message_extension; if (messageExtension) { const m = ForeignMessage.initialize(); ForeignMessage._readMessageJSON(m, messageExtension); msg.messageExtension = m; } const dynamicMessageExtension = - json[\\"dynamicMessageExtension\\"] ?? json.dynamic_message_extension; + json.dynamicMessageExtension ?? json.dynamic_message_extension; if (dynamicMessageExtension) { const m = TestDynamicExtensions.DynamicMessageType.initialize(); TestDynamicExtensions.DynamicMessageType._readMessageJSON( @@ -11221,12 +11212,11 @@ export const TestDynamicExtensions = { ); msg.dynamicMessageExtension = m; } - const repeatedExtension = - json[\\"repeatedExtension\\"] ?? json.repeated_extension; + const repeatedExtension = json.repeatedExtension ?? json.repeated_extension; if (repeatedExtension) { msg.repeatedExtension = repeatedExtension; } - const packedExtension = json[\\"packedExtension\\"] ?? json.packed_extension; + const packedExtension = json.packedExtension ?? json.packed_extension; if (packedExtension) { msg.packedExtension = packedExtension; } @@ -11300,9 +11290,9 @@ export const TestDynamicExtensions = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.dynamicField) { - json[\\"dynamicField\\"] = msg.dynamicField; + json.dynamicField = msg.dynamicField; } return json; }, @@ -11331,7 +11321,7 @@ export const TestDynamicExtensions = { * @private */ _readMessageJSON: function (msg, json) { - const dynamicField = json[\\"dynamicField\\"] ?? json.dynamic_field; + const dynamicField = json.dynamicField ?? json.dynamic_field; if (dynamicField) { msg.dynamicField = dynamicField; } @@ -11407,16 +11397,16 @@ export const TestRepeatedScalarDifferentTagSizes = { writer.writeRepeatedInt32(13, msg.repeatedInt32); } if (msg.repeatedFixed64?.length) { - writer.writeRepeatedFixed64String(2046, msg.repeatedFixed64); + writer.writeRepeatedFixed64String(2046, msg.repeatedFixed64.toString()); } if (msg.repeatedInt64?.length) { - writer.writeRepeatedInt64String(2047, msg.repeatedInt64); + writer.writeRepeatedInt64String(2047, msg.repeatedInt64.toString()); } if (msg.repeatedFloat?.length) { writer.writeRepeatedFloat(262142, msg.repeatedFloat); } if (msg.repeatedUint64?.length) { - writer.writeRepeatedUint64String(262143, msg.repeatedUint64); + writer.writeRepeatedUint64String(262143, msg.repeatedUint64.toString()); } return writer; }, @@ -11425,24 +11415,24 @@ export const TestRepeatedScalarDifferentTagSizes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.repeatedFixed32?.length) { - json[\\"repeatedFixed32\\"] = msg.repeatedFixed32; + json.repeatedFixed32 = msg.repeatedFixed32; } if (msg.repeatedInt32?.length) { - json[\\"repeatedInt32\\"] = msg.repeatedInt32; + json.repeatedInt32 = msg.repeatedInt32; } if (msg.repeatedFixed64?.length) { - json[\\"repeatedFixed64\\"] = msg.repeatedFixed64; + json.repeatedFixed64 = msg.repeatedFixed64.map((x) => x.toString()); } if (msg.repeatedInt64?.length) { - json[\\"repeatedInt64\\"] = msg.repeatedInt64; + json.repeatedInt64 = msg.repeatedInt64.map((x) => x.toString()); } if (msg.repeatedFloat?.length) { - json[\\"repeatedFloat\\"] = msg.repeatedFloat; + json.repeatedFloat = msg.repeatedFloat; } if (msg.repeatedUint64?.length) { - json[\\"repeatedUint64\\"] = msg.repeatedUint64; + json.repeatedUint64 = msg.repeatedUint64.map((x) => x.toString()); } return json; }, @@ -11463,11 +11453,11 @@ export const TestRepeatedScalarDifferentTagSizes = { break; } case 2046: { - msg.repeatedFixed64.push(reader.readFixed64String()); + msg.repeatedFixed64 = reader.readFixed64String().map(BigInt); break; } case 2047: { - msg.repeatedInt64.push(reader.readInt64String()); + msg.repeatedInt64 = reader.readInt64String().map(BigInt); break; } case 262142: { @@ -11475,7 +11465,7 @@ export const TestRepeatedScalarDifferentTagSizes = { break; } case 262143: { - msg.repeatedUint64.push(reader.readUint64String()); + msg.repeatedUint64 = reader.readUint64String().map(BigInt); break; } default: { @@ -11491,29 +11481,29 @@ export const TestRepeatedScalarDifferentTagSizes = { * @private */ _readMessageJSON: function (msg, json) { - const repeatedFixed32 = json[\\"repeatedFixed32\\"] ?? json.repeated_fixed32; + const repeatedFixed32 = json.repeatedFixed32 ?? json.repeated_fixed32; if (repeatedFixed32) { msg.repeatedFixed32 = repeatedFixed32; } - const repeatedInt32 = json[\\"repeatedInt32\\"] ?? json.repeated_int32; + const repeatedInt32 = json.repeatedInt32 ?? json.repeated_int32; if (repeatedInt32) { msg.repeatedInt32 = repeatedInt32; } - const repeatedFixed64 = json[\\"repeatedFixed64\\"] ?? json.repeated_fixed64; + const repeatedFixed64 = json.repeatedFixed64 ?? json.repeated_fixed64; if (repeatedFixed64) { - msg.repeatedFixed64 = repeatedFixed64; + msg.repeatedFixed64 = repeatedFixed64.map(BigInt); } - const repeatedInt64 = json[\\"repeatedInt64\\"] ?? json.repeated_int64; + const repeatedInt64 = json.repeatedInt64 ?? json.repeated_int64; if (repeatedInt64) { - msg.repeatedInt64 = repeatedInt64; + msg.repeatedInt64 = repeatedInt64.map(BigInt); } - const repeatedFloat = json[\\"repeatedFloat\\"] ?? json.repeated_float; + const repeatedFloat = json.repeatedFloat ?? json.repeated_float; if (repeatedFloat) { msg.repeatedFloat = repeatedFloat; } - const repeatedUint64 = json[\\"repeatedUint64\\"] ?? json.repeated_uint64; + const repeatedUint64 = json.repeatedUint64 ?? json.repeated_uint64; if (repeatedUint64) { - msg.repeatedUint64 = repeatedUint64; + msg.repeatedUint64 = repeatedUint64.map(BigInt); } return msg; }, @@ -11592,13 +11582,13 @@ export const TestParsingMerge = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.requiredAllTypes) { const requiredAllTypes = TestAllTypes._writeMessageJSON( msg.requiredAllTypes ); if (Object.keys(requiredAllTypes).length > 0) { - json[\\"requiredAllTypes\\"] = requiredAllTypes; + json.requiredAllTypes = requiredAllTypes; } } if (msg.optionalAllTypes) { @@ -11606,11 +11596,11 @@ export const TestParsingMerge = { msg.optionalAllTypes ); if (Object.keys(optionalAllTypes).length > 0) { - json[\\"optionalAllTypes\\"] = optionalAllTypes; + json.optionalAllTypes = optionalAllTypes; } } if (msg.repeatedAllTypes?.length) { - json[\\"repeatedAllTypes\\"] = msg.repeatedAllTypes.map( + json.repeatedAllTypes = msg.repeatedAllTypes.map( TestAllTypes._writeMessageJSON ); } @@ -11651,22 +11641,19 @@ export const TestParsingMerge = { * @private */ _readMessageJSON: function (msg, json) { - const requiredAllTypes = - json[\\"requiredAllTypes\\"] ?? json.required_all_types; + const requiredAllTypes = json.requiredAllTypes ?? json.required_all_types; if (requiredAllTypes) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, requiredAllTypes); msg.requiredAllTypes = m; } - const optionalAllTypes = - json[\\"optionalAllTypes\\"] ?? json.optional_all_types; + const optionalAllTypes = json.optionalAllTypes ?? json.optional_all_types; if (optionalAllTypes) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, optionalAllTypes); msg.optionalAllTypes = m; } - const repeatedAllTypes = - json[\\"repeatedAllTypes\\"] ?? json.repeated_all_types; + const repeatedAllTypes = json.repeatedAllTypes ?? json.repeated_all_types; if (repeatedAllTypes) { for (const item of repeatedAllTypes) { const m = TestAllTypes.initialize(); @@ -11758,21 +11745,21 @@ export const TestParsingMerge = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.field1?.length) { - json[\\"field1\\"] = msg.field1.map(TestAllTypes._writeMessageJSON); + json.field1 = msg.field1.map(TestAllTypes._writeMessageJSON); } if (msg.field2?.length) { - json[\\"field2\\"] = msg.field2.map(TestAllTypes._writeMessageJSON); + json.field2 = msg.field2.map(TestAllTypes._writeMessageJSON); } if (msg.field3?.length) { - json[\\"field3\\"] = msg.field3.map(TestAllTypes._writeMessageJSON); + json.field3 = msg.field3.map(TestAllTypes._writeMessageJSON); } if (msg.ext1?.length) { - json[\\"ext1\\"] = msg.ext1.map(TestAllTypes._writeMessageJSON); + json.ext1 = msg.ext1.map(TestAllTypes._writeMessageJSON); } if (msg.ext2?.length) { - json[\\"ext2\\"] = msg.ext2.map(TestAllTypes._writeMessageJSON); + json.ext2 = msg.ext2.map(TestAllTypes._writeMessageJSON); } return json; }, @@ -11827,7 +11814,7 @@ export const TestParsingMerge = { * @private */ _readMessageJSON: function (msg, json) { - const field1 = json[\\"field1\\"] ?? json.field1; + const field1 = json.field1 ?? json.field1; if (field1) { for (const item of field1) { const m = TestAllTypes.initialize(); @@ -11835,7 +11822,7 @@ export const TestParsingMerge = { msg.field1.push(m); } } - const field2 = json[\\"field2\\"] ?? json.field2; + const field2 = json.field2 ?? json.field2; if (field2) { for (const item of field2) { const m = TestAllTypes.initialize(); @@ -11843,7 +11830,7 @@ export const TestParsingMerge = { msg.field2.push(m); } } - const field3 = json[\\"field3\\"] ?? json.field3; + const field3 = json.field3 ?? json.field3; if (field3) { for (const item of field3) { const m = TestAllTypes.initialize(); @@ -11851,7 +11838,7 @@ export const TestParsingMerge = { msg.field3.push(m); } } - const ext1 = json[\\"ext1\\"] ?? json.ext1; + const ext1 = json.ext1 ?? json.ext1; if (ext1) { for (const item of ext1) { const m = TestAllTypes.initialize(); @@ -11859,7 +11846,7 @@ export const TestParsingMerge = { msg.ext1.push(m); } } - const ext2 = json[\\"ext2\\"] ?? json.ext2; + const ext2 = json.ext2 ?? json.ext2; if (ext2) { for (const item of ext2) { const m = TestAllTypes.initialize(); @@ -11935,11 +11922,11 @@ export const TestParsingMerge = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.field1) { const field1 = TestAllTypes._writeMessageJSON(msg.field1); if (Object.keys(field1).length > 0) { - json[\\"field1\\"] = field1; + json.field1 = field1; } } return json; @@ -11969,7 +11956,7 @@ export const TestParsingMerge = { * @private */ _readMessageJSON: function (msg, json) { - const field1 = json[\\"field1\\"] ?? json.field1; + const field1 = json.field1 ?? json.field1; if (field1) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, field1); @@ -12044,11 +12031,11 @@ export const TestParsingMerge = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.field1) { const field1 = TestAllTypes._writeMessageJSON(msg.field1); if (Object.keys(field1).length > 0) { - json[\\"field1\\"] = field1; + json.field1 = field1; } } return json; @@ -12078,7 +12065,7 @@ export const TestParsingMerge = { * @private */ _readMessageJSON: function (msg, json) { - const field1 = json[\\"field1\\"] ?? json.field1; + const field1 = json.field1 ?? json.field1; if (field1) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, field1); @@ -12156,13 +12143,13 @@ export const TestParsingMerge = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.optionalGroupAllTypes) { const optionalGroupAllTypes = TestAllTypes._writeMessageJSON( msg.optionalGroupAllTypes ); if (Object.keys(optionalGroupAllTypes).length > 0) { - json[\\"optionalGroupAllTypes\\"] = optionalGroupAllTypes; + json.optionalGroupAllTypes = optionalGroupAllTypes; } } return json; @@ -12196,7 +12183,7 @@ export const TestParsingMerge = { */ _readMessageJSON: function (msg, json) { const optionalGroupAllTypes = - json[\\"optionalGroupAllTypes\\"] ?? json.optional_group_all_types; + json.optionalGroupAllTypes ?? json.optional_group_all_types; if (optionalGroupAllTypes) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, optionalGroupAllTypes); @@ -12273,13 +12260,13 @@ export const TestParsingMerge = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.repeatedGroupAllTypes) { const repeatedGroupAllTypes = TestAllTypes._writeMessageJSON( msg.repeatedGroupAllTypes ); if (Object.keys(repeatedGroupAllTypes).length > 0) { - json[\\"repeatedGroupAllTypes\\"] = repeatedGroupAllTypes; + json.repeatedGroupAllTypes = repeatedGroupAllTypes; } } return json; @@ -12313,7 +12300,7 @@ export const TestParsingMerge = { */ _readMessageJSON: function (msg, json) { const repeatedGroupAllTypes = - json[\\"repeatedGroupAllTypes\\"] ?? json.repeated_group_all_types; + json.repeatedGroupAllTypes ?? json.repeated_group_all_types; if (repeatedGroupAllTypes) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, repeatedGroupAllTypes); @@ -12387,9 +12374,9 @@ export const TestCommentInjectionMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -12418,7 +12405,7 @@ export const TestCommentInjectionMessage = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -12799,27 +12786,27 @@ export const TestJsonName = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.fieldName1) { - json[\\"fieldName1\\"] = msg.fieldName1; + json.fieldName1 = msg.fieldName1; } if (msg.fieldName2) { - json[\\"fieldName2\\"] = msg.fieldName2; + json.fieldName2 = msg.fieldName2; } if (msg.FieldName3) { - json[\\"FieldName3\\"] = msg.FieldName3; + json.FieldName3 = msg.FieldName3; } if (msg.FieldName4) { - json[\\"FieldName4\\"] = msg.FieldName4; + json.FieldName4 = msg.FieldName4; } if (msg.FIELDNAME5) { - json[\\"FIELDNAME5\\"] = msg.FIELDNAME5; + json.FIELDNAME5 = msg.FIELDNAME5; } if (msg.fieldName6) { json[\\"@type\\"] = msg.fieldName6; } if (msg.fieldname7) { - json[\\"fieldname7\\"] = msg.fieldname7; + json.fieldname7 = msg.fieldname7; } return json; }, @@ -12872,23 +12859,23 @@ export const TestJsonName = { * @private */ _readMessageJSON: function (msg, json) { - const fieldName1 = json[\\"fieldName1\\"] ?? json.field_name1; + const fieldName1 = json.fieldName1 ?? json.field_name1; if (fieldName1) { msg.fieldName1 = fieldName1; } - const fieldName2 = json[\\"fieldName2\\"] ?? json.fieldName2; + const fieldName2 = json.fieldName2 ?? json.fieldName2; if (fieldName2) { msg.fieldName2 = fieldName2; } - const FieldName3 = json[\\"FieldName3\\"] ?? json.FieldName3; + const FieldName3 = json.FieldName3 ?? json.FieldName3; if (FieldName3) { msg.FieldName3 = FieldName3; } - const FieldName4 = json[\\"FieldName4\\"] ?? json._field_name4; + const FieldName4 = json.FieldName4 ?? json._field_name4; if (FieldName4) { msg.FieldName4 = FieldName4; } - const FIELDNAME5 = json[\\"FIELDNAME5\\"] ?? json.FIELD_NAME5; + const FIELDNAME5 = json.FIELDNAME5 ?? json.FIELD_NAME5; if (FIELDNAME5) { msg.FIELDNAME5 = FIELDNAME5; } @@ -12896,7 +12883,7 @@ export const TestJsonName = { if (fieldName6) { msg.fieldName6 = fieldName6; } - const fieldname7 = json[\\"fieldname7\\"] ?? json.fieldname7; + const fieldname7 = json.fieldname7 ?? json.fieldname7; if (fieldname7) { msg.fieldname7 = fieldname7; } @@ -12995,11 +12982,13 @@ export const TestHugeFieldNumbers = { ); } if (msg.stringStringMap) { - for (const key in msg.stringStringMap) { - writer.writeMessage(536870010, {}, (_, mapWriter) => { - mapWriter.writeString(1, key); - mapWriter.writeString(2, msg.stringStringMap[key]); - }); + for (const [key, value] of Object.entries(msg.stringStringMap)) { + if (key && value) { + writer.writeMessage(536870010, {}, (_, mapWriter) => { + mapWriter.writeString(1, key); + mapWriter.writeString(2, value); + }); + } } } if (msg.oneofUint32 != undefined) { @@ -13025,57 +13014,63 @@ export const TestHugeFieldNumbers = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.optionalInt32) { - json[\\"optionalInt32\\"] = msg.optionalInt32; + json.optionalInt32 = msg.optionalInt32; } if (msg.fixed32) { - json[\\"fixed32\\"] = msg.fixed32; + json.fixed32 = msg.fixed32; } if (msg.repeatedInt32?.length) { - json[\\"repeatedInt32\\"] = msg.repeatedInt32; + json.repeatedInt32 = msg.repeatedInt32; } if (msg.packedInt32?.length) { - json[\\"packedInt32\\"] = msg.packedInt32; + json.packedInt32 = msg.packedInt32; } if (msg.optionalEnum) { - json[\\"optionalEnum\\"] = msg.optionalEnum; + json.optionalEnum = msg.optionalEnum; } if (msg.optionalString) { - json[\\"optionalString\\"] = msg.optionalString; + json.optionalString = msg.optionalString; } if (msg.optionalBytes) { - json[\\"optionalBytes\\"] = msg.optionalBytes; + json.optionalBytes = msg.optionalBytes; } if (msg.optionalMessage) { const optionalMessage = ForeignMessage._writeMessageJSON( msg.optionalMessage ); if (Object.keys(optionalMessage).length > 0) { - json[\\"optionalMessage\\"] = optionalMessage; + json.optionalMessage = optionalMessage; } } if (msg.stringStringMap) { - if (Object.keys(msg.stringStringMap).length > 0) { - json[\\"stringStringMap\\"] = msg.stringStringMap; + if (msg.stringStringMap) { + const map = {}; + for (const [key, value] of Object.entries(msg.stringStringMap)) { + if (key && value) { + map[key] = value; + json.stringStringMap = map; + } + } } } if (msg.oneofUint32 != undefined) { - json[\\"oneofUint32\\"] = msg.oneofUint32; + json.oneofUint32 = msg.oneofUint32; } if (msg.oneofTestAllTypes != undefined) { const oneofTestAllTypes = TestAllTypes._writeMessageJSON( msg.oneofTestAllTypes ); if (Object.keys(oneofTestAllTypes).length > 0) { - json[\\"oneofTestAllTypes\\"] = oneofTestAllTypes; + json.oneofTestAllTypes = oneofTestAllTypes; } } if (msg.oneofString != undefined) { - json[\\"oneofString\\"] = msg.oneofString; + json.oneofString = msg.oneofString; } if (msg.oneofBytes != undefined) { - json[\\"oneofBytes\\"] = msg.oneofBytes; + json.oneofBytes = msg.oneofBytes; } return json; }, @@ -13171,60 +13166,62 @@ export const TestHugeFieldNumbers = { * @private */ _readMessageJSON: function (msg, json) { - const optionalInt32 = json[\\"optionalInt32\\"] ?? json.optional_int32; + const optionalInt32 = json.optionalInt32 ?? json.optional_int32; if (optionalInt32) { msg.optionalInt32 = optionalInt32; } - const fixed32 = json[\\"fixed32\\"] ?? json.fixed_32; + const fixed32 = json.fixed32 ?? json.fixed_32; if (fixed32) { msg.fixed32 = fixed32; } - const repeatedInt32 = json[\\"repeatedInt32\\"] ?? json.repeated_int32; + const repeatedInt32 = json.repeatedInt32 ?? json.repeated_int32; if (repeatedInt32) { msg.repeatedInt32 = repeatedInt32; } - const packedInt32 = json[\\"packedInt32\\"] ?? json.packed_int32; + const packedInt32 = json.packedInt32 ?? json.packed_int32; if (packedInt32) { msg.packedInt32 = packedInt32; } - const optionalEnum = json[\\"optionalEnum\\"] ?? json.optional_enum; + const optionalEnum = json.optionalEnum ?? json.optional_enum; if (optionalEnum) { msg.optionalEnum = optionalEnum; } - const optionalString = json[\\"optionalString\\"] ?? json.optional_string; + const optionalString = json.optionalString ?? json.optional_string; if (optionalString) { msg.optionalString = optionalString; } - const optionalBytes = json[\\"optionalBytes\\"] ?? json.optional_bytes; + const optionalBytes = json.optionalBytes ?? json.optional_bytes; if (optionalBytes) { msg.optionalBytes = optionalBytes; } - const optionalMessage = json[\\"optionalMessage\\"] ?? json.optional_message; + const optionalMessage = json.optionalMessage ?? json.optional_message; if (optionalMessage) { const m = ForeignMessage.initialize(); ForeignMessage._readMessageJSON(m, optionalMessage); msg.optionalMessage = m; } - const stringStringMap = json[\\"stringStringMap\\"] ?? json.string_string_map; + const stringStringMap = json.stringStringMap ?? json.string_string_map; if (stringStringMap) { - msg.stringStringMap = stringStringMap; + for (const [key, value] of Object.entries(stringStringMap)) { + msg.stringStringMap[key] = value; + } } - const oneofUint32 = json[\\"oneofUint32\\"] ?? json.oneof_uint32; + const oneofUint32 = json.oneofUint32 ?? json.oneof_uint32; if (oneofUint32) { msg.oneofUint32 = oneofUint32; } const oneofTestAllTypes = - json[\\"oneofTestAllTypes\\"] ?? json.oneof_test_all_types; + json.oneofTestAllTypes ?? json.oneof_test_all_types; if (oneofTestAllTypes) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, oneofTestAllTypes); msg.oneofTestAllTypes = m; } - const oneofString = json[\\"oneofString\\"] ?? json.oneof_string; + const oneofString = json.oneofString ?? json.oneof_string; if (oneofString) { msg.oneofString = oneofString; } - const oneofBytes = json[\\"oneofBytes\\"] ?? json.oneof_bytes; + const oneofBytes = json.oneofBytes ?? json.oneof_bytes; if (oneofBytes) { msg.oneofBytes = oneofBytes; } @@ -13294,9 +13291,9 @@ export const TestHugeFieldNumbers = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.groupA) { - json[\\"groupA\\"] = msg.groupA; + json.groupA = msg.groupA; } return json; }, @@ -13325,7 +13322,7 @@ export const TestHugeFieldNumbers = { * @private */ _readMessageJSON: function (msg, json) { - const groupA = json[\\"groupA\\"] ?? json.group_a; + const groupA = json.groupA ?? json.group_a; if (groupA) { msg.groupA = groupA; } @@ -13429,33 +13426,33 @@ export const TestExtensionInsideTable = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.field1) { - json[\\"field1\\"] = msg.field1; + json.field1 = msg.field1; } if (msg.field2) { - json[\\"field2\\"] = msg.field2; + json.field2 = msg.field2; } if (msg.field3) { - json[\\"field3\\"] = msg.field3; + json.field3 = msg.field3; } if (msg.field4) { - json[\\"field4\\"] = msg.field4; + json.field4 = msg.field4; } if (msg.field6) { - json[\\"field6\\"] = msg.field6; + json.field6 = msg.field6; } if (msg.field7) { - json[\\"field7\\"] = msg.field7; + json.field7 = msg.field7; } if (msg.field8) { - json[\\"field8\\"] = msg.field8; + json.field8 = msg.field8; } if (msg.field9) { - json[\\"field9\\"] = msg.field9; + json.field9 = msg.field9; } if (msg.field10) { - json[\\"field10\\"] = msg.field10; + json.field10 = msg.field10; } return json; }, @@ -13516,39 +13513,39 @@ export const TestExtensionInsideTable = { * @private */ _readMessageJSON: function (msg, json) { - const field1 = json[\\"field1\\"] ?? json.field1; + const field1 = json.field1 ?? json.field1; if (field1) { msg.field1 = field1; } - const field2 = json[\\"field2\\"] ?? json.field2; + const field2 = json.field2 ?? json.field2; if (field2) { msg.field2 = field2; } - const field3 = json[\\"field3\\"] ?? json.field3; + const field3 = json.field3 ?? json.field3; if (field3) { msg.field3 = field3; } - const field4 = json[\\"field4\\"] ?? json.field4; + const field4 = json.field4 ?? json.field4; if (field4) { msg.field4 = field4; } - const field6 = json[\\"field6\\"] ?? json.field6; + const field6 = json.field6 ?? json.field6; if (field6) { msg.field6 = field6; } - const field7 = json[\\"field7\\"] ?? json.field7; + const field7 = json.field7 ?? json.field7; if (field7) { msg.field7 = field7; } - const field8 = json[\\"field8\\"] ?? json.field8; + const field8 = json.field8 ?? json.field8; if (field8) { msg.field8 = field8; } - const field9 = json[\\"field9\\"] ?? json.field9; + const field9 = json.field9 ?? json.field9; if (field9) { msg.field9 = field9; } - const field10 = json[\\"field10\\"] ?? json.field10; + const field10 = json.field10 ?? json.field10; if (field10) { msg.field10 = field10; } @@ -13631,18 +13628,18 @@ export const TestExtensionRangeSerialize = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.fooOne) { - json[\\"fooOne\\"] = msg.fooOne; + json.fooOne = msg.fooOne; } if (msg.fooTwo) { - json[\\"fooTwo\\"] = msg.fooTwo; + json.fooTwo = msg.fooTwo; } if (msg.fooThree) { - json[\\"fooThree\\"] = msg.fooThree; + json.fooThree = msg.fooThree; } if (msg.fooFour) { - json[\\"fooFour\\"] = msg.fooFour; + json.fooFour = msg.fooFour; } return json; }, @@ -13683,19 +13680,19 @@ export const TestExtensionRangeSerialize = { * @private */ _readMessageJSON: function (msg, json) { - const fooOne = json[\\"fooOne\\"] ?? json.foo_one; + const fooOne = json.fooOne ?? json.foo_one; if (fooOne) { msg.fooOne = fooOne; } - const fooTwo = json[\\"fooTwo\\"] ?? json.foo_two; + const fooTwo = json.fooTwo ?? json.foo_two; if (fooTwo) { msg.fooTwo = fooTwo; } - const fooThree = json[\\"fooThree\\"] ?? json.foo_three; + const fooThree = json.fooThree ?? json.foo_three; if (fooThree) { msg.fooThree = fooThree; } - const fooFour = json[\\"fooFour\\"] ?? json.foo_four; + const fooFour = json.fooFour ?? json.foo_four; if (fooFour) { msg.fooFour = fooFour; } @@ -13793,155 +13790,193 @@ export const TestMap = { */ _writeMessage: function (msg, writer) { if (msg.mapInt32Int32) { - for (const key in msg.mapInt32Int32) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeInt32(2, msg.mapInt32Int32[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Int32)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeInt32(2, value); + }); + } } } if (msg.mapInt64Int64) { - for (const key in msg.mapInt64Int64) { - writer.writeMessage(2, {}, (_, mapWriter) => { - mapWriter.writeInt64String(1, key); - mapWriter.writeInt64String(2, msg.mapInt64Int64[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt64Int64)) { + if (key && value) { + writer.writeMessage(2, {}, (_, mapWriter) => { + mapWriter.writeInt64String(1, key); + mapWriter.writeInt64String(2, value.toString()); + }); + } } } if (msg.mapUint32Uint32) { - for (const key in msg.mapUint32Uint32) { - writer.writeMessage(3, {}, (_, mapWriter) => { - mapWriter.writeUint32(1, key); - mapWriter.writeUint32(2, msg.mapUint32Uint32[key]); - }); + for (const [key, value] of Object.entries(msg.mapUint32Uint32)) { + if (key && value) { + writer.writeMessage(3, {}, (_, mapWriter) => { + mapWriter.writeUint32(1, key); + mapWriter.writeUint32(2, value); + }); + } } } if (msg.mapUint64Uint64) { - for (const key in msg.mapUint64Uint64) { - writer.writeMessage(4, {}, (_, mapWriter) => { - mapWriter.writeUint64String(1, key); - mapWriter.writeUint64String(2, msg.mapUint64Uint64[key]); - }); + for (const [key, value] of Object.entries(msg.mapUint64Uint64)) { + if (key && value) { + writer.writeMessage(4, {}, (_, mapWriter) => { + mapWriter.writeUint64String(1, key); + mapWriter.writeUint64String(2, value.toString()); + }); + } } } if (msg.mapSint32Sint32) { - for (const key in msg.mapSint32Sint32) { - writer.writeMessage(5, {}, (_, mapWriter) => { - mapWriter.writeSint32(1, key); - mapWriter.writeSint32(2, msg.mapSint32Sint32[key]); - }); + for (const [key, value] of Object.entries(msg.mapSint32Sint32)) { + if (key && value) { + writer.writeMessage(5, {}, (_, mapWriter) => { + mapWriter.writeSint32(1, key); + mapWriter.writeSint32(2, value); + }); + } } } if (msg.mapSint64Sint64) { - for (const key in msg.mapSint64Sint64) { - writer.writeMessage(6, {}, (_, mapWriter) => { - mapWriter.writeSint64String(1, key); - mapWriter.writeSint64String(2, msg.mapSint64Sint64[key]); - }); + for (const [key, value] of Object.entries(msg.mapSint64Sint64)) { + if (key && value) { + writer.writeMessage(6, {}, (_, mapWriter) => { + mapWriter.writeSint64String(1, key); + mapWriter.writeSint64String(2, value.toString()); + }); + } } } if (msg.mapFixed32Fixed32) { - for (const key in msg.mapFixed32Fixed32) { - writer.writeMessage(7, {}, (_, mapWriter) => { - mapWriter.writeFixed32(1, key); - mapWriter.writeFixed32(2, msg.mapFixed32Fixed32[key]); - }); + for (const [key, value] of Object.entries(msg.mapFixed32Fixed32)) { + if (key && value) { + writer.writeMessage(7, {}, (_, mapWriter) => { + mapWriter.writeFixed32(1, key); + mapWriter.writeFixed32(2, value); + }); + } } } if (msg.mapFixed64Fixed64) { - for (const key in msg.mapFixed64Fixed64) { - writer.writeMessage(8, {}, (_, mapWriter) => { - mapWriter.writeFixed64String(1, key); - mapWriter.writeFixed64String(2, msg.mapFixed64Fixed64[key]); - }); + for (const [key, value] of Object.entries(msg.mapFixed64Fixed64)) { + if (key && value) { + writer.writeMessage(8, {}, (_, mapWriter) => { + mapWriter.writeFixed64String(1, key); + mapWriter.writeFixed64String(2, value.toString()); + }); + } } } if (msg.mapSfixed32Sfixed32) { - for (const key in msg.mapSfixed32Sfixed32) { - writer.writeMessage(9, {}, (_, mapWriter) => { - mapWriter.writeSfixed32(1, key); - mapWriter.writeSfixed32(2, msg.mapSfixed32Sfixed32[key]); - }); + for (const [key, value] of Object.entries(msg.mapSfixed32Sfixed32)) { + if (key && value) { + writer.writeMessage(9, {}, (_, mapWriter) => { + mapWriter.writeSfixed32(1, key); + mapWriter.writeSfixed32(2, value); + }); + } } } if (msg.mapSfixed64Sfixed64) { - for (const key in msg.mapSfixed64Sfixed64) { - writer.writeMessage(10, {}, (_, mapWriter) => { - mapWriter.writeSfixed64(1, key); - mapWriter.writeSfixed64(2, msg.mapSfixed64Sfixed64[key]); - }); + for (const [key, value] of Object.entries(msg.mapSfixed64Sfixed64)) { + if (key && value) { + writer.writeMessage(10, {}, (_, mapWriter) => { + mapWriter.writeSfixed64(1, key); + mapWriter.writeSfixed64(2, value.toString()); + }); + } } } if (msg.mapInt32Float) { - for (const key in msg.mapInt32Float) { - writer.writeMessage(11, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeFloat(2, msg.mapInt32Float[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Float)) { + if (key && value) { + writer.writeMessage(11, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeFloat(2, value); + }); + } } } if (msg.mapInt32Double) { - for (const key in msg.mapInt32Double) { - writer.writeMessage(12, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeDouble(2, msg.mapInt32Double[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Double)) { + if (key && value) { + writer.writeMessage(12, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeDouble(2, value); + }); + } } } if (msg.mapBoolBool) { - for (const key in msg.mapBoolBool) { - writer.writeMessage(13, {}, (_, mapWriter) => { - mapWriter.writeBool(1, key); - mapWriter.writeBool(2, msg.mapBoolBool[key]); - }); + for (const [key, value] of Object.entries(msg.mapBoolBool)) { + if (key && value) { + writer.writeMessage(13, {}, (_, mapWriter) => { + mapWriter.writeBool(1, key); + mapWriter.writeBool(2, value); + }); + } } } if (msg.mapStringString) { - for (const key in msg.mapStringString) { - writer.writeMessage(14, {}, (_, mapWriter) => { - mapWriter.writeString(1, key); - mapWriter.writeString(2, msg.mapStringString[key]); - }); + for (const [key, value] of Object.entries(msg.mapStringString)) { + if (key && value) { + writer.writeMessage(14, {}, (_, mapWriter) => { + mapWriter.writeString(1, key); + mapWriter.writeString(2, value); + }); + } } } if (msg.mapInt32Bytes) { - for (const key in msg.mapInt32Bytes) { - writer.writeMessage(15, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeBytes(2, msg.mapInt32Bytes[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Bytes)) { + if (key && value) { + writer.writeMessage(15, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeBytes(2, value); + }); + } } } if (msg.mapInt32Enum) { - for (const key in msg.mapInt32Enum) { - writer.writeMessage(16, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeEnum(2, msg.mapInt32Enum[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Enum)) { + if (key && value) { + writer.writeMessage(16, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeEnum(2, value); + }); + } } } if (msg.mapInt32ForeignMessage) { - for (const key in msg.mapInt32ForeignMessage) { - writer.writeMessage(17, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeMessage(2, msg.mapInt32ForeignMessage[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32ForeignMessage)) { + if (key && value) { + writer.writeMessage(17, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeMessage(2, value, ForeignMessage._writeMessage); + }); + } } } if (msg.mapStringForeignMessage) { - for (const key in msg.mapStringForeignMessage) { - writer.writeMessage(18, {}, (_, mapWriter) => { - mapWriter.writeString(1, key); - mapWriter.writeMessage(2, msg.mapStringForeignMessage[key]); - }); + for (const [key, value] of Object.entries(msg.mapStringForeignMessage)) { + if (key && value) { + writer.writeMessage(18, {}, (_, mapWriter) => { + mapWriter.writeString(1, key); + mapWriter.writeMessage(2, value, ForeignMessage._writeMessage); + }); + } } } if (msg.mapInt32AllTypes) { - for (const key in msg.mapInt32AllTypes) { - writer.writeMessage(19, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeMessage(2, msg.mapInt32AllTypes[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32AllTypes)) { + if (key && value) { + writer.writeMessage(19, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeMessage(2, value, TestAllTypes._writeMessage); + }); + } } } return writer; @@ -13951,100 +13986,216 @@ export const TestMap = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.mapInt32Int32) { - if (Object.keys(msg.mapInt32Int32).length > 0) { - json[\\"mapInt32Int32\\"] = msg.mapInt32Int32; + if (msg.mapInt32Int32) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32Int32)) { + if (key && value) { + map[key] = value; + json.mapInt32Int32 = map; + } + } } } if (msg.mapInt64Int64) { - if (Object.keys(msg.mapInt64Int64).length > 0) { - json[\\"mapInt64Int64\\"] = msg.mapInt64Int64; + if (msg.mapInt64Int64) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt64Int64)) { + if (key && value) { + map[key] = value.toString(); + json.mapInt64Int64 = map; + } + } } } if (msg.mapUint32Uint32) { - if (Object.keys(msg.mapUint32Uint32).length > 0) { - json[\\"mapUint32Uint32\\"] = msg.mapUint32Uint32; + if (msg.mapUint32Uint32) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapUint32Uint32)) { + if (key && value) { + map[key] = value; + json.mapUint32Uint32 = map; + } + } } } if (msg.mapUint64Uint64) { - if (Object.keys(msg.mapUint64Uint64).length > 0) { - json[\\"mapUint64Uint64\\"] = msg.mapUint64Uint64; + if (msg.mapUint64Uint64) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapUint64Uint64)) { + if (key && value) { + map[key] = value.toString(); + json.mapUint64Uint64 = map; + } + } } } if (msg.mapSint32Sint32) { - if (Object.keys(msg.mapSint32Sint32).length > 0) { - json[\\"mapSint32Sint32\\"] = msg.mapSint32Sint32; + if (msg.mapSint32Sint32) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapSint32Sint32)) { + if (key && value) { + map[key] = value; + json.mapSint32Sint32 = map; + } + } } } if (msg.mapSint64Sint64) { - if (Object.keys(msg.mapSint64Sint64).length > 0) { - json[\\"mapSint64Sint64\\"] = msg.mapSint64Sint64; + if (msg.mapSint64Sint64) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapSint64Sint64)) { + if (key && value) { + map[key] = value.toString(); + json.mapSint64Sint64 = map; + } + } } } if (msg.mapFixed32Fixed32) { - if (Object.keys(msg.mapFixed32Fixed32).length > 0) { - json[\\"mapFixed32Fixed32\\"] = msg.mapFixed32Fixed32; + if (msg.mapFixed32Fixed32) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapFixed32Fixed32)) { + if (key && value) { + map[key] = value; + json.mapFixed32Fixed32 = map; + } + } } } if (msg.mapFixed64Fixed64) { - if (Object.keys(msg.mapFixed64Fixed64).length > 0) { - json[\\"mapFixed64Fixed64\\"] = msg.mapFixed64Fixed64; + if (msg.mapFixed64Fixed64) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapFixed64Fixed64)) { + if (key && value) { + map[key] = value.toString(); + json.mapFixed64Fixed64 = map; + } + } } } if (msg.mapSfixed32Sfixed32) { - if (Object.keys(msg.mapSfixed32Sfixed32).length > 0) { - json[\\"mapSfixed32Sfixed32\\"] = msg.mapSfixed32Sfixed32; + if (msg.mapSfixed32Sfixed32) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapSfixed32Sfixed32)) { + if (key && value) { + map[key] = value; + json.mapSfixed32Sfixed32 = map; + } + } } } if (msg.mapSfixed64Sfixed64) { - if (Object.keys(msg.mapSfixed64Sfixed64).length > 0) { - json[\\"mapSfixed64Sfixed64\\"] = msg.mapSfixed64Sfixed64; + if (msg.mapSfixed64Sfixed64) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapSfixed64Sfixed64)) { + if (key && value) { + map[key] = value.toString(); + json.mapSfixed64Sfixed64 = map; + } + } } } if (msg.mapInt32Float) { - if (Object.keys(msg.mapInt32Float).length > 0) { - json[\\"mapInt32Float\\"] = msg.mapInt32Float; + if (msg.mapInt32Float) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32Float)) { + if (key && value) { + map[key] = value; + json.mapInt32Float = map; + } + } } } if (msg.mapInt32Double) { - if (Object.keys(msg.mapInt32Double).length > 0) { - json[\\"mapInt32Double\\"] = msg.mapInt32Double; + if (msg.mapInt32Double) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32Double)) { + if (key && value) { + map[key] = value; + json.mapInt32Double = map; + } + } } } if (msg.mapBoolBool) { - if (Object.keys(msg.mapBoolBool).length > 0) { - json[\\"mapBoolBool\\"] = msg.mapBoolBool; + if (msg.mapBoolBool) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapBoolBool)) { + if (key && value) { + map[key] = value; + json.mapBoolBool = map; + } + } } } if (msg.mapStringString) { - if (Object.keys(msg.mapStringString).length > 0) { - json[\\"mapStringString\\"] = msg.mapStringString; + if (msg.mapStringString) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapStringString)) { + if (key && value) { + map[key] = value; + json.mapStringString = map; + } + } } } if (msg.mapInt32Bytes) { - if (Object.keys(msg.mapInt32Bytes).length > 0) { - json[\\"mapInt32Bytes\\"] = msg.mapInt32Bytes; + if (msg.mapInt32Bytes) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32Bytes)) { + if (key && value) { + map[key] = value; + json.mapInt32Bytes = map; + } + } } } if (msg.mapInt32Enum) { - if (Object.keys(msg.mapInt32Enum).length > 0) { - json[\\"mapInt32Enum\\"] = msg.mapInt32Enum; + if (msg.mapInt32Enum) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32Enum)) { + if (key && value) { + map[key] = value; + json.mapInt32Enum = map; + } + } } } if (msg.mapInt32ForeignMessage) { - if (Object.keys(msg.mapInt32ForeignMessage).length > 0) { - json[\\"mapInt32ForeignMessage\\"] = msg.mapInt32ForeignMessage; + if (msg.mapInt32ForeignMessage) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32ForeignMessage)) { + if (key && value) { + map[key] = ForeignMessage._writeMessageJSON(value); + json.mapInt32ForeignMessage = map; + } + } } } if (msg.mapStringForeignMessage) { - if (Object.keys(msg.mapStringForeignMessage).length > 0) { - json[\\"mapStringForeignMessage\\"] = msg.mapStringForeignMessage; + if (msg.mapStringForeignMessage) { + const map = {}; + for (const [key, value] of Object.entries( + msg.mapStringForeignMessage + )) { + if (key && value) { + map[key] = ForeignMessage._writeMessageJSON(value); + json.mapStringForeignMessage = map; + } + } } } if (msg.mapInt32AllTypes) { - if (Object.keys(msg.mapInt32AllTypes).length > 0) { - json[\\"mapInt32AllTypes\\"] = msg.mapInt32AllTypes; + if (msg.mapInt32AllTypes) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32AllTypes)) { + if (key && value) { + map[key] = TestAllTypes._writeMessageJSON(value); + json.mapInt32AllTypes = map; + } + } } } return json; @@ -14083,7 +14234,7 @@ export const TestMap = { case 2: { reader.readMessage(undefined, () => { let key; - let value = \\"\\"; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -14092,7 +14243,7 @@ export const TestMap = { break; } case 2: { - value = reader.readInt64String(); + value = BigInt(reader.readInt64String()); break; } } @@ -14129,7 +14280,7 @@ export const TestMap = { case 4: { reader.readMessage(undefined, () => { let key; - let value = \\"\\"; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -14138,7 +14289,7 @@ export const TestMap = { break; } case 2: { - value = reader.readUint64String(); + value = BigInt(reader.readUint64String()); break; } } @@ -14175,7 +14326,7 @@ export const TestMap = { case 6: { reader.readMessage(undefined, () => { let key; - let value = \\"\\"; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -14184,7 +14335,7 @@ export const TestMap = { break; } case 2: { - value = reader.readSint64(); + value = BigInt(reader.readSint64()); break; } } @@ -14221,7 +14372,7 @@ export const TestMap = { case 8: { reader.readMessage(undefined, () => { let key; - let value = \\"\\"; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -14230,7 +14381,7 @@ export const TestMap = { break; } case 2: { - value = reader.readFixed64String(); + value = BigInt(reader.readFixed64String()); break; } } @@ -14267,7 +14418,7 @@ export const TestMap = { case 10: { reader.readMessage(undefined, () => { let key; - let value = \\"\\"; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -14276,7 +14427,7 @@ export const TestMap = { break; } case 2: { - value = reader.readSfixed64(); + value = BigInt(reader.readSfixed64()); break; } } @@ -14437,7 +14588,10 @@ export const TestMap = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + ForeignMessage.initialize(), + ForeignMessage._readMessage + ); break; } } @@ -14460,7 +14614,10 @@ export const TestMap = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + ForeignMessage.initialize(), + ForeignMessage._readMessage + ); break; } } @@ -14483,7 +14640,10 @@ export const TestMap = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + TestAllTypes.initialize(), + TestAllTypes._readMessage + ); break; } } @@ -14507,88 +14667,134 @@ export const TestMap = { * @private */ _readMessageJSON: function (msg, json) { - const mapInt32Int32 = json[\\"mapInt32Int32\\"] ?? json.map_int32_int32; + const mapInt32Int32 = json.mapInt32Int32 ?? json.map_int32_int32; if (mapInt32Int32) { - msg.mapInt32Int32 = mapInt32Int32; + for (const [key, value] of Object.entries(mapInt32Int32)) { + msg.mapInt32Int32[key] = value; + } } - const mapInt64Int64 = json[\\"mapInt64Int64\\"] ?? json.map_int64_int64; + const mapInt64Int64 = json.mapInt64Int64 ?? json.map_int64_int64; if (mapInt64Int64) { - msg.mapInt64Int64 = mapInt64Int64; + for (const [key, value] of Object.entries(mapInt64Int64)) { + msg.mapInt64Int64[key] = BigInt(value); + } } - const mapUint32Uint32 = json[\\"mapUint32Uint32\\"] ?? json.map_uint32_uint32; + const mapUint32Uint32 = json.mapUint32Uint32 ?? json.map_uint32_uint32; if (mapUint32Uint32) { - msg.mapUint32Uint32 = mapUint32Uint32; + for (const [key, value] of Object.entries(mapUint32Uint32)) { + msg.mapUint32Uint32[key] = value; + } } - const mapUint64Uint64 = json[\\"mapUint64Uint64\\"] ?? json.map_uint64_uint64; + const mapUint64Uint64 = json.mapUint64Uint64 ?? json.map_uint64_uint64; if (mapUint64Uint64) { - msg.mapUint64Uint64 = mapUint64Uint64; + for (const [key, value] of Object.entries(mapUint64Uint64)) { + msg.mapUint64Uint64[key] = BigInt(value); + } } - const mapSint32Sint32 = json[\\"mapSint32Sint32\\"] ?? json.map_sint32_sint32; + const mapSint32Sint32 = json.mapSint32Sint32 ?? json.map_sint32_sint32; if (mapSint32Sint32) { - msg.mapSint32Sint32 = mapSint32Sint32; + for (const [key, value] of Object.entries(mapSint32Sint32)) { + msg.mapSint32Sint32[key] = value; + } } - const mapSint64Sint64 = json[\\"mapSint64Sint64\\"] ?? json.map_sint64_sint64; + const mapSint64Sint64 = json.mapSint64Sint64 ?? json.map_sint64_sint64; if (mapSint64Sint64) { - msg.mapSint64Sint64 = mapSint64Sint64; + for (const [key, value] of Object.entries(mapSint64Sint64)) { + msg.mapSint64Sint64[key] = BigInt(value); + } } const mapFixed32Fixed32 = - json[\\"mapFixed32Fixed32\\"] ?? json.map_fixed32_fixed32; + json.mapFixed32Fixed32 ?? json.map_fixed32_fixed32; if (mapFixed32Fixed32) { - msg.mapFixed32Fixed32 = mapFixed32Fixed32; + for (const [key, value] of Object.entries(mapFixed32Fixed32)) { + msg.mapFixed32Fixed32[key] = value; + } } const mapFixed64Fixed64 = - json[\\"mapFixed64Fixed64\\"] ?? json.map_fixed64_fixed64; + json.mapFixed64Fixed64 ?? json.map_fixed64_fixed64; if (mapFixed64Fixed64) { - msg.mapFixed64Fixed64 = mapFixed64Fixed64; + for (const [key, value] of Object.entries(mapFixed64Fixed64)) { + msg.mapFixed64Fixed64[key] = BigInt(value); + } } const mapSfixed32Sfixed32 = - json[\\"mapSfixed32Sfixed32\\"] ?? json.map_sfixed32_sfixed32; + json.mapSfixed32Sfixed32 ?? json.map_sfixed32_sfixed32; if (mapSfixed32Sfixed32) { - msg.mapSfixed32Sfixed32 = mapSfixed32Sfixed32; + for (const [key, value] of Object.entries(mapSfixed32Sfixed32)) { + msg.mapSfixed32Sfixed32[key] = value; + } } const mapSfixed64Sfixed64 = - json[\\"mapSfixed64Sfixed64\\"] ?? json.map_sfixed64_sfixed64; + json.mapSfixed64Sfixed64 ?? json.map_sfixed64_sfixed64; if (mapSfixed64Sfixed64) { - msg.mapSfixed64Sfixed64 = mapSfixed64Sfixed64; + for (const [key, value] of Object.entries(mapSfixed64Sfixed64)) { + msg.mapSfixed64Sfixed64[key] = BigInt(value); + } } - const mapInt32Float = json[\\"mapInt32Float\\"] ?? json.map_int32_float; + const mapInt32Float = json.mapInt32Float ?? json.map_int32_float; if (mapInt32Float) { - msg.mapInt32Float = mapInt32Float; + for (const [key, value] of Object.entries(mapInt32Float)) { + msg.mapInt32Float[key] = value; + } } - const mapInt32Double = json[\\"mapInt32Double\\"] ?? json.map_int32_double; + const mapInt32Double = json.mapInt32Double ?? json.map_int32_double; if (mapInt32Double) { - msg.mapInt32Double = mapInt32Double; + for (const [key, value] of Object.entries(mapInt32Double)) { + msg.mapInt32Double[key] = value; + } } - const mapBoolBool = json[\\"mapBoolBool\\"] ?? json.map_bool_bool; + const mapBoolBool = json.mapBoolBool ?? json.map_bool_bool; if (mapBoolBool) { - msg.mapBoolBool = mapBoolBool; + for (const [key, value] of Object.entries(mapBoolBool)) { + msg.mapBoolBool[key] = value; + } } - const mapStringString = json[\\"mapStringString\\"] ?? json.map_string_string; + const mapStringString = json.mapStringString ?? json.map_string_string; if (mapStringString) { - msg.mapStringString = mapStringString; + for (const [key, value] of Object.entries(mapStringString)) { + msg.mapStringString[key] = value; + } } - const mapInt32Bytes = json[\\"mapInt32Bytes\\"] ?? json.map_int32_bytes; + const mapInt32Bytes = json.mapInt32Bytes ?? json.map_int32_bytes; if (mapInt32Bytes) { - msg.mapInt32Bytes = mapInt32Bytes; + for (const [key, value] of Object.entries(mapInt32Bytes)) { + msg.mapInt32Bytes[key] = value; + } } - const mapInt32Enum = json[\\"mapInt32Enum\\"] ?? json.map_int32_enum; + const mapInt32Enum = json.mapInt32Enum ?? json.map_int32_enum; if (mapInt32Enum) { - msg.mapInt32Enum = mapInt32Enum; + for (const [key, value] of Object.entries(mapInt32Enum)) { + msg.mapInt32Enum[key] = value; + } } const mapInt32ForeignMessage = - json[\\"mapInt32ForeignMessage\\"] ?? json.map_int32_foreign_message; + json.mapInt32ForeignMessage ?? json.map_int32_foreign_message; if (mapInt32ForeignMessage) { - msg.mapInt32ForeignMessage = mapInt32ForeignMessage; + for (const [key, value] of Object.entries(mapInt32ForeignMessage)) { + msg.mapInt32ForeignMessage[key] = ForeignMessage._readMessageJSON( + ForeignMessage.initialize(), + value + ); + } } const mapStringForeignMessage = - json[\\"mapStringForeignMessage\\"] ?? json.map_string_foreign_message; + json.mapStringForeignMessage ?? json.map_string_foreign_message; if (mapStringForeignMessage) { - msg.mapStringForeignMessage = mapStringForeignMessage; + for (const [key, value] of Object.entries(mapStringForeignMessage)) { + msg.mapStringForeignMessage[key] = ForeignMessage._readMessageJSON( + ForeignMessage.initialize(), + value + ); + } } - const mapInt32AllTypes = - json[\\"mapInt32AllTypes\\"] ?? json.map_int32_all_types; + const mapInt32AllTypes = json.mapInt32AllTypes ?? json.map_int32_all_types; if (mapInt32AllTypes) { - msg.mapInt32AllTypes = mapInt32AllTypes; + for (const [key, value] of Object.entries(mapInt32AllTypes)) { + msg.mapInt32AllTypes[key] = TestAllTypes._readMessageJSON( + TestAllTypes.initialize(), + value + ); + } } return msg; }, @@ -14657,11 +14863,11 @@ export const TestMapSubmessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.testMap) { const testMap = TestMap._writeMessageJSON(msg.testMap); if (Object.keys(testMap).length > 0) { - json[\\"testMap\\"] = testMap; + json.testMap = testMap; } } return json; @@ -14691,7 +14897,7 @@ export const TestMapSubmessage = { * @private */ _readMessageJSON: function (msg, json) { - const testMap = json[\\"testMap\\"] ?? json.test_map; + const testMap = json.testMap ?? json.test_map; if (testMap) { const m = TestMap.initialize(); TestMap._readMessageJSON(m, testMap); @@ -14753,11 +14959,13 @@ export const TestMessageMap = { */ _writeMessage: function (msg, writer) { if (msg.mapInt32Message) { - for (const key in msg.mapInt32Message) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeMessage(2, msg.mapInt32Message[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Message)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeMessage(2, value, TestAllTypes._writeMessage); + }); + } } } return writer; @@ -14767,10 +14975,16 @@ export const TestMessageMap = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.mapInt32Message) { - if (Object.keys(msg.mapInt32Message).length > 0) { - json[\\"mapInt32Message\\"] = msg.mapInt32Message; + if (msg.mapInt32Message) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32Message)) { + if (key && value) { + map[key] = TestAllTypes._writeMessageJSON(value); + json.mapInt32Message = map; + } + } } } return json; @@ -14795,7 +15009,10 @@ export const TestMessageMap = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + TestAllTypes.initialize(), + TestAllTypes._readMessage + ); break; } } @@ -14819,9 +15036,14 @@ export const TestMessageMap = { * @private */ _readMessageJSON: function (msg, json) { - const mapInt32Message = json[\\"mapInt32Message\\"] ?? json.map_int32_message; + const mapInt32Message = json.mapInt32Message ?? json.map_int32_message; if (mapInt32Message) { - msg.mapInt32Message = mapInt32Message; + for (const [key, value] of Object.entries(mapInt32Message)) { + msg.mapInt32Message[key] = TestAllTypes._readMessageJSON( + TestAllTypes.initialize(), + value + ); + } } return msg; }, @@ -14880,19 +15102,23 @@ export const TestSameTypeMap = { */ _writeMessage: function (msg, writer) { if (msg.map1) { - for (const key in msg.map1) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeInt32(2, msg.map1[key]); - }); + for (const [key, value] of Object.entries(msg.map1)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeInt32(2, value); + }); + } } } if (msg.map2) { - for (const key in msg.map2) { - writer.writeMessage(2, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeInt32(2, msg.map2[key]); - }); + for (const [key, value] of Object.entries(msg.map2)) { + if (key && value) { + writer.writeMessage(2, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeInt32(2, value); + }); + } } } return writer; @@ -14902,15 +15128,27 @@ export const TestSameTypeMap = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.map1) { - if (Object.keys(msg.map1).length > 0) { - json[\\"map1\\"] = msg.map1; + if (msg.map1) { + const map = {}; + for (const [key, value] of Object.entries(msg.map1)) { + if (key && value) { + map[key] = value; + json.map1 = map; + } + } } } if (msg.map2) { - if (Object.keys(msg.map2).length > 0) { - json[\\"map2\\"] = msg.map2; + if (msg.map2) { + const map = {}; + for (const [key, value] of Object.entries(msg.map2)) { + if (key && value) { + map[key] = value; + json.map2 = map; + } + } } } return json; @@ -14982,13 +15220,17 @@ export const TestSameTypeMap = { * @private */ _readMessageJSON: function (msg, json) { - const map1 = json[\\"map1\\"] ?? json.map1; + const map1 = json.map1 ?? json.map1; if (map1) { - msg.map1 = map1; + for (const [key, value] of Object.entries(map1)) { + msg.map1[key] = value; + } } - const map2 = json[\\"map2\\"] ?? json.map2; + const map2 = json.map2 ?? json.map2; if (map2) { - msg.map2 = map2; + for (const [key, value] of Object.entries(map2)) { + msg.map2[key] = value; + } } return msg; }, @@ -15048,11 +15290,13 @@ export const TestRequiredMessageMap = { */ _writeMessage: function (msg, writer) { if (msg.mapField) { - for (const key in msg.mapField) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeMessage(2, msg.mapField[key]); - }); + for (const [key, value] of Object.entries(msg.mapField)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeMessage(2, value, TestRequired._writeMessage); + }); + } } } return writer; @@ -15062,10 +15306,16 @@ export const TestRequiredMessageMap = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.mapField) { - if (Object.keys(msg.mapField).length > 0) { - json[\\"mapField\\"] = msg.mapField; + if (msg.mapField) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapField)) { + if (key && value) { + map[key] = TestRequired._writeMessageJSON(value); + json.mapField = map; + } + } } } return json; @@ -15090,7 +15340,10 @@ export const TestRequiredMessageMap = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + TestRequired.initialize(), + TestRequired._readMessage + ); break; } } @@ -15114,9 +15367,14 @@ export const TestRequiredMessageMap = { * @private */ _readMessageJSON: function (msg, json) { - const mapField = json[\\"mapField\\"] ?? json.map_field; + const mapField = json.mapField ?? json.map_field; if (mapField) { - msg.mapField = mapField; + for (const [key, value] of Object.entries(mapField)) { + msg.mapField[key] = TestRequired._readMessageJSON( + TestRequired.initialize(), + value + ); + } } return msg; }, @@ -15190,139 +15448,173 @@ export const TestArenaMap = { */ _writeMessage: function (msg, writer) { if (msg.mapInt32Int32) { - for (const key in msg.mapInt32Int32) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeInt32(2, msg.mapInt32Int32[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Int32)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeInt32(2, value); + }); + } } } if (msg.mapInt64Int64) { - for (const key in msg.mapInt64Int64) { - writer.writeMessage(2, {}, (_, mapWriter) => { - mapWriter.writeInt64String(1, key); - mapWriter.writeInt64String(2, msg.mapInt64Int64[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt64Int64)) { + if (key && value) { + writer.writeMessage(2, {}, (_, mapWriter) => { + mapWriter.writeInt64String(1, key); + mapWriter.writeInt64String(2, value.toString()); + }); + } } } if (msg.mapUint32Uint32) { - for (const key in msg.mapUint32Uint32) { - writer.writeMessage(3, {}, (_, mapWriter) => { - mapWriter.writeUint32(1, key); - mapWriter.writeUint32(2, msg.mapUint32Uint32[key]); - }); + for (const [key, value] of Object.entries(msg.mapUint32Uint32)) { + if (key && value) { + writer.writeMessage(3, {}, (_, mapWriter) => { + mapWriter.writeUint32(1, key); + mapWriter.writeUint32(2, value); + }); + } } } if (msg.mapUint64Uint64) { - for (const key in msg.mapUint64Uint64) { - writer.writeMessage(4, {}, (_, mapWriter) => { - mapWriter.writeUint64String(1, key); - mapWriter.writeUint64String(2, msg.mapUint64Uint64[key]); - }); + for (const [key, value] of Object.entries(msg.mapUint64Uint64)) { + if (key && value) { + writer.writeMessage(4, {}, (_, mapWriter) => { + mapWriter.writeUint64String(1, key); + mapWriter.writeUint64String(2, value.toString()); + }); + } } } if (msg.mapSint32Sint32) { - for (const key in msg.mapSint32Sint32) { - writer.writeMessage(5, {}, (_, mapWriter) => { - mapWriter.writeSint32(1, key); - mapWriter.writeSint32(2, msg.mapSint32Sint32[key]); - }); + for (const [key, value] of Object.entries(msg.mapSint32Sint32)) { + if (key && value) { + writer.writeMessage(5, {}, (_, mapWriter) => { + mapWriter.writeSint32(1, key); + mapWriter.writeSint32(2, value); + }); + } } } if (msg.mapSint64Sint64) { - for (const key in msg.mapSint64Sint64) { - writer.writeMessage(6, {}, (_, mapWriter) => { - mapWriter.writeSint64String(1, key); - mapWriter.writeSint64String(2, msg.mapSint64Sint64[key]); - }); + for (const [key, value] of Object.entries(msg.mapSint64Sint64)) { + if (key && value) { + writer.writeMessage(6, {}, (_, mapWriter) => { + mapWriter.writeSint64String(1, key); + mapWriter.writeSint64String(2, value.toString()); + }); + } } } if (msg.mapFixed32Fixed32) { - for (const key in msg.mapFixed32Fixed32) { - writer.writeMessage(7, {}, (_, mapWriter) => { - mapWriter.writeFixed32(1, key); - mapWriter.writeFixed32(2, msg.mapFixed32Fixed32[key]); - }); + for (const [key, value] of Object.entries(msg.mapFixed32Fixed32)) { + if (key && value) { + writer.writeMessage(7, {}, (_, mapWriter) => { + mapWriter.writeFixed32(1, key); + mapWriter.writeFixed32(2, value); + }); + } } } if (msg.mapFixed64Fixed64) { - for (const key in msg.mapFixed64Fixed64) { - writer.writeMessage(8, {}, (_, mapWriter) => { - mapWriter.writeFixed64String(1, key); - mapWriter.writeFixed64String(2, msg.mapFixed64Fixed64[key]); - }); + for (const [key, value] of Object.entries(msg.mapFixed64Fixed64)) { + if (key && value) { + writer.writeMessage(8, {}, (_, mapWriter) => { + mapWriter.writeFixed64String(1, key); + mapWriter.writeFixed64String(2, value.toString()); + }); + } } } if (msg.mapSfixed32Sfixed32) { - for (const key in msg.mapSfixed32Sfixed32) { - writer.writeMessage(9, {}, (_, mapWriter) => { - mapWriter.writeSfixed32(1, key); - mapWriter.writeSfixed32(2, msg.mapSfixed32Sfixed32[key]); - }); + for (const [key, value] of Object.entries(msg.mapSfixed32Sfixed32)) { + if (key && value) { + writer.writeMessage(9, {}, (_, mapWriter) => { + mapWriter.writeSfixed32(1, key); + mapWriter.writeSfixed32(2, value); + }); + } } } if (msg.mapSfixed64Sfixed64) { - for (const key in msg.mapSfixed64Sfixed64) { - writer.writeMessage(10, {}, (_, mapWriter) => { - mapWriter.writeSfixed64(1, key); - mapWriter.writeSfixed64(2, msg.mapSfixed64Sfixed64[key]); - }); + for (const [key, value] of Object.entries(msg.mapSfixed64Sfixed64)) { + if (key && value) { + writer.writeMessage(10, {}, (_, mapWriter) => { + mapWriter.writeSfixed64(1, key); + mapWriter.writeSfixed64(2, value.toString()); + }); + } } } if (msg.mapInt32Float) { - for (const key in msg.mapInt32Float) { - writer.writeMessage(11, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeFloat(2, msg.mapInt32Float[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Float)) { + if (key && value) { + writer.writeMessage(11, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeFloat(2, value); + }); + } } } if (msg.mapInt32Double) { - for (const key in msg.mapInt32Double) { - writer.writeMessage(12, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeDouble(2, msg.mapInt32Double[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Double)) { + if (key && value) { + writer.writeMessage(12, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeDouble(2, value); + }); + } } } if (msg.mapBoolBool) { - for (const key in msg.mapBoolBool) { - writer.writeMessage(13, {}, (_, mapWriter) => { - mapWriter.writeBool(1, key); - mapWriter.writeBool(2, msg.mapBoolBool[key]); - }); + for (const [key, value] of Object.entries(msg.mapBoolBool)) { + if (key && value) { + writer.writeMessage(13, {}, (_, mapWriter) => { + mapWriter.writeBool(1, key); + mapWriter.writeBool(2, value); + }); + } } } if (msg.mapStringString) { - for (const key in msg.mapStringString) { - writer.writeMessage(14, {}, (_, mapWriter) => { - mapWriter.writeString(1, key); - mapWriter.writeString(2, msg.mapStringString[key]); - }); + for (const [key, value] of Object.entries(msg.mapStringString)) { + if (key && value) { + writer.writeMessage(14, {}, (_, mapWriter) => { + mapWriter.writeString(1, key); + mapWriter.writeString(2, value); + }); + } } } if (msg.mapInt32Bytes) { - for (const key in msg.mapInt32Bytes) { - writer.writeMessage(15, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeBytes(2, msg.mapInt32Bytes[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Bytes)) { + if (key && value) { + writer.writeMessage(15, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeBytes(2, value); + }); + } } } if (msg.mapInt32Enum) { - for (const key in msg.mapInt32Enum) { - writer.writeMessage(16, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeEnum(2, msg.mapInt32Enum[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Enum)) { + if (key && value) { + writer.writeMessage(16, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeEnum(2, value); + }); + } } } if (msg.mapInt32ForeignMessage) { - for (const key in msg.mapInt32ForeignMessage) { - writer.writeMessage(17, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeMessage(2, msg.mapInt32ForeignMessage[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32ForeignMessage)) { + if (key && value) { + writer.writeMessage(17, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeMessage(2, value, ForeignMessage._writeMessage); + }); + } } } return writer; @@ -15332,90 +15624,192 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.mapInt32Int32) { - if (Object.keys(msg.mapInt32Int32).length > 0) { - json[\\"mapInt32Int32\\"] = msg.mapInt32Int32; + if (msg.mapInt32Int32) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32Int32)) { + if (key && value) { + map[key] = value; + json.mapInt32Int32 = map; + } + } } } if (msg.mapInt64Int64) { - if (Object.keys(msg.mapInt64Int64).length > 0) { - json[\\"mapInt64Int64\\"] = msg.mapInt64Int64; + if (msg.mapInt64Int64) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt64Int64)) { + if (key && value) { + map[key] = value.toString(); + json.mapInt64Int64 = map; + } + } } } if (msg.mapUint32Uint32) { - if (Object.keys(msg.mapUint32Uint32).length > 0) { - json[\\"mapUint32Uint32\\"] = msg.mapUint32Uint32; + if (msg.mapUint32Uint32) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapUint32Uint32)) { + if (key && value) { + map[key] = value; + json.mapUint32Uint32 = map; + } + } } } if (msg.mapUint64Uint64) { - if (Object.keys(msg.mapUint64Uint64).length > 0) { - json[\\"mapUint64Uint64\\"] = msg.mapUint64Uint64; + if (msg.mapUint64Uint64) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapUint64Uint64)) { + if (key && value) { + map[key] = value.toString(); + json.mapUint64Uint64 = map; + } + } } } if (msg.mapSint32Sint32) { - if (Object.keys(msg.mapSint32Sint32).length > 0) { - json[\\"mapSint32Sint32\\"] = msg.mapSint32Sint32; + if (msg.mapSint32Sint32) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapSint32Sint32)) { + if (key && value) { + map[key] = value; + json.mapSint32Sint32 = map; + } + } } } if (msg.mapSint64Sint64) { - if (Object.keys(msg.mapSint64Sint64).length > 0) { - json[\\"mapSint64Sint64\\"] = msg.mapSint64Sint64; + if (msg.mapSint64Sint64) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapSint64Sint64)) { + if (key && value) { + map[key] = value.toString(); + json.mapSint64Sint64 = map; + } + } } } if (msg.mapFixed32Fixed32) { - if (Object.keys(msg.mapFixed32Fixed32).length > 0) { - json[\\"mapFixed32Fixed32\\"] = msg.mapFixed32Fixed32; + if (msg.mapFixed32Fixed32) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapFixed32Fixed32)) { + if (key && value) { + map[key] = value; + json.mapFixed32Fixed32 = map; + } + } } } if (msg.mapFixed64Fixed64) { - if (Object.keys(msg.mapFixed64Fixed64).length > 0) { - json[\\"mapFixed64Fixed64\\"] = msg.mapFixed64Fixed64; + if (msg.mapFixed64Fixed64) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapFixed64Fixed64)) { + if (key && value) { + map[key] = value.toString(); + json.mapFixed64Fixed64 = map; + } + } } } if (msg.mapSfixed32Sfixed32) { - if (Object.keys(msg.mapSfixed32Sfixed32).length > 0) { - json[\\"mapSfixed32Sfixed32\\"] = msg.mapSfixed32Sfixed32; + if (msg.mapSfixed32Sfixed32) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapSfixed32Sfixed32)) { + if (key && value) { + map[key] = value; + json.mapSfixed32Sfixed32 = map; + } + } } } if (msg.mapSfixed64Sfixed64) { - if (Object.keys(msg.mapSfixed64Sfixed64).length > 0) { - json[\\"mapSfixed64Sfixed64\\"] = msg.mapSfixed64Sfixed64; + if (msg.mapSfixed64Sfixed64) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapSfixed64Sfixed64)) { + if (key && value) { + map[key] = value.toString(); + json.mapSfixed64Sfixed64 = map; + } + } } } if (msg.mapInt32Float) { - if (Object.keys(msg.mapInt32Float).length > 0) { - json[\\"mapInt32Float\\"] = msg.mapInt32Float; + if (msg.mapInt32Float) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32Float)) { + if (key && value) { + map[key] = value; + json.mapInt32Float = map; + } + } } } if (msg.mapInt32Double) { - if (Object.keys(msg.mapInt32Double).length > 0) { - json[\\"mapInt32Double\\"] = msg.mapInt32Double; + if (msg.mapInt32Double) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32Double)) { + if (key && value) { + map[key] = value; + json.mapInt32Double = map; + } + } } } if (msg.mapBoolBool) { - if (Object.keys(msg.mapBoolBool).length > 0) { - json[\\"mapBoolBool\\"] = msg.mapBoolBool; + if (msg.mapBoolBool) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapBoolBool)) { + if (key && value) { + map[key] = value; + json.mapBoolBool = map; + } + } } } if (msg.mapStringString) { - if (Object.keys(msg.mapStringString).length > 0) { - json[\\"mapStringString\\"] = msg.mapStringString; + if (msg.mapStringString) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapStringString)) { + if (key && value) { + map[key] = value; + json.mapStringString = map; + } + } } } if (msg.mapInt32Bytes) { - if (Object.keys(msg.mapInt32Bytes).length > 0) { - json[\\"mapInt32Bytes\\"] = msg.mapInt32Bytes; + if (msg.mapInt32Bytes) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32Bytes)) { + if (key && value) { + map[key] = value; + json.mapInt32Bytes = map; + } + } } } if (msg.mapInt32Enum) { - if (Object.keys(msg.mapInt32Enum).length > 0) { - json[\\"mapInt32Enum\\"] = msg.mapInt32Enum; + if (msg.mapInt32Enum) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32Enum)) { + if (key && value) { + map[key] = value; + json.mapInt32Enum = map; + } + } } } if (msg.mapInt32ForeignMessage) { - if (Object.keys(msg.mapInt32ForeignMessage).length > 0) { - json[\\"mapInt32ForeignMessage\\"] = msg.mapInt32ForeignMessage; + if (msg.mapInt32ForeignMessage) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32ForeignMessage)) { + if (key && value) { + map[key] = ForeignMessage._writeMessageJSON(value); + json.mapInt32ForeignMessage = map; + } + } } } return json; @@ -15454,7 +15848,7 @@ export const TestArenaMap = { case 2: { reader.readMessage(undefined, () => { let key; - let value = \\"\\"; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -15463,7 +15857,7 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readInt64String(); + value = BigInt(reader.readInt64String()); break; } } @@ -15500,7 +15894,7 @@ export const TestArenaMap = { case 4: { reader.readMessage(undefined, () => { let key; - let value = \\"\\"; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -15509,7 +15903,7 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readUint64String(); + value = BigInt(reader.readUint64String()); break; } } @@ -15546,7 +15940,7 @@ export const TestArenaMap = { case 6: { reader.readMessage(undefined, () => { let key; - let value = \\"\\"; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -15555,7 +15949,7 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readSint64(); + value = BigInt(reader.readSint64()); break; } } @@ -15592,7 +15986,7 @@ export const TestArenaMap = { case 8: { reader.readMessage(undefined, () => { let key; - let value = \\"\\"; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -15601,7 +15995,7 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readFixed64String(); + value = BigInt(reader.readFixed64String()); break; } } @@ -15638,7 +16032,7 @@ export const TestArenaMap = { case 10: { reader.readMessage(undefined, () => { let key; - let value = \\"\\"; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -15647,7 +16041,7 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readSfixed64(); + value = BigInt(reader.readSfixed64()); break; } } @@ -15808,7 +16202,10 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + ForeignMessage.initialize(), + ForeignMessage._readMessage + ); break; } } @@ -15832,78 +16229,115 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function (msg, json) { - const mapInt32Int32 = json[\\"mapInt32Int32\\"] ?? json.map_int32_int32; + const mapInt32Int32 = json.mapInt32Int32 ?? json.map_int32_int32; if (mapInt32Int32) { - msg.mapInt32Int32 = mapInt32Int32; + for (const [key, value] of Object.entries(mapInt32Int32)) { + msg.mapInt32Int32[key] = value; + } } - const mapInt64Int64 = json[\\"mapInt64Int64\\"] ?? json.map_int64_int64; + const mapInt64Int64 = json.mapInt64Int64 ?? json.map_int64_int64; if (mapInt64Int64) { - msg.mapInt64Int64 = mapInt64Int64; + for (const [key, value] of Object.entries(mapInt64Int64)) { + msg.mapInt64Int64[key] = BigInt(value); + } } - const mapUint32Uint32 = json[\\"mapUint32Uint32\\"] ?? json.map_uint32_uint32; + const mapUint32Uint32 = json.mapUint32Uint32 ?? json.map_uint32_uint32; if (mapUint32Uint32) { - msg.mapUint32Uint32 = mapUint32Uint32; + for (const [key, value] of Object.entries(mapUint32Uint32)) { + msg.mapUint32Uint32[key] = value; + } } - const mapUint64Uint64 = json[\\"mapUint64Uint64\\"] ?? json.map_uint64_uint64; + const mapUint64Uint64 = json.mapUint64Uint64 ?? json.map_uint64_uint64; if (mapUint64Uint64) { - msg.mapUint64Uint64 = mapUint64Uint64; + for (const [key, value] of Object.entries(mapUint64Uint64)) { + msg.mapUint64Uint64[key] = BigInt(value); + } } - const mapSint32Sint32 = json[\\"mapSint32Sint32\\"] ?? json.map_sint32_sint32; + const mapSint32Sint32 = json.mapSint32Sint32 ?? json.map_sint32_sint32; if (mapSint32Sint32) { - msg.mapSint32Sint32 = mapSint32Sint32; + for (const [key, value] of Object.entries(mapSint32Sint32)) { + msg.mapSint32Sint32[key] = value; + } } - const mapSint64Sint64 = json[\\"mapSint64Sint64\\"] ?? json.map_sint64_sint64; + const mapSint64Sint64 = json.mapSint64Sint64 ?? json.map_sint64_sint64; if (mapSint64Sint64) { - msg.mapSint64Sint64 = mapSint64Sint64; + for (const [key, value] of Object.entries(mapSint64Sint64)) { + msg.mapSint64Sint64[key] = BigInt(value); + } } const mapFixed32Fixed32 = - json[\\"mapFixed32Fixed32\\"] ?? json.map_fixed32_fixed32; + json.mapFixed32Fixed32 ?? json.map_fixed32_fixed32; if (mapFixed32Fixed32) { - msg.mapFixed32Fixed32 = mapFixed32Fixed32; + for (const [key, value] of Object.entries(mapFixed32Fixed32)) { + msg.mapFixed32Fixed32[key] = value; + } } const mapFixed64Fixed64 = - json[\\"mapFixed64Fixed64\\"] ?? json.map_fixed64_fixed64; + json.mapFixed64Fixed64 ?? json.map_fixed64_fixed64; if (mapFixed64Fixed64) { - msg.mapFixed64Fixed64 = mapFixed64Fixed64; + for (const [key, value] of Object.entries(mapFixed64Fixed64)) { + msg.mapFixed64Fixed64[key] = BigInt(value); + } } const mapSfixed32Sfixed32 = - json[\\"mapSfixed32Sfixed32\\"] ?? json.map_sfixed32_sfixed32; + json.mapSfixed32Sfixed32 ?? json.map_sfixed32_sfixed32; if (mapSfixed32Sfixed32) { - msg.mapSfixed32Sfixed32 = mapSfixed32Sfixed32; + for (const [key, value] of Object.entries(mapSfixed32Sfixed32)) { + msg.mapSfixed32Sfixed32[key] = value; + } } const mapSfixed64Sfixed64 = - json[\\"mapSfixed64Sfixed64\\"] ?? json.map_sfixed64_sfixed64; + json.mapSfixed64Sfixed64 ?? json.map_sfixed64_sfixed64; if (mapSfixed64Sfixed64) { - msg.mapSfixed64Sfixed64 = mapSfixed64Sfixed64; + for (const [key, value] of Object.entries(mapSfixed64Sfixed64)) { + msg.mapSfixed64Sfixed64[key] = BigInt(value); + } } - const mapInt32Float = json[\\"mapInt32Float\\"] ?? json.map_int32_float; + const mapInt32Float = json.mapInt32Float ?? json.map_int32_float; if (mapInt32Float) { - msg.mapInt32Float = mapInt32Float; + for (const [key, value] of Object.entries(mapInt32Float)) { + msg.mapInt32Float[key] = value; + } } - const mapInt32Double = json[\\"mapInt32Double\\"] ?? json.map_int32_double; + const mapInt32Double = json.mapInt32Double ?? json.map_int32_double; if (mapInt32Double) { - msg.mapInt32Double = mapInt32Double; + for (const [key, value] of Object.entries(mapInt32Double)) { + msg.mapInt32Double[key] = value; + } } - const mapBoolBool = json[\\"mapBoolBool\\"] ?? json.map_bool_bool; + const mapBoolBool = json.mapBoolBool ?? json.map_bool_bool; if (mapBoolBool) { - msg.mapBoolBool = mapBoolBool; + for (const [key, value] of Object.entries(mapBoolBool)) { + msg.mapBoolBool[key] = value; + } } - const mapStringString = json[\\"mapStringString\\"] ?? json.map_string_string; + const mapStringString = json.mapStringString ?? json.map_string_string; if (mapStringString) { - msg.mapStringString = mapStringString; + for (const [key, value] of Object.entries(mapStringString)) { + msg.mapStringString[key] = value; + } } - const mapInt32Bytes = json[\\"mapInt32Bytes\\"] ?? json.map_int32_bytes; + const mapInt32Bytes = json.mapInt32Bytes ?? json.map_int32_bytes; if (mapInt32Bytes) { - msg.mapInt32Bytes = mapInt32Bytes; + for (const [key, value] of Object.entries(mapInt32Bytes)) { + msg.mapInt32Bytes[key] = value; + } } - const mapInt32Enum = json[\\"mapInt32Enum\\"] ?? json.map_int32_enum; + const mapInt32Enum = json.mapInt32Enum ?? json.map_int32_enum; if (mapInt32Enum) { - msg.mapInt32Enum = mapInt32Enum; + for (const [key, value] of Object.entries(mapInt32Enum)) { + msg.mapInt32Enum[key] = value; + } } const mapInt32ForeignMessage = - json[\\"mapInt32ForeignMessage\\"] ?? json.map_int32_foreign_message; + json.mapInt32ForeignMessage ?? json.map_int32_foreign_message; if (mapInt32ForeignMessage) { - msg.mapInt32ForeignMessage = mapInt32ForeignMessage; + for (const [key, value] of Object.entries(mapInt32ForeignMessage)) { + msg.mapInt32ForeignMessage[key] = ForeignMessage._readMessageJSON( + ForeignMessage.initialize(), + value + ); + } } return msg; }, @@ -15965,11 +16399,13 @@ export const MessageContainingMapCalledEntry = { */ _writeMessage: function (msg, writer) { if (msg.entry) { - for (const key in msg.entry) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeInt32(2, msg.entry[key]); - }); + for (const [key, value] of Object.entries(msg.entry)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeInt32(2, value); + }); + } } } return writer; @@ -15979,10 +16415,16 @@ export const MessageContainingMapCalledEntry = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.entry) { - if (Object.keys(msg.entry).length > 0) { - json[\\"entry\\"] = msg.entry; + if (msg.entry) { + const map = {}; + for (const [key, value] of Object.entries(msg.entry)) { + if (key && value) { + map[key] = value; + json.entry = map; + } + } } } return json; @@ -16031,9 +16473,11 @@ export const MessageContainingMapCalledEntry = { * @private */ _readMessageJSON: function (msg, json) { - const entry = json[\\"entry\\"] ?? json.entry; + const entry = json.entry ?? json.entry; if (entry) { - msg.entry = entry; + for (const [key, value] of Object.entries(entry)) { + msg.entry[key] = value; + } } return msg; }, @@ -16093,11 +16537,17 @@ export const TestRecursiveMapMessage = { */ _writeMessage: function (msg, writer) { if (msg.a) { - for (const key in msg.a) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeString(1, key); - mapWriter.writeMessage(2, msg.a[key]); - }); + for (const [key, value] of Object.entries(msg.a)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeString(1, key); + mapWriter.writeMessage( + 2, + value, + TestRecursiveMapMessage._writeMessage + ); + }); + } } } return writer; @@ -16107,10 +16557,16 @@ export const TestRecursiveMapMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - if (Object.keys(msg.a).length > 0) { - json[\\"a\\"] = msg.a; + if (msg.a) { + const map = {}; + for (const [key, value] of Object.entries(msg.a)) { + if (key && value) { + map[key] = TestRecursiveMapMessage._writeMessageJSON(value); + json.a = map; + } + } } } return json; @@ -16135,7 +16591,10 @@ export const TestRecursiveMapMessage = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + TestRecursiveMapMessage.initialize(), + TestRecursiveMapMessage._readMessage + ); break; } } @@ -16159,9 +16618,14 @@ export const TestRecursiveMapMessage = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { - msg.a = a; + for (const [key, value] of Object.entries(a)) { + msg.a[key] = TestRecursiveMapMessage._readMessageJSON( + TestRecursiveMapMessage.initialize(), + value + ); + } } return msg; }, @@ -16246,15 +16710,15 @@ export const TestAllTypes = { initialize: function () { return { optionalInt32: 0, - optionalInt64: \\"\\", + optionalInt64: 0n, optionalUint32: 0, - optionalUint64: \\"\\", + optionalUint64: 0n, optionalSint32: 0, - optionalSint64: \\"\\", + optionalSint64: 0n, optionalFixed32: 0, - optionalFixed64: \\"\\", + optionalFixed64: 0n, optionalSfixed32: 0, - optionalSfixed64: \\"\\", + optionalSfixed64: 0n, optionalFloat: 0, optionalDouble: 0, optionalBool: false, @@ -16305,31 +16769,31 @@ export const TestAllTypes = { writer.writeInt32(1, msg.optionalInt32); } if (msg.optionalInt64) { - writer.writeInt64String(2, msg.optionalInt64); + writer.writeInt64String(2, msg.optionalInt64.toString()); } if (msg.optionalUint32) { writer.writeUint32(3, msg.optionalUint32); } if (msg.optionalUint64) { - writer.writeUint64String(4, msg.optionalUint64); + writer.writeUint64String(4, msg.optionalUint64.toString()); } if (msg.optionalSint32) { writer.writeSint32(5, msg.optionalSint32); } if (msg.optionalSint64) { - writer.writeSint64String(6, msg.optionalSint64); + writer.writeSint64String(6, msg.optionalSint64.toString()); } if (msg.optionalFixed32) { writer.writeFixed32(7, msg.optionalFixed32); } if (msg.optionalFixed64) { - writer.writeFixed64String(8, msg.optionalFixed64); + writer.writeFixed64String(8, msg.optionalFixed64.toString()); } if (msg.optionalSfixed32) { writer.writeSfixed32(9, msg.optionalSfixed32); } if (msg.optionalSfixed64) { - writer.writeSfixed64(10, msg.optionalSfixed64); + writer.writeSfixed64(10, msg.optionalSfixed64.toString()); } if (msg.optionalFloat) { writer.writeFloat(11, msg.optionalFloat); @@ -16404,31 +16868,31 @@ export const TestAllTypes = { writer.writeRepeatedInt32(31, msg.repeatedInt32); } if (msg.repeatedInt64?.length) { - writer.writeRepeatedInt64String(32, msg.repeatedInt64); + writer.writeRepeatedInt64String(32, msg.repeatedInt64.toString()); } if (msg.repeatedUint32?.length) { writer.writeRepeatedUint32(33, msg.repeatedUint32); } if (msg.repeatedUint64?.length) { - writer.writeRepeatedUint64String(34, msg.repeatedUint64); + writer.writeRepeatedUint64String(34, msg.repeatedUint64.toString()); } if (msg.repeatedSint32?.length) { writer.writeRepeatedSint32(35, msg.repeatedSint32); } if (msg.repeatedSint64?.length) { - writer.writeRepeatedSint64String(36, msg.repeatedSint64); + writer.writeRepeatedSint64String(36, msg.repeatedSint64.toString()); } if (msg.repeatedFixed32?.length) { writer.writeRepeatedFixed32(37, msg.repeatedFixed32); } if (msg.repeatedFixed64?.length) { - writer.writeRepeatedFixed64String(38, msg.repeatedFixed64); + writer.writeRepeatedFixed64String(38, msg.repeatedFixed64.toString()); } if (msg.repeatedSfixed32?.length) { writer.writeRepeatedSfixed32(39, msg.repeatedSfixed32); } if (msg.repeatedSfixed64?.length) { - writer.writeRepeatedSfixed64(40, msg.repeatedSfixed64); + writer.writeRepeatedSfixed64(40, msg.repeatedSfixed64.toString()); } if (msg.repeatedFloat?.length) { writer.writeRepeatedFloat(41, msg.repeatedFloat); @@ -16508,57 +16972,57 @@ export const TestAllTypes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.optionalInt32) { - json[\\"optionalInt32\\"] = msg.optionalInt32; + json.optionalInt32 = msg.optionalInt32; } if (msg.optionalInt64) { - json[\\"optionalInt64\\"] = msg.optionalInt64; + json.optionalInt64 = msg.optionalInt64.toString(); } if (msg.optionalUint32) { - json[\\"optionalUint32\\"] = msg.optionalUint32; + json.optionalUint32 = msg.optionalUint32; } if (msg.optionalUint64) { - json[\\"optionalUint64\\"] = msg.optionalUint64; + json.optionalUint64 = msg.optionalUint64.toString(); } if (msg.optionalSint32) { - json[\\"optionalSint32\\"] = msg.optionalSint32; + json.optionalSint32 = msg.optionalSint32; } if (msg.optionalSint64) { - json[\\"optionalSint64\\"] = msg.optionalSint64; + json.optionalSint64 = msg.optionalSint64.toString(); } if (msg.optionalFixed32) { - json[\\"optionalFixed32\\"] = msg.optionalFixed32; + json.optionalFixed32 = msg.optionalFixed32; } if (msg.optionalFixed64) { - json[\\"optionalFixed64\\"] = msg.optionalFixed64; + json.optionalFixed64 = msg.optionalFixed64.toString(); } if (msg.optionalSfixed32) { - json[\\"optionalSfixed32\\"] = msg.optionalSfixed32; + json.optionalSfixed32 = msg.optionalSfixed32; } if (msg.optionalSfixed64) { - json[\\"optionalSfixed64\\"] = msg.optionalSfixed64; + json.optionalSfixed64 = msg.optionalSfixed64.toString(); } if (msg.optionalFloat) { - json[\\"optionalFloat\\"] = msg.optionalFloat; + json.optionalFloat = msg.optionalFloat; } if (msg.optionalDouble) { - json[\\"optionalDouble\\"] = msg.optionalDouble; + json.optionalDouble = msg.optionalDouble; } if (msg.optionalBool) { - json[\\"optionalBool\\"] = msg.optionalBool; + json.optionalBool = msg.optionalBool; } if (msg.optionalString) { - json[\\"optionalString\\"] = msg.optionalString; + json.optionalString = msg.optionalString; } if (msg.optionalBytes) { - json[\\"optionalBytes\\"] = msg.optionalBytes; + json.optionalBytes = msg.optionalBytes; } if (msg.optionalNestedMessage) { const optionalNestedMessage = TestAllTypes.NestedMessage._writeMessageJSON(msg.optionalNestedMessage); if (Object.keys(optionalNestedMessage).length > 0) { - json[\\"optionalNestedMessage\\"] = optionalNestedMessage; + json.optionalNestedMessage = optionalNestedMessage; } } if (msg.optionalForeignMessage) { @@ -16566,7 +17030,7 @@ export const TestAllTypes = { msg.optionalForeignMessage ); if (Object.keys(optionalForeignMessage).length > 0) { - json[\\"optionalForeignMessage\\"] = optionalForeignMessage; + json.optionalForeignMessage = optionalForeignMessage; } } if (msg.optionalImportMessage) { @@ -16574,27 +17038,27 @@ export const TestAllTypes = { msg.optionalImportMessage ); if (Object.keys(optionalImportMessage).length > 0) { - json[\\"optionalImportMessage\\"] = optionalImportMessage; + json.optionalImportMessage = optionalImportMessage; } } if (msg.optionalNestedEnum) { - json[\\"optionalNestedEnum\\"] = msg.optionalNestedEnum; + json.optionalNestedEnum = msg.optionalNestedEnum; } if (msg.optionalForeignEnum) { - json[\\"optionalForeignEnum\\"] = msg.optionalForeignEnum; + json.optionalForeignEnum = msg.optionalForeignEnum; } if (msg.optionalStringPiece) { - json[\\"optionalStringPiece\\"] = msg.optionalStringPiece; + json.optionalStringPiece = msg.optionalStringPiece; } if (msg.optionalCord) { - json[\\"optionalCord\\"] = msg.optionalCord; + json.optionalCord = msg.optionalCord; } if (msg.optionalPublicImportMessage) { const optionalPublicImportMessage = PublicImportMessage._writeMessageJSON( msg.optionalPublicImportMessage ); if (Object.keys(optionalPublicImportMessage).length > 0) { - json[\\"optionalPublicImportMessage\\"] = optionalPublicImportMessage; + json.optionalPublicImportMessage = optionalPublicImportMessage; } } if (msg.optionalLazyMessage) { @@ -16602,7 +17066,7 @@ export const TestAllTypes = { msg.optionalLazyMessage ); if (Object.keys(optionalLazyMessage).length > 0) { - json[\\"optionalLazyMessage\\"] = optionalLazyMessage; + json.optionalLazyMessage = optionalLazyMessage; } } if (msg.optionalLazyImportMessage) { @@ -16610,102 +17074,102 @@ export const TestAllTypes = { msg.optionalLazyImportMessage ); if (Object.keys(optionalLazyImportMessage).length > 0) { - json[\\"optionalLazyImportMessage\\"] = optionalLazyImportMessage; + json.optionalLazyImportMessage = optionalLazyImportMessage; } } if (msg.repeatedInt32?.length) { - json[\\"repeatedInt32\\"] = msg.repeatedInt32; + json.repeatedInt32 = msg.repeatedInt32; } if (msg.repeatedInt64?.length) { - json[\\"repeatedInt64\\"] = msg.repeatedInt64; + json.repeatedInt64 = msg.repeatedInt64.map((x) => x.toString()); } if (msg.repeatedUint32?.length) { - json[\\"repeatedUint32\\"] = msg.repeatedUint32; + json.repeatedUint32 = msg.repeatedUint32; } if (msg.repeatedUint64?.length) { - json[\\"repeatedUint64\\"] = msg.repeatedUint64; + json.repeatedUint64 = msg.repeatedUint64.map((x) => x.toString()); } if (msg.repeatedSint32?.length) { - json[\\"repeatedSint32\\"] = msg.repeatedSint32; + json.repeatedSint32 = msg.repeatedSint32; } if (msg.repeatedSint64?.length) { - json[\\"repeatedSint64\\"] = msg.repeatedSint64; + json.repeatedSint64 = msg.repeatedSint64.map((x) => x.toString()); } if (msg.repeatedFixed32?.length) { - json[\\"repeatedFixed32\\"] = msg.repeatedFixed32; + json.repeatedFixed32 = msg.repeatedFixed32; } if (msg.repeatedFixed64?.length) { - json[\\"repeatedFixed64\\"] = msg.repeatedFixed64; + json.repeatedFixed64 = msg.repeatedFixed64.map((x) => x.toString()); } if (msg.repeatedSfixed32?.length) { - json[\\"repeatedSfixed32\\"] = msg.repeatedSfixed32; + json.repeatedSfixed32 = msg.repeatedSfixed32; } if (msg.repeatedSfixed64?.length) { - json[\\"repeatedSfixed64\\"] = msg.repeatedSfixed64; + json.repeatedSfixed64 = msg.repeatedSfixed64.map((x) => x.toString()); } if (msg.repeatedFloat?.length) { - json[\\"repeatedFloat\\"] = msg.repeatedFloat; + json.repeatedFloat = msg.repeatedFloat; } if (msg.repeatedDouble?.length) { - json[\\"repeatedDouble\\"] = msg.repeatedDouble; + json.repeatedDouble = msg.repeatedDouble; } if (msg.repeatedBool?.length) { - json[\\"repeatedBool\\"] = msg.repeatedBool; + json.repeatedBool = msg.repeatedBool; } if (msg.repeatedString?.length) { - json[\\"repeatedString\\"] = msg.repeatedString; + json.repeatedString = msg.repeatedString; } if (msg.repeatedBytes?.length) { - json[\\"repeatedBytes\\"] = msg.repeatedBytes; + json.repeatedBytes = msg.repeatedBytes; } if (msg.repeatedNestedMessage?.length) { - json[\\"repeatedNestedMessage\\"] = msg.repeatedNestedMessage.map( + json.repeatedNestedMessage = msg.repeatedNestedMessage.map( TestAllTypes.NestedMessage._writeMessageJSON ); } if (msg.repeatedForeignMessage?.length) { - json[\\"repeatedForeignMessage\\"] = msg.repeatedForeignMessage.map( + json.repeatedForeignMessage = msg.repeatedForeignMessage.map( ForeignMessage._writeMessageJSON ); } if (msg.repeatedImportMessage?.length) { - json[\\"repeatedImportMessage\\"] = msg.repeatedImportMessage.map( + json.repeatedImportMessage = msg.repeatedImportMessage.map( ImportMessage._writeMessageJSON ); } if (msg.repeatedNestedEnum?.length) { - json[\\"repeatedNestedEnum\\"] = msg.repeatedNestedEnum; + json.repeatedNestedEnum = msg.repeatedNestedEnum; } if (msg.repeatedForeignEnum?.length) { - json[\\"repeatedForeignEnum\\"] = msg.repeatedForeignEnum; + json.repeatedForeignEnum = msg.repeatedForeignEnum; } if (msg.repeatedStringPiece?.length) { - json[\\"repeatedStringPiece\\"] = msg.repeatedStringPiece; + json.repeatedStringPiece = msg.repeatedStringPiece; } if (msg.repeatedCord?.length) { - json[\\"repeatedCord\\"] = msg.repeatedCord; + json.repeatedCord = msg.repeatedCord; } if (msg.repeatedLazyMessage?.length) { - json[\\"repeatedLazyMessage\\"] = msg.repeatedLazyMessage.map( + json.repeatedLazyMessage = msg.repeatedLazyMessage.map( TestAllTypes.NestedMessage._writeMessageJSON ); } if (msg.oneofUint32 != undefined) { - json[\\"oneofUint32\\"] = msg.oneofUint32; + json.oneofUint32 = msg.oneofUint32; } if (msg.oneofNestedMessage != undefined) { const oneofNestedMessage = TestAllTypes.NestedMessage._writeMessageJSON( msg.oneofNestedMessage ); if (Object.keys(oneofNestedMessage).length > 0) { - json[\\"oneofNestedMessage\\"] = oneofNestedMessage; + json.oneofNestedMessage = oneofNestedMessage; } } if (msg.oneofString != undefined) { - json[\\"oneofString\\"] = msg.oneofString; + json.oneofString = msg.oneofString; } if (msg.oneofBytes != undefined) { - json[\\"oneofBytes\\"] = msg.oneofBytes; + json.oneofBytes = msg.oneofBytes; } return json; }, @@ -16722,7 +17186,7 @@ export const TestAllTypes = { break; } case 2: { - msg.optionalInt64 = reader.readInt64String(); + msg.optionalInt64 = BigInt(reader.readInt64String()); break; } case 3: { @@ -16730,7 +17194,7 @@ export const TestAllTypes = { break; } case 4: { - msg.optionalUint64 = reader.readUint64String(); + msg.optionalUint64 = BigInt(reader.readUint64String()); break; } case 5: { @@ -16738,7 +17202,7 @@ export const TestAllTypes = { break; } case 6: { - msg.optionalSint64 = reader.readSint64(); + msg.optionalSint64 = BigInt(reader.readSint64()); break; } case 7: { @@ -16746,7 +17210,7 @@ export const TestAllTypes = { break; } case 8: { - msg.optionalFixed64 = reader.readFixed64String(); + msg.optionalFixed64 = BigInt(reader.readFixed64String()); break; } case 9: { @@ -16754,7 +17218,7 @@ export const TestAllTypes = { break; } case 10: { - msg.optionalSfixed64 = reader.readSfixed64(); + msg.optionalSfixed64 = BigInt(reader.readSfixed64()); break; } case 11: { @@ -16840,7 +17304,7 @@ export const TestAllTypes = { break; } case 32: { - msg.repeatedInt64.push(reader.readInt64String()); + msg.repeatedInt64 = reader.readInt64String().map(BigInt); break; } case 33: { @@ -16848,7 +17312,7 @@ export const TestAllTypes = { break; } case 34: { - msg.repeatedUint64.push(reader.readUint64String()); + msg.repeatedUint64 = reader.readUint64String().map(BigInt); break; } case 35: { @@ -16856,7 +17320,7 @@ export const TestAllTypes = { break; } case 36: { - msg.repeatedSint64.push(reader.readSint64()); + msg.repeatedSint64 = reader.readSint64().map(BigInt); break; } case 37: { @@ -16864,7 +17328,7 @@ export const TestAllTypes = { break; } case 38: { - msg.repeatedFixed64.push(reader.readFixed64String()); + msg.repeatedFixed64 = reader.readFixed64String().map(BigInt); break; } case 39: { @@ -16872,7 +17336,7 @@ export const TestAllTypes = { break; } case 40: { - msg.repeatedSfixed64.push(reader.readSfixed64()); + msg.repeatedSfixed64 = reader.readSfixed64().map(BigInt); break; } case 41: { @@ -16967,190 +17431,189 @@ export const TestAllTypes = { * @private */ _readMessageJSON: function (msg, json) { - const optionalInt32 = json[\\"optionalInt32\\"] ?? json.optional_int32; + const optionalInt32 = json.optionalInt32 ?? json.optional_int32; if (optionalInt32) { msg.optionalInt32 = optionalInt32; } - const optionalInt64 = json[\\"optionalInt64\\"] ?? json.optional_int64; + const optionalInt64 = json.optionalInt64 ?? json.optional_int64; if (optionalInt64) { - msg.optionalInt64 = optionalInt64; + msg.optionalInt64 = BigInt(optionalInt64); } - const optionalUint32 = json[\\"optionalUint32\\"] ?? json.optional_uint32; + const optionalUint32 = json.optionalUint32 ?? json.optional_uint32; if (optionalUint32) { msg.optionalUint32 = optionalUint32; } - const optionalUint64 = json[\\"optionalUint64\\"] ?? json.optional_uint64; + const optionalUint64 = json.optionalUint64 ?? json.optional_uint64; if (optionalUint64) { - msg.optionalUint64 = optionalUint64; + msg.optionalUint64 = BigInt(optionalUint64); } - const optionalSint32 = json[\\"optionalSint32\\"] ?? json.optional_sint32; + const optionalSint32 = json.optionalSint32 ?? json.optional_sint32; if (optionalSint32) { msg.optionalSint32 = optionalSint32; } - const optionalSint64 = json[\\"optionalSint64\\"] ?? json.optional_sint64; + const optionalSint64 = json.optionalSint64 ?? json.optional_sint64; if (optionalSint64) { - msg.optionalSint64 = optionalSint64; + msg.optionalSint64 = BigInt(optionalSint64); } - const optionalFixed32 = json[\\"optionalFixed32\\"] ?? json.optional_fixed32; + const optionalFixed32 = json.optionalFixed32 ?? json.optional_fixed32; if (optionalFixed32) { msg.optionalFixed32 = optionalFixed32; } - const optionalFixed64 = json[\\"optionalFixed64\\"] ?? json.optional_fixed64; + const optionalFixed64 = json.optionalFixed64 ?? json.optional_fixed64; if (optionalFixed64) { - msg.optionalFixed64 = optionalFixed64; + msg.optionalFixed64 = BigInt(optionalFixed64); } - const optionalSfixed32 = json[\\"optionalSfixed32\\"] ?? json.optional_sfixed32; + const optionalSfixed32 = json.optionalSfixed32 ?? json.optional_sfixed32; if (optionalSfixed32) { msg.optionalSfixed32 = optionalSfixed32; } - const optionalSfixed64 = json[\\"optionalSfixed64\\"] ?? json.optional_sfixed64; + const optionalSfixed64 = json.optionalSfixed64 ?? json.optional_sfixed64; if (optionalSfixed64) { - msg.optionalSfixed64 = optionalSfixed64; + msg.optionalSfixed64 = BigInt(optionalSfixed64); } - const optionalFloat = json[\\"optionalFloat\\"] ?? json.optional_float; + const optionalFloat = json.optionalFloat ?? json.optional_float; if (optionalFloat) { msg.optionalFloat = optionalFloat; } - const optionalDouble = json[\\"optionalDouble\\"] ?? json.optional_double; + const optionalDouble = json.optionalDouble ?? json.optional_double; if (optionalDouble) { msg.optionalDouble = optionalDouble; } - const optionalBool = json[\\"optionalBool\\"] ?? json.optional_bool; + const optionalBool = json.optionalBool ?? json.optional_bool; if (optionalBool) { msg.optionalBool = optionalBool; } - const optionalString = json[\\"optionalString\\"] ?? json.optional_string; + const optionalString = json.optionalString ?? json.optional_string; if (optionalString) { msg.optionalString = optionalString; } - const optionalBytes = json[\\"optionalBytes\\"] ?? json.optional_bytes; + const optionalBytes = json.optionalBytes ?? json.optional_bytes; if (optionalBytes) { msg.optionalBytes = optionalBytes; } const optionalNestedMessage = - json[\\"optionalNestedMessage\\"] ?? json.optional_nested_message; + json.optionalNestedMessage ?? json.optional_nested_message; if (optionalNestedMessage) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, optionalNestedMessage); msg.optionalNestedMessage = m; } const optionalForeignMessage = - json[\\"optionalForeignMessage\\"] ?? json.optional_foreign_message; + json.optionalForeignMessage ?? json.optional_foreign_message; if (optionalForeignMessage) { const m = ForeignMessage.initialize(); ForeignMessage._readMessageJSON(m, optionalForeignMessage); msg.optionalForeignMessage = m; } const optionalImportMessage = - json[\\"optionalImportMessage\\"] ?? json.optional_import_message; + json.optionalImportMessage ?? json.optional_import_message; if (optionalImportMessage) { const m = ImportMessage.initialize(); ImportMessage._readMessageJSON(m, optionalImportMessage); msg.optionalImportMessage = m; } const optionalNestedEnum = - json[\\"optionalNestedEnum\\"] ?? json.optional_nested_enum; + json.optionalNestedEnum ?? json.optional_nested_enum; if (optionalNestedEnum) { msg.optionalNestedEnum = optionalNestedEnum; } const optionalForeignEnum = - json[\\"optionalForeignEnum\\"] ?? json.optional_foreign_enum; + json.optionalForeignEnum ?? json.optional_foreign_enum; if (optionalForeignEnum) { msg.optionalForeignEnum = optionalForeignEnum; } const optionalStringPiece = - json[\\"optionalStringPiece\\"] ?? json.optional_string_piece; + json.optionalStringPiece ?? json.optional_string_piece; if (optionalStringPiece) { msg.optionalStringPiece = optionalStringPiece; } - const optionalCord = json[\\"optionalCord\\"] ?? json.optional_cord; + const optionalCord = json.optionalCord ?? json.optional_cord; if (optionalCord) { msg.optionalCord = optionalCord; } const optionalPublicImportMessage = - json[\\"optionalPublicImportMessage\\"] ?? - json.optional_public_import_message; + json.optionalPublicImportMessage ?? json.optional_public_import_message; if (optionalPublicImportMessage) { const m = PublicImportMessage.initialize(); PublicImportMessage._readMessageJSON(m, optionalPublicImportMessage); msg.optionalPublicImportMessage = m; } const optionalLazyMessage = - json[\\"optionalLazyMessage\\"] ?? json.optional_lazy_message; + json.optionalLazyMessage ?? json.optional_lazy_message; if (optionalLazyMessage) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, optionalLazyMessage); msg.optionalLazyMessage = m; } const optionalLazyImportMessage = - json[\\"optionalLazyImportMessage\\"] ?? json.optional_lazy_import_message; + json.optionalLazyImportMessage ?? json.optional_lazy_import_message; if (optionalLazyImportMessage) { const m = ImportMessage.initialize(); ImportMessage._readMessageJSON(m, optionalLazyImportMessage); msg.optionalLazyImportMessage = m; } - const repeatedInt32 = json[\\"repeatedInt32\\"] ?? json.repeated_int32; + const repeatedInt32 = json.repeatedInt32 ?? json.repeated_int32; if (repeatedInt32) { msg.repeatedInt32 = repeatedInt32; } - const repeatedInt64 = json[\\"repeatedInt64\\"] ?? json.repeated_int64; + const repeatedInt64 = json.repeatedInt64 ?? json.repeated_int64; if (repeatedInt64) { - msg.repeatedInt64 = repeatedInt64; + msg.repeatedInt64 = repeatedInt64.map(BigInt); } - const repeatedUint32 = json[\\"repeatedUint32\\"] ?? json.repeated_uint32; + const repeatedUint32 = json.repeatedUint32 ?? json.repeated_uint32; if (repeatedUint32) { msg.repeatedUint32 = repeatedUint32; } - const repeatedUint64 = json[\\"repeatedUint64\\"] ?? json.repeated_uint64; + const repeatedUint64 = json.repeatedUint64 ?? json.repeated_uint64; if (repeatedUint64) { - msg.repeatedUint64 = repeatedUint64; + msg.repeatedUint64 = repeatedUint64.map(BigInt); } - const repeatedSint32 = json[\\"repeatedSint32\\"] ?? json.repeated_sint32; + const repeatedSint32 = json.repeatedSint32 ?? json.repeated_sint32; if (repeatedSint32) { msg.repeatedSint32 = repeatedSint32; } - const repeatedSint64 = json[\\"repeatedSint64\\"] ?? json.repeated_sint64; + const repeatedSint64 = json.repeatedSint64 ?? json.repeated_sint64; if (repeatedSint64) { - msg.repeatedSint64 = repeatedSint64; + msg.repeatedSint64 = repeatedSint64.map(BigInt); } - const repeatedFixed32 = json[\\"repeatedFixed32\\"] ?? json.repeated_fixed32; + const repeatedFixed32 = json.repeatedFixed32 ?? json.repeated_fixed32; if (repeatedFixed32) { msg.repeatedFixed32 = repeatedFixed32; } - const repeatedFixed64 = json[\\"repeatedFixed64\\"] ?? json.repeated_fixed64; + const repeatedFixed64 = json.repeatedFixed64 ?? json.repeated_fixed64; if (repeatedFixed64) { - msg.repeatedFixed64 = repeatedFixed64; + msg.repeatedFixed64 = repeatedFixed64.map(BigInt); } - const repeatedSfixed32 = json[\\"repeatedSfixed32\\"] ?? json.repeated_sfixed32; + const repeatedSfixed32 = json.repeatedSfixed32 ?? json.repeated_sfixed32; if (repeatedSfixed32) { msg.repeatedSfixed32 = repeatedSfixed32; } - const repeatedSfixed64 = json[\\"repeatedSfixed64\\"] ?? json.repeated_sfixed64; + const repeatedSfixed64 = json.repeatedSfixed64 ?? json.repeated_sfixed64; if (repeatedSfixed64) { - msg.repeatedSfixed64 = repeatedSfixed64; + msg.repeatedSfixed64 = repeatedSfixed64.map(BigInt); } - const repeatedFloat = json[\\"repeatedFloat\\"] ?? json.repeated_float; + const repeatedFloat = json.repeatedFloat ?? json.repeated_float; if (repeatedFloat) { msg.repeatedFloat = repeatedFloat; } - const repeatedDouble = json[\\"repeatedDouble\\"] ?? json.repeated_double; + const repeatedDouble = json.repeatedDouble ?? json.repeated_double; if (repeatedDouble) { msg.repeatedDouble = repeatedDouble; } - const repeatedBool = json[\\"repeatedBool\\"] ?? json.repeated_bool; + const repeatedBool = json.repeatedBool ?? json.repeated_bool; if (repeatedBool) { msg.repeatedBool = repeatedBool; } - const repeatedString = json[\\"repeatedString\\"] ?? json.repeated_string; + const repeatedString = json.repeatedString ?? json.repeated_string; if (repeatedString) { msg.repeatedString = repeatedString; } - const repeatedBytes = json[\\"repeatedBytes\\"] ?? json.repeated_bytes; + const repeatedBytes = json.repeatedBytes ?? json.repeated_bytes; if (repeatedBytes) { msg.repeatedBytes = repeatedBytes; } const repeatedNestedMessage = - json[\\"repeatedNestedMessage\\"] ?? json.repeated_nested_message; + json.repeatedNestedMessage ?? json.repeated_nested_message; if (repeatedNestedMessage) { for (const item of repeatedNestedMessage) { const m = TestAllTypes.NestedMessage.initialize(); @@ -17159,7 +17622,7 @@ export const TestAllTypes = { } } const repeatedForeignMessage = - json[\\"repeatedForeignMessage\\"] ?? json.repeated_foreign_message; + json.repeatedForeignMessage ?? json.repeated_foreign_message; if (repeatedForeignMessage) { for (const item of repeatedForeignMessage) { const m = ForeignMessage.initialize(); @@ -17168,7 +17631,7 @@ export const TestAllTypes = { } } const repeatedImportMessage = - json[\\"repeatedImportMessage\\"] ?? json.repeated_import_message; + json.repeatedImportMessage ?? json.repeated_import_message; if (repeatedImportMessage) { for (const item of repeatedImportMessage) { const m = ImportMessage.initialize(); @@ -17177,26 +17640,26 @@ export const TestAllTypes = { } } const repeatedNestedEnum = - json[\\"repeatedNestedEnum\\"] ?? json.repeated_nested_enum; + json.repeatedNestedEnum ?? json.repeated_nested_enum; if (repeatedNestedEnum) { msg.repeatedNestedEnum = repeatedNestedEnum; } const repeatedForeignEnum = - json[\\"repeatedForeignEnum\\"] ?? json.repeated_foreign_enum; + json.repeatedForeignEnum ?? json.repeated_foreign_enum; if (repeatedForeignEnum) { msg.repeatedForeignEnum = repeatedForeignEnum; } const repeatedStringPiece = - json[\\"repeatedStringPiece\\"] ?? json.repeated_string_piece; + json.repeatedStringPiece ?? json.repeated_string_piece; if (repeatedStringPiece) { msg.repeatedStringPiece = repeatedStringPiece; } - const repeatedCord = json[\\"repeatedCord\\"] ?? json.repeated_cord; + const repeatedCord = json.repeatedCord ?? json.repeated_cord; if (repeatedCord) { msg.repeatedCord = repeatedCord; } const repeatedLazyMessage = - json[\\"repeatedLazyMessage\\"] ?? json.repeated_lazy_message; + json.repeatedLazyMessage ?? json.repeated_lazy_message; if (repeatedLazyMessage) { for (const item of repeatedLazyMessage) { const m = TestAllTypes.NestedMessage.initialize(); @@ -17204,22 +17667,22 @@ export const TestAllTypes = { msg.repeatedLazyMessage.push(m); } } - const oneofUint32 = json[\\"oneofUint32\\"] ?? json.oneof_uint32; + const oneofUint32 = json.oneofUint32 ?? json.oneof_uint32; if (oneofUint32) { msg.oneofUint32 = oneofUint32; } const oneofNestedMessage = - json[\\"oneofNestedMessage\\"] ?? json.oneof_nested_message; + json.oneofNestedMessage ?? json.oneof_nested_message; if (oneofNestedMessage) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, oneofNestedMessage); msg.oneofNestedMessage = m; } - const oneofString = json[\\"oneofString\\"] ?? json.oneof_string; + const oneofString = json.oneofString ?? json.oneof_string; if (oneofString) { msg.oneofString = oneofString; } - const oneofBytes = json[\\"oneofBytes\\"] ?? json.oneof_bytes; + const oneofBytes = json.oneofBytes ?? json.oneof_bytes; if (oneofBytes) { msg.oneofBytes = oneofBytes; } @@ -17291,9 +17754,9 @@ export const TestAllTypes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.bb) { - json[\\"bb\\"] = msg.bb; + json.bb = msg.bb; } return json; }, @@ -17322,7 +17785,7 @@ export const TestAllTypes = { * @private */ _readMessageJSON: function (msg, json) { - const bb = json[\\"bb\\"] ?? json.bb; + const bb = json.bb ?? json.bb; if (bb) { msg.bb = bb; } @@ -17399,31 +17862,31 @@ export const TestPackedTypes = { writer.writeRepeatedInt32(90, msg.packedInt32); } if (msg.packedInt64?.length) { - writer.writeRepeatedInt64String(91, msg.packedInt64); + writer.writeRepeatedInt64String(91, msg.packedInt64.toString()); } if (msg.packedUint32?.length) { writer.writeRepeatedUint32(92, msg.packedUint32); } if (msg.packedUint64?.length) { - writer.writeRepeatedUint64String(93, msg.packedUint64); + writer.writeRepeatedUint64String(93, msg.packedUint64.toString()); } if (msg.packedSint32?.length) { writer.writeRepeatedSint32(94, msg.packedSint32); } if (msg.packedSint64?.length) { - writer.writeRepeatedSint64String(95, msg.packedSint64); + writer.writeRepeatedSint64String(95, msg.packedSint64.toString()); } if (msg.packedFixed32?.length) { writer.writeRepeatedFixed32(96, msg.packedFixed32); } if (msg.packedFixed64?.length) { - writer.writeRepeatedFixed64String(97, msg.packedFixed64); + writer.writeRepeatedFixed64String(97, msg.packedFixed64.toString()); } if (msg.packedSfixed32?.length) { writer.writeRepeatedSfixed32(98, msg.packedSfixed32); } if (msg.packedSfixed64?.length) { - writer.writeRepeatedSfixed64(99, msg.packedSfixed64); + writer.writeRepeatedSfixed64(99, msg.packedSfixed64.toString()); } if (msg.packedFloat?.length) { writer.writeRepeatedFloat(100, msg.packedFloat); @@ -17444,48 +17907,48 @@ export const TestPackedTypes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.packedInt32?.length) { - json[\\"packedInt32\\"] = msg.packedInt32; + json.packedInt32 = msg.packedInt32; } if (msg.packedInt64?.length) { - json[\\"packedInt64\\"] = msg.packedInt64; + json.packedInt64 = msg.packedInt64.map((x) => x.toString()); } if (msg.packedUint32?.length) { - json[\\"packedUint32\\"] = msg.packedUint32; + json.packedUint32 = msg.packedUint32; } if (msg.packedUint64?.length) { - json[\\"packedUint64\\"] = msg.packedUint64; + json.packedUint64 = msg.packedUint64.map((x) => x.toString()); } if (msg.packedSint32?.length) { - json[\\"packedSint32\\"] = msg.packedSint32; + json.packedSint32 = msg.packedSint32; } if (msg.packedSint64?.length) { - json[\\"packedSint64\\"] = msg.packedSint64; + json.packedSint64 = msg.packedSint64.map((x) => x.toString()); } if (msg.packedFixed32?.length) { - json[\\"packedFixed32\\"] = msg.packedFixed32; + json.packedFixed32 = msg.packedFixed32; } if (msg.packedFixed64?.length) { - json[\\"packedFixed64\\"] = msg.packedFixed64; + json.packedFixed64 = msg.packedFixed64.map((x) => x.toString()); } if (msg.packedSfixed32?.length) { - json[\\"packedSfixed32\\"] = msg.packedSfixed32; + json.packedSfixed32 = msg.packedSfixed32; } if (msg.packedSfixed64?.length) { - json[\\"packedSfixed64\\"] = msg.packedSfixed64; + json.packedSfixed64 = msg.packedSfixed64.map((x) => x.toString()); } if (msg.packedFloat?.length) { - json[\\"packedFloat\\"] = msg.packedFloat; + json.packedFloat = msg.packedFloat; } if (msg.packedDouble?.length) { - json[\\"packedDouble\\"] = msg.packedDouble; + json.packedDouble = msg.packedDouble; } if (msg.packedBool?.length) { - json[\\"packedBool\\"] = msg.packedBool; + json.packedBool = msg.packedBool; } if (msg.packedEnum?.length) { - json[\\"packedEnum\\"] = msg.packedEnum; + json.packedEnum = msg.packedEnum; } return json; }, @@ -17502,7 +17965,7 @@ export const TestPackedTypes = { break; } case 91: { - msg.packedInt64.push(reader.readInt64String()); + msg.packedInt64 = reader.readInt64String().map(BigInt); break; } case 92: { @@ -17510,7 +17973,7 @@ export const TestPackedTypes = { break; } case 93: { - msg.packedUint64.push(reader.readUint64String()); + msg.packedUint64 = reader.readUint64String().map(BigInt); break; } case 94: { @@ -17518,7 +17981,7 @@ export const TestPackedTypes = { break; } case 95: { - msg.packedSint64.push(reader.readSint64()); + msg.packedSint64 = reader.readSint64().map(BigInt); break; } case 96: { @@ -17526,7 +17989,7 @@ export const TestPackedTypes = { break; } case 97: { - msg.packedFixed64.push(reader.readFixed64String()); + msg.packedFixed64 = reader.readFixed64String().map(BigInt); break; } case 98: { @@ -17534,7 +17997,7 @@ export const TestPackedTypes = { break; } case 99: { - msg.packedSfixed64.push(reader.readSfixed64()); + msg.packedSfixed64 = reader.readSfixed64().map(BigInt); break; } case 100: { @@ -17566,59 +18029,59 @@ export const TestPackedTypes = { * @private */ _readMessageJSON: function (msg, json) { - const packedInt32 = json[\\"packedInt32\\"] ?? json.packed_int32; + const packedInt32 = json.packedInt32 ?? json.packed_int32; if (packedInt32) { msg.packedInt32 = packedInt32; } - const packedInt64 = json[\\"packedInt64\\"] ?? json.packed_int64; + const packedInt64 = json.packedInt64 ?? json.packed_int64; if (packedInt64) { - msg.packedInt64 = packedInt64; + msg.packedInt64 = packedInt64.map(BigInt); } - const packedUint32 = json[\\"packedUint32\\"] ?? json.packed_uint32; + const packedUint32 = json.packedUint32 ?? json.packed_uint32; if (packedUint32) { msg.packedUint32 = packedUint32; } - const packedUint64 = json[\\"packedUint64\\"] ?? json.packed_uint64; + const packedUint64 = json.packedUint64 ?? json.packed_uint64; if (packedUint64) { - msg.packedUint64 = packedUint64; + msg.packedUint64 = packedUint64.map(BigInt); } - const packedSint32 = json[\\"packedSint32\\"] ?? json.packed_sint32; + const packedSint32 = json.packedSint32 ?? json.packed_sint32; if (packedSint32) { msg.packedSint32 = packedSint32; } - const packedSint64 = json[\\"packedSint64\\"] ?? json.packed_sint64; + const packedSint64 = json.packedSint64 ?? json.packed_sint64; if (packedSint64) { - msg.packedSint64 = packedSint64; + msg.packedSint64 = packedSint64.map(BigInt); } - const packedFixed32 = json[\\"packedFixed32\\"] ?? json.packed_fixed32; + const packedFixed32 = json.packedFixed32 ?? json.packed_fixed32; if (packedFixed32) { msg.packedFixed32 = packedFixed32; } - const packedFixed64 = json[\\"packedFixed64\\"] ?? json.packed_fixed64; + const packedFixed64 = json.packedFixed64 ?? json.packed_fixed64; if (packedFixed64) { - msg.packedFixed64 = packedFixed64; + msg.packedFixed64 = packedFixed64.map(BigInt); } - const packedSfixed32 = json[\\"packedSfixed32\\"] ?? json.packed_sfixed32; + const packedSfixed32 = json.packedSfixed32 ?? json.packed_sfixed32; if (packedSfixed32) { msg.packedSfixed32 = packedSfixed32; } - const packedSfixed64 = json[\\"packedSfixed64\\"] ?? json.packed_sfixed64; + const packedSfixed64 = json.packedSfixed64 ?? json.packed_sfixed64; if (packedSfixed64) { - msg.packedSfixed64 = packedSfixed64; + msg.packedSfixed64 = packedSfixed64.map(BigInt); } - const packedFloat = json[\\"packedFloat\\"] ?? json.packed_float; + const packedFloat = json.packedFloat ?? json.packed_float; if (packedFloat) { msg.packedFloat = packedFloat; } - const packedDouble = json[\\"packedDouble\\"] ?? json.packed_double; + const packedDouble = json.packedDouble ?? json.packed_double; if (packedDouble) { msg.packedDouble = packedDouble; } - const packedBool = json[\\"packedBool\\"] ?? json.packed_bool; + const packedBool = json.packedBool ?? json.packed_bool; if (packedBool) { msg.packedBool = packedBool; } - const packedEnum = json[\\"packedEnum\\"] ?? json.packed_enum; + const packedEnum = json.packedEnum ?? json.packed_enum; if (packedEnum) { msg.packedEnum = packedEnum; } @@ -17696,31 +18159,31 @@ export const TestUnpackedTypes = { writer.writeRepeatedInt32(1, msg.repeatedInt32); } if (msg.repeatedInt64?.length) { - writer.writeRepeatedInt64String(2, msg.repeatedInt64); + writer.writeRepeatedInt64String(2, msg.repeatedInt64.toString()); } if (msg.repeatedUint32?.length) { writer.writeRepeatedUint32(3, msg.repeatedUint32); } if (msg.repeatedUint64?.length) { - writer.writeRepeatedUint64String(4, msg.repeatedUint64); + writer.writeRepeatedUint64String(4, msg.repeatedUint64.toString()); } if (msg.repeatedSint32?.length) { writer.writeRepeatedSint32(5, msg.repeatedSint32); } if (msg.repeatedSint64?.length) { - writer.writeRepeatedSint64String(6, msg.repeatedSint64); + writer.writeRepeatedSint64String(6, msg.repeatedSint64.toString()); } if (msg.repeatedFixed32?.length) { writer.writeRepeatedFixed32(7, msg.repeatedFixed32); } if (msg.repeatedFixed64?.length) { - writer.writeRepeatedFixed64String(8, msg.repeatedFixed64); + writer.writeRepeatedFixed64String(8, msg.repeatedFixed64.toString()); } if (msg.repeatedSfixed32?.length) { writer.writeRepeatedSfixed32(9, msg.repeatedSfixed32); } if (msg.repeatedSfixed64?.length) { - writer.writeRepeatedSfixed64(10, msg.repeatedSfixed64); + writer.writeRepeatedSfixed64(10, msg.repeatedSfixed64.toString()); } if (msg.repeatedFloat?.length) { writer.writeRepeatedFloat(11, msg.repeatedFloat); @@ -17741,48 +18204,48 @@ export const TestUnpackedTypes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.repeatedInt32?.length) { - json[\\"repeatedInt32\\"] = msg.repeatedInt32; + json.repeatedInt32 = msg.repeatedInt32; } if (msg.repeatedInt64?.length) { - json[\\"repeatedInt64\\"] = msg.repeatedInt64; + json.repeatedInt64 = msg.repeatedInt64.map((x) => x.toString()); } if (msg.repeatedUint32?.length) { - json[\\"repeatedUint32\\"] = msg.repeatedUint32; + json.repeatedUint32 = msg.repeatedUint32; } if (msg.repeatedUint64?.length) { - json[\\"repeatedUint64\\"] = msg.repeatedUint64; + json.repeatedUint64 = msg.repeatedUint64.map((x) => x.toString()); } if (msg.repeatedSint32?.length) { - json[\\"repeatedSint32\\"] = msg.repeatedSint32; + json.repeatedSint32 = msg.repeatedSint32; } if (msg.repeatedSint64?.length) { - json[\\"repeatedSint64\\"] = msg.repeatedSint64; + json.repeatedSint64 = msg.repeatedSint64.map((x) => x.toString()); } if (msg.repeatedFixed32?.length) { - json[\\"repeatedFixed32\\"] = msg.repeatedFixed32; + json.repeatedFixed32 = msg.repeatedFixed32; } if (msg.repeatedFixed64?.length) { - json[\\"repeatedFixed64\\"] = msg.repeatedFixed64; + json.repeatedFixed64 = msg.repeatedFixed64.map((x) => x.toString()); } if (msg.repeatedSfixed32?.length) { - json[\\"repeatedSfixed32\\"] = msg.repeatedSfixed32; + json.repeatedSfixed32 = msg.repeatedSfixed32; } if (msg.repeatedSfixed64?.length) { - json[\\"repeatedSfixed64\\"] = msg.repeatedSfixed64; + json.repeatedSfixed64 = msg.repeatedSfixed64.map((x) => x.toString()); } if (msg.repeatedFloat?.length) { - json[\\"repeatedFloat\\"] = msg.repeatedFloat; + json.repeatedFloat = msg.repeatedFloat; } if (msg.repeatedDouble?.length) { - json[\\"repeatedDouble\\"] = msg.repeatedDouble; + json.repeatedDouble = msg.repeatedDouble; } if (msg.repeatedBool?.length) { - json[\\"repeatedBool\\"] = msg.repeatedBool; + json.repeatedBool = msg.repeatedBool; } if (msg.repeatedNestedEnum?.length) { - json[\\"repeatedNestedEnum\\"] = msg.repeatedNestedEnum; + json.repeatedNestedEnum = msg.repeatedNestedEnum; } return json; }, @@ -17799,7 +18262,7 @@ export const TestUnpackedTypes = { break; } case 2: { - msg.repeatedInt64.push(reader.readInt64String()); + msg.repeatedInt64 = reader.readInt64String().map(BigInt); break; } case 3: { @@ -17807,7 +18270,7 @@ export const TestUnpackedTypes = { break; } case 4: { - msg.repeatedUint64.push(reader.readUint64String()); + msg.repeatedUint64 = reader.readUint64String().map(BigInt); break; } case 5: { @@ -17815,7 +18278,7 @@ export const TestUnpackedTypes = { break; } case 6: { - msg.repeatedSint64.push(reader.readSint64()); + msg.repeatedSint64 = reader.readSint64().map(BigInt); break; } case 7: { @@ -17823,7 +18286,7 @@ export const TestUnpackedTypes = { break; } case 8: { - msg.repeatedFixed64.push(reader.readFixed64String()); + msg.repeatedFixed64 = reader.readFixed64String().map(BigInt); break; } case 9: { @@ -17831,7 +18294,7 @@ export const TestUnpackedTypes = { break; } case 10: { - msg.repeatedSfixed64.push(reader.readSfixed64()); + msg.repeatedSfixed64 = reader.readSfixed64().map(BigInt); break; } case 11: { @@ -17863,60 +18326,60 @@ export const TestUnpackedTypes = { * @private */ _readMessageJSON: function (msg, json) { - const repeatedInt32 = json[\\"repeatedInt32\\"] ?? json.repeated_int32; + const repeatedInt32 = json.repeatedInt32 ?? json.repeated_int32; if (repeatedInt32) { msg.repeatedInt32 = repeatedInt32; } - const repeatedInt64 = json[\\"repeatedInt64\\"] ?? json.repeated_int64; + const repeatedInt64 = json.repeatedInt64 ?? json.repeated_int64; if (repeatedInt64) { - msg.repeatedInt64 = repeatedInt64; + msg.repeatedInt64 = repeatedInt64.map(BigInt); } - const repeatedUint32 = json[\\"repeatedUint32\\"] ?? json.repeated_uint32; + const repeatedUint32 = json.repeatedUint32 ?? json.repeated_uint32; if (repeatedUint32) { msg.repeatedUint32 = repeatedUint32; } - const repeatedUint64 = json[\\"repeatedUint64\\"] ?? json.repeated_uint64; + const repeatedUint64 = json.repeatedUint64 ?? json.repeated_uint64; if (repeatedUint64) { - msg.repeatedUint64 = repeatedUint64; + msg.repeatedUint64 = repeatedUint64.map(BigInt); } - const repeatedSint32 = json[\\"repeatedSint32\\"] ?? json.repeated_sint32; + const repeatedSint32 = json.repeatedSint32 ?? json.repeated_sint32; if (repeatedSint32) { msg.repeatedSint32 = repeatedSint32; } - const repeatedSint64 = json[\\"repeatedSint64\\"] ?? json.repeated_sint64; + const repeatedSint64 = json.repeatedSint64 ?? json.repeated_sint64; if (repeatedSint64) { - msg.repeatedSint64 = repeatedSint64; + msg.repeatedSint64 = repeatedSint64.map(BigInt); } - const repeatedFixed32 = json[\\"repeatedFixed32\\"] ?? json.repeated_fixed32; + const repeatedFixed32 = json.repeatedFixed32 ?? json.repeated_fixed32; if (repeatedFixed32) { msg.repeatedFixed32 = repeatedFixed32; } - const repeatedFixed64 = json[\\"repeatedFixed64\\"] ?? json.repeated_fixed64; + const repeatedFixed64 = json.repeatedFixed64 ?? json.repeated_fixed64; if (repeatedFixed64) { - msg.repeatedFixed64 = repeatedFixed64; + msg.repeatedFixed64 = repeatedFixed64.map(BigInt); } - const repeatedSfixed32 = json[\\"repeatedSfixed32\\"] ?? json.repeated_sfixed32; + const repeatedSfixed32 = json.repeatedSfixed32 ?? json.repeated_sfixed32; if (repeatedSfixed32) { msg.repeatedSfixed32 = repeatedSfixed32; } - const repeatedSfixed64 = json[\\"repeatedSfixed64\\"] ?? json.repeated_sfixed64; + const repeatedSfixed64 = json.repeatedSfixed64 ?? json.repeated_sfixed64; if (repeatedSfixed64) { - msg.repeatedSfixed64 = repeatedSfixed64; + msg.repeatedSfixed64 = repeatedSfixed64.map(BigInt); } - const repeatedFloat = json[\\"repeatedFloat\\"] ?? json.repeated_float; + const repeatedFloat = json.repeatedFloat ?? json.repeated_float; if (repeatedFloat) { msg.repeatedFloat = repeatedFloat; } - const repeatedDouble = json[\\"repeatedDouble\\"] ?? json.repeated_double; + const repeatedDouble = json.repeatedDouble ?? json.repeated_double; if (repeatedDouble) { msg.repeatedDouble = repeatedDouble; } - const repeatedBool = json[\\"repeatedBool\\"] ?? json.repeated_bool; + const repeatedBool = json.repeatedBool ?? json.repeated_bool; if (repeatedBool) { msg.repeatedBool = repeatedBool; } const repeatedNestedEnum = - json[\\"repeatedNestedEnum\\"] ?? json.repeated_nested_enum; + json.repeatedNestedEnum ?? json.repeated_nested_enum; if (repeatedNestedEnum) { msg.repeatedNestedEnum = repeatedNestedEnum; } @@ -17991,17 +18454,17 @@ export const NestedTestAllTypes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.child) { const child = NestedTestAllTypes._writeMessageJSON(msg.child); if (Object.keys(child).length > 0) { - json[\\"child\\"] = child; + json.child = child; } } if (msg.payload) { const payload = TestAllTypes._writeMessageJSON(msg.payload); if (Object.keys(payload).length > 0) { - json[\\"payload\\"] = payload; + json.payload = payload; } } return json; @@ -18035,13 +18498,13 @@ export const NestedTestAllTypes = { * @private */ _readMessageJSON: function (msg, json) { - const child = json[\\"child\\"] ?? json.child; + const child = json.child ?? json.child; if (child) { const m = NestedTestAllTypes.initialize(); NestedTestAllTypes._readMessageJSON(m, child); msg.child = m; } - const payload = json[\\"payload\\"] ?? json.payload; + const payload = json.payload ?? json.payload; if (payload) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, payload); @@ -18112,9 +18575,9 @@ export const ForeignMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.c) { - json[\\"c\\"] = msg.c; + json.c = msg.c; } return json; }, @@ -18143,7 +18606,7 @@ export const ForeignMessage = { * @private */ _readMessageJSON: function (msg, json) { - const c = json[\\"c\\"] ?? json.c; + const c = json.c ?? json.c; if (c) { msg.c = c; } @@ -18262,9 +18725,9 @@ export const TestMessageWithDummy = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.dummy) { - json[\\"dummy\\"] = msg.dummy; + json.dummy = msg.dummy; } return json; }, @@ -18293,7 +18756,7 @@ export const TestMessageWithDummy = { * @private */ _readMessageJSON: function (msg, json) { - const dummy = json[\\"dummy\\"] ?? json.dummy; + const dummy = json.dummy ?? json.dummy; if (dummy) { msg.dummy = dummy; } @@ -18360,9 +18823,9 @@ export const TestOneof2 = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.fooEnum != undefined) { - json[\\"fooEnum\\"] = msg.fooEnum; + json.fooEnum = msg.fooEnum; } return json; }, @@ -18391,7 +18854,7 @@ export const TestOneof2 = { * @private */ _readMessageJSON: function (msg, json) { - const fooEnum = json[\\"fooEnum\\"] ?? json.foo_enum; + const fooEnum = json.fooEnum ?? json.foo_enum; if (fooEnum) { msg.fooEnum = fooEnum; } @@ -18623,9 +19086,9 @@ export const PublicImportMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.e) { - json[\\"e\\"] = msg.e; + json.e = msg.e; } return json; }, @@ -18654,7 +19117,7 @@ export const PublicImportMessage = { * @private */ _readMessageJSON: function (msg, json) { - const e = json[\\"e\\"] ?? json.e; + const e = json.e ?? json.e; if (e) { msg.e = e; } @@ -18759,9 +19222,9 @@ export const ImportMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.d) { - json[\\"d\\"] = msg.d; + json.d = msg.d; } return json; }, @@ -18790,7 +19253,7 @@ export const ImportMessage = { * @private */ _readMessageJSON: function (msg, json) { - const d = json[\\"d\\"] ?? json.d; + const d = json.d ?? json.d; if (d) { msg.d = d; } @@ -19074,15 +19537,15 @@ export const TestAllTypes = { initialize: function () { return { optionalInt32: 0, - optionalInt64: \\"\\", + optionalInt64: 0n, optionalUint32: 0, - optionalUint64: \\"\\", + optionalUint64: 0n, optionalSint32: 0, - optionalSint64: \\"\\", + optionalSint64: 0n, optionalFixed32: 0, - optionalFixed64: \\"\\", + optionalFixed64: 0n, optionalSfixed32: 0, - optionalSfixed64: \\"\\", + optionalSfixed64: 0n, optionalFloat: 0, optionalDouble: 0, optionalBool: false, @@ -19123,15 +19586,15 @@ export const TestAllTypes = { repeatedCord: [], repeatedLazyMessage: [], defaultInt32: 0, - defaultInt64: \\"\\", + defaultInt64: 0n, defaultUint32: 0, - defaultUint64: \\"\\", + defaultUint64: 0n, defaultSint32: 0, - defaultSint64: \\"\\", + defaultSint64: 0n, defaultFixed32: 0, - defaultFixed64: \\"\\", + defaultFixed64: 0n, defaultSfixed32: 0, - defaultSfixed64: \\"\\", + defaultSfixed64: 0n, defaultFloat: 0, defaultDouble: 0, defaultBool: false, @@ -19154,31 +19617,31 @@ export const TestAllTypes = { writer.writeInt32(1, msg.optionalInt32); } if (msg.optionalInt64) { - writer.writeInt64String(2, msg.optionalInt64); + writer.writeInt64String(2, msg.optionalInt64.toString()); } if (msg.optionalUint32) { writer.writeUint32(3, msg.optionalUint32); } if (msg.optionalUint64) { - writer.writeUint64String(4, msg.optionalUint64); + writer.writeUint64String(4, msg.optionalUint64.toString()); } if (msg.optionalSint32) { writer.writeSint32(5, msg.optionalSint32); } if (msg.optionalSint64) { - writer.writeSint64String(6, msg.optionalSint64); + writer.writeSint64String(6, msg.optionalSint64.toString()); } if (msg.optionalFixed32) { writer.writeFixed32(7, msg.optionalFixed32); } if (msg.optionalFixed64) { - writer.writeFixed64String(8, msg.optionalFixed64); + writer.writeFixed64String(8, msg.optionalFixed64.toString()); } if (msg.optionalSfixed32) { writer.writeSfixed32(9, msg.optionalSfixed32); } if (msg.optionalSfixed64) { - writer.writeSfixed64(10, msg.optionalSfixed64); + writer.writeSfixed64(10, msg.optionalSfixed64.toString()); } if (msg.optionalFloat) { writer.writeFloat(11, msg.optionalFloat); @@ -19249,31 +19712,31 @@ export const TestAllTypes = { writer.writeRepeatedInt32(31, msg.repeatedInt32); } if (msg.repeatedInt64?.length) { - writer.writeRepeatedInt64String(32, msg.repeatedInt64); + writer.writeRepeatedInt64String(32, msg.repeatedInt64.toString()); } if (msg.repeatedUint32?.length) { writer.writeRepeatedUint32(33, msg.repeatedUint32); } if (msg.repeatedUint64?.length) { - writer.writeRepeatedUint64String(34, msg.repeatedUint64); + writer.writeRepeatedUint64String(34, msg.repeatedUint64.toString()); } if (msg.repeatedSint32?.length) { writer.writeRepeatedSint32(35, msg.repeatedSint32); } if (msg.repeatedSint64?.length) { - writer.writeRepeatedSint64String(36, msg.repeatedSint64); + writer.writeRepeatedSint64String(36, msg.repeatedSint64.toString()); } if (msg.repeatedFixed32?.length) { writer.writeRepeatedFixed32(37, msg.repeatedFixed32); } if (msg.repeatedFixed64?.length) { - writer.writeRepeatedFixed64String(38, msg.repeatedFixed64); + writer.writeRepeatedFixed64String(38, msg.repeatedFixed64.toString()); } if (msg.repeatedSfixed32?.length) { writer.writeRepeatedSfixed32(39, msg.repeatedSfixed32); } if (msg.repeatedSfixed64?.length) { - writer.writeRepeatedSfixed64(40, msg.repeatedSfixed64); + writer.writeRepeatedSfixed64(40, msg.repeatedSfixed64.toString()); } if (msg.repeatedFloat?.length) { writer.writeRepeatedFloat(41, msg.repeatedFloat); @@ -19337,31 +19800,31 @@ export const TestAllTypes = { writer.writeInt32(61, msg.defaultInt32); } if (msg.defaultInt64) { - writer.writeInt64String(62, msg.defaultInt64); + writer.writeInt64String(62, msg.defaultInt64.toString()); } if (msg.defaultUint32) { writer.writeUint32(63, msg.defaultUint32); } if (msg.defaultUint64) { - writer.writeUint64String(64, msg.defaultUint64); + writer.writeUint64String(64, msg.defaultUint64.toString()); } if (msg.defaultSint32) { writer.writeSint32(65, msg.defaultSint32); } if (msg.defaultSint64) { - writer.writeSint64String(66, msg.defaultSint64); + writer.writeSint64String(66, msg.defaultSint64.toString()); } if (msg.defaultFixed32) { writer.writeFixed32(67, msg.defaultFixed32); } if (msg.defaultFixed64) { - writer.writeFixed64String(68, msg.defaultFixed64); + writer.writeFixed64String(68, msg.defaultFixed64.toString()); } if (msg.defaultSfixed32) { writer.writeSfixed32(69, msg.defaultSfixed32); } if (msg.defaultSfixed64) { - writer.writeSfixed64(70, msg.defaultSfixed64); + writer.writeSfixed64(70, msg.defaultSfixed64.toString()); } if (msg.defaultFloat) { writer.writeFloat(71, msg.defaultFloat); @@ -19416,57 +19879,57 @@ export const TestAllTypes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.optionalInt32) { - json[\\"optionalInt32\\"] = msg.optionalInt32; + json.optionalInt32 = msg.optionalInt32; } if (msg.optionalInt64) { - json[\\"optionalInt64\\"] = msg.optionalInt64; + json.optionalInt64 = msg.optionalInt64.toString(); } if (msg.optionalUint32) { - json[\\"optionalUint32\\"] = msg.optionalUint32; + json.optionalUint32 = msg.optionalUint32; } if (msg.optionalUint64) { - json[\\"optionalUint64\\"] = msg.optionalUint64; + json.optionalUint64 = msg.optionalUint64.toString(); } if (msg.optionalSint32) { - json[\\"optionalSint32\\"] = msg.optionalSint32; + json.optionalSint32 = msg.optionalSint32; } if (msg.optionalSint64) { - json[\\"optionalSint64\\"] = msg.optionalSint64; + json.optionalSint64 = msg.optionalSint64.toString(); } if (msg.optionalFixed32) { - json[\\"optionalFixed32\\"] = msg.optionalFixed32; + json.optionalFixed32 = msg.optionalFixed32; } if (msg.optionalFixed64) { - json[\\"optionalFixed64\\"] = msg.optionalFixed64; + json.optionalFixed64 = msg.optionalFixed64.toString(); } if (msg.optionalSfixed32) { - json[\\"optionalSfixed32\\"] = msg.optionalSfixed32; + json.optionalSfixed32 = msg.optionalSfixed32; } if (msg.optionalSfixed64) { - json[\\"optionalSfixed64\\"] = msg.optionalSfixed64; + json.optionalSfixed64 = msg.optionalSfixed64.toString(); } if (msg.optionalFloat) { - json[\\"optionalFloat\\"] = msg.optionalFloat; + json.optionalFloat = msg.optionalFloat; } if (msg.optionalDouble) { - json[\\"optionalDouble\\"] = msg.optionalDouble; + json.optionalDouble = msg.optionalDouble; } if (msg.optionalBool) { - json[\\"optionalBool\\"] = msg.optionalBool; + json.optionalBool = msg.optionalBool; } if (msg.optionalString) { - json[\\"optionalString\\"] = msg.optionalString; + json.optionalString = msg.optionalString; } if (msg.optionalBytes) { - json[\\"optionalBytes\\"] = msg.optionalBytes; + json.optionalBytes = msg.optionalBytes; } if (msg.optionalNestedMessage) { const optionalNestedMessage = TestAllTypes.NestedMessage._writeMessageJSON(msg.optionalNestedMessage); if (Object.keys(optionalNestedMessage).length > 0) { - json[\\"optionalNestedMessage\\"] = optionalNestedMessage; + json.optionalNestedMessage = optionalNestedMessage; } } if (msg.optionalForeignMessage) { @@ -19474,7 +19937,7 @@ export const TestAllTypes = { msg.optionalForeignMessage ); if (Object.keys(optionalForeignMessage).length > 0) { - json[\\"optionalForeignMessage\\"] = optionalForeignMessage; + json.optionalForeignMessage = optionalForeignMessage; } } if (msg.optionalImportMessage) { @@ -19482,30 +19945,30 @@ export const TestAllTypes = { msg.optionalImportMessage ); if (Object.keys(optionalImportMessage).length > 0) { - json[\\"optionalImportMessage\\"] = optionalImportMessage; + json.optionalImportMessage = optionalImportMessage; } } if (msg.optionalNestedEnum) { - json[\\"optionalNestedEnum\\"] = msg.optionalNestedEnum; + json.optionalNestedEnum = msg.optionalNestedEnum; } if (msg.optionalForeignEnum) { - json[\\"optionalForeignEnum\\"] = msg.optionalForeignEnum; + json.optionalForeignEnum = msg.optionalForeignEnum; } if (msg.optionalImportEnum) { - json[\\"optionalImportEnum\\"] = msg.optionalImportEnum; + json.optionalImportEnum = msg.optionalImportEnum; } if (msg.optionalStringPiece) { - json[\\"optionalStringPiece\\"] = msg.optionalStringPiece; + json.optionalStringPiece = msg.optionalStringPiece; } if (msg.optionalCord) { - json[\\"optionalCord\\"] = msg.optionalCord; + json.optionalCord = msg.optionalCord; } if (msg.optionalPublicImportMessage) { const optionalPublicImportMessage = PublicImportMessage._writeMessageJSON( msg.optionalPublicImportMessage ); if (Object.keys(optionalPublicImportMessage).length > 0) { - json[\\"optionalPublicImportMessage\\"] = optionalPublicImportMessage; + json.optionalPublicImportMessage = optionalPublicImportMessage; } } if (msg.optionalLazyMessage) { @@ -19513,165 +19976,165 @@ export const TestAllTypes = { msg.optionalLazyMessage ); if (Object.keys(optionalLazyMessage).length > 0) { - json[\\"optionalLazyMessage\\"] = optionalLazyMessage; + json.optionalLazyMessage = optionalLazyMessage; } } if (msg.repeatedInt32?.length) { - json[\\"repeatedInt32\\"] = msg.repeatedInt32; + json.repeatedInt32 = msg.repeatedInt32; } if (msg.repeatedInt64?.length) { - json[\\"repeatedInt64\\"] = msg.repeatedInt64; + json.repeatedInt64 = msg.repeatedInt64.map((x) => x.toString()); } if (msg.repeatedUint32?.length) { - json[\\"repeatedUint32\\"] = msg.repeatedUint32; + json.repeatedUint32 = msg.repeatedUint32; } if (msg.repeatedUint64?.length) { - json[\\"repeatedUint64\\"] = msg.repeatedUint64; + json.repeatedUint64 = msg.repeatedUint64.map((x) => x.toString()); } if (msg.repeatedSint32?.length) { - json[\\"repeatedSint32\\"] = msg.repeatedSint32; + json.repeatedSint32 = msg.repeatedSint32; } if (msg.repeatedSint64?.length) { - json[\\"repeatedSint64\\"] = msg.repeatedSint64; + json.repeatedSint64 = msg.repeatedSint64.map((x) => x.toString()); } if (msg.repeatedFixed32?.length) { - json[\\"repeatedFixed32\\"] = msg.repeatedFixed32; + json.repeatedFixed32 = msg.repeatedFixed32; } if (msg.repeatedFixed64?.length) { - json[\\"repeatedFixed64\\"] = msg.repeatedFixed64; + json.repeatedFixed64 = msg.repeatedFixed64.map((x) => x.toString()); } if (msg.repeatedSfixed32?.length) { - json[\\"repeatedSfixed32\\"] = msg.repeatedSfixed32; + json.repeatedSfixed32 = msg.repeatedSfixed32; } if (msg.repeatedSfixed64?.length) { - json[\\"repeatedSfixed64\\"] = msg.repeatedSfixed64; + json.repeatedSfixed64 = msg.repeatedSfixed64.map((x) => x.toString()); } if (msg.repeatedFloat?.length) { - json[\\"repeatedFloat\\"] = msg.repeatedFloat; + json.repeatedFloat = msg.repeatedFloat; } if (msg.repeatedDouble?.length) { - json[\\"repeatedDouble\\"] = msg.repeatedDouble; + json.repeatedDouble = msg.repeatedDouble; } if (msg.repeatedBool?.length) { - json[\\"repeatedBool\\"] = msg.repeatedBool; + json.repeatedBool = msg.repeatedBool; } if (msg.repeatedString?.length) { - json[\\"repeatedString\\"] = msg.repeatedString; + json.repeatedString = msg.repeatedString; } if (msg.repeatedBytes?.length) { - json[\\"repeatedBytes\\"] = msg.repeatedBytes; + json.repeatedBytes = msg.repeatedBytes; } if (msg.repeatedNestedMessage?.length) { - json[\\"repeatedNestedMessage\\"] = msg.repeatedNestedMessage.map( + json.repeatedNestedMessage = msg.repeatedNestedMessage.map( TestAllTypes.NestedMessage._writeMessageJSON ); } if (msg.repeatedForeignMessage?.length) { - json[\\"repeatedForeignMessage\\"] = msg.repeatedForeignMessage.map( + json.repeatedForeignMessage = msg.repeatedForeignMessage.map( ForeignMessage._writeMessageJSON ); } if (msg.repeatedImportMessage?.length) { - json[\\"repeatedImportMessage\\"] = msg.repeatedImportMessage.map( + json.repeatedImportMessage = msg.repeatedImportMessage.map( ImportMessage._writeMessageJSON ); } if (msg.repeatedNestedEnum?.length) { - json[\\"repeatedNestedEnum\\"] = msg.repeatedNestedEnum; + json.repeatedNestedEnum = msg.repeatedNestedEnum; } if (msg.repeatedForeignEnum?.length) { - json[\\"repeatedForeignEnum\\"] = msg.repeatedForeignEnum; + json.repeatedForeignEnum = msg.repeatedForeignEnum; } if (msg.repeatedImportEnum?.length) { - json[\\"repeatedImportEnum\\"] = msg.repeatedImportEnum; + json.repeatedImportEnum = msg.repeatedImportEnum; } if (msg.repeatedStringPiece?.length) { - json[\\"repeatedStringPiece\\"] = msg.repeatedStringPiece; + json.repeatedStringPiece = msg.repeatedStringPiece; } if (msg.repeatedCord?.length) { - json[\\"repeatedCord\\"] = msg.repeatedCord; + json.repeatedCord = msg.repeatedCord; } if (msg.repeatedLazyMessage?.length) { - json[\\"repeatedLazyMessage\\"] = msg.repeatedLazyMessage.map( + json.repeatedLazyMessage = msg.repeatedLazyMessage.map( TestAllTypes.NestedMessage._writeMessageJSON ); } if (msg.defaultInt32) { - json[\\"defaultInt32\\"] = msg.defaultInt32; + json.defaultInt32 = msg.defaultInt32; } if (msg.defaultInt64) { - json[\\"defaultInt64\\"] = msg.defaultInt64; + json.defaultInt64 = msg.defaultInt64.toString(); } if (msg.defaultUint32) { - json[\\"defaultUint32\\"] = msg.defaultUint32; + json.defaultUint32 = msg.defaultUint32; } if (msg.defaultUint64) { - json[\\"defaultUint64\\"] = msg.defaultUint64; + json.defaultUint64 = msg.defaultUint64.toString(); } if (msg.defaultSint32) { - json[\\"defaultSint32\\"] = msg.defaultSint32; + json.defaultSint32 = msg.defaultSint32; } if (msg.defaultSint64) { - json[\\"defaultSint64\\"] = msg.defaultSint64; + json.defaultSint64 = msg.defaultSint64.toString(); } if (msg.defaultFixed32) { - json[\\"defaultFixed32\\"] = msg.defaultFixed32; + json.defaultFixed32 = msg.defaultFixed32; } if (msg.defaultFixed64) { - json[\\"defaultFixed64\\"] = msg.defaultFixed64; + json.defaultFixed64 = msg.defaultFixed64.toString(); } if (msg.defaultSfixed32) { - json[\\"defaultSfixed32\\"] = msg.defaultSfixed32; + json.defaultSfixed32 = msg.defaultSfixed32; } if (msg.defaultSfixed64) { - json[\\"defaultSfixed64\\"] = msg.defaultSfixed64; + json.defaultSfixed64 = msg.defaultSfixed64.toString(); } if (msg.defaultFloat) { - json[\\"defaultFloat\\"] = msg.defaultFloat; + json.defaultFloat = msg.defaultFloat; } if (msg.defaultDouble) { - json[\\"defaultDouble\\"] = msg.defaultDouble; + json.defaultDouble = msg.defaultDouble; } if (msg.defaultBool) { - json[\\"defaultBool\\"] = msg.defaultBool; + json.defaultBool = msg.defaultBool; } if (msg.defaultString) { - json[\\"defaultString\\"] = msg.defaultString; + json.defaultString = msg.defaultString; } if (msg.defaultBytes) { - json[\\"defaultBytes\\"] = msg.defaultBytes; + json.defaultBytes = msg.defaultBytes; } if (msg.defaultNestedEnum) { - json[\\"defaultNestedEnum\\"] = msg.defaultNestedEnum; + json.defaultNestedEnum = msg.defaultNestedEnum; } if (msg.defaultForeignEnum) { - json[\\"defaultForeignEnum\\"] = msg.defaultForeignEnum; + json.defaultForeignEnum = msg.defaultForeignEnum; } if (msg.defaultImportEnum) { - json[\\"defaultImportEnum\\"] = msg.defaultImportEnum; + json.defaultImportEnum = msg.defaultImportEnum; } if (msg.defaultStringPiece) { - json[\\"defaultStringPiece\\"] = msg.defaultStringPiece; + json.defaultStringPiece = msg.defaultStringPiece; } if (msg.defaultCord) { - json[\\"defaultCord\\"] = msg.defaultCord; + json.defaultCord = msg.defaultCord; } if (msg.oneofUint32 != undefined) { - json[\\"oneofUint32\\"] = msg.oneofUint32; + json.oneofUint32 = msg.oneofUint32; } if (msg.oneofNestedMessage != undefined) { const oneofNestedMessage = TestAllTypes.NestedMessage._writeMessageJSON( msg.oneofNestedMessage ); if (Object.keys(oneofNestedMessage).length > 0) { - json[\\"oneofNestedMessage\\"] = oneofNestedMessage; + json.oneofNestedMessage = oneofNestedMessage; } } if (msg.oneofString != undefined) { - json[\\"oneofString\\"] = msg.oneofString; + json.oneofString = msg.oneofString; } if (msg.oneofBytes != undefined) { - json[\\"oneofBytes\\"] = msg.oneofBytes; + json.oneofBytes = msg.oneofBytes; } return json; }, @@ -19688,7 +20151,7 @@ export const TestAllTypes = { break; } case 2: { - msg.optionalInt64 = reader.readInt64String(); + msg.optionalInt64 = BigInt(reader.readInt64String()); break; } case 3: { @@ -19696,7 +20159,7 @@ export const TestAllTypes = { break; } case 4: { - msg.optionalUint64 = reader.readUint64String(); + msg.optionalUint64 = BigInt(reader.readUint64String()); break; } case 5: { @@ -19704,7 +20167,7 @@ export const TestAllTypes = { break; } case 6: { - msg.optionalSint64 = reader.readSint64(); + msg.optionalSint64 = BigInt(reader.readSint64()); break; } case 7: { @@ -19712,7 +20175,7 @@ export const TestAllTypes = { break; } case 8: { - msg.optionalFixed64 = reader.readFixed64String(); + msg.optionalFixed64 = BigInt(reader.readFixed64String()); break; } case 9: { @@ -19720,7 +20183,7 @@ export const TestAllTypes = { break; } case 10: { - msg.optionalSfixed64 = reader.readSfixed64(); + msg.optionalSfixed64 = BigInt(reader.readSfixed64()); break; } case 11: { @@ -19803,7 +20266,7 @@ export const TestAllTypes = { break; } case 32: { - msg.repeatedInt64.push(reader.readInt64String()); + msg.repeatedInt64 = reader.readInt64String().map(BigInt); break; } case 33: { @@ -19811,7 +20274,7 @@ export const TestAllTypes = { break; } case 34: { - msg.repeatedUint64.push(reader.readUint64String()); + msg.repeatedUint64 = reader.readUint64String().map(BigInt); break; } case 35: { @@ -19819,7 +20282,7 @@ export const TestAllTypes = { break; } case 36: { - msg.repeatedSint64.push(reader.readSint64()); + msg.repeatedSint64 = reader.readSint64().map(BigInt); break; } case 37: { @@ -19827,7 +20290,7 @@ export const TestAllTypes = { break; } case 38: { - msg.repeatedFixed64.push(reader.readFixed64String()); + msg.repeatedFixed64 = reader.readFixed64String().map(BigInt); break; } case 39: { @@ -19835,7 +20298,7 @@ export const TestAllTypes = { break; } case 40: { - msg.repeatedSfixed64.push(reader.readSfixed64()); + msg.repeatedSfixed64 = reader.readSfixed64().map(BigInt); break; } case 41: { @@ -19907,7 +20370,7 @@ export const TestAllTypes = { break; } case 62: { - msg.defaultInt64 = reader.readInt64String(); + msg.defaultInt64 = BigInt(reader.readInt64String()); break; } case 63: { @@ -19915,7 +20378,7 @@ export const TestAllTypes = { break; } case 64: { - msg.defaultUint64 = reader.readUint64String(); + msg.defaultUint64 = BigInt(reader.readUint64String()); break; } case 65: { @@ -19923,7 +20386,7 @@ export const TestAllTypes = { break; } case 66: { - msg.defaultSint64 = reader.readSint64(); + msg.defaultSint64 = BigInt(reader.readSint64()); break; } case 67: { @@ -19931,7 +20394,7 @@ export const TestAllTypes = { break; } case 68: { - msg.defaultFixed64 = reader.readFixed64String(); + msg.defaultFixed64 = BigInt(reader.readFixed64String()); break; } case 69: { @@ -19939,7 +20402,7 @@ export const TestAllTypes = { break; } case 70: { - msg.defaultSfixed64 = reader.readSfixed64(); + msg.defaultSfixed64 = BigInt(reader.readSfixed64()); break; } case 71: { @@ -20014,188 +20477,187 @@ export const TestAllTypes = { * @private */ _readMessageJSON: function (msg, json) { - const optionalInt32 = json[\\"optionalInt32\\"] ?? json.optional_int32; + const optionalInt32 = json.optionalInt32 ?? json.optional_int32; if (optionalInt32) { msg.optionalInt32 = optionalInt32; } - const optionalInt64 = json[\\"optionalInt64\\"] ?? json.optional_int64; + const optionalInt64 = json.optionalInt64 ?? json.optional_int64; if (optionalInt64) { - msg.optionalInt64 = optionalInt64; + msg.optionalInt64 = BigInt(optionalInt64); } - const optionalUint32 = json[\\"optionalUint32\\"] ?? json.optional_uint32; + const optionalUint32 = json.optionalUint32 ?? json.optional_uint32; if (optionalUint32) { msg.optionalUint32 = optionalUint32; } - const optionalUint64 = json[\\"optionalUint64\\"] ?? json.optional_uint64; + const optionalUint64 = json.optionalUint64 ?? json.optional_uint64; if (optionalUint64) { - msg.optionalUint64 = optionalUint64; + msg.optionalUint64 = BigInt(optionalUint64); } - const optionalSint32 = json[\\"optionalSint32\\"] ?? json.optional_sint32; + const optionalSint32 = json.optionalSint32 ?? json.optional_sint32; if (optionalSint32) { msg.optionalSint32 = optionalSint32; } - const optionalSint64 = json[\\"optionalSint64\\"] ?? json.optional_sint64; + const optionalSint64 = json.optionalSint64 ?? json.optional_sint64; if (optionalSint64) { - msg.optionalSint64 = optionalSint64; + msg.optionalSint64 = BigInt(optionalSint64); } - const optionalFixed32 = json[\\"optionalFixed32\\"] ?? json.optional_fixed32; + const optionalFixed32 = json.optionalFixed32 ?? json.optional_fixed32; if (optionalFixed32) { msg.optionalFixed32 = optionalFixed32; } - const optionalFixed64 = json[\\"optionalFixed64\\"] ?? json.optional_fixed64; + const optionalFixed64 = json.optionalFixed64 ?? json.optional_fixed64; if (optionalFixed64) { - msg.optionalFixed64 = optionalFixed64; + msg.optionalFixed64 = BigInt(optionalFixed64); } - const optionalSfixed32 = json[\\"optionalSfixed32\\"] ?? json.optional_sfixed32; + const optionalSfixed32 = json.optionalSfixed32 ?? json.optional_sfixed32; if (optionalSfixed32) { msg.optionalSfixed32 = optionalSfixed32; } - const optionalSfixed64 = json[\\"optionalSfixed64\\"] ?? json.optional_sfixed64; + const optionalSfixed64 = json.optionalSfixed64 ?? json.optional_sfixed64; if (optionalSfixed64) { - msg.optionalSfixed64 = optionalSfixed64; + msg.optionalSfixed64 = BigInt(optionalSfixed64); } - const optionalFloat = json[\\"optionalFloat\\"] ?? json.optional_float; + const optionalFloat = json.optionalFloat ?? json.optional_float; if (optionalFloat) { msg.optionalFloat = optionalFloat; } - const optionalDouble = json[\\"optionalDouble\\"] ?? json.optional_double; + const optionalDouble = json.optionalDouble ?? json.optional_double; if (optionalDouble) { msg.optionalDouble = optionalDouble; } - const optionalBool = json[\\"optionalBool\\"] ?? json.optional_bool; + const optionalBool = json.optionalBool ?? json.optional_bool; if (optionalBool) { msg.optionalBool = optionalBool; } - const optionalString = json[\\"optionalString\\"] ?? json.optional_string; + const optionalString = json.optionalString ?? json.optional_string; if (optionalString) { msg.optionalString = optionalString; } - const optionalBytes = json[\\"optionalBytes\\"] ?? json.optional_bytes; + const optionalBytes = json.optionalBytes ?? json.optional_bytes; if (optionalBytes) { msg.optionalBytes = optionalBytes; } const optionalNestedMessage = - json[\\"optionalNestedMessage\\"] ?? json.optional_nested_message; + json.optionalNestedMessage ?? json.optional_nested_message; if (optionalNestedMessage) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, optionalNestedMessage); msg.optionalNestedMessage = m; } const optionalForeignMessage = - json[\\"optionalForeignMessage\\"] ?? json.optional_foreign_message; + json.optionalForeignMessage ?? json.optional_foreign_message; if (optionalForeignMessage) { const m = ForeignMessage.initialize(); ForeignMessage._readMessageJSON(m, optionalForeignMessage); msg.optionalForeignMessage = m; } const optionalImportMessage = - json[\\"optionalImportMessage\\"] ?? json.optional_import_message; + json.optionalImportMessage ?? json.optional_import_message; if (optionalImportMessage) { const m = ImportMessage.initialize(); ImportMessage._readMessageJSON(m, optionalImportMessage); msg.optionalImportMessage = m; } const optionalNestedEnum = - json[\\"optionalNestedEnum\\"] ?? json.optional_nested_enum; + json.optionalNestedEnum ?? json.optional_nested_enum; if (optionalNestedEnum) { msg.optionalNestedEnum = optionalNestedEnum; } const optionalForeignEnum = - json[\\"optionalForeignEnum\\"] ?? json.optional_foreign_enum; + json.optionalForeignEnum ?? json.optional_foreign_enum; if (optionalForeignEnum) { msg.optionalForeignEnum = optionalForeignEnum; } const optionalImportEnum = - json[\\"optionalImportEnum\\"] ?? json.optional_import_enum; + json.optionalImportEnum ?? json.optional_import_enum; if (optionalImportEnum) { msg.optionalImportEnum = optionalImportEnum; } const optionalStringPiece = - json[\\"optionalStringPiece\\"] ?? json.optional_string_piece; + json.optionalStringPiece ?? json.optional_string_piece; if (optionalStringPiece) { msg.optionalStringPiece = optionalStringPiece; } - const optionalCord = json[\\"optionalCord\\"] ?? json.optional_cord; + const optionalCord = json.optionalCord ?? json.optional_cord; if (optionalCord) { msg.optionalCord = optionalCord; } const optionalPublicImportMessage = - json[\\"optionalPublicImportMessage\\"] ?? - json.optional_public_import_message; + json.optionalPublicImportMessage ?? json.optional_public_import_message; if (optionalPublicImportMessage) { const m = PublicImportMessage.initialize(); PublicImportMessage._readMessageJSON(m, optionalPublicImportMessage); msg.optionalPublicImportMessage = m; } const optionalLazyMessage = - json[\\"optionalLazyMessage\\"] ?? json.optional_lazy_message; + json.optionalLazyMessage ?? json.optional_lazy_message; if (optionalLazyMessage) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, optionalLazyMessage); msg.optionalLazyMessage = m; } - const repeatedInt32 = json[\\"repeatedInt32\\"] ?? json.repeated_int32; + const repeatedInt32 = json.repeatedInt32 ?? json.repeated_int32; if (repeatedInt32) { msg.repeatedInt32 = repeatedInt32; } - const repeatedInt64 = json[\\"repeatedInt64\\"] ?? json.repeated_int64; + const repeatedInt64 = json.repeatedInt64 ?? json.repeated_int64; if (repeatedInt64) { - msg.repeatedInt64 = repeatedInt64; + msg.repeatedInt64 = repeatedInt64.map(BigInt); } - const repeatedUint32 = json[\\"repeatedUint32\\"] ?? json.repeated_uint32; + const repeatedUint32 = json.repeatedUint32 ?? json.repeated_uint32; if (repeatedUint32) { msg.repeatedUint32 = repeatedUint32; } - const repeatedUint64 = json[\\"repeatedUint64\\"] ?? json.repeated_uint64; + const repeatedUint64 = json.repeatedUint64 ?? json.repeated_uint64; if (repeatedUint64) { - msg.repeatedUint64 = repeatedUint64; + msg.repeatedUint64 = repeatedUint64.map(BigInt); } - const repeatedSint32 = json[\\"repeatedSint32\\"] ?? json.repeated_sint32; + const repeatedSint32 = json.repeatedSint32 ?? json.repeated_sint32; if (repeatedSint32) { msg.repeatedSint32 = repeatedSint32; } - const repeatedSint64 = json[\\"repeatedSint64\\"] ?? json.repeated_sint64; + const repeatedSint64 = json.repeatedSint64 ?? json.repeated_sint64; if (repeatedSint64) { - msg.repeatedSint64 = repeatedSint64; + msg.repeatedSint64 = repeatedSint64.map(BigInt); } - const repeatedFixed32 = json[\\"repeatedFixed32\\"] ?? json.repeated_fixed32; + const repeatedFixed32 = json.repeatedFixed32 ?? json.repeated_fixed32; if (repeatedFixed32) { msg.repeatedFixed32 = repeatedFixed32; } - const repeatedFixed64 = json[\\"repeatedFixed64\\"] ?? json.repeated_fixed64; + const repeatedFixed64 = json.repeatedFixed64 ?? json.repeated_fixed64; if (repeatedFixed64) { - msg.repeatedFixed64 = repeatedFixed64; + msg.repeatedFixed64 = repeatedFixed64.map(BigInt); } - const repeatedSfixed32 = json[\\"repeatedSfixed32\\"] ?? json.repeated_sfixed32; + const repeatedSfixed32 = json.repeatedSfixed32 ?? json.repeated_sfixed32; if (repeatedSfixed32) { msg.repeatedSfixed32 = repeatedSfixed32; } - const repeatedSfixed64 = json[\\"repeatedSfixed64\\"] ?? json.repeated_sfixed64; + const repeatedSfixed64 = json.repeatedSfixed64 ?? json.repeated_sfixed64; if (repeatedSfixed64) { - msg.repeatedSfixed64 = repeatedSfixed64; + msg.repeatedSfixed64 = repeatedSfixed64.map(BigInt); } - const repeatedFloat = json[\\"repeatedFloat\\"] ?? json.repeated_float; + const repeatedFloat = json.repeatedFloat ?? json.repeated_float; if (repeatedFloat) { msg.repeatedFloat = repeatedFloat; } - const repeatedDouble = json[\\"repeatedDouble\\"] ?? json.repeated_double; + const repeatedDouble = json.repeatedDouble ?? json.repeated_double; if (repeatedDouble) { msg.repeatedDouble = repeatedDouble; } - const repeatedBool = json[\\"repeatedBool\\"] ?? json.repeated_bool; + const repeatedBool = json.repeatedBool ?? json.repeated_bool; if (repeatedBool) { msg.repeatedBool = repeatedBool; } - const repeatedString = json[\\"repeatedString\\"] ?? json.repeated_string; + const repeatedString = json.repeatedString ?? json.repeated_string; if (repeatedString) { msg.repeatedString = repeatedString; } - const repeatedBytes = json[\\"repeatedBytes\\"] ?? json.repeated_bytes; + const repeatedBytes = json.repeatedBytes ?? json.repeated_bytes; if (repeatedBytes) { msg.repeatedBytes = repeatedBytes; } const repeatedNestedMessage = - json[\\"repeatedNestedMessage\\"] ?? json.repeated_nested_message; + json.repeatedNestedMessage ?? json.repeated_nested_message; if (repeatedNestedMessage) { for (const item of repeatedNestedMessage) { const m = TestAllTypes.NestedMessage.initialize(); @@ -20204,7 +20666,7 @@ export const TestAllTypes = { } } const repeatedForeignMessage = - json[\\"repeatedForeignMessage\\"] ?? json.repeated_foreign_message; + json.repeatedForeignMessage ?? json.repeated_foreign_message; if (repeatedForeignMessage) { for (const item of repeatedForeignMessage) { const m = ForeignMessage.initialize(); @@ -20213,7 +20675,7 @@ export const TestAllTypes = { } } const repeatedImportMessage = - json[\\"repeatedImportMessage\\"] ?? json.repeated_import_message; + json.repeatedImportMessage ?? json.repeated_import_message; if (repeatedImportMessage) { for (const item of repeatedImportMessage) { const m = ImportMessage.initialize(); @@ -20222,31 +20684,31 @@ export const TestAllTypes = { } } const repeatedNestedEnum = - json[\\"repeatedNestedEnum\\"] ?? json.repeated_nested_enum; + json.repeatedNestedEnum ?? json.repeated_nested_enum; if (repeatedNestedEnum) { msg.repeatedNestedEnum = repeatedNestedEnum; } const repeatedForeignEnum = - json[\\"repeatedForeignEnum\\"] ?? json.repeated_foreign_enum; + json.repeatedForeignEnum ?? json.repeated_foreign_enum; if (repeatedForeignEnum) { msg.repeatedForeignEnum = repeatedForeignEnum; } const repeatedImportEnum = - json[\\"repeatedImportEnum\\"] ?? json.repeated_import_enum; + json.repeatedImportEnum ?? json.repeated_import_enum; if (repeatedImportEnum) { msg.repeatedImportEnum = repeatedImportEnum; } const repeatedStringPiece = - json[\\"repeatedStringPiece\\"] ?? json.repeated_string_piece; + json.repeatedStringPiece ?? json.repeated_string_piece; if (repeatedStringPiece) { msg.repeatedStringPiece = repeatedStringPiece; } - const repeatedCord = json[\\"repeatedCord\\"] ?? json.repeated_cord; + const repeatedCord = json.repeatedCord ?? json.repeated_cord; if (repeatedCord) { msg.repeatedCord = repeatedCord; } const repeatedLazyMessage = - json[\\"repeatedLazyMessage\\"] ?? json.repeated_lazy_message; + json.repeatedLazyMessage ?? json.repeated_lazy_message; if (repeatedLazyMessage) { for (const item of repeatedLazyMessage) { const m = TestAllTypes.NestedMessage.initialize(); @@ -20254,106 +20716,106 @@ export const TestAllTypes = { msg.repeatedLazyMessage.push(m); } } - const defaultInt32 = json[\\"defaultInt32\\"] ?? json.default_int32; + const defaultInt32 = json.defaultInt32 ?? json.default_int32; if (defaultInt32) { msg.defaultInt32 = defaultInt32; } - const defaultInt64 = json[\\"defaultInt64\\"] ?? json.default_int64; + const defaultInt64 = json.defaultInt64 ?? json.default_int64; if (defaultInt64) { - msg.defaultInt64 = defaultInt64; + msg.defaultInt64 = BigInt(defaultInt64); } - const defaultUint32 = json[\\"defaultUint32\\"] ?? json.default_uint32; + const defaultUint32 = json.defaultUint32 ?? json.default_uint32; if (defaultUint32) { msg.defaultUint32 = defaultUint32; } - const defaultUint64 = json[\\"defaultUint64\\"] ?? json.default_uint64; + const defaultUint64 = json.defaultUint64 ?? json.default_uint64; if (defaultUint64) { - msg.defaultUint64 = defaultUint64; + msg.defaultUint64 = BigInt(defaultUint64); } - const defaultSint32 = json[\\"defaultSint32\\"] ?? json.default_sint32; + const defaultSint32 = json.defaultSint32 ?? json.default_sint32; if (defaultSint32) { msg.defaultSint32 = defaultSint32; } - const defaultSint64 = json[\\"defaultSint64\\"] ?? json.default_sint64; + const defaultSint64 = json.defaultSint64 ?? json.default_sint64; if (defaultSint64) { - msg.defaultSint64 = defaultSint64; + msg.defaultSint64 = BigInt(defaultSint64); } - const defaultFixed32 = json[\\"defaultFixed32\\"] ?? json.default_fixed32; + const defaultFixed32 = json.defaultFixed32 ?? json.default_fixed32; if (defaultFixed32) { msg.defaultFixed32 = defaultFixed32; } - const defaultFixed64 = json[\\"defaultFixed64\\"] ?? json.default_fixed64; + const defaultFixed64 = json.defaultFixed64 ?? json.default_fixed64; if (defaultFixed64) { - msg.defaultFixed64 = defaultFixed64; + msg.defaultFixed64 = BigInt(defaultFixed64); } - const defaultSfixed32 = json[\\"defaultSfixed32\\"] ?? json.default_sfixed32; + const defaultSfixed32 = json.defaultSfixed32 ?? json.default_sfixed32; if (defaultSfixed32) { msg.defaultSfixed32 = defaultSfixed32; } - const defaultSfixed64 = json[\\"defaultSfixed64\\"] ?? json.default_sfixed64; + const defaultSfixed64 = json.defaultSfixed64 ?? json.default_sfixed64; if (defaultSfixed64) { - msg.defaultSfixed64 = defaultSfixed64; + msg.defaultSfixed64 = BigInt(defaultSfixed64); } - const defaultFloat = json[\\"defaultFloat\\"] ?? json.default_float; + const defaultFloat = json.defaultFloat ?? json.default_float; if (defaultFloat) { msg.defaultFloat = defaultFloat; } - const defaultDouble = json[\\"defaultDouble\\"] ?? json.default_double; + const defaultDouble = json.defaultDouble ?? json.default_double; if (defaultDouble) { msg.defaultDouble = defaultDouble; } - const defaultBool = json[\\"defaultBool\\"] ?? json.default_bool; + const defaultBool = json.defaultBool ?? json.default_bool; if (defaultBool) { msg.defaultBool = defaultBool; } - const defaultString = json[\\"defaultString\\"] ?? json.default_string; + const defaultString = json.defaultString ?? json.default_string; if (defaultString) { msg.defaultString = defaultString; } - const defaultBytes = json[\\"defaultBytes\\"] ?? json.default_bytes; + const defaultBytes = json.defaultBytes ?? json.default_bytes; if (defaultBytes) { msg.defaultBytes = defaultBytes; } const defaultNestedEnum = - json[\\"defaultNestedEnum\\"] ?? json.default_nested_enum; + json.defaultNestedEnum ?? json.default_nested_enum; if (defaultNestedEnum) { msg.defaultNestedEnum = defaultNestedEnum; } const defaultForeignEnum = - json[\\"defaultForeignEnum\\"] ?? json.default_foreign_enum; + json.defaultForeignEnum ?? json.default_foreign_enum; if (defaultForeignEnum) { msg.defaultForeignEnum = defaultForeignEnum; } const defaultImportEnum = - json[\\"defaultImportEnum\\"] ?? json.default_import_enum; + json.defaultImportEnum ?? json.default_import_enum; if (defaultImportEnum) { msg.defaultImportEnum = defaultImportEnum; } const defaultStringPiece = - json[\\"defaultStringPiece\\"] ?? json.default_string_piece; + json.defaultStringPiece ?? json.default_string_piece; if (defaultStringPiece) { msg.defaultStringPiece = defaultStringPiece; } - const defaultCord = json[\\"defaultCord\\"] ?? json.default_cord; + const defaultCord = json.defaultCord ?? json.default_cord; if (defaultCord) { msg.defaultCord = defaultCord; } - const oneofUint32 = json[\\"oneofUint32\\"] ?? json.oneof_uint32; + const oneofUint32 = json.oneofUint32 ?? json.oneof_uint32; if (oneofUint32) { msg.oneofUint32 = oneofUint32; } const oneofNestedMessage = - json[\\"oneofNestedMessage\\"] ?? json.oneof_nested_message; + json.oneofNestedMessage ?? json.oneof_nested_message; if (oneofNestedMessage) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, oneofNestedMessage); msg.oneofNestedMessage = m; } - const oneofString = json[\\"oneofString\\"] ?? json.oneof_string; + const oneofString = json.oneofString ?? json.oneof_string; if (oneofString) { msg.oneofString = oneofString; } - const oneofBytes = json[\\"oneofBytes\\"] ?? json.oneof_bytes; + const oneofBytes = json.oneofBytes ?? json.oneof_bytes; if (oneofBytes) { msg.oneofBytes = oneofBytes; } @@ -20425,9 +20887,9 @@ export const TestAllTypes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.bb) { - json[\\"bb\\"] = msg.bb; + json.bb = msg.bb; } return json; }, @@ -20456,7 +20918,7 @@ export const TestAllTypes = { * @private */ _readMessageJSON: function (msg, json) { - const bb = json[\\"bb\\"] ?? json.bb; + const bb = json.bb ?? json.bb; if (bb) { msg.bb = bb; } @@ -20527,9 +20989,9 @@ export const TestAllTypes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -20558,7 +21020,7 @@ export const TestAllTypes = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -20629,9 +21091,9 @@ export const TestAllTypes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -20660,7 +21122,7 @@ export const TestAllTypes = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -20744,21 +21206,21 @@ export const NestedTestAllTypes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.child) { const child = NestedTestAllTypes._writeMessageJSON(msg.child); if (Object.keys(child).length > 0) { - json[\\"child\\"] = child; + json.child = child; } } if (msg.payload) { const payload = TestAllTypes._writeMessageJSON(msg.payload); if (Object.keys(payload).length > 0) { - json[\\"payload\\"] = payload; + json.payload = payload; } } if (msg.repeatedChild?.length) { - json[\\"repeatedChild\\"] = msg.repeatedChild.map( + json.repeatedChild = msg.repeatedChild.map( NestedTestAllTypes._writeMessageJSON ); } @@ -20799,19 +21261,19 @@ export const NestedTestAllTypes = { * @private */ _readMessageJSON: function (msg, json) { - const child = json[\\"child\\"] ?? json.child; + const child = json.child ?? json.child; if (child) { const m = NestedTestAllTypes.initialize(); NestedTestAllTypes._readMessageJSON(m, child); msg.child = m; } - const payload = json[\\"payload\\"] ?? json.payload; + const payload = json.payload ?? json.payload; if (payload) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, payload); msg.payload = m; } - const repeatedChild = json[\\"repeatedChild\\"] ?? json.repeated_child; + const repeatedChild = json.repeatedChild ?? json.repeated_child; if (repeatedChild) { for (const item of repeatedChild) { const m = NestedTestAllTypes.initialize(); @@ -20889,12 +21351,12 @@ export const TestDeprecatedFields = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.deprecatedInt32) { - json[\\"deprecatedInt32\\"] = msg.deprecatedInt32; + json.deprecatedInt32 = msg.deprecatedInt32; } if (msg.deprecatedInt32InOneof != undefined) { - json[\\"deprecatedInt32InOneof\\"] = msg.deprecatedInt32InOneof; + json.deprecatedInt32InOneof = msg.deprecatedInt32InOneof; } return json; }, @@ -20927,12 +21389,12 @@ export const TestDeprecatedFields = { * @private */ _readMessageJSON: function (msg, json) { - const deprecatedInt32 = json[\\"deprecatedInt32\\"] ?? json.deprecated_int32; + const deprecatedInt32 = json.deprecatedInt32 ?? json.deprecated_int32; if (deprecatedInt32) { msg.deprecatedInt32 = deprecatedInt32; } const deprecatedInt32InOneof = - json[\\"deprecatedInt32InOneof\\"] ?? json.deprecated_int32_in_oneof; + json.deprecatedInt32InOneof ?? json.deprecated_int32_in_oneof; if (deprecatedInt32InOneof) { msg.deprecatedInt32InOneof = deprecatedInt32InOneof; } @@ -21053,12 +21515,12 @@ export const ForeignMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.c) { - json[\\"c\\"] = msg.c; + json.c = msg.c; } if (msg.d) { - json[\\"d\\"] = msg.d; + json.d = msg.d; } return json; }, @@ -21091,11 +21553,11 @@ export const ForeignMessage = { * @private */ _readMessageJSON: function (msg, json) { - const c = json[\\"c\\"] ?? json.c; + const c = json.c ?? json.c; if (c) { msg.c = c; } - const d = json[\\"d\\"] ?? json.d; + const d = json.d ?? json.d; if (d) { msg.d = d; } @@ -21262,9 +21724,9 @@ export const OptionalGroup_extension = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -21293,7 +21755,7 @@ export const OptionalGroup_extension = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -21364,9 +21826,9 @@ export const RepeatedGroup_extension = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -21395,7 +21857,7 @@ export const RepeatedGroup_extension = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -21461,9 +21923,9 @@ export const TestGroup = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.optionalForeignEnum) { - json[\\"optionalForeignEnum\\"] = msg.optionalForeignEnum; + json.optionalForeignEnum = msg.optionalForeignEnum; } return json; }, @@ -21493,7 +21955,7 @@ export const TestGroup = { */ _readMessageJSON: function (msg, json) { const optionalForeignEnum = - json[\\"optionalForeignEnum\\"] ?? json.optional_foreign_enum; + json.optionalForeignEnum ?? json.optional_foreign_enum; if (optionalForeignEnum) { msg.optionalForeignEnum = optionalForeignEnum; } @@ -21563,9 +22025,9 @@ export const TestGroup = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -21594,7 +22056,7 @@ export const TestGroup = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -21763,9 +22225,9 @@ export const TestNestedExtension = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -21794,7 +22256,7 @@ export const TestNestedExtension = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -21878,19 +22340,19 @@ export const TestChildExtension = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } if (msg.b) { - json[\\"b\\"] = msg.b; + json.b = msg.b; } if (msg.optionalExtension) { const optionalExtension = TestAllExtensions._writeMessageJSON( msg.optionalExtension ); if (Object.keys(optionalExtension).length > 0) { - json[\\"optionalExtension\\"] = optionalExtension; + json.optionalExtension = optionalExtension; } } return json; @@ -21931,16 +22393,15 @@ export const TestChildExtension = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } - const b = json[\\"b\\"] ?? json.b; + const b = json.b ?? json.b; if (b) { msg.b = b; } - const optionalExtension = - json[\\"optionalExtension\\"] ?? json.optional_extension; + const optionalExtension = json.optionalExtension ?? json.optional_extension; if (optionalExtension) { const m = TestAllExtensions.initialize(); TestAllExtensions._readMessageJSON(m, optionalExtension); @@ -22139,105 +22600,105 @@ export const TestRequired = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } if (msg.dummy2) { - json[\\"dummy2\\"] = msg.dummy2; + json.dummy2 = msg.dummy2; } if (msg.b) { - json[\\"b\\"] = msg.b; + json.b = msg.b; } if (msg.dummy4) { - json[\\"dummy4\\"] = msg.dummy4; + json.dummy4 = msg.dummy4; } if (msg.dummy5) { - json[\\"dummy5\\"] = msg.dummy5; + json.dummy5 = msg.dummy5; } if (msg.dummy6) { - json[\\"dummy6\\"] = msg.dummy6; + json.dummy6 = msg.dummy6; } if (msg.dummy7) { - json[\\"dummy7\\"] = msg.dummy7; + json.dummy7 = msg.dummy7; } if (msg.dummy8) { - json[\\"dummy8\\"] = msg.dummy8; + json.dummy8 = msg.dummy8; } if (msg.dummy9) { - json[\\"dummy9\\"] = msg.dummy9; + json.dummy9 = msg.dummy9; } if (msg.dummy10) { - json[\\"dummy10\\"] = msg.dummy10; + json.dummy10 = msg.dummy10; } if (msg.dummy11) { - json[\\"dummy11\\"] = msg.dummy11; + json.dummy11 = msg.dummy11; } if (msg.dummy12) { - json[\\"dummy12\\"] = msg.dummy12; + json.dummy12 = msg.dummy12; } if (msg.dummy13) { - json[\\"dummy13\\"] = msg.dummy13; + json.dummy13 = msg.dummy13; } if (msg.dummy14) { - json[\\"dummy14\\"] = msg.dummy14; + json.dummy14 = msg.dummy14; } if (msg.dummy15) { - json[\\"dummy15\\"] = msg.dummy15; + json.dummy15 = msg.dummy15; } if (msg.dummy16) { - json[\\"dummy16\\"] = msg.dummy16; + json.dummy16 = msg.dummy16; } if (msg.dummy17) { - json[\\"dummy17\\"] = msg.dummy17; + json.dummy17 = msg.dummy17; } if (msg.dummy18) { - json[\\"dummy18\\"] = msg.dummy18; + json.dummy18 = msg.dummy18; } if (msg.dummy19) { - json[\\"dummy19\\"] = msg.dummy19; + json.dummy19 = msg.dummy19; } if (msg.dummy20) { - json[\\"dummy20\\"] = msg.dummy20; + json.dummy20 = msg.dummy20; } if (msg.dummy21) { - json[\\"dummy21\\"] = msg.dummy21; + json.dummy21 = msg.dummy21; } if (msg.dummy22) { - json[\\"dummy22\\"] = msg.dummy22; + json.dummy22 = msg.dummy22; } if (msg.dummy23) { - json[\\"dummy23\\"] = msg.dummy23; + json.dummy23 = msg.dummy23; } if (msg.dummy24) { - json[\\"dummy24\\"] = msg.dummy24; + json.dummy24 = msg.dummy24; } if (msg.dummy25) { - json[\\"dummy25\\"] = msg.dummy25; + json.dummy25 = msg.dummy25; } if (msg.dummy26) { - json[\\"dummy26\\"] = msg.dummy26; + json.dummy26 = msg.dummy26; } if (msg.dummy27) { - json[\\"dummy27\\"] = msg.dummy27; + json.dummy27 = msg.dummy27; } if (msg.dummy28) { - json[\\"dummy28\\"] = msg.dummy28; + json.dummy28 = msg.dummy28; } if (msg.dummy29) { - json[\\"dummy29\\"] = msg.dummy29; + json.dummy29 = msg.dummy29; } if (msg.dummy30) { - json[\\"dummy30\\"] = msg.dummy30; + json.dummy30 = msg.dummy30; } if (msg.dummy31) { - json[\\"dummy31\\"] = msg.dummy31; + json.dummy31 = msg.dummy31; } if (msg.dummy32) { - json[\\"dummy32\\"] = msg.dummy32; + json.dummy32 = msg.dummy32; } if (msg.c) { - json[\\"c\\"] = msg.c; + json.c = msg.c; } return json; }, @@ -22394,135 +22855,135 @@ export const TestRequired = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } - const dummy2 = json[\\"dummy2\\"] ?? json.dummy2; + const dummy2 = json.dummy2 ?? json.dummy2; if (dummy2) { msg.dummy2 = dummy2; } - const b = json[\\"b\\"] ?? json.b; + const b = json.b ?? json.b; if (b) { msg.b = b; } - const dummy4 = json[\\"dummy4\\"] ?? json.dummy4; + const dummy4 = json.dummy4 ?? json.dummy4; if (dummy4) { msg.dummy4 = dummy4; } - const dummy5 = json[\\"dummy5\\"] ?? json.dummy5; + const dummy5 = json.dummy5 ?? json.dummy5; if (dummy5) { msg.dummy5 = dummy5; } - const dummy6 = json[\\"dummy6\\"] ?? json.dummy6; + const dummy6 = json.dummy6 ?? json.dummy6; if (dummy6) { msg.dummy6 = dummy6; } - const dummy7 = json[\\"dummy7\\"] ?? json.dummy7; + const dummy7 = json.dummy7 ?? json.dummy7; if (dummy7) { msg.dummy7 = dummy7; } - const dummy8 = json[\\"dummy8\\"] ?? json.dummy8; + const dummy8 = json.dummy8 ?? json.dummy8; if (dummy8) { msg.dummy8 = dummy8; } - const dummy9 = json[\\"dummy9\\"] ?? json.dummy9; + const dummy9 = json.dummy9 ?? json.dummy9; if (dummy9) { msg.dummy9 = dummy9; } - const dummy10 = json[\\"dummy10\\"] ?? json.dummy10; + const dummy10 = json.dummy10 ?? json.dummy10; if (dummy10) { msg.dummy10 = dummy10; } - const dummy11 = json[\\"dummy11\\"] ?? json.dummy11; + const dummy11 = json.dummy11 ?? json.dummy11; if (dummy11) { msg.dummy11 = dummy11; } - const dummy12 = json[\\"dummy12\\"] ?? json.dummy12; + const dummy12 = json.dummy12 ?? json.dummy12; if (dummy12) { msg.dummy12 = dummy12; } - const dummy13 = json[\\"dummy13\\"] ?? json.dummy13; + const dummy13 = json.dummy13 ?? json.dummy13; if (dummy13) { msg.dummy13 = dummy13; } - const dummy14 = json[\\"dummy14\\"] ?? json.dummy14; + const dummy14 = json.dummy14 ?? json.dummy14; if (dummy14) { msg.dummy14 = dummy14; } - const dummy15 = json[\\"dummy15\\"] ?? json.dummy15; + const dummy15 = json.dummy15 ?? json.dummy15; if (dummy15) { msg.dummy15 = dummy15; } - const dummy16 = json[\\"dummy16\\"] ?? json.dummy16; + const dummy16 = json.dummy16 ?? json.dummy16; if (dummy16) { msg.dummy16 = dummy16; } - const dummy17 = json[\\"dummy17\\"] ?? json.dummy17; + const dummy17 = json.dummy17 ?? json.dummy17; if (dummy17) { msg.dummy17 = dummy17; } - const dummy18 = json[\\"dummy18\\"] ?? json.dummy18; + const dummy18 = json.dummy18 ?? json.dummy18; if (dummy18) { msg.dummy18 = dummy18; } - const dummy19 = json[\\"dummy19\\"] ?? json.dummy19; + const dummy19 = json.dummy19 ?? json.dummy19; if (dummy19) { msg.dummy19 = dummy19; } - const dummy20 = json[\\"dummy20\\"] ?? json.dummy20; + const dummy20 = json.dummy20 ?? json.dummy20; if (dummy20) { msg.dummy20 = dummy20; } - const dummy21 = json[\\"dummy21\\"] ?? json.dummy21; + const dummy21 = json.dummy21 ?? json.dummy21; if (dummy21) { msg.dummy21 = dummy21; } - const dummy22 = json[\\"dummy22\\"] ?? json.dummy22; + const dummy22 = json.dummy22 ?? json.dummy22; if (dummy22) { msg.dummy22 = dummy22; } - const dummy23 = json[\\"dummy23\\"] ?? json.dummy23; + const dummy23 = json.dummy23 ?? json.dummy23; if (dummy23) { msg.dummy23 = dummy23; } - const dummy24 = json[\\"dummy24\\"] ?? json.dummy24; + const dummy24 = json.dummy24 ?? json.dummy24; if (dummy24) { msg.dummy24 = dummy24; } - const dummy25 = json[\\"dummy25\\"] ?? json.dummy25; + const dummy25 = json.dummy25 ?? json.dummy25; if (dummy25) { msg.dummy25 = dummy25; } - const dummy26 = json[\\"dummy26\\"] ?? json.dummy26; + const dummy26 = json.dummy26 ?? json.dummy26; if (dummy26) { msg.dummy26 = dummy26; } - const dummy27 = json[\\"dummy27\\"] ?? json.dummy27; + const dummy27 = json.dummy27 ?? json.dummy27; if (dummy27) { msg.dummy27 = dummy27; } - const dummy28 = json[\\"dummy28\\"] ?? json.dummy28; + const dummy28 = json.dummy28 ?? json.dummy28; if (dummy28) { msg.dummy28 = dummy28; } - const dummy29 = json[\\"dummy29\\"] ?? json.dummy29; + const dummy29 = json.dummy29 ?? json.dummy29; if (dummy29) { msg.dummy29 = dummy29; } - const dummy30 = json[\\"dummy30\\"] ?? json.dummy30; + const dummy30 = json.dummy30 ?? json.dummy30; if (dummy30) { msg.dummy30 = dummy30; } - const dummy31 = json[\\"dummy31\\"] ?? json.dummy31; + const dummy31 = json.dummy31 ?? json.dummy31; if (dummy31) { msg.dummy31 = dummy31; } - const dummy32 = json[\\"dummy32\\"] ?? json.dummy32; + const dummy32 = json.dummy32 ?? json.dummy32; if (dummy32) { msg.dummy32 = dummy32; } - const c = json[\\"c\\"] ?? json.c; + const c = json.c ?? json.c; if (c) { msg.c = c; } @@ -22605,22 +23066,22 @@ export const TestRequiredForeign = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.optionalMessage) { const optionalMessage = TestRequired._writeMessageJSON( msg.optionalMessage ); if (Object.keys(optionalMessage).length > 0) { - json[\\"optionalMessage\\"] = optionalMessage; + json.optionalMessage = optionalMessage; } } if (msg.repeatedMessage?.length) { - json[\\"repeatedMessage\\"] = msg.repeatedMessage.map( + json.repeatedMessage = msg.repeatedMessage.map( TestRequired._writeMessageJSON ); } if (msg.dummy) { - json[\\"dummy\\"] = msg.dummy; + json.dummy = msg.dummy; } return json; }, @@ -22659,13 +23120,13 @@ export const TestRequiredForeign = { * @private */ _readMessageJSON: function (msg, json) { - const optionalMessage = json[\\"optionalMessage\\"] ?? json.optional_message; + const optionalMessage = json.optionalMessage ?? json.optional_message; if (optionalMessage) { const m = TestRequired.initialize(); TestRequired._readMessageJSON(m, optionalMessage); msg.optionalMessage = m; } - const repeatedMessage = json[\\"repeatedMessage\\"] ?? json.repeated_message; + const repeatedMessage = json.repeatedMessage ?? json.repeated_message; if (repeatedMessage) { for (const item of repeatedMessage) { const m = TestRequired.initialize(); @@ -22673,7 +23134,7 @@ export const TestRequiredForeign = { msg.repeatedMessage.push(m); } } - const dummy = json[\\"dummy\\"] ?? json.dummy; + const dummy = json.dummy ?? json.dummy; if (dummy) { msg.dummy = dummy; } @@ -22756,17 +23217,17 @@ export const TestRequiredMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.optionalMessage) { const optionalMessage = TestRequired._writeMessageJSON( msg.optionalMessage ); if (Object.keys(optionalMessage).length > 0) { - json[\\"optionalMessage\\"] = optionalMessage; + json.optionalMessage = optionalMessage; } } if (msg.repeatedMessage?.length) { - json[\\"repeatedMessage\\"] = msg.repeatedMessage.map( + json.repeatedMessage = msg.repeatedMessage.map( TestRequired._writeMessageJSON ); } @@ -22775,7 +23236,7 @@ export const TestRequiredMessage = { msg.requiredMessage ); if (Object.keys(requiredMessage).length > 0) { - json[\\"requiredMessage\\"] = requiredMessage; + json.requiredMessage = requiredMessage; } } return json; @@ -22815,13 +23276,13 @@ export const TestRequiredMessage = { * @private */ _readMessageJSON: function (msg, json) { - const optionalMessage = json[\\"optionalMessage\\"] ?? json.optional_message; + const optionalMessage = json.optionalMessage ?? json.optional_message; if (optionalMessage) { const m = TestRequired.initialize(); TestRequired._readMessageJSON(m, optionalMessage); msg.optionalMessage = m; } - const repeatedMessage = json[\\"repeatedMessage\\"] ?? json.repeated_message; + const repeatedMessage = json.repeatedMessage ?? json.repeated_message; if (repeatedMessage) { for (const item of repeatedMessage) { const m = TestRequired.initialize(); @@ -22829,7 +23290,7 @@ export const TestRequiredMessage = { msg.repeatedMessage.push(m); } } - const requiredMessage = json[\\"requiredMessage\\"] ?? json.required_message; + const requiredMessage = json.requiredMessage ?? json.required_message; if (requiredMessage) { const m = TestRequired.initialize(); TestRequired._readMessageJSON(m, requiredMessage); @@ -22906,13 +23367,13 @@ export const TestForeignNested = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.foreignNested) { const foreignNested = TestAllTypes.NestedMessage._writeMessageJSON( msg.foreignNested ); if (Object.keys(foreignNested).length > 0) { - json[\\"foreignNested\\"] = foreignNested; + json.foreignNested = foreignNested; } } return json; @@ -22945,7 +23406,7 @@ export const TestForeignNested = { * @private */ _readMessageJSON: function (msg, json) { - const foreignNested = json[\\"foreignNested\\"] ?? json.foreign_nested; + const foreignNested = json.foreignNested ?? json.foreign_nested; if (foreignNested) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, foreignNested); @@ -23161,9 +23622,9 @@ export const TestPickleNestedMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.bb) { - json[\\"bb\\"] = msg.bb; + json.bb = msg.bb; } return json; }, @@ -23192,7 +23653,7 @@ export const TestPickleNestedMessage = { * @private */ _readMessageJSON: function (msg, json) { - const bb = json[\\"bb\\"] ?? json.bb; + const bb = json.bb ?? json.bb; if (bb) { msg.bb = bb; } @@ -23264,9 +23725,9 @@ export const TestPickleNestedMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.cc) { - json[\\"cc\\"] = msg.cc; + json.cc = msg.cc; } return json; }, @@ -23295,7 +23756,7 @@ export const TestPickleNestedMessage = { * @private */ _readMessageJSON: function (msg, json) { - const cc = json[\\"cc\\"] ?? json.cc; + const cc = json.cc ?? json.cc; if (cc) { msg.cc = cc; } @@ -23420,12 +23881,12 @@ export const TestReallyLargeTagNumber = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } if (msg.bb) { - json[\\"bb\\"] = msg.bb; + json.bb = msg.bb; } return json; }, @@ -23458,11 +23919,11 @@ export const TestReallyLargeTagNumber = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } - const bb = json[\\"bb\\"] ?? json.bb; + const bb = json.bb ?? json.bb; if (bb) { msg.bb = bb; } @@ -23537,15 +23998,15 @@ export const TestRecursiveMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { const a = TestRecursiveMessage._writeMessageJSON(msg.a); if (Object.keys(a).length > 0) { - json[\\"a\\"] = a; + json.a = a; } } if (msg.i) { - json[\\"i\\"] = msg.i; + json.i = msg.i; } return json; }, @@ -23578,13 +24039,13 @@ export const TestRecursiveMessage = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { const m = TestRecursiveMessage.initialize(); TestRecursiveMessage._readMessageJSON(m, a); msg.a = m; } - const i = json[\\"i\\"] ?? json.i; + const i = json.i ?? json.i; if (i) { msg.i = i; } @@ -23655,11 +24116,11 @@ export const TestMutualRecursionA = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.bb) { const bb = TestMutualRecursionB._writeMessageJSON(msg.bb); if (Object.keys(bb).length > 0) { - json[\\"bb\\"] = bb; + json.bb = bb; } } return json; @@ -23689,7 +24150,7 @@ export const TestMutualRecursionA = { * @private */ _readMessageJSON: function (msg, json) { - const bb = json[\\"bb\\"] ?? json.bb; + const bb = json.bb ?? json.bb; if (bb) { const m = TestMutualRecursionB.initialize(); TestMutualRecursionB._readMessageJSON(m, bb); @@ -23761,11 +24222,11 @@ export const TestMutualRecursionA = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.b) { const b = TestMutualRecursionB._writeMessageJSON(msg.b); if (Object.keys(b).length > 0) { - json[\\"b\\"] = b; + json.b = b; } } return json; @@ -23795,7 +24256,7 @@ export const TestMutualRecursionA = { * @private */ _readMessageJSON: function (msg, json) { - const b = json[\\"b\\"] ?? json.b; + const b = json.b ?? json.b; if (b) { const m = TestMutualRecursionB.initialize(); TestMutualRecursionB._readMessageJSON(m, b); @@ -23876,19 +24337,19 @@ export const TestMutualRecursionA = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.subMessage) { const subMessage = TestMutualRecursionA.SubMessage._writeMessageJSON( msg.subMessage ); if (Object.keys(subMessage).length > 0) { - json[\\"subMessage\\"] = subMessage; + json.subMessage = subMessage; } } if (msg.notInThisScc) { const notInThisScc = TestAllTypes._writeMessageJSON(msg.notInThisScc); if (Object.keys(notInThisScc).length > 0) { - json[\\"notInThisScc\\"] = notInThisScc; + json.notInThisScc = notInThisScc; } } return json; @@ -23925,13 +24386,13 @@ export const TestMutualRecursionA = { * @private */ _readMessageJSON: function (msg, json) { - const subMessage = json[\\"subMessage\\"] ?? json.sub_message; + const subMessage = json.subMessage ?? json.sub_message; if (subMessage) { const m = TestMutualRecursionA.SubMessage.initialize(); TestMutualRecursionA.SubMessage._readMessageJSON(m, subMessage); msg.subMessage = m; } - const notInThisScc = json[\\"notInThisScc\\"] ?? json.not_in_this_scc; + const notInThisScc = json.notInThisScc ?? json.not_in_this_scc; if (notInThisScc) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, notInThisScc); @@ -24009,15 +24470,15 @@ export const TestMutualRecursionB = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { const a = TestMutualRecursionA._writeMessageJSON(msg.a); if (Object.keys(a).length > 0) { - json[\\"a\\"] = a; + json.a = a; } } if (msg.optionalInt32) { - json[\\"optionalInt32\\"] = msg.optionalInt32; + json.optionalInt32 = msg.optionalInt32; } return json; }, @@ -24050,13 +24511,13 @@ export const TestMutualRecursionB = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { const m = TestMutualRecursionA.initialize(); TestMutualRecursionA._readMessageJSON(m, a); msg.a = m; } - const optionalInt32 = json[\\"optionalInt32\\"] ?? json.optional_int32; + const optionalInt32 = json.optionalInt32 ?? json.optional_int32; if (optionalInt32) { msg.optionalInt32 = optionalInt32; } @@ -24131,13 +24592,13 @@ export const TestIsInitialized = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.subMessage) { const subMessage = TestIsInitialized.SubMessage._writeMessageJSON( msg.subMessage ); if (Object.keys(subMessage).length > 0) { - json[\\"subMessage\\"] = subMessage; + json.subMessage = subMessage; } } return json; @@ -24170,7 +24631,7 @@ export const TestIsInitialized = { * @private */ _readMessageJSON: function (msg, json) { - const subMessage = json[\\"subMessage\\"] ?? json.sub_message; + const subMessage = json.subMessage ?? json.sub_message; if (subMessage) { const m = TestIsInitialized.SubMessage.initialize(); TestIsInitialized.SubMessage._readMessageJSON(m, subMessage); @@ -24289,9 +24750,9 @@ export const TestIsInitialized = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.i) { - json[\\"i\\"] = msg.i; + json.i = msg.i; } return json; }, @@ -24320,7 +24781,7 @@ export const TestIsInitialized = { * @private */ _readMessageJSON: function (msg, json) { - const i = json[\\"i\\"] ?? json.i; + const i = json.i ?? json.i; if (i) { msg.i = i; } @@ -24393,9 +24854,9 @@ export const TestDupFieldNumber = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -24424,7 +24885,7 @@ export const TestDupFieldNumber = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -24492,9 +24953,9 @@ export const TestDupFieldNumber = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -24523,7 +24984,7 @@ export const TestDupFieldNumber = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -24592,9 +25053,9 @@ export const TestDupFieldNumber = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -24623,7 +25084,7 @@ export const TestDupFieldNumber = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -24693,11 +25154,11 @@ export const TestEagerMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.subMessage) { const subMessage = TestAllTypes._writeMessageJSON(msg.subMessage); if (Object.keys(subMessage).length > 0) { - json[\\"subMessage\\"] = subMessage; + json.subMessage = subMessage; } } return json; @@ -24727,7 +25188,7 @@ export const TestEagerMessage = { * @private */ _readMessageJSON: function (msg, json) { - const subMessage = json[\\"subMessage\\"] ?? json.sub_message; + const subMessage = json.subMessage ?? json.sub_message; if (subMessage) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, subMessage); @@ -24798,11 +25259,11 @@ export const TestLazyMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.subMessage) { const subMessage = TestAllTypes._writeMessageJSON(msg.subMessage); if (Object.keys(subMessage).length > 0) { - json[\\"subMessage\\"] = subMessage; + json.subMessage = subMessage; } } return json; @@ -24832,7 +25293,7 @@ export const TestLazyMessage = { * @private */ _readMessageJSON: function (msg, json) { - const subMessage = json[\\"subMessage\\"] ?? json.sub_message; + const subMessage = json.subMessage ?? json.sub_message; if (subMessage) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, subMessage); @@ -24910,14 +25371,14 @@ export const TestNestedMessageHasBits = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.optionalNestedMessage) { const optionalNestedMessage = TestNestedMessageHasBits.NestedMessage._writeMessageJSON( msg.optionalNestedMessage ); if (Object.keys(optionalNestedMessage).length > 0) { - json[\\"optionalNestedMessage\\"] = optionalNestedMessage; + json.optionalNestedMessage = optionalNestedMessage; } } return json; @@ -24951,7 +25412,7 @@ export const TestNestedMessageHasBits = { */ _readMessageJSON: function (msg, json) { const optionalNestedMessage = - json[\\"optionalNestedMessage\\"] ?? json.optional_nested_message; + json.optionalNestedMessage ?? json.optional_nested_message; if (optionalNestedMessage) { const m = TestNestedMessageHasBits.NestedMessage.initialize(); TestNestedMessageHasBits.NestedMessage._readMessageJSON( @@ -25034,12 +25495,12 @@ export const TestNestedMessageHasBits = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.nestedmessageRepeatedInt32?.length) { - json[\\"nestedmessageRepeatedInt32\\"] = msg.nestedmessageRepeatedInt32; + json.nestedmessageRepeatedInt32 = msg.nestedmessageRepeatedInt32; } if (msg.nestedmessageRepeatedForeignmessage?.length) { - json[\\"nestedmessageRepeatedForeignmessage\\"] = + json.nestedmessageRepeatedForeignmessage = msg.nestedmessageRepeatedForeignmessage.map( ForeignMessage._writeMessageJSON ); @@ -25078,12 +25539,12 @@ export const TestNestedMessageHasBits = { */ _readMessageJSON: function (msg, json) { const nestedmessageRepeatedInt32 = - json[\\"nestedmessageRepeatedInt32\\"] ?? json.nestedmessage_repeated_int32; + json.nestedmessageRepeatedInt32 ?? json.nestedmessage_repeated_int32; if (nestedmessageRepeatedInt32) { msg.nestedmessageRepeatedInt32 = nestedmessageRepeatedInt32; } const nestedmessageRepeatedForeignmessage = - json[\\"nestedmessageRepeatedForeignmessage\\"] ?? + json.nestedmessageRepeatedForeignmessage ?? json.nestedmessage_repeated_foreignmessage; if (nestedmessageRepeatedForeignmessage) { for (const item of nestedmessageRepeatedForeignmessage) { @@ -25208,47 +25669,47 @@ export const TestCamelCaseFieldNames = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.PrimitiveField) { - json[\\"PrimitiveField\\"] = msg.PrimitiveField; + json.PrimitiveField = msg.PrimitiveField; } if (msg.StringField) { - json[\\"StringField\\"] = msg.StringField; + json.StringField = msg.StringField; } if (msg.EnumField) { - json[\\"EnumField\\"] = msg.EnumField; + json.EnumField = msg.EnumField; } if (msg.MessageField) { const MessageField = ForeignMessage._writeMessageJSON(msg.MessageField); if (Object.keys(MessageField).length > 0) { - json[\\"MessageField\\"] = MessageField; + json.MessageField = MessageField; } } if (msg.StringPieceField) { - json[\\"StringPieceField\\"] = msg.StringPieceField; + json.StringPieceField = msg.StringPieceField; } if (msg.CordField) { - json[\\"CordField\\"] = msg.CordField; + json.CordField = msg.CordField; } if (msg.RepeatedPrimitiveField?.length) { - json[\\"RepeatedPrimitiveField\\"] = msg.RepeatedPrimitiveField; + json.RepeatedPrimitiveField = msg.RepeatedPrimitiveField; } if (msg.RepeatedStringField?.length) { - json[\\"RepeatedStringField\\"] = msg.RepeatedStringField; + json.RepeatedStringField = msg.RepeatedStringField; } if (msg.RepeatedEnumField?.length) { - json[\\"RepeatedEnumField\\"] = msg.RepeatedEnumField; + json.RepeatedEnumField = msg.RepeatedEnumField; } if (msg.RepeatedMessageField?.length) { - json[\\"RepeatedMessageField\\"] = msg.RepeatedMessageField.map( + json.RepeatedMessageField = msg.RepeatedMessageField.map( ForeignMessage._writeMessageJSON ); } if (msg.RepeatedStringPieceField?.length) { - json[\\"RepeatedStringPieceField\\"] = msg.RepeatedStringPieceField; + json.RepeatedStringPieceField = msg.RepeatedStringPieceField; } if (msg.RepeatedCordField?.length) { - json[\\"RepeatedCordField\\"] = msg.RepeatedCordField; + json.RepeatedCordField = msg.RepeatedCordField; } return json; }, @@ -25323,49 +25784,48 @@ export const TestCamelCaseFieldNames = { * @private */ _readMessageJSON: function (msg, json) { - const PrimitiveField = json[\\"PrimitiveField\\"] ?? json.PrimitiveField; + const PrimitiveField = json.PrimitiveField ?? json.PrimitiveField; if (PrimitiveField) { msg.PrimitiveField = PrimitiveField; } - const StringField = json[\\"StringField\\"] ?? json.StringField; + const StringField = json.StringField ?? json.StringField; if (StringField) { msg.StringField = StringField; } - const EnumField = json[\\"EnumField\\"] ?? json.EnumField; + const EnumField = json.EnumField ?? json.EnumField; if (EnumField) { msg.EnumField = EnumField; } - const MessageField = json[\\"MessageField\\"] ?? json.MessageField; + const MessageField = json.MessageField ?? json.MessageField; if (MessageField) { const m = ForeignMessage.initialize(); ForeignMessage._readMessageJSON(m, MessageField); msg.MessageField = m; } - const StringPieceField = json[\\"StringPieceField\\"] ?? json.StringPieceField; + const StringPieceField = json.StringPieceField ?? json.StringPieceField; if (StringPieceField) { msg.StringPieceField = StringPieceField; } - const CordField = json[\\"CordField\\"] ?? json.CordField; + const CordField = json.CordField ?? json.CordField; if (CordField) { msg.CordField = CordField; } const RepeatedPrimitiveField = - json[\\"RepeatedPrimitiveField\\"] ?? json.RepeatedPrimitiveField; + json.RepeatedPrimitiveField ?? json.RepeatedPrimitiveField; if (RepeatedPrimitiveField) { msg.RepeatedPrimitiveField = RepeatedPrimitiveField; } const RepeatedStringField = - json[\\"RepeatedStringField\\"] ?? json.RepeatedStringField; + json.RepeatedStringField ?? json.RepeatedStringField; if (RepeatedStringField) { msg.RepeatedStringField = RepeatedStringField; } - const RepeatedEnumField = - json[\\"RepeatedEnumField\\"] ?? json.RepeatedEnumField; + const RepeatedEnumField = json.RepeatedEnumField ?? json.RepeatedEnumField; if (RepeatedEnumField) { msg.RepeatedEnumField = RepeatedEnumField; } const RepeatedMessageField = - json[\\"RepeatedMessageField\\"] ?? json.RepeatedMessageField; + json.RepeatedMessageField ?? json.RepeatedMessageField; if (RepeatedMessageField) { for (const item of RepeatedMessageField) { const m = ForeignMessage.initialize(); @@ -25374,12 +25834,11 @@ export const TestCamelCaseFieldNames = { } } const RepeatedStringPieceField = - json[\\"RepeatedStringPieceField\\"] ?? json.RepeatedStringPieceField; + json.RepeatedStringPieceField ?? json.RepeatedStringPieceField; if (RepeatedStringPieceField) { msg.RepeatedStringPieceField = RepeatedStringPieceField; } - const RepeatedCordField = - json[\\"RepeatedCordField\\"] ?? json.RepeatedCordField; + const RepeatedCordField = json.RepeatedCordField ?? json.RepeatedCordField; if (RepeatedCordField) { msg.RepeatedCordField = RepeatedCordField; } @@ -25433,7 +25892,7 @@ export const TestFieldOrderings = { initialize: function () { return { myString: \\"\\", - myInt: \\"\\", + myInt: 0n, myFloat: 0, optionalNestedMessage: TestFieldOrderings.NestedMessage.initialize(), }; @@ -25447,7 +25906,7 @@ export const TestFieldOrderings = { writer.writeString(11, msg.myString); } if (msg.myInt) { - writer.writeInt64String(1, msg.myInt); + writer.writeInt64String(1, msg.myInt.toString()); } if (msg.myFloat) { writer.writeFloat(101, msg.myFloat); @@ -25466,15 +25925,15 @@ export const TestFieldOrderings = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.myString) { - json[\\"myString\\"] = msg.myString; + json.myString = msg.myString; } if (msg.myInt) { - json[\\"myInt\\"] = msg.myInt; + json.myInt = msg.myInt.toString(); } if (msg.myFloat) { - json[\\"myFloat\\"] = msg.myFloat; + json.myFloat = msg.myFloat; } if (msg.optionalNestedMessage) { const optionalNestedMessage = @@ -25482,7 +25941,7 @@ export const TestFieldOrderings = { msg.optionalNestedMessage ); if (Object.keys(optionalNestedMessage).length > 0) { - json[\\"optionalNestedMessage\\"] = optionalNestedMessage; + json.optionalNestedMessage = optionalNestedMessage; } } return json; @@ -25500,7 +25959,7 @@ export const TestFieldOrderings = { break; } case 1: { - msg.myInt = reader.readInt64String(); + msg.myInt = BigInt(reader.readInt64String()); break; } case 101: { @@ -25527,20 +25986,20 @@ export const TestFieldOrderings = { * @private */ _readMessageJSON: function (msg, json) { - const myString = json[\\"myString\\"] ?? json.my_string; + const myString = json.myString ?? json.my_string; if (myString) { msg.myString = myString; } - const myInt = json[\\"myInt\\"] ?? json.my_int; + const myInt = json.myInt ?? json.my_int; if (myInt) { - msg.myInt = myInt; + msg.myInt = BigInt(myInt); } - const myFloat = json[\\"myFloat\\"] ?? json.my_float; + const myFloat = json.myFloat ?? json.my_float; if (myFloat) { msg.myFloat = myFloat; } const optionalNestedMessage = - json[\\"optionalNestedMessage\\"] ?? json.optional_nested_message; + json.optionalNestedMessage ?? json.optional_nested_message; if (optionalNestedMessage) { const m = TestFieldOrderings.NestedMessage.initialize(); TestFieldOrderings.NestedMessage._readMessageJSON( @@ -25597,7 +26056,7 @@ export const TestFieldOrderings = { */ initialize: function () { return { - oo: \\"\\", + oo: 0n, bb: 0, }; }, @@ -25607,7 +26066,7 @@ export const TestFieldOrderings = { */ _writeMessage: function (msg, writer) { if (msg.oo) { - writer.writeInt64String(2, msg.oo); + writer.writeInt64String(2, msg.oo.toString()); } if (msg.bb) { writer.writeInt32(1, msg.bb); @@ -25619,12 +26078,12 @@ export const TestFieldOrderings = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.oo) { - json[\\"oo\\"] = msg.oo; + json.oo = msg.oo.toString(); } if (msg.bb) { - json[\\"bb\\"] = msg.bb; + json.bb = msg.bb; } return json; }, @@ -25637,7 +26096,7 @@ export const TestFieldOrderings = { const field = reader.getFieldNumber(); switch (field) { case 2: { - msg.oo = reader.readInt64String(); + msg.oo = BigInt(reader.readInt64String()); break; } case 1: { @@ -25657,11 +26116,11 @@ export const TestFieldOrderings = { * @private */ _readMessageJSON: function (msg, json) { - const oo = json[\\"oo\\"] ?? json.oo; + const oo = json.oo ?? json.oo; if (oo) { - msg.oo = oo; + msg.oo = BigInt(oo); } - const bb = json[\\"bb\\"] ?? json.bb; + const bb = json.bb ?? json.bb; if (bb) { msg.bb = bb; } @@ -25733,9 +26192,9 @@ export const TestExtensionOrderings1 = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.myString) { - json[\\"myString\\"] = msg.myString; + json.myString = msg.myString; } return json; }, @@ -25764,7 +26223,7 @@ export const TestExtensionOrderings1 = { * @private */ _readMessageJSON: function (msg, json) { - const myString = json[\\"myString\\"] ?? json.my_string; + const myString = json.myString ?? json.my_string; if (myString) { msg.myString = myString; } @@ -25835,9 +26294,9 @@ export const TestExtensionOrderings2 = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.myString) { - json[\\"myString\\"] = msg.myString; + json.myString = msg.myString; } return json; }, @@ -25866,7 +26325,7 @@ export const TestExtensionOrderings2 = { * @private */ _readMessageJSON: function (msg, json) { - const myString = json[\\"myString\\"] ?? json.my_string; + const myString = json.myString ?? json.my_string; if (myString) { msg.myString = myString; } @@ -25938,9 +26397,9 @@ export const TestExtensionOrderings2 = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.myString) { - json[\\"myString\\"] = msg.myString; + json.myString = msg.myString; } return json; }, @@ -25969,7 +26428,7 @@ export const TestExtensionOrderings2 = { * @private */ _readMessageJSON: function (msg, json) { - const myString = json[\\"myString\\"] ?? json.my_string; + const myString = json.myString ?? json.my_string; if (myString) { msg.myString = myString; } @@ -26025,11 +26484,11 @@ export const TestExtremeDefaultValues = { return { escapedBytes: new Uint8Array(), largeUint32: 0, - largeUint64: \\"\\", + largeUint64: 0n, smallInt32: 0, - smallInt64: \\"\\", + smallInt64: 0n, reallySmallInt32: 0, - reallySmallInt64: \\"\\", + reallySmallInt64: 0n, utf8String: \\"\\", zeroFloat: 0, oneFloat: 0, @@ -26064,19 +26523,19 @@ export const TestExtremeDefaultValues = { writer.writeUint32(2, msg.largeUint32); } if (msg.largeUint64) { - writer.writeUint64String(3, msg.largeUint64); + writer.writeUint64String(3, msg.largeUint64.toString()); } if (msg.smallInt32) { writer.writeInt32(4, msg.smallInt32); } if (msg.smallInt64) { - writer.writeInt64String(5, msg.smallInt64); + writer.writeInt64String(5, msg.smallInt64.toString()); } if (msg.reallySmallInt32) { writer.writeInt32(21, msg.reallySmallInt32); } if (msg.reallySmallInt64) { - writer.writeInt64String(22, msg.reallySmallInt64); + writer.writeInt64String(22, msg.reallySmallInt64.toString()); } if (msg.utf8String) { writer.writeString(6, msg.utf8String); @@ -26145,87 +26604,87 @@ export const TestExtremeDefaultValues = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.escapedBytes) { - json[\\"escapedBytes\\"] = msg.escapedBytes; + json.escapedBytes = msg.escapedBytes; } if (msg.largeUint32) { - json[\\"largeUint32\\"] = msg.largeUint32; + json.largeUint32 = msg.largeUint32; } if (msg.largeUint64) { - json[\\"largeUint64\\"] = msg.largeUint64; + json.largeUint64 = msg.largeUint64.toString(); } if (msg.smallInt32) { - json[\\"smallInt32\\"] = msg.smallInt32; + json.smallInt32 = msg.smallInt32; } if (msg.smallInt64) { - json[\\"smallInt64\\"] = msg.smallInt64; + json.smallInt64 = msg.smallInt64.toString(); } if (msg.reallySmallInt32) { - json[\\"reallySmallInt32\\"] = msg.reallySmallInt32; + json.reallySmallInt32 = msg.reallySmallInt32; } if (msg.reallySmallInt64) { - json[\\"reallySmallInt64\\"] = msg.reallySmallInt64; + json.reallySmallInt64 = msg.reallySmallInt64.toString(); } if (msg.utf8String) { - json[\\"utf8String\\"] = msg.utf8String; + json.utf8String = msg.utf8String; } if (msg.zeroFloat) { - json[\\"zeroFloat\\"] = msg.zeroFloat; + json.zeroFloat = msg.zeroFloat; } if (msg.oneFloat) { - json[\\"oneFloat\\"] = msg.oneFloat; + json.oneFloat = msg.oneFloat; } if (msg.smallFloat) { - json[\\"smallFloat\\"] = msg.smallFloat; + json.smallFloat = msg.smallFloat; } if (msg.negativeOneFloat) { - json[\\"negativeOneFloat\\"] = msg.negativeOneFloat; + json.negativeOneFloat = msg.negativeOneFloat; } if (msg.negativeFloat) { - json[\\"negativeFloat\\"] = msg.negativeFloat; + json.negativeFloat = msg.negativeFloat; } if (msg.largeFloat) { - json[\\"largeFloat\\"] = msg.largeFloat; + json.largeFloat = msg.largeFloat; } if (msg.smallNegativeFloat) { - json[\\"smallNegativeFloat\\"] = msg.smallNegativeFloat; + json.smallNegativeFloat = msg.smallNegativeFloat; } if (msg.infDouble) { - json[\\"infDouble\\"] = msg.infDouble; + json.infDouble = msg.infDouble; } if (msg.negInfDouble) { - json[\\"negInfDouble\\"] = msg.negInfDouble; + json.negInfDouble = msg.negInfDouble; } if (msg.nanDouble) { - json[\\"nanDouble\\"] = msg.nanDouble; + json.nanDouble = msg.nanDouble; } if (msg.infFloat) { - json[\\"infFloat\\"] = msg.infFloat; + json.infFloat = msg.infFloat; } if (msg.negInfFloat) { - json[\\"negInfFloat\\"] = msg.negInfFloat; + json.negInfFloat = msg.negInfFloat; } if (msg.nanFloat) { - json[\\"nanFloat\\"] = msg.nanFloat; + json.nanFloat = msg.nanFloat; } if (msg.cppTrigraph) { - json[\\"cppTrigraph\\"] = msg.cppTrigraph; + json.cppTrigraph = msg.cppTrigraph; } if (msg.stringWithZero) { - json[\\"stringWithZero\\"] = msg.stringWithZero; + json.stringWithZero = msg.stringWithZero; } if (msg.bytesWithZero) { - json[\\"bytesWithZero\\"] = msg.bytesWithZero; + json.bytesWithZero = msg.bytesWithZero; } if (msg.stringPieceWithZero) { - json[\\"stringPieceWithZero\\"] = msg.stringPieceWithZero; + json.stringPieceWithZero = msg.stringPieceWithZero; } if (msg.cordWithZero) { - json[\\"cordWithZero\\"] = msg.cordWithZero; + json.cordWithZero = msg.cordWithZero; } if (msg.replacementString) { - json[\\"replacementString\\"] = msg.replacementString; + json.replacementString = msg.replacementString; } return json; }, @@ -26246,7 +26705,7 @@ export const TestExtremeDefaultValues = { break; } case 3: { - msg.largeUint64 = reader.readUint64String(); + msg.largeUint64 = BigInt(reader.readUint64String()); break; } case 4: { @@ -26254,7 +26713,7 @@ export const TestExtremeDefaultValues = { break; } case 5: { - msg.smallInt64 = reader.readInt64String(); + msg.smallInt64 = BigInt(reader.readInt64String()); break; } case 21: { @@ -26262,7 +26721,7 @@ export const TestExtremeDefaultValues = { break; } case 22: { - msg.reallySmallInt64 = reader.readInt64String(); + msg.reallySmallInt64 = BigInt(reader.readInt64String()); break; } case 6: { @@ -26358,117 +26817,113 @@ export const TestExtremeDefaultValues = { * @private */ _readMessageJSON: function (msg, json) { - const escapedBytes = json[\\"escapedBytes\\"] ?? json.escaped_bytes; + const escapedBytes = json.escapedBytes ?? json.escaped_bytes; if (escapedBytes) { msg.escapedBytes = escapedBytes; } - const largeUint32 = json[\\"largeUint32\\"] ?? json.large_uint32; + const largeUint32 = json.largeUint32 ?? json.large_uint32; if (largeUint32) { msg.largeUint32 = largeUint32; } - const largeUint64 = json[\\"largeUint64\\"] ?? json.large_uint64; + const largeUint64 = json.largeUint64 ?? json.large_uint64; if (largeUint64) { - msg.largeUint64 = largeUint64; + msg.largeUint64 = BigInt(largeUint64); } - const smallInt32 = json[\\"smallInt32\\"] ?? json.small_int32; + const smallInt32 = json.smallInt32 ?? json.small_int32; if (smallInt32) { msg.smallInt32 = smallInt32; } - const smallInt64 = json[\\"smallInt64\\"] ?? json.small_int64; + const smallInt64 = json.smallInt64 ?? json.small_int64; if (smallInt64) { - msg.smallInt64 = smallInt64; + msg.smallInt64 = BigInt(smallInt64); } - const reallySmallInt32 = - json[\\"reallySmallInt32\\"] ?? json.really_small_int32; + const reallySmallInt32 = json.reallySmallInt32 ?? json.really_small_int32; if (reallySmallInt32) { msg.reallySmallInt32 = reallySmallInt32; } - const reallySmallInt64 = - json[\\"reallySmallInt64\\"] ?? json.really_small_int64; + const reallySmallInt64 = json.reallySmallInt64 ?? json.really_small_int64; if (reallySmallInt64) { - msg.reallySmallInt64 = reallySmallInt64; + msg.reallySmallInt64 = BigInt(reallySmallInt64); } - const utf8String = json[\\"utf8String\\"] ?? json.utf8_string; + const utf8String = json.utf8String ?? json.utf8_string; if (utf8String) { msg.utf8String = utf8String; } - const zeroFloat = json[\\"zeroFloat\\"] ?? json.zero_float; + const zeroFloat = json.zeroFloat ?? json.zero_float; if (zeroFloat) { msg.zeroFloat = zeroFloat; } - const oneFloat = json[\\"oneFloat\\"] ?? json.one_float; + const oneFloat = json.oneFloat ?? json.one_float; if (oneFloat) { msg.oneFloat = oneFloat; } - const smallFloat = json[\\"smallFloat\\"] ?? json.small_float; + const smallFloat = json.smallFloat ?? json.small_float; if (smallFloat) { msg.smallFloat = smallFloat; } - const negativeOneFloat = - json[\\"negativeOneFloat\\"] ?? json.negative_one_float; + const negativeOneFloat = json.negativeOneFloat ?? json.negative_one_float; if (negativeOneFloat) { msg.negativeOneFloat = negativeOneFloat; } - const negativeFloat = json[\\"negativeFloat\\"] ?? json.negative_float; + const negativeFloat = json.negativeFloat ?? json.negative_float; if (negativeFloat) { msg.negativeFloat = negativeFloat; } - const largeFloat = json[\\"largeFloat\\"] ?? json.large_float; + const largeFloat = json.largeFloat ?? json.large_float; if (largeFloat) { msg.largeFloat = largeFloat; } const smallNegativeFloat = - json[\\"smallNegativeFloat\\"] ?? json.small_negative_float; + json.smallNegativeFloat ?? json.small_negative_float; if (smallNegativeFloat) { msg.smallNegativeFloat = smallNegativeFloat; } - const infDouble = json[\\"infDouble\\"] ?? json.inf_double; + const infDouble = json.infDouble ?? json.inf_double; if (infDouble) { msg.infDouble = infDouble; } - const negInfDouble = json[\\"negInfDouble\\"] ?? json.neg_inf_double; + const negInfDouble = json.negInfDouble ?? json.neg_inf_double; if (negInfDouble) { msg.negInfDouble = negInfDouble; } - const nanDouble = json[\\"nanDouble\\"] ?? json.nan_double; + const nanDouble = json.nanDouble ?? json.nan_double; if (nanDouble) { msg.nanDouble = nanDouble; } - const infFloat = json[\\"infFloat\\"] ?? json.inf_float; + const infFloat = json.infFloat ?? json.inf_float; if (infFloat) { msg.infFloat = infFloat; } - const negInfFloat = json[\\"negInfFloat\\"] ?? json.neg_inf_float; + const negInfFloat = json.negInfFloat ?? json.neg_inf_float; if (negInfFloat) { msg.negInfFloat = negInfFloat; } - const nanFloat = json[\\"nanFloat\\"] ?? json.nan_float; + const nanFloat = json.nanFloat ?? json.nan_float; if (nanFloat) { msg.nanFloat = nanFloat; } - const cppTrigraph = json[\\"cppTrigraph\\"] ?? json.cpp_trigraph; + const cppTrigraph = json.cppTrigraph ?? json.cpp_trigraph; if (cppTrigraph) { msg.cppTrigraph = cppTrigraph; } - const stringWithZero = json[\\"stringWithZero\\"] ?? json.string_with_zero; + const stringWithZero = json.stringWithZero ?? json.string_with_zero; if (stringWithZero) { msg.stringWithZero = stringWithZero; } - const bytesWithZero = json[\\"bytesWithZero\\"] ?? json.bytes_with_zero; + const bytesWithZero = json.bytesWithZero ?? json.bytes_with_zero; if (bytesWithZero) { msg.bytesWithZero = bytesWithZero; } const stringPieceWithZero = - json[\\"stringPieceWithZero\\"] ?? json.string_piece_with_zero; + json.stringPieceWithZero ?? json.string_piece_with_zero; if (stringPieceWithZero) { msg.stringPieceWithZero = stringPieceWithZero; } - const cordWithZero = json[\\"cordWithZero\\"] ?? json.cord_with_zero; + const cordWithZero = json.cordWithZero ?? json.cord_with_zero; if (cordWithZero) { msg.cordWithZero = cordWithZero; } - const replacementString = - json[\\"replacementString\\"] ?? json.replacement_string; + const replacementString = json.replacementString ?? json.replacement_string; if (replacementString) { msg.replacementString = replacementString; } @@ -26539,9 +26994,9 @@ export const SparseEnumMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.sparseEnum) { - json[\\"sparseEnum\\"] = msg.sparseEnum; + json.sparseEnum = msg.sparseEnum; } return json; }, @@ -26570,7 +27025,7 @@ export const SparseEnumMessage = { * @private */ _readMessageJSON: function (msg, json) { - const sparseEnum = json[\\"sparseEnum\\"] ?? json.sparse_enum; + const sparseEnum = json.sparseEnum ?? json.sparse_enum; if (sparseEnum) { msg.sparseEnum = sparseEnum; } @@ -26636,9 +27091,9 @@ export const OneString = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -26667,7 +27122,7 @@ export const OneString = { * @private */ _readMessageJSON: function (msg, json) { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -26736,9 +27191,9 @@ export const MoreString = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.data?.length) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -26767,7 +27222,7 @@ export const MoreString = { * @private */ _readMessageJSON: function (msg, json) { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -26833,9 +27288,9 @@ export const OneBytes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -26864,7 +27319,7 @@ export const OneBytes = { * @private */ _readMessageJSON: function (msg, json) { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -26930,9 +27385,9 @@ export const MoreBytes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.data?.length) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -26961,7 +27416,7 @@ export const MoreBytes = { * @private */ _readMessageJSON: function (msg, json) { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -27030,9 +27485,9 @@ export const Int32Message = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -27061,7 +27516,7 @@ export const Int32Message = { * @private */ _readMessageJSON: function (msg, json) { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -27130,9 +27585,9 @@ export const Uint32Message = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -27161,7 +27616,7 @@ export const Uint32Message = { * @private */ _readMessageJSON: function (msg, json) { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -27212,7 +27667,7 @@ export const Int64Message = { */ initialize: function () { return { - data: \\"\\", + data: 0n, }; }, @@ -27221,7 +27676,7 @@ export const Int64Message = { */ _writeMessage: function (msg, writer) { if (msg.data) { - writer.writeInt64String(1, msg.data); + writer.writeInt64String(1, msg.data.toString()); } return writer; }, @@ -27230,9 +27685,9 @@ export const Int64Message = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data.toString(); } return json; }, @@ -27245,7 +27700,7 @@ export const Int64Message = { const field = reader.getFieldNumber(); switch (field) { case 1: { - msg.data = reader.readInt64String(); + msg.data = BigInt(reader.readInt64String()); break; } default: { @@ -27261,9 +27716,9 @@ export const Int64Message = { * @private */ _readMessageJSON: function (msg, json) { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { - msg.data = data; + msg.data = BigInt(data); } return msg; }, @@ -27312,7 +27767,7 @@ export const Uint64Message = { */ initialize: function () { return { - data: \\"\\", + data: 0n, }; }, @@ -27321,7 +27776,7 @@ export const Uint64Message = { */ _writeMessage: function (msg, writer) { if (msg.data) { - writer.writeUint64String(1, msg.data); + writer.writeUint64String(1, msg.data.toString()); } return writer; }, @@ -27330,9 +27785,9 @@ export const Uint64Message = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data.toString(); } return json; }, @@ -27345,7 +27800,7 @@ export const Uint64Message = { const field = reader.getFieldNumber(); switch (field) { case 1: { - msg.data = reader.readUint64String(); + msg.data = BigInt(reader.readUint64String()); break; } default: { @@ -27361,9 +27816,9 @@ export const Uint64Message = { * @private */ _readMessageJSON: function (msg, json) { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { - msg.data = data; + msg.data = BigInt(data); } return msg; }, @@ -27430,9 +27885,9 @@ export const BoolMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -27461,7 +27916,7 @@ export const BoolMessage = { * @private */ _readMessageJSON: function (msg, json) { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -27533,17 +27988,17 @@ export const TestOneof = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.fooInt != undefined) { - json[\\"fooInt\\"] = msg.fooInt; + json.fooInt = msg.fooInt; } if (msg.fooString != undefined) { - json[\\"fooString\\"] = msg.fooString; + json.fooString = msg.fooString; } if (msg.fooMessage != undefined) { const fooMessage = TestAllTypes._writeMessageJSON(msg.fooMessage); if (Object.keys(fooMessage).length > 0) { - json[\\"fooMessage\\"] = fooMessage; + json.fooMessage = fooMessage; } } return json; @@ -27581,15 +28036,15 @@ export const TestOneof = { * @private */ _readMessageJSON: function (msg, json) { - const fooInt = json[\\"fooInt\\"] ?? json.foo_int; + const fooInt = json.fooInt ?? json.foo_int; if (fooInt) { msg.fooInt = fooInt; } - const fooString = json[\\"fooString\\"] ?? json.foo_string; + const fooString = json.fooString ?? json.foo_string; if (fooString) { msg.fooString = fooString; } - const fooMessage = json[\\"fooMessage\\"] ?? json.foo_message; + const fooMessage = json.fooMessage ?? json.foo_message; if (fooMessage) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, fooMessage); @@ -27663,12 +28118,12 @@ export const TestOneof = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } if (msg.b) { - json[\\"b\\"] = msg.b; + json.b = msg.b; } return json; }, @@ -27701,11 +28156,11 @@ export const TestOneof = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } - const b = json[\\"b\\"] ?? json.b; + const b = json.b ?? json.b; if (b) { msg.b = b; } @@ -27787,17 +28242,17 @@ export const TestOneofBackwardsCompatible = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.fooInt) { - json[\\"fooInt\\"] = msg.fooInt; + json.fooInt = msg.fooInt; } if (msg.fooString) { - json[\\"fooString\\"] = msg.fooString; + json.fooString = msg.fooString; } if (msg.fooMessage) { const fooMessage = TestAllTypes._writeMessageJSON(msg.fooMessage); if (Object.keys(fooMessage).length > 0) { - json[\\"fooMessage\\"] = fooMessage; + json.fooMessage = fooMessage; } } return json; @@ -27835,15 +28290,15 @@ export const TestOneofBackwardsCompatible = { * @private */ _readMessageJSON: function (msg, json) { - const fooInt = json[\\"fooInt\\"] ?? json.foo_int; + const fooInt = json.fooInt ?? json.foo_int; if (fooInt) { msg.fooInt = fooInt; } - const fooString = json[\\"fooString\\"] ?? json.foo_string; + const fooString = json.fooString ?? json.foo_string; if (fooString) { msg.fooString = fooString; } - const fooMessage = json[\\"fooMessage\\"] ?? json.foo_message; + const fooMessage = json.fooMessage ?? json.foo_message; if (fooMessage) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, fooMessage); @@ -27919,12 +28374,12 @@ export const TestOneofBackwardsCompatible = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } if (msg.b) { - json[\\"b\\"] = msg.b; + json.b = msg.b; } return json; }, @@ -27957,11 +28412,11 @@ export const TestOneofBackwardsCompatible = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } - const b = json[\\"b\\"] ?? json.b; + const b = json.b ?? json.b; if (b) { msg.b = b; } @@ -28099,31 +28554,31 @@ export const TestOneof2 = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.fooInt != undefined) { - json[\\"fooInt\\"] = msg.fooInt; + json.fooInt = msg.fooInt; } if (msg.fooString != undefined) { - json[\\"fooString\\"] = msg.fooString; + json.fooString = msg.fooString; } if (msg.fooCord != undefined) { - json[\\"fooCord\\"] = msg.fooCord; + json.fooCord = msg.fooCord; } if (msg.fooStringPiece != undefined) { - json[\\"fooStringPiece\\"] = msg.fooStringPiece; + json.fooStringPiece = msg.fooStringPiece; } if (msg.fooBytes != undefined) { - json[\\"fooBytes\\"] = msg.fooBytes; + json.fooBytes = msg.fooBytes; } if (msg.fooEnum != undefined) { - json[\\"fooEnum\\"] = msg.fooEnum; + json.fooEnum = msg.fooEnum; } if (msg.fooMessage != undefined) { const fooMessage = TestOneof2.NestedMessage._writeMessageJSON( msg.fooMessage ); if (Object.keys(fooMessage).length > 0) { - json[\\"fooMessage\\"] = fooMessage; + json.fooMessage = fooMessage; } } if (msg.fooLazyMessage != undefined) { @@ -28131,45 +28586,44 @@ export const TestOneof2 = { msg.fooLazyMessage ); if (Object.keys(fooLazyMessage).length > 0) { - json[\\"fooLazyMessage\\"] = fooLazyMessage; + json.fooLazyMessage = fooLazyMessage; } } if (msg.barInt != undefined) { - json[\\"barInt\\"] = msg.barInt; + json.barInt = msg.barInt; } if (msg.barString != undefined) { - json[\\"barString\\"] = msg.barString; + json.barString = msg.barString; } if (msg.barCord != undefined) { - json[\\"barCord\\"] = msg.barCord; + json.barCord = msg.barCord; } if (msg.barStringPiece != undefined) { - json[\\"barStringPiece\\"] = msg.barStringPiece; + json.barStringPiece = msg.barStringPiece; } if (msg.barBytes != undefined) { - json[\\"barBytes\\"] = msg.barBytes; + json.barBytes = msg.barBytes; } if (msg.barEnum != undefined) { - json[\\"barEnum\\"] = msg.barEnum; + json.barEnum = msg.barEnum; } if (msg.barStringWithEmptyDefault != undefined) { - json[\\"barStringWithEmptyDefault\\"] = msg.barStringWithEmptyDefault; + json.barStringWithEmptyDefault = msg.barStringWithEmptyDefault; } if (msg.barCordWithEmptyDefault != undefined) { - json[\\"barCordWithEmptyDefault\\"] = msg.barCordWithEmptyDefault; + json.barCordWithEmptyDefault = msg.barCordWithEmptyDefault; } if (msg.barStringPieceWithEmptyDefault != undefined) { - json[\\"barStringPieceWithEmptyDefault\\"] = - msg.barStringPieceWithEmptyDefault; + json.barStringPieceWithEmptyDefault = msg.barStringPieceWithEmptyDefault; } if (msg.barBytesWithEmptyDefault != undefined) { - json[\\"barBytesWithEmptyDefault\\"] = msg.barBytesWithEmptyDefault; + json.barBytesWithEmptyDefault = msg.barBytesWithEmptyDefault; } if (msg.bazInt) { - json[\\"bazInt\\"] = msg.bazInt; + json.bazInt = msg.bazInt; } if (msg.bazString) { - json[\\"bazString\\"] = msg.bazString; + json.bazString = msg.bazString; } return json; }, @@ -28280,92 +28734,92 @@ export const TestOneof2 = { * @private */ _readMessageJSON: function (msg, json) { - const fooInt = json[\\"fooInt\\"] ?? json.foo_int; + const fooInt = json.fooInt ?? json.foo_int; if (fooInt) { msg.fooInt = fooInt; } - const fooString = json[\\"fooString\\"] ?? json.foo_string; + const fooString = json.fooString ?? json.foo_string; if (fooString) { msg.fooString = fooString; } - const fooCord = json[\\"fooCord\\"] ?? json.foo_cord; + const fooCord = json.fooCord ?? json.foo_cord; if (fooCord) { msg.fooCord = fooCord; } - const fooStringPiece = json[\\"fooStringPiece\\"] ?? json.foo_string_piece; + const fooStringPiece = json.fooStringPiece ?? json.foo_string_piece; if (fooStringPiece) { msg.fooStringPiece = fooStringPiece; } - const fooBytes = json[\\"fooBytes\\"] ?? json.foo_bytes; + const fooBytes = json.fooBytes ?? json.foo_bytes; if (fooBytes) { msg.fooBytes = fooBytes; } - const fooEnum = json[\\"fooEnum\\"] ?? json.foo_enum; + const fooEnum = json.fooEnum ?? json.foo_enum; if (fooEnum) { msg.fooEnum = fooEnum; } - const fooMessage = json[\\"fooMessage\\"] ?? json.foo_message; + const fooMessage = json.fooMessage ?? json.foo_message; if (fooMessage) { const m = TestOneof2.NestedMessage.initialize(); TestOneof2.NestedMessage._readMessageJSON(m, fooMessage); msg.fooMessage = m; } - const fooLazyMessage = json[\\"fooLazyMessage\\"] ?? json.foo_lazy_message; + const fooLazyMessage = json.fooLazyMessage ?? json.foo_lazy_message; if (fooLazyMessage) { const m = TestOneof2.NestedMessage.initialize(); TestOneof2.NestedMessage._readMessageJSON(m, fooLazyMessage); msg.fooLazyMessage = m; } - const barInt = json[\\"barInt\\"] ?? json.bar_int; + const barInt = json.barInt ?? json.bar_int; if (barInt) { msg.barInt = barInt; } - const barString = json[\\"barString\\"] ?? json.bar_string; + const barString = json.barString ?? json.bar_string; if (barString) { msg.barString = barString; } - const barCord = json[\\"barCord\\"] ?? json.bar_cord; + const barCord = json.barCord ?? json.bar_cord; if (barCord) { msg.barCord = barCord; } - const barStringPiece = json[\\"barStringPiece\\"] ?? json.bar_string_piece; + const barStringPiece = json.barStringPiece ?? json.bar_string_piece; if (barStringPiece) { msg.barStringPiece = barStringPiece; } - const barBytes = json[\\"barBytes\\"] ?? json.bar_bytes; + const barBytes = json.barBytes ?? json.bar_bytes; if (barBytes) { msg.barBytes = barBytes; } - const barEnum = json[\\"barEnum\\"] ?? json.bar_enum; + const barEnum = json.barEnum ?? json.bar_enum; if (barEnum) { msg.barEnum = barEnum; } const barStringWithEmptyDefault = - json[\\"barStringWithEmptyDefault\\"] ?? json.bar_string_with_empty_default; + json.barStringWithEmptyDefault ?? json.bar_string_with_empty_default; if (barStringWithEmptyDefault) { msg.barStringWithEmptyDefault = barStringWithEmptyDefault; } const barCordWithEmptyDefault = - json[\\"barCordWithEmptyDefault\\"] ?? json.bar_cord_with_empty_default; + json.barCordWithEmptyDefault ?? json.bar_cord_with_empty_default; if (barCordWithEmptyDefault) { msg.barCordWithEmptyDefault = barCordWithEmptyDefault; } const barStringPieceWithEmptyDefault = - json[\\"barStringPieceWithEmptyDefault\\"] ?? + json.barStringPieceWithEmptyDefault ?? json.bar_string_piece_with_empty_default; if (barStringPieceWithEmptyDefault) { msg.barStringPieceWithEmptyDefault = barStringPieceWithEmptyDefault; } const barBytesWithEmptyDefault = - json[\\"barBytesWithEmptyDefault\\"] ?? json.bar_bytes_with_empty_default; + json.barBytesWithEmptyDefault ?? json.bar_bytes_with_empty_default; if (barBytesWithEmptyDefault) { msg.barBytesWithEmptyDefault = barBytesWithEmptyDefault; } - const bazInt = json[\\"bazInt\\"] ?? json.baz_int; + const bazInt = json.bazInt ?? json.baz_int; if (bazInt) { msg.bazInt = bazInt; } - const bazString = json[\\"bazString\\"] ?? json.baz_string; + const bazString = json.bazString ?? json.baz_string; if (bazString) { msg.bazString = bazString; } @@ -28439,12 +28893,12 @@ export const TestOneof2 = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } if (msg.b) { - json[\\"b\\"] = msg.b; + json.b = msg.b; } return json; }, @@ -28477,11 +28931,11 @@ export const TestOneof2 = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } - const b = json[\\"b\\"] ?? json.b; + const b = json.b ?? json.b; if (b) { msg.b = b; } @@ -28534,7 +28988,7 @@ export const TestOneof2 = { */ initialize: function () { return { - quxInt: \\"\\", + quxInt: 0n, corgeInt: [], }; }, @@ -28544,7 +28998,7 @@ export const TestOneof2 = { */ _writeMessage: function (msg, writer) { if (msg.quxInt) { - writer.writeInt64String(1, msg.quxInt); + writer.writeInt64String(1, msg.quxInt.toString()); } if (msg.corgeInt?.length) { writer.writeRepeatedInt32(2, msg.corgeInt); @@ -28556,12 +29010,12 @@ export const TestOneof2 = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.quxInt) { - json[\\"quxInt\\"] = msg.quxInt; + json.quxInt = msg.quxInt.toString(); } if (msg.corgeInt?.length) { - json[\\"corgeInt\\"] = msg.corgeInt; + json.corgeInt = msg.corgeInt; } return json; }, @@ -28574,7 +29028,7 @@ export const TestOneof2 = { const field = reader.getFieldNumber(); switch (field) { case 1: { - msg.quxInt = reader.readInt64String(); + msg.quxInt = BigInt(reader.readInt64String()); break; } case 2: { @@ -28594,11 +29048,11 @@ export const TestOneof2 = { * @private */ _readMessageJSON: function (msg, json) { - const quxInt = json[\\"quxInt\\"] ?? json.qux_int; + const quxInt = json.quxInt ?? json.qux_int; if (quxInt) { - msg.quxInt = quxInt; + msg.quxInt = BigInt(quxInt); } - const corgeInt = json[\\"corgeInt\\"] ?? json.corge_int; + const corgeInt = json.corgeInt ?? json.corge_int; if (corgeInt) { msg.corgeInt = corgeInt; } @@ -28680,19 +29134,19 @@ export const TestRequiredOneof = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.fooInt != undefined) { - json[\\"fooInt\\"] = msg.fooInt; + json.fooInt = msg.fooInt; } if (msg.fooString != undefined) { - json[\\"fooString\\"] = msg.fooString; + json.fooString = msg.fooString; } if (msg.fooMessage != undefined) { const fooMessage = TestRequiredOneof.NestedMessage._writeMessageJSON( msg.fooMessage ); if (Object.keys(fooMessage).length > 0) { - json[\\"fooMessage\\"] = fooMessage; + json.fooMessage = fooMessage; } } return json; @@ -28733,15 +29187,15 @@ export const TestRequiredOneof = { * @private */ _readMessageJSON: function (msg, json) { - const fooInt = json[\\"fooInt\\"] ?? json.foo_int; + const fooInt = json.fooInt ?? json.foo_int; if (fooInt) { msg.fooInt = fooInt; } - const fooString = json[\\"fooString\\"] ?? json.foo_string; + const fooString = json.fooString ?? json.foo_string; if (fooString) { msg.fooString = fooString; } - const fooMessage = json[\\"fooMessage\\"] ?? json.foo_message; + const fooMessage = json.fooMessage ?? json.foo_message; if (fooMessage) { const m = TestRequiredOneof.NestedMessage.initialize(); TestRequiredOneof.NestedMessage._readMessageJSON(m, fooMessage); @@ -28813,9 +29267,9 @@ export const TestRequiredOneof = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.requiredDouble) { - json[\\"requiredDouble\\"] = msg.requiredDouble; + json.requiredDouble = msg.requiredDouble; } return json; }, @@ -28844,7 +29298,7 @@ export const TestRequiredOneof = { * @private */ _readMessageJSON: function (msg, json) { - const requiredDouble = json[\\"requiredDouble\\"] ?? json.required_double; + const requiredDouble = json.requiredDouble ?? json.required_double; if (requiredDouble) { msg.requiredDouble = requiredDouble; } @@ -28921,31 +29375,31 @@ export const TestPackedTypes = { writer.writeRepeatedInt32(90, msg.packedInt32); } if (msg.packedInt64?.length) { - writer.writeRepeatedInt64String(91, msg.packedInt64); + writer.writeRepeatedInt64String(91, msg.packedInt64.toString()); } if (msg.packedUint32?.length) { writer.writeRepeatedUint32(92, msg.packedUint32); } if (msg.packedUint64?.length) { - writer.writeRepeatedUint64String(93, msg.packedUint64); + writer.writeRepeatedUint64String(93, msg.packedUint64.toString()); } if (msg.packedSint32?.length) { writer.writeRepeatedSint32(94, msg.packedSint32); } if (msg.packedSint64?.length) { - writer.writeRepeatedSint64String(95, msg.packedSint64); + writer.writeRepeatedSint64String(95, msg.packedSint64.toString()); } if (msg.packedFixed32?.length) { writer.writeRepeatedFixed32(96, msg.packedFixed32); } if (msg.packedFixed64?.length) { - writer.writeRepeatedFixed64String(97, msg.packedFixed64); + writer.writeRepeatedFixed64String(97, msg.packedFixed64.toString()); } if (msg.packedSfixed32?.length) { writer.writeRepeatedSfixed32(98, msg.packedSfixed32); } if (msg.packedSfixed64?.length) { - writer.writeRepeatedSfixed64(99, msg.packedSfixed64); + writer.writeRepeatedSfixed64(99, msg.packedSfixed64.toString()); } if (msg.packedFloat?.length) { writer.writeRepeatedFloat(100, msg.packedFloat); @@ -28966,48 +29420,48 @@ export const TestPackedTypes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.packedInt32?.length) { - json[\\"packedInt32\\"] = msg.packedInt32; + json.packedInt32 = msg.packedInt32; } if (msg.packedInt64?.length) { - json[\\"packedInt64\\"] = msg.packedInt64; + json.packedInt64 = msg.packedInt64.map((x) => x.toString()); } if (msg.packedUint32?.length) { - json[\\"packedUint32\\"] = msg.packedUint32; + json.packedUint32 = msg.packedUint32; } if (msg.packedUint64?.length) { - json[\\"packedUint64\\"] = msg.packedUint64; + json.packedUint64 = msg.packedUint64.map((x) => x.toString()); } if (msg.packedSint32?.length) { - json[\\"packedSint32\\"] = msg.packedSint32; + json.packedSint32 = msg.packedSint32; } if (msg.packedSint64?.length) { - json[\\"packedSint64\\"] = msg.packedSint64; + json.packedSint64 = msg.packedSint64.map((x) => x.toString()); } if (msg.packedFixed32?.length) { - json[\\"packedFixed32\\"] = msg.packedFixed32; + json.packedFixed32 = msg.packedFixed32; } if (msg.packedFixed64?.length) { - json[\\"packedFixed64\\"] = msg.packedFixed64; + json.packedFixed64 = msg.packedFixed64.map((x) => x.toString()); } if (msg.packedSfixed32?.length) { - json[\\"packedSfixed32\\"] = msg.packedSfixed32; + json.packedSfixed32 = msg.packedSfixed32; } if (msg.packedSfixed64?.length) { - json[\\"packedSfixed64\\"] = msg.packedSfixed64; + json.packedSfixed64 = msg.packedSfixed64.map((x) => x.toString()); } if (msg.packedFloat?.length) { - json[\\"packedFloat\\"] = msg.packedFloat; + json.packedFloat = msg.packedFloat; } if (msg.packedDouble?.length) { - json[\\"packedDouble\\"] = msg.packedDouble; + json.packedDouble = msg.packedDouble; } if (msg.packedBool?.length) { - json[\\"packedBool\\"] = msg.packedBool; + json.packedBool = msg.packedBool; } if (msg.packedEnum?.length) { - json[\\"packedEnum\\"] = msg.packedEnum; + json.packedEnum = msg.packedEnum; } return json; }, @@ -29024,7 +29478,7 @@ export const TestPackedTypes = { break; } case 91: { - msg.packedInt64.push(reader.readInt64String()); + msg.packedInt64 = reader.readInt64String().map(BigInt); break; } case 92: { @@ -29032,7 +29486,7 @@ export const TestPackedTypes = { break; } case 93: { - msg.packedUint64.push(reader.readUint64String()); + msg.packedUint64 = reader.readUint64String().map(BigInt); break; } case 94: { @@ -29040,7 +29494,7 @@ export const TestPackedTypes = { break; } case 95: { - msg.packedSint64.push(reader.readSint64()); + msg.packedSint64 = reader.readSint64().map(BigInt); break; } case 96: { @@ -29048,7 +29502,7 @@ export const TestPackedTypes = { break; } case 97: { - msg.packedFixed64.push(reader.readFixed64String()); + msg.packedFixed64 = reader.readFixed64String().map(BigInt); break; } case 98: { @@ -29056,7 +29510,7 @@ export const TestPackedTypes = { break; } case 99: { - msg.packedSfixed64.push(reader.readSfixed64()); + msg.packedSfixed64 = reader.readSfixed64().map(BigInt); break; } case 100: { @@ -29088,59 +29542,59 @@ export const TestPackedTypes = { * @private */ _readMessageJSON: function (msg, json) { - const packedInt32 = json[\\"packedInt32\\"] ?? json.packed_int32; + const packedInt32 = json.packedInt32 ?? json.packed_int32; if (packedInt32) { msg.packedInt32 = packedInt32; } - const packedInt64 = json[\\"packedInt64\\"] ?? json.packed_int64; + const packedInt64 = json.packedInt64 ?? json.packed_int64; if (packedInt64) { - msg.packedInt64 = packedInt64; + msg.packedInt64 = packedInt64.map(BigInt); } - const packedUint32 = json[\\"packedUint32\\"] ?? json.packed_uint32; + const packedUint32 = json.packedUint32 ?? json.packed_uint32; if (packedUint32) { msg.packedUint32 = packedUint32; } - const packedUint64 = json[\\"packedUint64\\"] ?? json.packed_uint64; + const packedUint64 = json.packedUint64 ?? json.packed_uint64; if (packedUint64) { - msg.packedUint64 = packedUint64; + msg.packedUint64 = packedUint64.map(BigInt); } - const packedSint32 = json[\\"packedSint32\\"] ?? json.packed_sint32; + const packedSint32 = json.packedSint32 ?? json.packed_sint32; if (packedSint32) { msg.packedSint32 = packedSint32; } - const packedSint64 = json[\\"packedSint64\\"] ?? json.packed_sint64; + const packedSint64 = json.packedSint64 ?? json.packed_sint64; if (packedSint64) { - msg.packedSint64 = packedSint64; + msg.packedSint64 = packedSint64.map(BigInt); } - const packedFixed32 = json[\\"packedFixed32\\"] ?? json.packed_fixed32; + const packedFixed32 = json.packedFixed32 ?? json.packed_fixed32; if (packedFixed32) { msg.packedFixed32 = packedFixed32; } - const packedFixed64 = json[\\"packedFixed64\\"] ?? json.packed_fixed64; + const packedFixed64 = json.packedFixed64 ?? json.packed_fixed64; if (packedFixed64) { - msg.packedFixed64 = packedFixed64; + msg.packedFixed64 = packedFixed64.map(BigInt); } - const packedSfixed32 = json[\\"packedSfixed32\\"] ?? json.packed_sfixed32; + const packedSfixed32 = json.packedSfixed32 ?? json.packed_sfixed32; if (packedSfixed32) { msg.packedSfixed32 = packedSfixed32; } - const packedSfixed64 = json[\\"packedSfixed64\\"] ?? json.packed_sfixed64; + const packedSfixed64 = json.packedSfixed64 ?? json.packed_sfixed64; if (packedSfixed64) { - msg.packedSfixed64 = packedSfixed64; + msg.packedSfixed64 = packedSfixed64.map(BigInt); } - const packedFloat = json[\\"packedFloat\\"] ?? json.packed_float; + const packedFloat = json.packedFloat ?? json.packed_float; if (packedFloat) { msg.packedFloat = packedFloat; } - const packedDouble = json[\\"packedDouble\\"] ?? json.packed_double; + const packedDouble = json.packedDouble ?? json.packed_double; if (packedDouble) { msg.packedDouble = packedDouble; } - const packedBool = json[\\"packedBool\\"] ?? json.packed_bool; + const packedBool = json.packedBool ?? json.packed_bool; if (packedBool) { msg.packedBool = packedBool; } - const packedEnum = json[\\"packedEnum\\"] ?? json.packed_enum; + const packedEnum = json.packedEnum ?? json.packed_enum; if (packedEnum) { msg.packedEnum = packedEnum; } @@ -29218,31 +29672,31 @@ export const TestUnpackedTypes = { writer.writeRepeatedInt32(90, msg.unpackedInt32); } if (msg.unpackedInt64?.length) { - writer.writeRepeatedInt64String(91, msg.unpackedInt64); + writer.writeRepeatedInt64String(91, msg.unpackedInt64.toString()); } if (msg.unpackedUint32?.length) { writer.writeRepeatedUint32(92, msg.unpackedUint32); } if (msg.unpackedUint64?.length) { - writer.writeRepeatedUint64String(93, msg.unpackedUint64); + writer.writeRepeatedUint64String(93, msg.unpackedUint64.toString()); } if (msg.unpackedSint32?.length) { writer.writeRepeatedSint32(94, msg.unpackedSint32); } if (msg.unpackedSint64?.length) { - writer.writeRepeatedSint64String(95, msg.unpackedSint64); + writer.writeRepeatedSint64String(95, msg.unpackedSint64.toString()); } if (msg.unpackedFixed32?.length) { writer.writeRepeatedFixed32(96, msg.unpackedFixed32); } if (msg.unpackedFixed64?.length) { - writer.writeRepeatedFixed64String(97, msg.unpackedFixed64); + writer.writeRepeatedFixed64String(97, msg.unpackedFixed64.toString()); } if (msg.unpackedSfixed32?.length) { writer.writeRepeatedSfixed32(98, msg.unpackedSfixed32); } if (msg.unpackedSfixed64?.length) { - writer.writeRepeatedSfixed64(99, msg.unpackedSfixed64); + writer.writeRepeatedSfixed64(99, msg.unpackedSfixed64.toString()); } if (msg.unpackedFloat?.length) { writer.writeRepeatedFloat(100, msg.unpackedFloat); @@ -29263,48 +29717,48 @@ export const TestUnpackedTypes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.unpackedInt32?.length) { - json[\\"unpackedInt32\\"] = msg.unpackedInt32; + json.unpackedInt32 = msg.unpackedInt32; } if (msg.unpackedInt64?.length) { - json[\\"unpackedInt64\\"] = msg.unpackedInt64; + json.unpackedInt64 = msg.unpackedInt64.map((x) => x.toString()); } if (msg.unpackedUint32?.length) { - json[\\"unpackedUint32\\"] = msg.unpackedUint32; + json.unpackedUint32 = msg.unpackedUint32; } if (msg.unpackedUint64?.length) { - json[\\"unpackedUint64\\"] = msg.unpackedUint64; + json.unpackedUint64 = msg.unpackedUint64.map((x) => x.toString()); } if (msg.unpackedSint32?.length) { - json[\\"unpackedSint32\\"] = msg.unpackedSint32; + json.unpackedSint32 = msg.unpackedSint32; } if (msg.unpackedSint64?.length) { - json[\\"unpackedSint64\\"] = msg.unpackedSint64; + json.unpackedSint64 = msg.unpackedSint64.map((x) => x.toString()); } if (msg.unpackedFixed32?.length) { - json[\\"unpackedFixed32\\"] = msg.unpackedFixed32; + json.unpackedFixed32 = msg.unpackedFixed32; } if (msg.unpackedFixed64?.length) { - json[\\"unpackedFixed64\\"] = msg.unpackedFixed64; + json.unpackedFixed64 = msg.unpackedFixed64.map((x) => x.toString()); } if (msg.unpackedSfixed32?.length) { - json[\\"unpackedSfixed32\\"] = msg.unpackedSfixed32; + json.unpackedSfixed32 = msg.unpackedSfixed32; } if (msg.unpackedSfixed64?.length) { - json[\\"unpackedSfixed64\\"] = msg.unpackedSfixed64; + json.unpackedSfixed64 = msg.unpackedSfixed64.map((x) => x.toString()); } if (msg.unpackedFloat?.length) { - json[\\"unpackedFloat\\"] = msg.unpackedFloat; + json.unpackedFloat = msg.unpackedFloat; } if (msg.unpackedDouble?.length) { - json[\\"unpackedDouble\\"] = msg.unpackedDouble; + json.unpackedDouble = msg.unpackedDouble; } if (msg.unpackedBool?.length) { - json[\\"unpackedBool\\"] = msg.unpackedBool; + json.unpackedBool = msg.unpackedBool; } if (msg.unpackedEnum?.length) { - json[\\"unpackedEnum\\"] = msg.unpackedEnum; + json.unpackedEnum = msg.unpackedEnum; } return json; }, @@ -29321,7 +29775,7 @@ export const TestUnpackedTypes = { break; } case 91: { - msg.unpackedInt64.push(reader.readInt64String()); + msg.unpackedInt64 = reader.readInt64String().map(BigInt); break; } case 92: { @@ -29329,7 +29783,7 @@ export const TestUnpackedTypes = { break; } case 93: { - msg.unpackedUint64.push(reader.readUint64String()); + msg.unpackedUint64 = reader.readUint64String().map(BigInt); break; } case 94: { @@ -29337,7 +29791,7 @@ export const TestUnpackedTypes = { break; } case 95: { - msg.unpackedSint64.push(reader.readSint64()); + msg.unpackedSint64 = reader.readSint64().map(BigInt); break; } case 96: { @@ -29345,7 +29799,7 @@ export const TestUnpackedTypes = { break; } case 97: { - msg.unpackedFixed64.push(reader.readFixed64String()); + msg.unpackedFixed64 = reader.readFixed64String().map(BigInt); break; } case 98: { @@ -29353,7 +29807,7 @@ export const TestUnpackedTypes = { break; } case 99: { - msg.unpackedSfixed64.push(reader.readSfixed64()); + msg.unpackedSfixed64 = reader.readSfixed64().map(BigInt); break; } case 100: { @@ -29385,59 +29839,59 @@ export const TestUnpackedTypes = { * @private */ _readMessageJSON: function (msg, json) { - const unpackedInt32 = json[\\"unpackedInt32\\"] ?? json.unpacked_int32; + const unpackedInt32 = json.unpackedInt32 ?? json.unpacked_int32; if (unpackedInt32) { msg.unpackedInt32 = unpackedInt32; } - const unpackedInt64 = json[\\"unpackedInt64\\"] ?? json.unpacked_int64; + const unpackedInt64 = json.unpackedInt64 ?? json.unpacked_int64; if (unpackedInt64) { - msg.unpackedInt64 = unpackedInt64; + msg.unpackedInt64 = unpackedInt64.map(BigInt); } - const unpackedUint32 = json[\\"unpackedUint32\\"] ?? json.unpacked_uint32; + const unpackedUint32 = json.unpackedUint32 ?? json.unpacked_uint32; if (unpackedUint32) { msg.unpackedUint32 = unpackedUint32; } - const unpackedUint64 = json[\\"unpackedUint64\\"] ?? json.unpacked_uint64; + const unpackedUint64 = json.unpackedUint64 ?? json.unpacked_uint64; if (unpackedUint64) { - msg.unpackedUint64 = unpackedUint64; + msg.unpackedUint64 = unpackedUint64.map(BigInt); } - const unpackedSint32 = json[\\"unpackedSint32\\"] ?? json.unpacked_sint32; + const unpackedSint32 = json.unpackedSint32 ?? json.unpacked_sint32; if (unpackedSint32) { msg.unpackedSint32 = unpackedSint32; } - const unpackedSint64 = json[\\"unpackedSint64\\"] ?? json.unpacked_sint64; + const unpackedSint64 = json.unpackedSint64 ?? json.unpacked_sint64; if (unpackedSint64) { - msg.unpackedSint64 = unpackedSint64; + msg.unpackedSint64 = unpackedSint64.map(BigInt); } - const unpackedFixed32 = json[\\"unpackedFixed32\\"] ?? json.unpacked_fixed32; + const unpackedFixed32 = json.unpackedFixed32 ?? json.unpacked_fixed32; if (unpackedFixed32) { msg.unpackedFixed32 = unpackedFixed32; } - const unpackedFixed64 = json[\\"unpackedFixed64\\"] ?? json.unpacked_fixed64; + const unpackedFixed64 = json.unpackedFixed64 ?? json.unpacked_fixed64; if (unpackedFixed64) { - msg.unpackedFixed64 = unpackedFixed64; + msg.unpackedFixed64 = unpackedFixed64.map(BigInt); } - const unpackedSfixed32 = json[\\"unpackedSfixed32\\"] ?? json.unpacked_sfixed32; + const unpackedSfixed32 = json.unpackedSfixed32 ?? json.unpacked_sfixed32; if (unpackedSfixed32) { msg.unpackedSfixed32 = unpackedSfixed32; } - const unpackedSfixed64 = json[\\"unpackedSfixed64\\"] ?? json.unpacked_sfixed64; + const unpackedSfixed64 = json.unpackedSfixed64 ?? json.unpacked_sfixed64; if (unpackedSfixed64) { - msg.unpackedSfixed64 = unpackedSfixed64; + msg.unpackedSfixed64 = unpackedSfixed64.map(BigInt); } - const unpackedFloat = json[\\"unpackedFloat\\"] ?? json.unpacked_float; + const unpackedFloat = json.unpackedFloat ?? json.unpacked_float; if (unpackedFloat) { msg.unpackedFloat = unpackedFloat; } - const unpackedDouble = json[\\"unpackedDouble\\"] ?? json.unpacked_double; + const unpackedDouble = json.unpackedDouble ?? json.unpacked_double; if (unpackedDouble) { msg.unpackedDouble = unpackedDouble; } - const unpackedBool = json[\\"unpackedBool\\"] ?? json.unpacked_bool; + const unpackedBool = json.unpackedBool ?? json.unpacked_bool; if (unpackedBool) { msg.unpackedBool = unpackedBool; } - const unpackedEnum = json[\\"unpackedEnum\\"] ?? json.unpacked_enum; + const unpackedEnum = json.unpackedEnum ?? json.unpacked_enum; if (unpackedEnum) { msg.unpackedEnum = unpackedEnum; } @@ -29637,22 +30091,22 @@ export const TestDynamicExtensions = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.scalarExtension) { - json[\\"scalarExtension\\"] = msg.scalarExtension; + json.scalarExtension = msg.scalarExtension; } if (msg.enumExtension) { - json[\\"enumExtension\\"] = msg.enumExtension; + json.enumExtension = msg.enumExtension; } if (msg.dynamicEnumExtension) { - json[\\"dynamicEnumExtension\\"] = msg.dynamicEnumExtension; + json.dynamicEnumExtension = msg.dynamicEnumExtension; } if (msg.messageExtension) { const messageExtension = ForeignMessage._writeMessageJSON( msg.messageExtension ); if (Object.keys(messageExtension).length > 0) { - json[\\"messageExtension\\"] = messageExtension; + json.messageExtension = messageExtension; } } if (msg.dynamicMessageExtension) { @@ -29661,14 +30115,14 @@ export const TestDynamicExtensions = { msg.dynamicMessageExtension ); if (Object.keys(dynamicMessageExtension).length > 0) { - json[\\"dynamicMessageExtension\\"] = dynamicMessageExtension; + json.dynamicMessageExtension = dynamicMessageExtension; } } if (msg.repeatedExtension?.length) { - json[\\"repeatedExtension\\"] = msg.repeatedExtension; + json.repeatedExtension = msg.repeatedExtension; } if (msg.packedExtension?.length) { - json[\\"packedExtension\\"] = msg.packedExtension; + json.packedExtension = msg.packedExtension; } return json; }, @@ -29724,27 +30178,27 @@ export const TestDynamicExtensions = { * @private */ _readMessageJSON: function (msg, json) { - const scalarExtension = json[\\"scalarExtension\\"] ?? json.scalar_extension; + const scalarExtension = json.scalarExtension ?? json.scalar_extension; if (scalarExtension) { msg.scalarExtension = scalarExtension; } - const enumExtension = json[\\"enumExtension\\"] ?? json.enum_extension; + const enumExtension = json.enumExtension ?? json.enum_extension; if (enumExtension) { msg.enumExtension = enumExtension; } const dynamicEnumExtension = - json[\\"dynamicEnumExtension\\"] ?? json.dynamic_enum_extension; + json.dynamicEnumExtension ?? json.dynamic_enum_extension; if (dynamicEnumExtension) { msg.dynamicEnumExtension = dynamicEnumExtension; } - const messageExtension = json[\\"messageExtension\\"] ?? json.message_extension; + const messageExtension = json.messageExtension ?? json.message_extension; if (messageExtension) { const m = ForeignMessage.initialize(); ForeignMessage._readMessageJSON(m, messageExtension); msg.messageExtension = m; } const dynamicMessageExtension = - json[\\"dynamicMessageExtension\\"] ?? json.dynamic_message_extension; + json.dynamicMessageExtension ?? json.dynamic_message_extension; if (dynamicMessageExtension) { const m = TestDynamicExtensions.DynamicMessageType.initialize(); TestDynamicExtensions.DynamicMessageType._readMessageJSON( @@ -29753,12 +30207,11 @@ export const TestDynamicExtensions = { ); msg.dynamicMessageExtension = m; } - const repeatedExtension = - json[\\"repeatedExtension\\"] ?? json.repeated_extension; + const repeatedExtension = json.repeatedExtension ?? json.repeated_extension; if (repeatedExtension) { msg.repeatedExtension = repeatedExtension; } - const packedExtension = json[\\"packedExtension\\"] ?? json.packed_extension; + const packedExtension = json.packedExtension ?? json.packed_extension; if (packedExtension) { msg.packedExtension = packedExtension; } @@ -29832,9 +30285,9 @@ export const TestDynamicExtensions = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.dynamicField) { - json[\\"dynamicField\\"] = msg.dynamicField; + json.dynamicField = msg.dynamicField; } return json; }, @@ -29863,7 +30316,7 @@ export const TestDynamicExtensions = { * @private */ _readMessageJSON: function (msg, json) { - const dynamicField = json[\\"dynamicField\\"] ?? json.dynamic_field; + const dynamicField = json.dynamicField ?? json.dynamic_field; if (dynamicField) { msg.dynamicField = dynamicField; } @@ -29939,16 +30392,16 @@ export const TestRepeatedScalarDifferentTagSizes = { writer.writeRepeatedInt32(13, msg.repeatedInt32); } if (msg.repeatedFixed64?.length) { - writer.writeRepeatedFixed64String(2046, msg.repeatedFixed64); + writer.writeRepeatedFixed64String(2046, msg.repeatedFixed64.toString()); } if (msg.repeatedInt64?.length) { - writer.writeRepeatedInt64String(2047, msg.repeatedInt64); + writer.writeRepeatedInt64String(2047, msg.repeatedInt64.toString()); } if (msg.repeatedFloat?.length) { writer.writeRepeatedFloat(262142, msg.repeatedFloat); } if (msg.repeatedUint64?.length) { - writer.writeRepeatedUint64String(262143, msg.repeatedUint64); + writer.writeRepeatedUint64String(262143, msg.repeatedUint64.toString()); } return writer; }, @@ -29957,24 +30410,24 @@ export const TestRepeatedScalarDifferentTagSizes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.repeatedFixed32?.length) { - json[\\"repeatedFixed32\\"] = msg.repeatedFixed32; + json.repeatedFixed32 = msg.repeatedFixed32; } if (msg.repeatedInt32?.length) { - json[\\"repeatedInt32\\"] = msg.repeatedInt32; + json.repeatedInt32 = msg.repeatedInt32; } if (msg.repeatedFixed64?.length) { - json[\\"repeatedFixed64\\"] = msg.repeatedFixed64; + json.repeatedFixed64 = msg.repeatedFixed64.map((x) => x.toString()); } if (msg.repeatedInt64?.length) { - json[\\"repeatedInt64\\"] = msg.repeatedInt64; + json.repeatedInt64 = msg.repeatedInt64.map((x) => x.toString()); } if (msg.repeatedFloat?.length) { - json[\\"repeatedFloat\\"] = msg.repeatedFloat; + json.repeatedFloat = msg.repeatedFloat; } if (msg.repeatedUint64?.length) { - json[\\"repeatedUint64\\"] = msg.repeatedUint64; + json.repeatedUint64 = msg.repeatedUint64.map((x) => x.toString()); } return json; }, @@ -29995,11 +30448,11 @@ export const TestRepeatedScalarDifferentTagSizes = { break; } case 2046: { - msg.repeatedFixed64.push(reader.readFixed64String()); + msg.repeatedFixed64 = reader.readFixed64String().map(BigInt); break; } case 2047: { - msg.repeatedInt64.push(reader.readInt64String()); + msg.repeatedInt64 = reader.readInt64String().map(BigInt); break; } case 262142: { @@ -30007,7 +30460,7 @@ export const TestRepeatedScalarDifferentTagSizes = { break; } case 262143: { - msg.repeatedUint64.push(reader.readUint64String()); + msg.repeatedUint64 = reader.readUint64String().map(BigInt); break; } default: { @@ -30023,29 +30476,29 @@ export const TestRepeatedScalarDifferentTagSizes = { * @private */ _readMessageJSON: function (msg, json) { - const repeatedFixed32 = json[\\"repeatedFixed32\\"] ?? json.repeated_fixed32; + const repeatedFixed32 = json.repeatedFixed32 ?? json.repeated_fixed32; if (repeatedFixed32) { msg.repeatedFixed32 = repeatedFixed32; } - const repeatedInt32 = json[\\"repeatedInt32\\"] ?? json.repeated_int32; + const repeatedInt32 = json.repeatedInt32 ?? json.repeated_int32; if (repeatedInt32) { msg.repeatedInt32 = repeatedInt32; } - const repeatedFixed64 = json[\\"repeatedFixed64\\"] ?? json.repeated_fixed64; + const repeatedFixed64 = json.repeatedFixed64 ?? json.repeated_fixed64; if (repeatedFixed64) { - msg.repeatedFixed64 = repeatedFixed64; + msg.repeatedFixed64 = repeatedFixed64.map(BigInt); } - const repeatedInt64 = json[\\"repeatedInt64\\"] ?? json.repeated_int64; + const repeatedInt64 = json.repeatedInt64 ?? json.repeated_int64; if (repeatedInt64) { - msg.repeatedInt64 = repeatedInt64; + msg.repeatedInt64 = repeatedInt64.map(BigInt); } - const repeatedFloat = json[\\"repeatedFloat\\"] ?? json.repeated_float; + const repeatedFloat = json.repeatedFloat ?? json.repeated_float; if (repeatedFloat) { msg.repeatedFloat = repeatedFloat; } - const repeatedUint64 = json[\\"repeatedUint64\\"] ?? json.repeated_uint64; + const repeatedUint64 = json.repeatedUint64 ?? json.repeated_uint64; if (repeatedUint64) { - msg.repeatedUint64 = repeatedUint64; + msg.repeatedUint64 = repeatedUint64.map(BigInt); } return msg; }, @@ -30124,13 +30577,13 @@ export const TestParsingMerge = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.requiredAllTypes) { const requiredAllTypes = TestAllTypes._writeMessageJSON( msg.requiredAllTypes ); if (Object.keys(requiredAllTypes).length > 0) { - json[\\"requiredAllTypes\\"] = requiredAllTypes; + json.requiredAllTypes = requiredAllTypes; } } if (msg.optionalAllTypes) { @@ -30138,11 +30591,11 @@ export const TestParsingMerge = { msg.optionalAllTypes ); if (Object.keys(optionalAllTypes).length > 0) { - json[\\"optionalAllTypes\\"] = optionalAllTypes; + json.optionalAllTypes = optionalAllTypes; } } if (msg.repeatedAllTypes?.length) { - json[\\"repeatedAllTypes\\"] = msg.repeatedAllTypes.map( + json.repeatedAllTypes = msg.repeatedAllTypes.map( TestAllTypes._writeMessageJSON ); } @@ -30183,22 +30636,19 @@ export const TestParsingMerge = { * @private */ _readMessageJSON: function (msg, json) { - const requiredAllTypes = - json[\\"requiredAllTypes\\"] ?? json.required_all_types; + const requiredAllTypes = json.requiredAllTypes ?? json.required_all_types; if (requiredAllTypes) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, requiredAllTypes); msg.requiredAllTypes = m; } - const optionalAllTypes = - json[\\"optionalAllTypes\\"] ?? json.optional_all_types; + const optionalAllTypes = json.optionalAllTypes ?? json.optional_all_types; if (optionalAllTypes) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, optionalAllTypes); msg.optionalAllTypes = m; } - const repeatedAllTypes = - json[\\"repeatedAllTypes\\"] ?? json.repeated_all_types; + const repeatedAllTypes = json.repeatedAllTypes ?? json.repeated_all_types; if (repeatedAllTypes) { for (const item of repeatedAllTypes) { const m = TestAllTypes.initialize(); @@ -30290,21 +30740,21 @@ export const TestParsingMerge = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.field1?.length) { - json[\\"field1\\"] = msg.field1.map(TestAllTypes._writeMessageJSON); + json.field1 = msg.field1.map(TestAllTypes._writeMessageJSON); } if (msg.field2?.length) { - json[\\"field2\\"] = msg.field2.map(TestAllTypes._writeMessageJSON); + json.field2 = msg.field2.map(TestAllTypes._writeMessageJSON); } if (msg.field3?.length) { - json[\\"field3\\"] = msg.field3.map(TestAllTypes._writeMessageJSON); + json.field3 = msg.field3.map(TestAllTypes._writeMessageJSON); } if (msg.ext1?.length) { - json[\\"ext1\\"] = msg.ext1.map(TestAllTypes._writeMessageJSON); + json.ext1 = msg.ext1.map(TestAllTypes._writeMessageJSON); } if (msg.ext2?.length) { - json[\\"ext2\\"] = msg.ext2.map(TestAllTypes._writeMessageJSON); + json.ext2 = msg.ext2.map(TestAllTypes._writeMessageJSON); } return json; }, @@ -30359,7 +30809,7 @@ export const TestParsingMerge = { * @private */ _readMessageJSON: function (msg, json) { - const field1 = json[\\"field1\\"] ?? json.field1; + const field1 = json.field1 ?? json.field1; if (field1) { for (const item of field1) { const m = TestAllTypes.initialize(); @@ -30367,7 +30817,7 @@ export const TestParsingMerge = { msg.field1.push(m); } } - const field2 = json[\\"field2\\"] ?? json.field2; + const field2 = json.field2 ?? json.field2; if (field2) { for (const item of field2) { const m = TestAllTypes.initialize(); @@ -30375,7 +30825,7 @@ export const TestParsingMerge = { msg.field2.push(m); } } - const field3 = json[\\"field3\\"] ?? json.field3; + const field3 = json.field3 ?? json.field3; if (field3) { for (const item of field3) { const m = TestAllTypes.initialize(); @@ -30383,7 +30833,7 @@ export const TestParsingMerge = { msg.field3.push(m); } } - const ext1 = json[\\"ext1\\"] ?? json.ext1; + const ext1 = json.ext1 ?? json.ext1; if (ext1) { for (const item of ext1) { const m = TestAllTypes.initialize(); @@ -30391,7 +30841,7 @@ export const TestParsingMerge = { msg.ext1.push(m); } } - const ext2 = json[\\"ext2\\"] ?? json.ext2; + const ext2 = json.ext2 ?? json.ext2; if (ext2) { for (const item of ext2) { const m = TestAllTypes.initialize(); @@ -30467,11 +30917,11 @@ export const TestParsingMerge = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.field1) { const field1 = TestAllTypes._writeMessageJSON(msg.field1); if (Object.keys(field1).length > 0) { - json[\\"field1\\"] = field1; + json.field1 = field1; } } return json; @@ -30501,7 +30951,7 @@ export const TestParsingMerge = { * @private */ _readMessageJSON: function (msg, json) { - const field1 = json[\\"field1\\"] ?? json.field1; + const field1 = json.field1 ?? json.field1; if (field1) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, field1); @@ -30576,11 +31026,11 @@ export const TestParsingMerge = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.field1) { const field1 = TestAllTypes._writeMessageJSON(msg.field1); if (Object.keys(field1).length > 0) { - json[\\"field1\\"] = field1; + json.field1 = field1; } } return json; @@ -30610,7 +31060,7 @@ export const TestParsingMerge = { * @private */ _readMessageJSON: function (msg, json) { - const field1 = json[\\"field1\\"] ?? json.field1; + const field1 = json.field1 ?? json.field1; if (field1) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, field1); @@ -30688,13 +31138,13 @@ export const TestParsingMerge = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.optionalGroupAllTypes) { const optionalGroupAllTypes = TestAllTypes._writeMessageJSON( msg.optionalGroupAllTypes ); if (Object.keys(optionalGroupAllTypes).length > 0) { - json[\\"optionalGroupAllTypes\\"] = optionalGroupAllTypes; + json.optionalGroupAllTypes = optionalGroupAllTypes; } } return json; @@ -30728,7 +31178,7 @@ export const TestParsingMerge = { */ _readMessageJSON: function (msg, json) { const optionalGroupAllTypes = - json[\\"optionalGroupAllTypes\\"] ?? json.optional_group_all_types; + json.optionalGroupAllTypes ?? json.optional_group_all_types; if (optionalGroupAllTypes) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, optionalGroupAllTypes); @@ -30805,13 +31255,13 @@ export const TestParsingMerge = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.repeatedGroupAllTypes) { const repeatedGroupAllTypes = TestAllTypes._writeMessageJSON( msg.repeatedGroupAllTypes ); if (Object.keys(repeatedGroupAllTypes).length > 0) { - json[\\"repeatedGroupAllTypes\\"] = repeatedGroupAllTypes; + json.repeatedGroupAllTypes = repeatedGroupAllTypes; } } return json; @@ -30845,7 +31295,7 @@ export const TestParsingMerge = { */ _readMessageJSON: function (msg, json) { const repeatedGroupAllTypes = - json[\\"repeatedGroupAllTypes\\"] ?? json.repeated_group_all_types; + json.repeatedGroupAllTypes ?? json.repeated_group_all_types; if (repeatedGroupAllTypes) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, repeatedGroupAllTypes); @@ -30919,9 +31369,9 @@ export const TestCommentInjectionMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -30950,7 +31400,7 @@ export const TestCommentInjectionMessage = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -31331,27 +31781,27 @@ export const TestJsonName = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.fieldName1) { - json[\\"fieldName1\\"] = msg.fieldName1; + json.fieldName1 = msg.fieldName1; } if (msg.fieldName2) { - json[\\"fieldName2\\"] = msg.fieldName2; + json.fieldName2 = msg.fieldName2; } if (msg.FieldName3) { - json[\\"FieldName3\\"] = msg.FieldName3; + json.FieldName3 = msg.FieldName3; } if (msg.FieldName4) { - json[\\"FieldName4\\"] = msg.FieldName4; + json.FieldName4 = msg.FieldName4; } if (msg.FIELDNAME5) { - json[\\"FIELDNAME5\\"] = msg.FIELDNAME5; + json.FIELDNAME5 = msg.FIELDNAME5; } if (msg.fieldName6) { json[\\"@type\\"] = msg.fieldName6; } if (msg.fieldname7) { - json[\\"fieldname7\\"] = msg.fieldname7; + json.fieldname7 = msg.fieldname7; } return json; }, @@ -31404,23 +31854,23 @@ export const TestJsonName = { * @private */ _readMessageJSON: function (msg, json) { - const fieldName1 = json[\\"fieldName1\\"] ?? json.field_name1; + const fieldName1 = json.fieldName1 ?? json.field_name1; if (fieldName1) { msg.fieldName1 = fieldName1; } - const fieldName2 = json[\\"fieldName2\\"] ?? json.fieldName2; + const fieldName2 = json.fieldName2 ?? json.fieldName2; if (fieldName2) { msg.fieldName2 = fieldName2; } - const FieldName3 = json[\\"FieldName3\\"] ?? json.FieldName3; + const FieldName3 = json.FieldName3 ?? json.FieldName3; if (FieldName3) { msg.FieldName3 = FieldName3; } - const FieldName4 = json[\\"FieldName4\\"] ?? json._field_name4; + const FieldName4 = json.FieldName4 ?? json._field_name4; if (FieldName4) { msg.FieldName4 = FieldName4; } - const FIELDNAME5 = json[\\"FIELDNAME5\\"] ?? json.FIELD_NAME5; + const FIELDNAME5 = json.FIELDNAME5 ?? json.FIELD_NAME5; if (FIELDNAME5) { msg.FIELDNAME5 = FIELDNAME5; } @@ -31428,7 +31878,7 @@ export const TestJsonName = { if (fieldName6) { msg.fieldName6 = fieldName6; } - const fieldname7 = json[\\"fieldname7\\"] ?? json.fieldname7; + const fieldname7 = json.fieldname7 ?? json.fieldname7; if (fieldname7) { msg.fieldname7 = fieldname7; } @@ -31527,11 +31977,13 @@ export const TestHugeFieldNumbers = { ); } if (msg.stringStringMap) { - for (const key in msg.stringStringMap) { - writer.writeMessage(536870010, {}, (_, mapWriter) => { - mapWriter.writeString(1, key); - mapWriter.writeString(2, msg.stringStringMap[key]); - }); + for (const [key, value] of Object.entries(msg.stringStringMap)) { + if (key && value) { + writer.writeMessage(536870010, {}, (_, mapWriter) => { + mapWriter.writeString(1, key); + mapWriter.writeString(2, value); + }); + } } } if (msg.oneofUint32 != undefined) { @@ -31557,57 +32009,63 @@ export const TestHugeFieldNumbers = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.optionalInt32) { - json[\\"optionalInt32\\"] = msg.optionalInt32; + json.optionalInt32 = msg.optionalInt32; } if (msg.fixed32) { - json[\\"fixed32\\"] = msg.fixed32; + json.fixed32 = msg.fixed32; } if (msg.repeatedInt32?.length) { - json[\\"repeatedInt32\\"] = msg.repeatedInt32; + json.repeatedInt32 = msg.repeatedInt32; } if (msg.packedInt32?.length) { - json[\\"packedInt32\\"] = msg.packedInt32; + json.packedInt32 = msg.packedInt32; } if (msg.optionalEnum) { - json[\\"optionalEnum\\"] = msg.optionalEnum; + json.optionalEnum = msg.optionalEnum; } if (msg.optionalString) { - json[\\"optionalString\\"] = msg.optionalString; + json.optionalString = msg.optionalString; } if (msg.optionalBytes) { - json[\\"optionalBytes\\"] = msg.optionalBytes; + json.optionalBytes = msg.optionalBytes; } if (msg.optionalMessage) { const optionalMessage = ForeignMessage._writeMessageJSON( msg.optionalMessage ); if (Object.keys(optionalMessage).length > 0) { - json[\\"optionalMessage\\"] = optionalMessage; + json.optionalMessage = optionalMessage; } } if (msg.stringStringMap) { - if (Object.keys(msg.stringStringMap).length > 0) { - json[\\"stringStringMap\\"] = msg.stringStringMap; + if (msg.stringStringMap) { + const map = {}; + for (const [key, value] of Object.entries(msg.stringStringMap)) { + if (key && value) { + map[key] = value; + json.stringStringMap = map; + } + } } } if (msg.oneofUint32 != undefined) { - json[\\"oneofUint32\\"] = msg.oneofUint32; + json.oneofUint32 = msg.oneofUint32; } if (msg.oneofTestAllTypes != undefined) { const oneofTestAllTypes = TestAllTypes._writeMessageJSON( msg.oneofTestAllTypes ); if (Object.keys(oneofTestAllTypes).length > 0) { - json[\\"oneofTestAllTypes\\"] = oneofTestAllTypes; + json.oneofTestAllTypes = oneofTestAllTypes; } } if (msg.oneofString != undefined) { - json[\\"oneofString\\"] = msg.oneofString; + json.oneofString = msg.oneofString; } if (msg.oneofBytes != undefined) { - json[\\"oneofBytes\\"] = msg.oneofBytes; + json.oneofBytes = msg.oneofBytes; } return json; }, @@ -31703,60 +32161,62 @@ export const TestHugeFieldNumbers = { * @private */ _readMessageJSON: function (msg, json) { - const optionalInt32 = json[\\"optionalInt32\\"] ?? json.optional_int32; + const optionalInt32 = json.optionalInt32 ?? json.optional_int32; if (optionalInt32) { msg.optionalInt32 = optionalInt32; } - const fixed32 = json[\\"fixed32\\"] ?? json.fixed_32; + const fixed32 = json.fixed32 ?? json.fixed_32; if (fixed32) { msg.fixed32 = fixed32; } - const repeatedInt32 = json[\\"repeatedInt32\\"] ?? json.repeated_int32; + const repeatedInt32 = json.repeatedInt32 ?? json.repeated_int32; if (repeatedInt32) { msg.repeatedInt32 = repeatedInt32; } - const packedInt32 = json[\\"packedInt32\\"] ?? json.packed_int32; + const packedInt32 = json.packedInt32 ?? json.packed_int32; if (packedInt32) { msg.packedInt32 = packedInt32; } - const optionalEnum = json[\\"optionalEnum\\"] ?? json.optional_enum; + const optionalEnum = json.optionalEnum ?? json.optional_enum; if (optionalEnum) { msg.optionalEnum = optionalEnum; } - const optionalString = json[\\"optionalString\\"] ?? json.optional_string; + const optionalString = json.optionalString ?? json.optional_string; if (optionalString) { msg.optionalString = optionalString; } - const optionalBytes = json[\\"optionalBytes\\"] ?? json.optional_bytes; + const optionalBytes = json.optionalBytes ?? json.optional_bytes; if (optionalBytes) { msg.optionalBytes = optionalBytes; } - const optionalMessage = json[\\"optionalMessage\\"] ?? json.optional_message; + const optionalMessage = json.optionalMessage ?? json.optional_message; if (optionalMessage) { const m = ForeignMessage.initialize(); ForeignMessage._readMessageJSON(m, optionalMessage); msg.optionalMessage = m; } - const stringStringMap = json[\\"stringStringMap\\"] ?? json.string_string_map; + const stringStringMap = json.stringStringMap ?? json.string_string_map; if (stringStringMap) { - msg.stringStringMap = stringStringMap; + for (const [key, value] of Object.entries(stringStringMap)) { + msg.stringStringMap[key] = value; + } } - const oneofUint32 = json[\\"oneofUint32\\"] ?? json.oneof_uint32; + const oneofUint32 = json.oneofUint32 ?? json.oneof_uint32; if (oneofUint32) { msg.oneofUint32 = oneofUint32; } const oneofTestAllTypes = - json[\\"oneofTestAllTypes\\"] ?? json.oneof_test_all_types; + json.oneofTestAllTypes ?? json.oneof_test_all_types; if (oneofTestAllTypes) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, oneofTestAllTypes); msg.oneofTestAllTypes = m; } - const oneofString = json[\\"oneofString\\"] ?? json.oneof_string; + const oneofString = json.oneofString ?? json.oneof_string; if (oneofString) { msg.oneofString = oneofString; } - const oneofBytes = json[\\"oneofBytes\\"] ?? json.oneof_bytes; + const oneofBytes = json.oneofBytes ?? json.oneof_bytes; if (oneofBytes) { msg.oneofBytes = oneofBytes; } @@ -31826,9 +32286,9 @@ export const TestHugeFieldNumbers = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.groupA) { - json[\\"groupA\\"] = msg.groupA; + json.groupA = msg.groupA; } return json; }, @@ -31857,7 +32317,7 @@ export const TestHugeFieldNumbers = { * @private */ _readMessageJSON: function (msg, json) { - const groupA = json[\\"groupA\\"] ?? json.group_a; + const groupA = json.groupA ?? json.group_a; if (groupA) { msg.groupA = groupA; } @@ -31961,33 +32421,33 @@ export const TestExtensionInsideTable = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.field1) { - json[\\"field1\\"] = msg.field1; + json.field1 = msg.field1; } if (msg.field2) { - json[\\"field2\\"] = msg.field2; + json.field2 = msg.field2; } if (msg.field3) { - json[\\"field3\\"] = msg.field3; + json.field3 = msg.field3; } if (msg.field4) { - json[\\"field4\\"] = msg.field4; + json.field4 = msg.field4; } if (msg.field6) { - json[\\"field6\\"] = msg.field6; + json.field6 = msg.field6; } if (msg.field7) { - json[\\"field7\\"] = msg.field7; + json.field7 = msg.field7; } if (msg.field8) { - json[\\"field8\\"] = msg.field8; + json.field8 = msg.field8; } if (msg.field9) { - json[\\"field9\\"] = msg.field9; + json.field9 = msg.field9; } if (msg.field10) { - json[\\"field10\\"] = msg.field10; + json.field10 = msg.field10; } return json; }, @@ -32048,39 +32508,39 @@ export const TestExtensionInsideTable = { * @private */ _readMessageJSON: function (msg, json) { - const field1 = json[\\"field1\\"] ?? json.field1; + const field1 = json.field1 ?? json.field1; if (field1) { msg.field1 = field1; } - const field2 = json[\\"field2\\"] ?? json.field2; + const field2 = json.field2 ?? json.field2; if (field2) { msg.field2 = field2; } - const field3 = json[\\"field3\\"] ?? json.field3; + const field3 = json.field3 ?? json.field3; if (field3) { msg.field3 = field3; } - const field4 = json[\\"field4\\"] ?? json.field4; + const field4 = json.field4 ?? json.field4; if (field4) { msg.field4 = field4; } - const field6 = json[\\"field6\\"] ?? json.field6; + const field6 = json.field6 ?? json.field6; if (field6) { msg.field6 = field6; } - const field7 = json[\\"field7\\"] ?? json.field7; + const field7 = json.field7 ?? json.field7; if (field7) { msg.field7 = field7; } - const field8 = json[\\"field8\\"] ?? json.field8; + const field8 = json.field8 ?? json.field8; if (field8) { msg.field8 = field8; } - const field9 = json[\\"field9\\"] ?? json.field9; + const field9 = json.field9 ?? json.field9; if (field9) { msg.field9 = field9; } - const field10 = json[\\"field10\\"] ?? json.field10; + const field10 = json.field10 ?? json.field10; if (field10) { msg.field10 = field10; } @@ -32163,18 +32623,18 @@ export const TestExtensionRangeSerialize = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.fooOne) { - json[\\"fooOne\\"] = msg.fooOne; + json.fooOne = msg.fooOne; } if (msg.fooTwo) { - json[\\"fooTwo\\"] = msg.fooTwo; + json.fooTwo = msg.fooTwo; } if (msg.fooThree) { - json[\\"fooThree\\"] = msg.fooThree; + json.fooThree = msg.fooThree; } if (msg.fooFour) { - json[\\"fooFour\\"] = msg.fooFour; + json.fooFour = msg.fooFour; } return json; }, @@ -32215,19 +32675,19 @@ export const TestExtensionRangeSerialize = { * @private */ _readMessageJSON: function (msg, json) { - const fooOne = json[\\"fooOne\\"] ?? json.foo_one; + const fooOne = json.fooOne ?? json.foo_one; if (fooOne) { msg.fooOne = fooOne; } - const fooTwo = json[\\"fooTwo\\"] ?? json.foo_two; + const fooTwo = json.fooTwo ?? json.foo_two; if (fooTwo) { msg.fooTwo = fooTwo; } - const fooThree = json[\\"fooThree\\"] ?? json.foo_three; + const fooThree = json.fooThree ?? json.foo_three; if (fooThree) { msg.fooThree = fooThree; } - const fooFour = json[\\"fooFour\\"] ?? json.foo_four; + const fooFour = json.fooFour ?? json.foo_four; if (fooFour) { msg.fooFour = fooFour; } @@ -32332,155 +32792,193 @@ export const TestMap = { */ _writeMessage: function (msg, writer) { if (msg.mapInt32Int32) { - for (const key in msg.mapInt32Int32) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeInt32(2, msg.mapInt32Int32[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Int32)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeInt32(2, value); + }); + } } } if (msg.mapInt64Int64) { - for (const key in msg.mapInt64Int64) { - writer.writeMessage(2, {}, (_, mapWriter) => { - mapWriter.writeInt64String(1, key); - mapWriter.writeInt64String(2, msg.mapInt64Int64[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt64Int64)) { + if (key && value) { + writer.writeMessage(2, {}, (_, mapWriter) => { + mapWriter.writeInt64String(1, key); + mapWriter.writeInt64String(2, value.toString()); + }); + } } } if (msg.mapUint32Uint32) { - for (const key in msg.mapUint32Uint32) { - writer.writeMessage(3, {}, (_, mapWriter) => { - mapWriter.writeUint32(1, key); - mapWriter.writeUint32(2, msg.mapUint32Uint32[key]); - }); + for (const [key, value] of Object.entries(msg.mapUint32Uint32)) { + if (key && value) { + writer.writeMessage(3, {}, (_, mapWriter) => { + mapWriter.writeUint32(1, key); + mapWriter.writeUint32(2, value); + }); + } } } if (msg.mapUint64Uint64) { - for (const key in msg.mapUint64Uint64) { - writer.writeMessage(4, {}, (_, mapWriter) => { - mapWriter.writeUint64String(1, key); - mapWriter.writeUint64String(2, msg.mapUint64Uint64[key]); - }); + for (const [key, value] of Object.entries(msg.mapUint64Uint64)) { + if (key && value) { + writer.writeMessage(4, {}, (_, mapWriter) => { + mapWriter.writeUint64String(1, key); + mapWriter.writeUint64String(2, value.toString()); + }); + } } } if (msg.mapSint32Sint32) { - for (const key in msg.mapSint32Sint32) { - writer.writeMessage(5, {}, (_, mapWriter) => { - mapWriter.writeSint32(1, key); - mapWriter.writeSint32(2, msg.mapSint32Sint32[key]); - }); + for (const [key, value] of Object.entries(msg.mapSint32Sint32)) { + if (key && value) { + writer.writeMessage(5, {}, (_, mapWriter) => { + mapWriter.writeSint32(1, key); + mapWriter.writeSint32(2, value); + }); + } } } if (msg.mapSint64Sint64) { - for (const key in msg.mapSint64Sint64) { - writer.writeMessage(6, {}, (_, mapWriter) => { - mapWriter.writeSint64String(1, key); - mapWriter.writeSint64String(2, msg.mapSint64Sint64[key]); - }); + for (const [key, value] of Object.entries(msg.mapSint64Sint64)) { + if (key && value) { + writer.writeMessage(6, {}, (_, mapWriter) => { + mapWriter.writeSint64String(1, key); + mapWriter.writeSint64String(2, value.toString()); + }); + } } } if (msg.mapFixed32Fixed32) { - for (const key in msg.mapFixed32Fixed32) { - writer.writeMessage(7, {}, (_, mapWriter) => { - mapWriter.writeFixed32(1, key); - mapWriter.writeFixed32(2, msg.mapFixed32Fixed32[key]); - }); + for (const [key, value] of Object.entries(msg.mapFixed32Fixed32)) { + if (key && value) { + writer.writeMessage(7, {}, (_, mapWriter) => { + mapWriter.writeFixed32(1, key); + mapWriter.writeFixed32(2, value); + }); + } } } if (msg.mapFixed64Fixed64) { - for (const key in msg.mapFixed64Fixed64) { - writer.writeMessage(8, {}, (_, mapWriter) => { - mapWriter.writeFixed64String(1, key); - mapWriter.writeFixed64String(2, msg.mapFixed64Fixed64[key]); - }); + for (const [key, value] of Object.entries(msg.mapFixed64Fixed64)) { + if (key && value) { + writer.writeMessage(8, {}, (_, mapWriter) => { + mapWriter.writeFixed64String(1, key); + mapWriter.writeFixed64String(2, value.toString()); + }); + } } } if (msg.mapSfixed32Sfixed32) { - for (const key in msg.mapSfixed32Sfixed32) { - writer.writeMessage(9, {}, (_, mapWriter) => { - mapWriter.writeSfixed32(1, key); - mapWriter.writeSfixed32(2, msg.mapSfixed32Sfixed32[key]); - }); + for (const [key, value] of Object.entries(msg.mapSfixed32Sfixed32)) { + if (key && value) { + writer.writeMessage(9, {}, (_, mapWriter) => { + mapWriter.writeSfixed32(1, key); + mapWriter.writeSfixed32(2, value); + }); + } } } if (msg.mapSfixed64Sfixed64) { - for (const key in msg.mapSfixed64Sfixed64) { - writer.writeMessage(10, {}, (_, mapWriter) => { - mapWriter.writeSfixed64(1, key); - mapWriter.writeSfixed64(2, msg.mapSfixed64Sfixed64[key]); - }); + for (const [key, value] of Object.entries(msg.mapSfixed64Sfixed64)) { + if (key && value) { + writer.writeMessage(10, {}, (_, mapWriter) => { + mapWriter.writeSfixed64(1, key); + mapWriter.writeSfixed64(2, value.toString()); + }); + } } } if (msg.mapInt32Float) { - for (const key in msg.mapInt32Float) { - writer.writeMessage(11, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeFloat(2, msg.mapInt32Float[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Float)) { + if (key && value) { + writer.writeMessage(11, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeFloat(2, value); + }); + } } } if (msg.mapInt32Double) { - for (const key in msg.mapInt32Double) { - writer.writeMessage(12, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeDouble(2, msg.mapInt32Double[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Double)) { + if (key && value) { + writer.writeMessage(12, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeDouble(2, value); + }); + } } } if (msg.mapBoolBool) { - for (const key in msg.mapBoolBool) { - writer.writeMessage(13, {}, (_, mapWriter) => { - mapWriter.writeBool(1, key); - mapWriter.writeBool(2, msg.mapBoolBool[key]); - }); + for (const [key, value] of Object.entries(msg.mapBoolBool)) { + if (key && value) { + writer.writeMessage(13, {}, (_, mapWriter) => { + mapWriter.writeBool(1, key); + mapWriter.writeBool(2, value); + }); + } } } if (msg.mapStringString) { - for (const key in msg.mapStringString) { - writer.writeMessage(14, {}, (_, mapWriter) => { - mapWriter.writeString(1, key); - mapWriter.writeString(2, msg.mapStringString[key]); - }); + for (const [key, value] of Object.entries(msg.mapStringString)) { + if (key && value) { + writer.writeMessage(14, {}, (_, mapWriter) => { + mapWriter.writeString(1, key); + mapWriter.writeString(2, value); + }); + } } } if (msg.mapInt32Bytes) { - for (const key in msg.mapInt32Bytes) { - writer.writeMessage(15, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeBytes(2, msg.mapInt32Bytes[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Bytes)) { + if (key && value) { + writer.writeMessage(15, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeBytes(2, value); + }); + } } } if (msg.mapInt32Enum) { - for (const key in msg.mapInt32Enum) { - writer.writeMessage(16, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeEnum(2, msg.mapInt32Enum[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Enum)) { + if (key && value) { + writer.writeMessage(16, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeEnum(2, value); + }); + } } } if (msg.mapInt32ForeignMessage) { - for (const key in msg.mapInt32ForeignMessage) { - writer.writeMessage(17, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeMessage(2, msg.mapInt32ForeignMessage[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32ForeignMessage)) { + if (key && value) { + writer.writeMessage(17, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeMessage(2, value, ForeignMessage._writeMessage); + }); + } } } if (msg.mapStringForeignMessage) { - for (const key in msg.mapStringForeignMessage) { - writer.writeMessage(18, {}, (_, mapWriter) => { - mapWriter.writeString(1, key); - mapWriter.writeMessage(2, msg.mapStringForeignMessage[key]); - }); + for (const [key, value] of Object.entries(msg.mapStringForeignMessage)) { + if (key && value) { + writer.writeMessage(18, {}, (_, mapWriter) => { + mapWriter.writeString(1, key); + mapWriter.writeMessage(2, value, ForeignMessage._writeMessage); + }); + } } } if (msg.mapInt32AllTypes) { - for (const key in msg.mapInt32AllTypes) { - writer.writeMessage(19, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeMessage(2, msg.mapInt32AllTypes[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32AllTypes)) { + if (key && value) { + writer.writeMessage(19, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeMessage(2, value, TestAllTypes._writeMessage); + }); + } } } return writer; @@ -32490,100 +32988,216 @@ export const TestMap = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.mapInt32Int32) { - if (Object.keys(msg.mapInt32Int32).length > 0) { - json[\\"mapInt32Int32\\"] = msg.mapInt32Int32; + if (msg.mapInt32Int32) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32Int32)) { + if (key && value) { + map[key] = value; + json.mapInt32Int32 = map; + } + } } } if (msg.mapInt64Int64) { - if (Object.keys(msg.mapInt64Int64).length > 0) { - json[\\"mapInt64Int64\\"] = msg.mapInt64Int64; + if (msg.mapInt64Int64) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt64Int64)) { + if (key && value) { + map[key] = value.toString(); + json.mapInt64Int64 = map; + } + } } } if (msg.mapUint32Uint32) { - if (Object.keys(msg.mapUint32Uint32).length > 0) { - json[\\"mapUint32Uint32\\"] = msg.mapUint32Uint32; + if (msg.mapUint32Uint32) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapUint32Uint32)) { + if (key && value) { + map[key] = value; + json.mapUint32Uint32 = map; + } + } } } if (msg.mapUint64Uint64) { - if (Object.keys(msg.mapUint64Uint64).length > 0) { - json[\\"mapUint64Uint64\\"] = msg.mapUint64Uint64; + if (msg.mapUint64Uint64) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapUint64Uint64)) { + if (key && value) { + map[key] = value.toString(); + json.mapUint64Uint64 = map; + } + } } } if (msg.mapSint32Sint32) { - if (Object.keys(msg.mapSint32Sint32).length > 0) { - json[\\"mapSint32Sint32\\"] = msg.mapSint32Sint32; + if (msg.mapSint32Sint32) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapSint32Sint32)) { + if (key && value) { + map[key] = value; + json.mapSint32Sint32 = map; + } + } } } if (msg.mapSint64Sint64) { - if (Object.keys(msg.mapSint64Sint64).length > 0) { - json[\\"mapSint64Sint64\\"] = msg.mapSint64Sint64; + if (msg.mapSint64Sint64) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapSint64Sint64)) { + if (key && value) { + map[key] = value.toString(); + json.mapSint64Sint64 = map; + } + } } } if (msg.mapFixed32Fixed32) { - if (Object.keys(msg.mapFixed32Fixed32).length > 0) { - json[\\"mapFixed32Fixed32\\"] = msg.mapFixed32Fixed32; + if (msg.mapFixed32Fixed32) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapFixed32Fixed32)) { + if (key && value) { + map[key] = value; + json.mapFixed32Fixed32 = map; + } + } } } if (msg.mapFixed64Fixed64) { - if (Object.keys(msg.mapFixed64Fixed64).length > 0) { - json[\\"mapFixed64Fixed64\\"] = msg.mapFixed64Fixed64; + if (msg.mapFixed64Fixed64) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapFixed64Fixed64)) { + if (key && value) { + map[key] = value.toString(); + json.mapFixed64Fixed64 = map; + } + } } } if (msg.mapSfixed32Sfixed32) { - if (Object.keys(msg.mapSfixed32Sfixed32).length > 0) { - json[\\"mapSfixed32Sfixed32\\"] = msg.mapSfixed32Sfixed32; + if (msg.mapSfixed32Sfixed32) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapSfixed32Sfixed32)) { + if (key && value) { + map[key] = value; + json.mapSfixed32Sfixed32 = map; + } + } } } if (msg.mapSfixed64Sfixed64) { - if (Object.keys(msg.mapSfixed64Sfixed64).length > 0) { - json[\\"mapSfixed64Sfixed64\\"] = msg.mapSfixed64Sfixed64; + if (msg.mapSfixed64Sfixed64) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapSfixed64Sfixed64)) { + if (key && value) { + map[key] = value.toString(); + json.mapSfixed64Sfixed64 = map; + } + } } } if (msg.mapInt32Float) { - if (Object.keys(msg.mapInt32Float).length > 0) { - json[\\"mapInt32Float\\"] = msg.mapInt32Float; + if (msg.mapInt32Float) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32Float)) { + if (key && value) { + map[key] = value; + json.mapInt32Float = map; + } + } } } if (msg.mapInt32Double) { - if (Object.keys(msg.mapInt32Double).length > 0) { - json[\\"mapInt32Double\\"] = msg.mapInt32Double; + if (msg.mapInt32Double) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32Double)) { + if (key && value) { + map[key] = value; + json.mapInt32Double = map; + } + } } } if (msg.mapBoolBool) { - if (Object.keys(msg.mapBoolBool).length > 0) { - json[\\"mapBoolBool\\"] = msg.mapBoolBool; + if (msg.mapBoolBool) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapBoolBool)) { + if (key && value) { + map[key] = value; + json.mapBoolBool = map; + } + } } } if (msg.mapStringString) { - if (Object.keys(msg.mapStringString).length > 0) { - json[\\"mapStringString\\"] = msg.mapStringString; + if (msg.mapStringString) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapStringString)) { + if (key && value) { + map[key] = value; + json.mapStringString = map; + } + } } } if (msg.mapInt32Bytes) { - if (Object.keys(msg.mapInt32Bytes).length > 0) { - json[\\"mapInt32Bytes\\"] = msg.mapInt32Bytes; + if (msg.mapInt32Bytes) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32Bytes)) { + if (key && value) { + map[key] = value; + json.mapInt32Bytes = map; + } + } } } if (msg.mapInt32Enum) { - if (Object.keys(msg.mapInt32Enum).length > 0) { - json[\\"mapInt32Enum\\"] = msg.mapInt32Enum; + if (msg.mapInt32Enum) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32Enum)) { + if (key && value) { + map[key] = value; + json.mapInt32Enum = map; + } + } } } if (msg.mapInt32ForeignMessage) { - if (Object.keys(msg.mapInt32ForeignMessage).length > 0) { - json[\\"mapInt32ForeignMessage\\"] = msg.mapInt32ForeignMessage; + if (msg.mapInt32ForeignMessage) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32ForeignMessage)) { + if (key && value) { + map[key] = ForeignMessage._writeMessageJSON(value); + json.mapInt32ForeignMessage = map; + } + } } } if (msg.mapStringForeignMessage) { - if (Object.keys(msg.mapStringForeignMessage).length > 0) { - json[\\"mapStringForeignMessage\\"] = msg.mapStringForeignMessage; + if (msg.mapStringForeignMessage) { + const map = {}; + for (const [key, value] of Object.entries( + msg.mapStringForeignMessage + )) { + if (key && value) { + map[key] = ForeignMessage._writeMessageJSON(value); + json.mapStringForeignMessage = map; + } + } } } if (msg.mapInt32AllTypes) { - if (Object.keys(msg.mapInt32AllTypes).length > 0) { - json[\\"mapInt32AllTypes\\"] = msg.mapInt32AllTypes; + if (msg.mapInt32AllTypes) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32AllTypes)) { + if (key && value) { + map[key] = TestAllTypes._writeMessageJSON(value); + json.mapInt32AllTypes = map; + } + } } } return json; @@ -32622,7 +33236,7 @@ export const TestMap = { case 2: { reader.readMessage(undefined, () => { let key; - let value = \\"\\"; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -32631,7 +33245,7 @@ export const TestMap = { break; } case 2: { - value = reader.readInt64String(); + value = BigInt(reader.readInt64String()); break; } } @@ -32668,7 +33282,7 @@ export const TestMap = { case 4: { reader.readMessage(undefined, () => { let key; - let value = \\"\\"; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -32677,7 +33291,7 @@ export const TestMap = { break; } case 2: { - value = reader.readUint64String(); + value = BigInt(reader.readUint64String()); break; } } @@ -32714,7 +33328,7 @@ export const TestMap = { case 6: { reader.readMessage(undefined, () => { let key; - let value = \\"\\"; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -32723,7 +33337,7 @@ export const TestMap = { break; } case 2: { - value = reader.readSint64(); + value = BigInt(reader.readSint64()); break; } } @@ -32760,7 +33374,7 @@ export const TestMap = { case 8: { reader.readMessage(undefined, () => { let key; - let value = \\"\\"; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -32769,7 +33383,7 @@ export const TestMap = { break; } case 2: { - value = reader.readFixed64String(); + value = BigInt(reader.readFixed64String()); break; } } @@ -32806,7 +33420,7 @@ export const TestMap = { case 10: { reader.readMessage(undefined, () => { let key; - let value = \\"\\"; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -32815,7 +33429,7 @@ export const TestMap = { break; } case 2: { - value = reader.readSfixed64(); + value = BigInt(reader.readSfixed64()); break; } } @@ -32976,7 +33590,10 @@ export const TestMap = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + ForeignMessage.initialize(), + ForeignMessage._readMessage + ); break; } } @@ -32999,7 +33616,10 @@ export const TestMap = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + ForeignMessage.initialize(), + ForeignMessage._readMessage + ); break; } } @@ -33022,7 +33642,10 @@ export const TestMap = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + TestAllTypes.initialize(), + TestAllTypes._readMessage + ); break; } } @@ -33046,88 +33669,134 @@ export const TestMap = { * @private */ _readMessageJSON: function (msg, json) { - const mapInt32Int32 = json[\\"mapInt32Int32\\"] ?? json.map_int32_int32; + const mapInt32Int32 = json.mapInt32Int32 ?? json.map_int32_int32; if (mapInt32Int32) { - msg.mapInt32Int32 = mapInt32Int32; + for (const [key, value] of Object.entries(mapInt32Int32)) { + msg.mapInt32Int32[key] = value; + } } - const mapInt64Int64 = json[\\"mapInt64Int64\\"] ?? json.map_int64_int64; + const mapInt64Int64 = json.mapInt64Int64 ?? json.map_int64_int64; if (mapInt64Int64) { - msg.mapInt64Int64 = mapInt64Int64; + for (const [key, value] of Object.entries(mapInt64Int64)) { + msg.mapInt64Int64[key] = BigInt(value); + } } - const mapUint32Uint32 = json[\\"mapUint32Uint32\\"] ?? json.map_uint32_uint32; + const mapUint32Uint32 = json.mapUint32Uint32 ?? json.map_uint32_uint32; if (mapUint32Uint32) { - msg.mapUint32Uint32 = mapUint32Uint32; + for (const [key, value] of Object.entries(mapUint32Uint32)) { + msg.mapUint32Uint32[key] = value; + } } - const mapUint64Uint64 = json[\\"mapUint64Uint64\\"] ?? json.map_uint64_uint64; + const mapUint64Uint64 = json.mapUint64Uint64 ?? json.map_uint64_uint64; if (mapUint64Uint64) { - msg.mapUint64Uint64 = mapUint64Uint64; + for (const [key, value] of Object.entries(mapUint64Uint64)) { + msg.mapUint64Uint64[key] = BigInt(value); + } } - const mapSint32Sint32 = json[\\"mapSint32Sint32\\"] ?? json.map_sint32_sint32; + const mapSint32Sint32 = json.mapSint32Sint32 ?? json.map_sint32_sint32; if (mapSint32Sint32) { - msg.mapSint32Sint32 = mapSint32Sint32; + for (const [key, value] of Object.entries(mapSint32Sint32)) { + msg.mapSint32Sint32[key] = value; + } } - const mapSint64Sint64 = json[\\"mapSint64Sint64\\"] ?? json.map_sint64_sint64; + const mapSint64Sint64 = json.mapSint64Sint64 ?? json.map_sint64_sint64; if (mapSint64Sint64) { - msg.mapSint64Sint64 = mapSint64Sint64; + for (const [key, value] of Object.entries(mapSint64Sint64)) { + msg.mapSint64Sint64[key] = BigInt(value); + } } const mapFixed32Fixed32 = - json[\\"mapFixed32Fixed32\\"] ?? json.map_fixed32_fixed32; + json.mapFixed32Fixed32 ?? json.map_fixed32_fixed32; if (mapFixed32Fixed32) { - msg.mapFixed32Fixed32 = mapFixed32Fixed32; + for (const [key, value] of Object.entries(mapFixed32Fixed32)) { + msg.mapFixed32Fixed32[key] = value; + } } const mapFixed64Fixed64 = - json[\\"mapFixed64Fixed64\\"] ?? json.map_fixed64_fixed64; + json.mapFixed64Fixed64 ?? json.map_fixed64_fixed64; if (mapFixed64Fixed64) { - msg.mapFixed64Fixed64 = mapFixed64Fixed64; + for (const [key, value] of Object.entries(mapFixed64Fixed64)) { + msg.mapFixed64Fixed64[key] = BigInt(value); + } } const mapSfixed32Sfixed32 = - json[\\"mapSfixed32Sfixed32\\"] ?? json.map_sfixed32_sfixed32; + json.mapSfixed32Sfixed32 ?? json.map_sfixed32_sfixed32; if (mapSfixed32Sfixed32) { - msg.mapSfixed32Sfixed32 = mapSfixed32Sfixed32; + for (const [key, value] of Object.entries(mapSfixed32Sfixed32)) { + msg.mapSfixed32Sfixed32[key] = value; + } } const mapSfixed64Sfixed64 = - json[\\"mapSfixed64Sfixed64\\"] ?? json.map_sfixed64_sfixed64; + json.mapSfixed64Sfixed64 ?? json.map_sfixed64_sfixed64; if (mapSfixed64Sfixed64) { - msg.mapSfixed64Sfixed64 = mapSfixed64Sfixed64; + for (const [key, value] of Object.entries(mapSfixed64Sfixed64)) { + msg.mapSfixed64Sfixed64[key] = BigInt(value); + } } - const mapInt32Float = json[\\"mapInt32Float\\"] ?? json.map_int32_float; + const mapInt32Float = json.mapInt32Float ?? json.map_int32_float; if (mapInt32Float) { - msg.mapInt32Float = mapInt32Float; + for (const [key, value] of Object.entries(mapInt32Float)) { + msg.mapInt32Float[key] = value; + } } - const mapInt32Double = json[\\"mapInt32Double\\"] ?? json.map_int32_double; + const mapInt32Double = json.mapInt32Double ?? json.map_int32_double; if (mapInt32Double) { - msg.mapInt32Double = mapInt32Double; + for (const [key, value] of Object.entries(mapInt32Double)) { + msg.mapInt32Double[key] = value; + } } - const mapBoolBool = json[\\"mapBoolBool\\"] ?? json.map_bool_bool; + const mapBoolBool = json.mapBoolBool ?? json.map_bool_bool; if (mapBoolBool) { - msg.mapBoolBool = mapBoolBool; + for (const [key, value] of Object.entries(mapBoolBool)) { + msg.mapBoolBool[key] = value; + } } - const mapStringString = json[\\"mapStringString\\"] ?? json.map_string_string; + const mapStringString = json.mapStringString ?? json.map_string_string; if (mapStringString) { - msg.mapStringString = mapStringString; + for (const [key, value] of Object.entries(mapStringString)) { + msg.mapStringString[key] = value; + } } - const mapInt32Bytes = json[\\"mapInt32Bytes\\"] ?? json.map_int32_bytes; + const mapInt32Bytes = json.mapInt32Bytes ?? json.map_int32_bytes; if (mapInt32Bytes) { - msg.mapInt32Bytes = mapInt32Bytes; + for (const [key, value] of Object.entries(mapInt32Bytes)) { + msg.mapInt32Bytes[key] = value; + } } - const mapInt32Enum = json[\\"mapInt32Enum\\"] ?? json.map_int32_enum; + const mapInt32Enum = json.mapInt32Enum ?? json.map_int32_enum; if (mapInt32Enum) { - msg.mapInt32Enum = mapInt32Enum; + for (const [key, value] of Object.entries(mapInt32Enum)) { + msg.mapInt32Enum[key] = value; + } } const mapInt32ForeignMessage = - json[\\"mapInt32ForeignMessage\\"] ?? json.map_int32_foreign_message; + json.mapInt32ForeignMessage ?? json.map_int32_foreign_message; if (mapInt32ForeignMessage) { - msg.mapInt32ForeignMessage = mapInt32ForeignMessage; + for (const [key, value] of Object.entries(mapInt32ForeignMessage)) { + msg.mapInt32ForeignMessage[key] = ForeignMessage._readMessageJSON( + ForeignMessage.initialize(), + value + ); + } } const mapStringForeignMessage = - json[\\"mapStringForeignMessage\\"] ?? json.map_string_foreign_message; + json.mapStringForeignMessage ?? json.map_string_foreign_message; if (mapStringForeignMessage) { - msg.mapStringForeignMessage = mapStringForeignMessage; + for (const [key, value] of Object.entries(mapStringForeignMessage)) { + msg.mapStringForeignMessage[key] = ForeignMessage._readMessageJSON( + ForeignMessage.initialize(), + value + ); + } } - const mapInt32AllTypes = - json[\\"mapInt32AllTypes\\"] ?? json.map_int32_all_types; + const mapInt32AllTypes = json.mapInt32AllTypes ?? json.map_int32_all_types; if (mapInt32AllTypes) { - msg.mapInt32AllTypes = mapInt32AllTypes; + for (const [key, value] of Object.entries(mapInt32AllTypes)) { + msg.mapInt32AllTypes[key] = TestAllTypes._readMessageJSON( + TestAllTypes.initialize(), + value + ); + } } return msg; }, @@ -33196,11 +33865,11 @@ export const TestMapSubmessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.testMap) { const testMap = TestMap._writeMessageJSON(msg.testMap); if (Object.keys(testMap).length > 0) { - json[\\"testMap\\"] = testMap; + json.testMap = testMap; } } return json; @@ -33230,7 +33899,7 @@ export const TestMapSubmessage = { * @private */ _readMessageJSON: function (msg, json) { - const testMap = json[\\"testMap\\"] ?? json.test_map; + const testMap = json.testMap ?? json.test_map; if (testMap) { const m = TestMap.initialize(); TestMap._readMessageJSON(m, testMap); @@ -33292,11 +33961,13 @@ export const TestMessageMap = { */ _writeMessage: function (msg, writer) { if (msg.mapInt32Message) { - for (const key in msg.mapInt32Message) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeMessage(2, msg.mapInt32Message[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Message)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeMessage(2, value, TestAllTypes._writeMessage); + }); + } } } return writer; @@ -33306,10 +33977,16 @@ export const TestMessageMap = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.mapInt32Message) { - if (Object.keys(msg.mapInt32Message).length > 0) { - json[\\"mapInt32Message\\"] = msg.mapInt32Message; + if (msg.mapInt32Message) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32Message)) { + if (key && value) { + map[key] = TestAllTypes._writeMessageJSON(value); + json.mapInt32Message = map; + } + } } } return json; @@ -33334,7 +34011,10 @@ export const TestMessageMap = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + TestAllTypes.initialize(), + TestAllTypes._readMessage + ); break; } } @@ -33358,9 +34038,14 @@ export const TestMessageMap = { * @private */ _readMessageJSON: function (msg, json) { - const mapInt32Message = json[\\"mapInt32Message\\"] ?? json.map_int32_message; + const mapInt32Message = json.mapInt32Message ?? json.map_int32_message; if (mapInt32Message) { - msg.mapInt32Message = mapInt32Message; + for (const [key, value] of Object.entries(mapInt32Message)) { + msg.mapInt32Message[key] = TestAllTypes._readMessageJSON( + TestAllTypes.initialize(), + value + ); + } } return msg; }, @@ -33419,19 +34104,23 @@ export const TestSameTypeMap = { */ _writeMessage: function (msg, writer) { if (msg.map1) { - for (const key in msg.map1) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeInt32(2, msg.map1[key]); - }); + for (const [key, value] of Object.entries(msg.map1)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeInt32(2, value); + }); + } } } if (msg.map2) { - for (const key in msg.map2) { - writer.writeMessage(2, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeInt32(2, msg.map2[key]); - }); + for (const [key, value] of Object.entries(msg.map2)) { + if (key && value) { + writer.writeMessage(2, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeInt32(2, value); + }); + } } } return writer; @@ -33441,15 +34130,27 @@ export const TestSameTypeMap = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.map1) { - if (Object.keys(msg.map1).length > 0) { - json[\\"map1\\"] = msg.map1; + if (msg.map1) { + const map = {}; + for (const [key, value] of Object.entries(msg.map1)) { + if (key && value) { + map[key] = value; + json.map1 = map; + } + } } } if (msg.map2) { - if (Object.keys(msg.map2).length > 0) { - json[\\"map2\\"] = msg.map2; + if (msg.map2) { + const map = {}; + for (const [key, value] of Object.entries(msg.map2)) { + if (key && value) { + map[key] = value; + json.map2 = map; + } + } } } return json; @@ -33521,13 +34222,17 @@ export const TestSameTypeMap = { * @private */ _readMessageJSON: function (msg, json) { - const map1 = json[\\"map1\\"] ?? json.map1; + const map1 = json.map1 ?? json.map1; if (map1) { - msg.map1 = map1; + for (const [key, value] of Object.entries(map1)) { + msg.map1[key] = value; + } } - const map2 = json[\\"map2\\"] ?? json.map2; + const map2 = json.map2 ?? json.map2; if (map2) { - msg.map2 = map2; + for (const [key, value] of Object.entries(map2)) { + msg.map2[key] = value; + } } return msg; }, @@ -33587,11 +34292,13 @@ export const TestRequiredMessageMap = { */ _writeMessage: function (msg, writer) { if (msg.mapField) { - for (const key in msg.mapField) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeMessage(2, msg.mapField[key]); - }); + for (const [key, value] of Object.entries(msg.mapField)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeMessage(2, value, TestRequired._writeMessage); + }); + } } } return writer; @@ -33601,10 +34308,16 @@ export const TestRequiredMessageMap = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.mapField) { - if (Object.keys(msg.mapField).length > 0) { - json[\\"mapField\\"] = msg.mapField; + if (msg.mapField) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapField)) { + if (key && value) { + map[key] = TestRequired._writeMessageJSON(value); + json.mapField = map; + } + } } } return json; @@ -33629,7 +34342,10 @@ export const TestRequiredMessageMap = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + TestRequired.initialize(), + TestRequired._readMessage + ); break; } } @@ -33653,9 +34369,14 @@ export const TestRequiredMessageMap = { * @private */ _readMessageJSON: function (msg, json) { - const mapField = json[\\"mapField\\"] ?? json.map_field; + const mapField = json.mapField ?? json.map_field; if (mapField) { - msg.mapField = mapField; + for (const [key, value] of Object.entries(mapField)) { + msg.mapField[key] = TestRequired._readMessageJSON( + TestRequired.initialize(), + value + ); + } } return msg; }, @@ -33729,139 +34450,173 @@ export const TestArenaMap = { */ _writeMessage: function (msg, writer) { if (msg.mapInt32Int32) { - for (const key in msg.mapInt32Int32) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeInt32(2, msg.mapInt32Int32[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Int32)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeInt32(2, value); + }); + } } } if (msg.mapInt64Int64) { - for (const key in msg.mapInt64Int64) { - writer.writeMessage(2, {}, (_, mapWriter) => { - mapWriter.writeInt64String(1, key); - mapWriter.writeInt64String(2, msg.mapInt64Int64[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt64Int64)) { + if (key && value) { + writer.writeMessage(2, {}, (_, mapWriter) => { + mapWriter.writeInt64String(1, key); + mapWriter.writeInt64String(2, value.toString()); + }); + } } } if (msg.mapUint32Uint32) { - for (const key in msg.mapUint32Uint32) { - writer.writeMessage(3, {}, (_, mapWriter) => { - mapWriter.writeUint32(1, key); - mapWriter.writeUint32(2, msg.mapUint32Uint32[key]); - }); + for (const [key, value] of Object.entries(msg.mapUint32Uint32)) { + if (key && value) { + writer.writeMessage(3, {}, (_, mapWriter) => { + mapWriter.writeUint32(1, key); + mapWriter.writeUint32(2, value); + }); + } } } if (msg.mapUint64Uint64) { - for (const key in msg.mapUint64Uint64) { - writer.writeMessage(4, {}, (_, mapWriter) => { - mapWriter.writeUint64String(1, key); - mapWriter.writeUint64String(2, msg.mapUint64Uint64[key]); - }); + for (const [key, value] of Object.entries(msg.mapUint64Uint64)) { + if (key && value) { + writer.writeMessage(4, {}, (_, mapWriter) => { + mapWriter.writeUint64String(1, key); + mapWriter.writeUint64String(2, value.toString()); + }); + } } } if (msg.mapSint32Sint32) { - for (const key in msg.mapSint32Sint32) { - writer.writeMessage(5, {}, (_, mapWriter) => { - mapWriter.writeSint32(1, key); - mapWriter.writeSint32(2, msg.mapSint32Sint32[key]); - }); + for (const [key, value] of Object.entries(msg.mapSint32Sint32)) { + if (key && value) { + writer.writeMessage(5, {}, (_, mapWriter) => { + mapWriter.writeSint32(1, key); + mapWriter.writeSint32(2, value); + }); + } } } if (msg.mapSint64Sint64) { - for (const key in msg.mapSint64Sint64) { - writer.writeMessage(6, {}, (_, mapWriter) => { - mapWriter.writeSint64String(1, key); - mapWriter.writeSint64String(2, msg.mapSint64Sint64[key]); - }); + for (const [key, value] of Object.entries(msg.mapSint64Sint64)) { + if (key && value) { + writer.writeMessage(6, {}, (_, mapWriter) => { + mapWriter.writeSint64String(1, key); + mapWriter.writeSint64String(2, value.toString()); + }); + } } } if (msg.mapFixed32Fixed32) { - for (const key in msg.mapFixed32Fixed32) { - writer.writeMessage(7, {}, (_, mapWriter) => { - mapWriter.writeFixed32(1, key); - mapWriter.writeFixed32(2, msg.mapFixed32Fixed32[key]); - }); + for (const [key, value] of Object.entries(msg.mapFixed32Fixed32)) { + if (key && value) { + writer.writeMessage(7, {}, (_, mapWriter) => { + mapWriter.writeFixed32(1, key); + mapWriter.writeFixed32(2, value); + }); + } } } if (msg.mapFixed64Fixed64) { - for (const key in msg.mapFixed64Fixed64) { - writer.writeMessage(8, {}, (_, mapWriter) => { - mapWriter.writeFixed64String(1, key); - mapWriter.writeFixed64String(2, msg.mapFixed64Fixed64[key]); - }); + for (const [key, value] of Object.entries(msg.mapFixed64Fixed64)) { + if (key && value) { + writer.writeMessage(8, {}, (_, mapWriter) => { + mapWriter.writeFixed64String(1, key); + mapWriter.writeFixed64String(2, value.toString()); + }); + } } } if (msg.mapSfixed32Sfixed32) { - for (const key in msg.mapSfixed32Sfixed32) { - writer.writeMessage(9, {}, (_, mapWriter) => { - mapWriter.writeSfixed32(1, key); - mapWriter.writeSfixed32(2, msg.mapSfixed32Sfixed32[key]); - }); + for (const [key, value] of Object.entries(msg.mapSfixed32Sfixed32)) { + if (key && value) { + writer.writeMessage(9, {}, (_, mapWriter) => { + mapWriter.writeSfixed32(1, key); + mapWriter.writeSfixed32(2, value); + }); + } } } if (msg.mapSfixed64Sfixed64) { - for (const key in msg.mapSfixed64Sfixed64) { - writer.writeMessage(10, {}, (_, mapWriter) => { - mapWriter.writeSfixed64(1, key); - mapWriter.writeSfixed64(2, msg.mapSfixed64Sfixed64[key]); - }); + for (const [key, value] of Object.entries(msg.mapSfixed64Sfixed64)) { + if (key && value) { + writer.writeMessage(10, {}, (_, mapWriter) => { + mapWriter.writeSfixed64(1, key); + mapWriter.writeSfixed64(2, value.toString()); + }); + } } } if (msg.mapInt32Float) { - for (const key in msg.mapInt32Float) { - writer.writeMessage(11, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeFloat(2, msg.mapInt32Float[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Float)) { + if (key && value) { + writer.writeMessage(11, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeFloat(2, value); + }); + } } } if (msg.mapInt32Double) { - for (const key in msg.mapInt32Double) { - writer.writeMessage(12, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeDouble(2, msg.mapInt32Double[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Double)) { + if (key && value) { + writer.writeMessage(12, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeDouble(2, value); + }); + } } } if (msg.mapBoolBool) { - for (const key in msg.mapBoolBool) { - writer.writeMessage(13, {}, (_, mapWriter) => { - mapWriter.writeBool(1, key); - mapWriter.writeBool(2, msg.mapBoolBool[key]); - }); + for (const [key, value] of Object.entries(msg.mapBoolBool)) { + if (key && value) { + writer.writeMessage(13, {}, (_, mapWriter) => { + mapWriter.writeBool(1, key); + mapWriter.writeBool(2, value); + }); + } } } if (msg.mapStringString) { - for (const key in msg.mapStringString) { - writer.writeMessage(14, {}, (_, mapWriter) => { - mapWriter.writeString(1, key); - mapWriter.writeString(2, msg.mapStringString[key]); - }); + for (const [key, value] of Object.entries(msg.mapStringString)) { + if (key && value) { + writer.writeMessage(14, {}, (_, mapWriter) => { + mapWriter.writeString(1, key); + mapWriter.writeString(2, value); + }); + } } } if (msg.mapInt32Bytes) { - for (const key in msg.mapInt32Bytes) { - writer.writeMessage(15, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeBytes(2, msg.mapInt32Bytes[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Bytes)) { + if (key && value) { + writer.writeMessage(15, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeBytes(2, value); + }); + } } } if (msg.mapInt32Enum) { - for (const key in msg.mapInt32Enum) { - writer.writeMessage(16, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeEnum(2, msg.mapInt32Enum[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Enum)) { + if (key && value) { + writer.writeMessage(16, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeEnum(2, value); + }); + } } } if (msg.mapInt32ForeignMessage) { - for (const key in msg.mapInt32ForeignMessage) { - writer.writeMessage(17, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeMessage(2, msg.mapInt32ForeignMessage[key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32ForeignMessage)) { + if (key && value) { + writer.writeMessage(17, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeMessage(2, value, ForeignMessage._writeMessage); + }); + } } } return writer; @@ -33871,90 +34626,192 @@ export const TestArenaMap = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.mapInt32Int32) { - if (Object.keys(msg.mapInt32Int32).length > 0) { - json[\\"mapInt32Int32\\"] = msg.mapInt32Int32; + if (msg.mapInt32Int32) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32Int32)) { + if (key && value) { + map[key] = value; + json.mapInt32Int32 = map; + } + } } } if (msg.mapInt64Int64) { - if (Object.keys(msg.mapInt64Int64).length > 0) { - json[\\"mapInt64Int64\\"] = msg.mapInt64Int64; + if (msg.mapInt64Int64) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt64Int64)) { + if (key && value) { + map[key] = value.toString(); + json.mapInt64Int64 = map; + } + } } } if (msg.mapUint32Uint32) { - if (Object.keys(msg.mapUint32Uint32).length > 0) { - json[\\"mapUint32Uint32\\"] = msg.mapUint32Uint32; + if (msg.mapUint32Uint32) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapUint32Uint32)) { + if (key && value) { + map[key] = value; + json.mapUint32Uint32 = map; + } + } } } if (msg.mapUint64Uint64) { - if (Object.keys(msg.mapUint64Uint64).length > 0) { - json[\\"mapUint64Uint64\\"] = msg.mapUint64Uint64; + if (msg.mapUint64Uint64) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapUint64Uint64)) { + if (key && value) { + map[key] = value.toString(); + json.mapUint64Uint64 = map; + } + } } } if (msg.mapSint32Sint32) { - if (Object.keys(msg.mapSint32Sint32).length > 0) { - json[\\"mapSint32Sint32\\"] = msg.mapSint32Sint32; + if (msg.mapSint32Sint32) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapSint32Sint32)) { + if (key && value) { + map[key] = value; + json.mapSint32Sint32 = map; + } + } } } if (msg.mapSint64Sint64) { - if (Object.keys(msg.mapSint64Sint64).length > 0) { - json[\\"mapSint64Sint64\\"] = msg.mapSint64Sint64; + if (msg.mapSint64Sint64) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapSint64Sint64)) { + if (key && value) { + map[key] = value.toString(); + json.mapSint64Sint64 = map; + } + } } } if (msg.mapFixed32Fixed32) { - if (Object.keys(msg.mapFixed32Fixed32).length > 0) { - json[\\"mapFixed32Fixed32\\"] = msg.mapFixed32Fixed32; + if (msg.mapFixed32Fixed32) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapFixed32Fixed32)) { + if (key && value) { + map[key] = value; + json.mapFixed32Fixed32 = map; + } + } } } if (msg.mapFixed64Fixed64) { - if (Object.keys(msg.mapFixed64Fixed64).length > 0) { - json[\\"mapFixed64Fixed64\\"] = msg.mapFixed64Fixed64; + if (msg.mapFixed64Fixed64) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapFixed64Fixed64)) { + if (key && value) { + map[key] = value.toString(); + json.mapFixed64Fixed64 = map; + } + } } } if (msg.mapSfixed32Sfixed32) { - if (Object.keys(msg.mapSfixed32Sfixed32).length > 0) { - json[\\"mapSfixed32Sfixed32\\"] = msg.mapSfixed32Sfixed32; + if (msg.mapSfixed32Sfixed32) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapSfixed32Sfixed32)) { + if (key && value) { + map[key] = value; + json.mapSfixed32Sfixed32 = map; + } + } } } if (msg.mapSfixed64Sfixed64) { - if (Object.keys(msg.mapSfixed64Sfixed64).length > 0) { - json[\\"mapSfixed64Sfixed64\\"] = msg.mapSfixed64Sfixed64; + if (msg.mapSfixed64Sfixed64) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapSfixed64Sfixed64)) { + if (key && value) { + map[key] = value.toString(); + json.mapSfixed64Sfixed64 = map; + } + } } } if (msg.mapInt32Float) { - if (Object.keys(msg.mapInt32Float).length > 0) { - json[\\"mapInt32Float\\"] = msg.mapInt32Float; + if (msg.mapInt32Float) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32Float)) { + if (key && value) { + map[key] = value; + json.mapInt32Float = map; + } + } } } if (msg.mapInt32Double) { - if (Object.keys(msg.mapInt32Double).length > 0) { - json[\\"mapInt32Double\\"] = msg.mapInt32Double; + if (msg.mapInt32Double) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32Double)) { + if (key && value) { + map[key] = value; + json.mapInt32Double = map; + } + } } } if (msg.mapBoolBool) { - if (Object.keys(msg.mapBoolBool).length > 0) { - json[\\"mapBoolBool\\"] = msg.mapBoolBool; + if (msg.mapBoolBool) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapBoolBool)) { + if (key && value) { + map[key] = value; + json.mapBoolBool = map; + } + } } } if (msg.mapStringString) { - if (Object.keys(msg.mapStringString).length > 0) { - json[\\"mapStringString\\"] = msg.mapStringString; + if (msg.mapStringString) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapStringString)) { + if (key && value) { + map[key] = value; + json.mapStringString = map; + } + } } } if (msg.mapInt32Bytes) { - if (Object.keys(msg.mapInt32Bytes).length > 0) { - json[\\"mapInt32Bytes\\"] = msg.mapInt32Bytes; + if (msg.mapInt32Bytes) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32Bytes)) { + if (key && value) { + map[key] = value; + json.mapInt32Bytes = map; + } + } } } if (msg.mapInt32Enum) { - if (Object.keys(msg.mapInt32Enum).length > 0) { - json[\\"mapInt32Enum\\"] = msg.mapInt32Enum; + if (msg.mapInt32Enum) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32Enum)) { + if (key && value) { + map[key] = value; + json.mapInt32Enum = map; + } + } } } if (msg.mapInt32ForeignMessage) { - if (Object.keys(msg.mapInt32ForeignMessage).length > 0) { - json[\\"mapInt32ForeignMessage\\"] = msg.mapInt32ForeignMessage; + if (msg.mapInt32ForeignMessage) { + const map = {}; + for (const [key, value] of Object.entries(msg.mapInt32ForeignMessage)) { + if (key && value) { + map[key] = ForeignMessage._writeMessageJSON(value); + json.mapInt32ForeignMessage = map; + } + } } } return json; @@ -33993,7 +34850,7 @@ export const TestArenaMap = { case 2: { reader.readMessage(undefined, () => { let key; - let value = \\"\\"; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -34002,7 +34859,7 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readInt64String(); + value = BigInt(reader.readInt64String()); break; } } @@ -34039,7 +34896,7 @@ export const TestArenaMap = { case 4: { reader.readMessage(undefined, () => { let key; - let value = \\"\\"; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -34048,7 +34905,7 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readUint64String(); + value = BigInt(reader.readUint64String()); break; } } @@ -34085,7 +34942,7 @@ export const TestArenaMap = { case 6: { reader.readMessage(undefined, () => { let key; - let value = \\"\\"; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -34094,7 +34951,7 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readSint64(); + value = BigInt(reader.readSint64()); break; } } @@ -34131,7 +34988,7 @@ export const TestArenaMap = { case 8: { reader.readMessage(undefined, () => { let key; - let value = \\"\\"; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -34140,7 +34997,7 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readFixed64String(); + value = BigInt(reader.readFixed64String()); break; } } @@ -34177,7 +35034,7 @@ export const TestArenaMap = { case 10: { reader.readMessage(undefined, () => { let key; - let value = \\"\\"; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -34186,7 +35043,7 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readSfixed64(); + value = BigInt(reader.readSfixed64()); break; } } @@ -34347,7 +35204,10 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + ForeignMessage.initialize(), + ForeignMessage._readMessage + ); break; } } @@ -34371,78 +35231,115 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function (msg, json) { - const mapInt32Int32 = json[\\"mapInt32Int32\\"] ?? json.map_int32_int32; + const mapInt32Int32 = json.mapInt32Int32 ?? json.map_int32_int32; if (mapInt32Int32) { - msg.mapInt32Int32 = mapInt32Int32; + for (const [key, value] of Object.entries(mapInt32Int32)) { + msg.mapInt32Int32[key] = value; + } } - const mapInt64Int64 = json[\\"mapInt64Int64\\"] ?? json.map_int64_int64; + const mapInt64Int64 = json.mapInt64Int64 ?? json.map_int64_int64; if (mapInt64Int64) { - msg.mapInt64Int64 = mapInt64Int64; + for (const [key, value] of Object.entries(mapInt64Int64)) { + msg.mapInt64Int64[key] = BigInt(value); + } } - const mapUint32Uint32 = json[\\"mapUint32Uint32\\"] ?? json.map_uint32_uint32; + const mapUint32Uint32 = json.mapUint32Uint32 ?? json.map_uint32_uint32; if (mapUint32Uint32) { - msg.mapUint32Uint32 = mapUint32Uint32; + for (const [key, value] of Object.entries(mapUint32Uint32)) { + msg.mapUint32Uint32[key] = value; + } } - const mapUint64Uint64 = json[\\"mapUint64Uint64\\"] ?? json.map_uint64_uint64; + const mapUint64Uint64 = json.mapUint64Uint64 ?? json.map_uint64_uint64; if (mapUint64Uint64) { - msg.mapUint64Uint64 = mapUint64Uint64; + for (const [key, value] of Object.entries(mapUint64Uint64)) { + msg.mapUint64Uint64[key] = BigInt(value); + } } - const mapSint32Sint32 = json[\\"mapSint32Sint32\\"] ?? json.map_sint32_sint32; + const mapSint32Sint32 = json.mapSint32Sint32 ?? json.map_sint32_sint32; if (mapSint32Sint32) { - msg.mapSint32Sint32 = mapSint32Sint32; + for (const [key, value] of Object.entries(mapSint32Sint32)) { + msg.mapSint32Sint32[key] = value; + } } - const mapSint64Sint64 = json[\\"mapSint64Sint64\\"] ?? json.map_sint64_sint64; + const mapSint64Sint64 = json.mapSint64Sint64 ?? json.map_sint64_sint64; if (mapSint64Sint64) { - msg.mapSint64Sint64 = mapSint64Sint64; + for (const [key, value] of Object.entries(mapSint64Sint64)) { + msg.mapSint64Sint64[key] = BigInt(value); + } } const mapFixed32Fixed32 = - json[\\"mapFixed32Fixed32\\"] ?? json.map_fixed32_fixed32; + json.mapFixed32Fixed32 ?? json.map_fixed32_fixed32; if (mapFixed32Fixed32) { - msg.mapFixed32Fixed32 = mapFixed32Fixed32; + for (const [key, value] of Object.entries(mapFixed32Fixed32)) { + msg.mapFixed32Fixed32[key] = value; + } } const mapFixed64Fixed64 = - json[\\"mapFixed64Fixed64\\"] ?? json.map_fixed64_fixed64; + json.mapFixed64Fixed64 ?? json.map_fixed64_fixed64; if (mapFixed64Fixed64) { - msg.mapFixed64Fixed64 = mapFixed64Fixed64; + for (const [key, value] of Object.entries(mapFixed64Fixed64)) { + msg.mapFixed64Fixed64[key] = BigInt(value); + } } const mapSfixed32Sfixed32 = - json[\\"mapSfixed32Sfixed32\\"] ?? json.map_sfixed32_sfixed32; + json.mapSfixed32Sfixed32 ?? json.map_sfixed32_sfixed32; if (mapSfixed32Sfixed32) { - msg.mapSfixed32Sfixed32 = mapSfixed32Sfixed32; + for (const [key, value] of Object.entries(mapSfixed32Sfixed32)) { + msg.mapSfixed32Sfixed32[key] = value; + } } const mapSfixed64Sfixed64 = - json[\\"mapSfixed64Sfixed64\\"] ?? json.map_sfixed64_sfixed64; + json.mapSfixed64Sfixed64 ?? json.map_sfixed64_sfixed64; if (mapSfixed64Sfixed64) { - msg.mapSfixed64Sfixed64 = mapSfixed64Sfixed64; + for (const [key, value] of Object.entries(mapSfixed64Sfixed64)) { + msg.mapSfixed64Sfixed64[key] = BigInt(value); + } } - const mapInt32Float = json[\\"mapInt32Float\\"] ?? json.map_int32_float; + const mapInt32Float = json.mapInt32Float ?? json.map_int32_float; if (mapInt32Float) { - msg.mapInt32Float = mapInt32Float; + for (const [key, value] of Object.entries(mapInt32Float)) { + msg.mapInt32Float[key] = value; + } } - const mapInt32Double = json[\\"mapInt32Double\\"] ?? json.map_int32_double; + const mapInt32Double = json.mapInt32Double ?? json.map_int32_double; if (mapInt32Double) { - msg.mapInt32Double = mapInt32Double; + for (const [key, value] of Object.entries(mapInt32Double)) { + msg.mapInt32Double[key] = value; + } } - const mapBoolBool = json[\\"mapBoolBool\\"] ?? json.map_bool_bool; + const mapBoolBool = json.mapBoolBool ?? json.map_bool_bool; if (mapBoolBool) { - msg.mapBoolBool = mapBoolBool; + for (const [key, value] of Object.entries(mapBoolBool)) { + msg.mapBoolBool[key] = value; + } } - const mapStringString = json[\\"mapStringString\\"] ?? json.map_string_string; + const mapStringString = json.mapStringString ?? json.map_string_string; if (mapStringString) { - msg.mapStringString = mapStringString; + for (const [key, value] of Object.entries(mapStringString)) { + msg.mapStringString[key] = value; + } } - const mapInt32Bytes = json[\\"mapInt32Bytes\\"] ?? json.map_int32_bytes; + const mapInt32Bytes = json.mapInt32Bytes ?? json.map_int32_bytes; if (mapInt32Bytes) { - msg.mapInt32Bytes = mapInt32Bytes; + for (const [key, value] of Object.entries(mapInt32Bytes)) { + msg.mapInt32Bytes[key] = value; + } } - const mapInt32Enum = json[\\"mapInt32Enum\\"] ?? json.map_int32_enum; + const mapInt32Enum = json.mapInt32Enum ?? json.map_int32_enum; if (mapInt32Enum) { - msg.mapInt32Enum = mapInt32Enum; + for (const [key, value] of Object.entries(mapInt32Enum)) { + msg.mapInt32Enum[key] = value; + } } const mapInt32ForeignMessage = - json[\\"mapInt32ForeignMessage\\"] ?? json.map_int32_foreign_message; + json.mapInt32ForeignMessage ?? json.map_int32_foreign_message; if (mapInt32ForeignMessage) { - msg.mapInt32ForeignMessage = mapInt32ForeignMessage; + for (const [key, value] of Object.entries(mapInt32ForeignMessage)) { + msg.mapInt32ForeignMessage[key] = ForeignMessage._readMessageJSON( + ForeignMessage.initialize(), + value + ); + } } return msg; }, @@ -34504,11 +35401,13 @@ export const MessageContainingMapCalledEntry = { */ _writeMessage: function (msg, writer) { if (msg.entry) { - for (const key in msg.entry) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key); - mapWriter.writeInt32(2, msg.entry[key]); - }); + for (const [key, value] of Object.entries(msg.entry)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key); + mapWriter.writeInt32(2, value); + }); + } } } return writer; @@ -34518,10 +35417,16 @@ export const MessageContainingMapCalledEntry = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.entry) { - if (Object.keys(msg.entry).length > 0) { - json[\\"entry\\"] = msg.entry; + if (msg.entry) { + const map = {}; + for (const [key, value] of Object.entries(msg.entry)) { + if (key && value) { + map[key] = value; + json.entry = map; + } + } } } return json; @@ -34570,9 +35475,11 @@ export const MessageContainingMapCalledEntry = { * @private */ _readMessageJSON: function (msg, json) { - const entry = json[\\"entry\\"] ?? json.entry; + const entry = json.entry ?? json.entry; if (entry) { - msg.entry = entry; + for (const [key, value] of Object.entries(entry)) { + msg.entry[key] = value; + } } return msg; }, @@ -34632,11 +35539,17 @@ export const TestRecursiveMapMessage = { */ _writeMessage: function (msg, writer) { if (msg.a) { - for (const key in msg.a) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeString(1, key); - mapWriter.writeMessage(2, msg.a[key]); - }); + for (const [key, value] of Object.entries(msg.a)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeString(1, key); + mapWriter.writeMessage( + 2, + value, + TestRecursiveMapMessage._writeMessage + ); + }); + } } } return writer; @@ -34646,10 +35559,16 @@ export const TestRecursiveMapMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.a) { - if (Object.keys(msg.a).length > 0) { - json[\\"a\\"] = msg.a; + if (msg.a) { + const map = {}; + for (const [key, value] of Object.entries(msg.a)) { + if (key && value) { + map[key] = TestRecursiveMapMessage._writeMessageJSON(value); + json.a = map; + } + } } } return json; @@ -34674,7 +35593,10 @@ export const TestRecursiveMapMessage = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + TestRecursiveMapMessage.initialize(), + TestRecursiveMapMessage._readMessage + ); break; } } @@ -34698,9 +35620,14 @@ export const TestRecursiveMapMessage = { * @private */ _readMessageJSON: function (msg, json) { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { - msg.a = a; + for (const [key, value] of Object.entries(a)) { + msg.a[key] = TestRecursiveMapMessage._readMessageJSON( + TestRecursiveMapMessage.initialize(), + value + ); + } } return msg; }, @@ -34792,15 +35719,15 @@ export const TestAllTypes = { initialize: function () { return { optionalInt32: 0, - optionalInt64: \\"\\", + optionalInt64: 0n, optionalUint32: 0, - optionalUint64: \\"\\", + optionalUint64: 0n, optionalSint32: 0, - optionalSint64: \\"\\", + optionalSint64: 0n, optionalFixed32: 0, - optionalFixed64: \\"\\", + optionalFixed64: 0n, optionalSfixed32: 0, - optionalSfixed64: \\"\\", + optionalSfixed64: 0n, optionalFloat: 0, optionalDouble: 0, optionalBool: false, @@ -34851,31 +35778,31 @@ export const TestAllTypes = { writer.writeInt32(1, msg.optionalInt32); } if (msg.optionalInt64) { - writer.writeInt64String(2, msg.optionalInt64); + writer.writeInt64String(2, msg.optionalInt64.toString()); } if (msg.optionalUint32) { writer.writeUint32(3, msg.optionalUint32); } if (msg.optionalUint64) { - writer.writeUint64String(4, msg.optionalUint64); + writer.writeUint64String(4, msg.optionalUint64.toString()); } if (msg.optionalSint32) { writer.writeSint32(5, msg.optionalSint32); } if (msg.optionalSint64) { - writer.writeSint64String(6, msg.optionalSint64); + writer.writeSint64String(6, msg.optionalSint64.toString()); } if (msg.optionalFixed32) { writer.writeFixed32(7, msg.optionalFixed32); } if (msg.optionalFixed64) { - writer.writeFixed64String(8, msg.optionalFixed64); + writer.writeFixed64String(8, msg.optionalFixed64.toString()); } if (msg.optionalSfixed32) { writer.writeSfixed32(9, msg.optionalSfixed32); } if (msg.optionalSfixed64) { - writer.writeSfixed64(10, msg.optionalSfixed64); + writer.writeSfixed64(10, msg.optionalSfixed64.toString()); } if (msg.optionalFloat) { writer.writeFloat(11, msg.optionalFloat); @@ -34950,31 +35877,31 @@ export const TestAllTypes = { writer.writeRepeatedInt32(31, msg.repeatedInt32); } if (msg.repeatedInt64?.length) { - writer.writeRepeatedInt64String(32, msg.repeatedInt64); + writer.writeRepeatedInt64String(32, msg.repeatedInt64.toString()); } if (msg.repeatedUint32?.length) { writer.writeRepeatedUint32(33, msg.repeatedUint32); } if (msg.repeatedUint64?.length) { - writer.writeRepeatedUint64String(34, msg.repeatedUint64); + writer.writeRepeatedUint64String(34, msg.repeatedUint64.toString()); } if (msg.repeatedSint32?.length) { writer.writeRepeatedSint32(35, msg.repeatedSint32); } if (msg.repeatedSint64?.length) { - writer.writeRepeatedSint64String(36, msg.repeatedSint64); + writer.writeRepeatedSint64String(36, msg.repeatedSint64.toString()); } if (msg.repeatedFixed32?.length) { writer.writeRepeatedFixed32(37, msg.repeatedFixed32); } if (msg.repeatedFixed64?.length) { - writer.writeRepeatedFixed64String(38, msg.repeatedFixed64); + writer.writeRepeatedFixed64String(38, msg.repeatedFixed64.toString()); } if (msg.repeatedSfixed32?.length) { writer.writeRepeatedSfixed32(39, msg.repeatedSfixed32); } if (msg.repeatedSfixed64?.length) { - writer.writeRepeatedSfixed64(40, msg.repeatedSfixed64); + writer.writeRepeatedSfixed64(40, msg.repeatedSfixed64.toString()); } if (msg.repeatedFloat?.length) { writer.writeRepeatedFloat(41, msg.repeatedFloat); @@ -35054,57 +35981,57 @@ export const TestAllTypes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.optionalInt32) { - json[\\"optionalInt32\\"] = msg.optionalInt32; + json.optionalInt32 = msg.optionalInt32; } if (msg.optionalInt64) { - json[\\"optionalInt64\\"] = msg.optionalInt64; + json.optionalInt64 = msg.optionalInt64.toString(); } if (msg.optionalUint32) { - json[\\"optionalUint32\\"] = msg.optionalUint32; + json.optionalUint32 = msg.optionalUint32; } if (msg.optionalUint64) { - json[\\"optionalUint64\\"] = msg.optionalUint64; + json.optionalUint64 = msg.optionalUint64.toString(); } if (msg.optionalSint32) { - json[\\"optionalSint32\\"] = msg.optionalSint32; + json.optionalSint32 = msg.optionalSint32; } if (msg.optionalSint64) { - json[\\"optionalSint64\\"] = msg.optionalSint64; + json.optionalSint64 = msg.optionalSint64.toString(); } if (msg.optionalFixed32) { - json[\\"optionalFixed32\\"] = msg.optionalFixed32; + json.optionalFixed32 = msg.optionalFixed32; } if (msg.optionalFixed64) { - json[\\"optionalFixed64\\"] = msg.optionalFixed64; + json.optionalFixed64 = msg.optionalFixed64.toString(); } if (msg.optionalSfixed32) { - json[\\"optionalSfixed32\\"] = msg.optionalSfixed32; + json.optionalSfixed32 = msg.optionalSfixed32; } if (msg.optionalSfixed64) { - json[\\"optionalSfixed64\\"] = msg.optionalSfixed64; + json.optionalSfixed64 = msg.optionalSfixed64.toString(); } if (msg.optionalFloat) { - json[\\"optionalFloat\\"] = msg.optionalFloat; + json.optionalFloat = msg.optionalFloat; } if (msg.optionalDouble) { - json[\\"optionalDouble\\"] = msg.optionalDouble; + json.optionalDouble = msg.optionalDouble; } if (msg.optionalBool) { - json[\\"optionalBool\\"] = msg.optionalBool; + json.optionalBool = msg.optionalBool; } if (msg.optionalString) { - json[\\"optionalString\\"] = msg.optionalString; + json.optionalString = msg.optionalString; } if (msg.optionalBytes) { - json[\\"optionalBytes\\"] = msg.optionalBytes; + json.optionalBytes = msg.optionalBytes; } if (msg.optionalNestedMessage) { const optionalNestedMessage = TestAllTypes.NestedMessage._writeMessageJSON(msg.optionalNestedMessage); if (Object.keys(optionalNestedMessage).length > 0) { - json[\\"optionalNestedMessage\\"] = optionalNestedMessage; + json.optionalNestedMessage = optionalNestedMessage; } } if (msg.optionalForeignMessage) { @@ -35112,7 +36039,7 @@ export const TestAllTypes = { msg.optionalForeignMessage ); if (Object.keys(optionalForeignMessage).length > 0) { - json[\\"optionalForeignMessage\\"] = optionalForeignMessage; + json.optionalForeignMessage = optionalForeignMessage; } } if (msg.optionalImportMessage) { @@ -35120,27 +36047,27 @@ export const TestAllTypes = { msg.optionalImportMessage ); if (Object.keys(optionalImportMessage).length > 0) { - json[\\"optionalImportMessage\\"] = optionalImportMessage; + json.optionalImportMessage = optionalImportMessage; } } if (msg.optionalNestedEnum) { - json[\\"optionalNestedEnum\\"] = msg.optionalNestedEnum; + json.optionalNestedEnum = msg.optionalNestedEnum; } if (msg.optionalForeignEnum) { - json[\\"optionalForeignEnum\\"] = msg.optionalForeignEnum; + json.optionalForeignEnum = msg.optionalForeignEnum; } if (msg.optionalStringPiece) { - json[\\"optionalStringPiece\\"] = msg.optionalStringPiece; + json.optionalStringPiece = msg.optionalStringPiece; } if (msg.optionalCord) { - json[\\"optionalCord\\"] = msg.optionalCord; + json.optionalCord = msg.optionalCord; } if (msg.optionalPublicImportMessage) { const optionalPublicImportMessage = PublicImportMessage._writeMessageJSON( msg.optionalPublicImportMessage ); if (Object.keys(optionalPublicImportMessage).length > 0) { - json[\\"optionalPublicImportMessage\\"] = optionalPublicImportMessage; + json.optionalPublicImportMessage = optionalPublicImportMessage; } } if (msg.optionalLazyMessage) { @@ -35148,7 +36075,7 @@ export const TestAllTypes = { msg.optionalLazyMessage ); if (Object.keys(optionalLazyMessage).length > 0) { - json[\\"optionalLazyMessage\\"] = optionalLazyMessage; + json.optionalLazyMessage = optionalLazyMessage; } } if (msg.optionalLazyImportMessage) { @@ -35156,102 +36083,102 @@ export const TestAllTypes = { msg.optionalLazyImportMessage ); if (Object.keys(optionalLazyImportMessage).length > 0) { - json[\\"optionalLazyImportMessage\\"] = optionalLazyImportMessage; + json.optionalLazyImportMessage = optionalLazyImportMessage; } } if (msg.repeatedInt32?.length) { - json[\\"repeatedInt32\\"] = msg.repeatedInt32; + json.repeatedInt32 = msg.repeatedInt32; } if (msg.repeatedInt64?.length) { - json[\\"repeatedInt64\\"] = msg.repeatedInt64; + json.repeatedInt64 = msg.repeatedInt64.map((x) => x.toString()); } if (msg.repeatedUint32?.length) { - json[\\"repeatedUint32\\"] = msg.repeatedUint32; + json.repeatedUint32 = msg.repeatedUint32; } if (msg.repeatedUint64?.length) { - json[\\"repeatedUint64\\"] = msg.repeatedUint64; + json.repeatedUint64 = msg.repeatedUint64.map((x) => x.toString()); } if (msg.repeatedSint32?.length) { - json[\\"repeatedSint32\\"] = msg.repeatedSint32; + json.repeatedSint32 = msg.repeatedSint32; } if (msg.repeatedSint64?.length) { - json[\\"repeatedSint64\\"] = msg.repeatedSint64; + json.repeatedSint64 = msg.repeatedSint64.map((x) => x.toString()); } if (msg.repeatedFixed32?.length) { - json[\\"repeatedFixed32\\"] = msg.repeatedFixed32; + json.repeatedFixed32 = msg.repeatedFixed32; } if (msg.repeatedFixed64?.length) { - json[\\"repeatedFixed64\\"] = msg.repeatedFixed64; + json.repeatedFixed64 = msg.repeatedFixed64.map((x) => x.toString()); } if (msg.repeatedSfixed32?.length) { - json[\\"repeatedSfixed32\\"] = msg.repeatedSfixed32; + json.repeatedSfixed32 = msg.repeatedSfixed32; } if (msg.repeatedSfixed64?.length) { - json[\\"repeatedSfixed64\\"] = msg.repeatedSfixed64; + json.repeatedSfixed64 = msg.repeatedSfixed64.map((x) => x.toString()); } if (msg.repeatedFloat?.length) { - json[\\"repeatedFloat\\"] = msg.repeatedFloat; + json.repeatedFloat = msg.repeatedFloat; } if (msg.repeatedDouble?.length) { - json[\\"repeatedDouble\\"] = msg.repeatedDouble; + json.repeatedDouble = msg.repeatedDouble; } if (msg.repeatedBool?.length) { - json[\\"repeatedBool\\"] = msg.repeatedBool; + json.repeatedBool = msg.repeatedBool; } if (msg.repeatedString?.length) { - json[\\"repeatedString\\"] = msg.repeatedString; + json.repeatedString = msg.repeatedString; } if (msg.repeatedBytes?.length) { - json[\\"repeatedBytes\\"] = msg.repeatedBytes; + json.repeatedBytes = msg.repeatedBytes; } if (msg.repeatedNestedMessage?.length) { - json[\\"repeatedNestedMessage\\"] = msg.repeatedNestedMessage.map( + json.repeatedNestedMessage = msg.repeatedNestedMessage.map( TestAllTypes.NestedMessage._writeMessageJSON ); } if (msg.repeatedForeignMessage?.length) { - json[\\"repeatedForeignMessage\\"] = msg.repeatedForeignMessage.map( + json.repeatedForeignMessage = msg.repeatedForeignMessage.map( ForeignMessage._writeMessageJSON ); } if (msg.repeatedImportMessage?.length) { - json[\\"repeatedImportMessage\\"] = msg.repeatedImportMessage.map( + json.repeatedImportMessage = msg.repeatedImportMessage.map( ImportMessage._writeMessageJSON ); } if (msg.repeatedNestedEnum?.length) { - json[\\"repeatedNestedEnum\\"] = msg.repeatedNestedEnum; + json.repeatedNestedEnum = msg.repeatedNestedEnum; } if (msg.repeatedForeignEnum?.length) { - json[\\"repeatedForeignEnum\\"] = msg.repeatedForeignEnum; + json.repeatedForeignEnum = msg.repeatedForeignEnum; } if (msg.repeatedStringPiece?.length) { - json[\\"repeatedStringPiece\\"] = msg.repeatedStringPiece; + json.repeatedStringPiece = msg.repeatedStringPiece; } if (msg.repeatedCord?.length) { - json[\\"repeatedCord\\"] = msg.repeatedCord; + json.repeatedCord = msg.repeatedCord; } if (msg.repeatedLazyMessage?.length) { - json[\\"repeatedLazyMessage\\"] = msg.repeatedLazyMessage.map( + json.repeatedLazyMessage = msg.repeatedLazyMessage.map( TestAllTypes.NestedMessage._writeMessageJSON ); } if (msg.oneofUint32 != undefined) { - json[\\"oneofUint32\\"] = msg.oneofUint32; + json.oneofUint32 = msg.oneofUint32; } if (msg.oneofNestedMessage != undefined) { const oneofNestedMessage = TestAllTypes.NestedMessage._writeMessageJSON( msg.oneofNestedMessage ); if (Object.keys(oneofNestedMessage).length > 0) { - json[\\"oneofNestedMessage\\"] = oneofNestedMessage; + json.oneofNestedMessage = oneofNestedMessage; } } if (msg.oneofString != undefined) { - json[\\"oneofString\\"] = msg.oneofString; + json.oneofString = msg.oneofString; } if (msg.oneofBytes != undefined) { - json[\\"oneofBytes\\"] = msg.oneofBytes; + json.oneofBytes = msg.oneofBytes; } return json; }, @@ -35268,7 +36195,7 @@ export const TestAllTypes = { break; } case 2: { - msg.optionalInt64 = reader.readInt64String(); + msg.optionalInt64 = BigInt(reader.readInt64String()); break; } case 3: { @@ -35276,7 +36203,7 @@ export const TestAllTypes = { break; } case 4: { - msg.optionalUint64 = reader.readUint64String(); + msg.optionalUint64 = BigInt(reader.readUint64String()); break; } case 5: { @@ -35284,7 +36211,7 @@ export const TestAllTypes = { break; } case 6: { - msg.optionalSint64 = reader.readSint64(); + msg.optionalSint64 = BigInt(reader.readSint64()); break; } case 7: { @@ -35292,7 +36219,7 @@ export const TestAllTypes = { break; } case 8: { - msg.optionalFixed64 = reader.readFixed64String(); + msg.optionalFixed64 = BigInt(reader.readFixed64String()); break; } case 9: { @@ -35300,7 +36227,7 @@ export const TestAllTypes = { break; } case 10: { - msg.optionalSfixed64 = reader.readSfixed64(); + msg.optionalSfixed64 = BigInt(reader.readSfixed64()); break; } case 11: { @@ -35386,7 +36313,7 @@ export const TestAllTypes = { break; } case 32: { - msg.repeatedInt64.push(reader.readInt64String()); + msg.repeatedInt64 = reader.readInt64String().map(BigInt); break; } case 33: { @@ -35394,7 +36321,7 @@ export const TestAllTypes = { break; } case 34: { - msg.repeatedUint64.push(reader.readUint64String()); + msg.repeatedUint64 = reader.readUint64String().map(BigInt); break; } case 35: { @@ -35402,7 +36329,7 @@ export const TestAllTypes = { break; } case 36: { - msg.repeatedSint64.push(reader.readSint64()); + msg.repeatedSint64 = reader.readSint64().map(BigInt); break; } case 37: { @@ -35410,7 +36337,7 @@ export const TestAllTypes = { break; } case 38: { - msg.repeatedFixed64.push(reader.readFixed64String()); + msg.repeatedFixed64 = reader.readFixed64String().map(BigInt); break; } case 39: { @@ -35418,7 +36345,7 @@ export const TestAllTypes = { break; } case 40: { - msg.repeatedSfixed64.push(reader.readSfixed64()); + msg.repeatedSfixed64 = reader.readSfixed64().map(BigInt); break; } case 41: { @@ -35513,190 +36440,189 @@ export const TestAllTypes = { * @private */ _readMessageJSON: function (msg, json) { - const optionalInt32 = json[\\"optionalInt32\\"] ?? json.optional_int32; + const optionalInt32 = json.optionalInt32 ?? json.optional_int32; if (optionalInt32) { msg.optionalInt32 = optionalInt32; } - const optionalInt64 = json[\\"optionalInt64\\"] ?? json.optional_int64; + const optionalInt64 = json.optionalInt64 ?? json.optional_int64; if (optionalInt64) { - msg.optionalInt64 = optionalInt64; + msg.optionalInt64 = BigInt(optionalInt64); } - const optionalUint32 = json[\\"optionalUint32\\"] ?? json.optional_uint32; + const optionalUint32 = json.optionalUint32 ?? json.optional_uint32; if (optionalUint32) { msg.optionalUint32 = optionalUint32; } - const optionalUint64 = json[\\"optionalUint64\\"] ?? json.optional_uint64; + const optionalUint64 = json.optionalUint64 ?? json.optional_uint64; if (optionalUint64) { - msg.optionalUint64 = optionalUint64; + msg.optionalUint64 = BigInt(optionalUint64); } - const optionalSint32 = json[\\"optionalSint32\\"] ?? json.optional_sint32; + const optionalSint32 = json.optionalSint32 ?? json.optional_sint32; if (optionalSint32) { msg.optionalSint32 = optionalSint32; } - const optionalSint64 = json[\\"optionalSint64\\"] ?? json.optional_sint64; + const optionalSint64 = json.optionalSint64 ?? json.optional_sint64; if (optionalSint64) { - msg.optionalSint64 = optionalSint64; + msg.optionalSint64 = BigInt(optionalSint64); } - const optionalFixed32 = json[\\"optionalFixed32\\"] ?? json.optional_fixed32; + const optionalFixed32 = json.optionalFixed32 ?? json.optional_fixed32; if (optionalFixed32) { msg.optionalFixed32 = optionalFixed32; } - const optionalFixed64 = json[\\"optionalFixed64\\"] ?? json.optional_fixed64; + const optionalFixed64 = json.optionalFixed64 ?? json.optional_fixed64; if (optionalFixed64) { - msg.optionalFixed64 = optionalFixed64; + msg.optionalFixed64 = BigInt(optionalFixed64); } - const optionalSfixed32 = json[\\"optionalSfixed32\\"] ?? json.optional_sfixed32; + const optionalSfixed32 = json.optionalSfixed32 ?? json.optional_sfixed32; if (optionalSfixed32) { msg.optionalSfixed32 = optionalSfixed32; } - const optionalSfixed64 = json[\\"optionalSfixed64\\"] ?? json.optional_sfixed64; + const optionalSfixed64 = json.optionalSfixed64 ?? json.optional_sfixed64; if (optionalSfixed64) { - msg.optionalSfixed64 = optionalSfixed64; + msg.optionalSfixed64 = BigInt(optionalSfixed64); } - const optionalFloat = json[\\"optionalFloat\\"] ?? json.optional_float; + const optionalFloat = json.optionalFloat ?? json.optional_float; if (optionalFloat) { msg.optionalFloat = optionalFloat; } - const optionalDouble = json[\\"optionalDouble\\"] ?? json.optional_double; + const optionalDouble = json.optionalDouble ?? json.optional_double; if (optionalDouble) { msg.optionalDouble = optionalDouble; } - const optionalBool = json[\\"optionalBool\\"] ?? json.optional_bool; + const optionalBool = json.optionalBool ?? json.optional_bool; if (optionalBool) { msg.optionalBool = optionalBool; } - const optionalString = json[\\"optionalString\\"] ?? json.optional_string; + const optionalString = json.optionalString ?? json.optional_string; if (optionalString) { msg.optionalString = optionalString; } - const optionalBytes = json[\\"optionalBytes\\"] ?? json.optional_bytes; + const optionalBytes = json.optionalBytes ?? json.optional_bytes; if (optionalBytes) { msg.optionalBytes = optionalBytes; } const optionalNestedMessage = - json[\\"optionalNestedMessage\\"] ?? json.optional_nested_message; + json.optionalNestedMessage ?? json.optional_nested_message; if (optionalNestedMessage) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, optionalNestedMessage); msg.optionalNestedMessage = m; } const optionalForeignMessage = - json[\\"optionalForeignMessage\\"] ?? json.optional_foreign_message; + json.optionalForeignMessage ?? json.optional_foreign_message; if (optionalForeignMessage) { const m = ForeignMessage.initialize(); ForeignMessage._readMessageJSON(m, optionalForeignMessage); msg.optionalForeignMessage = m; } const optionalImportMessage = - json[\\"optionalImportMessage\\"] ?? json.optional_import_message; + json.optionalImportMessage ?? json.optional_import_message; if (optionalImportMessage) { const m = ImportMessage.initialize(); ImportMessage._readMessageJSON(m, optionalImportMessage); msg.optionalImportMessage = m; } const optionalNestedEnum = - json[\\"optionalNestedEnum\\"] ?? json.optional_nested_enum; + json.optionalNestedEnum ?? json.optional_nested_enum; if (optionalNestedEnum) { msg.optionalNestedEnum = optionalNestedEnum; } const optionalForeignEnum = - json[\\"optionalForeignEnum\\"] ?? json.optional_foreign_enum; + json.optionalForeignEnum ?? json.optional_foreign_enum; if (optionalForeignEnum) { msg.optionalForeignEnum = optionalForeignEnum; } const optionalStringPiece = - json[\\"optionalStringPiece\\"] ?? json.optional_string_piece; + json.optionalStringPiece ?? json.optional_string_piece; if (optionalStringPiece) { msg.optionalStringPiece = optionalStringPiece; } - const optionalCord = json[\\"optionalCord\\"] ?? json.optional_cord; + const optionalCord = json.optionalCord ?? json.optional_cord; if (optionalCord) { msg.optionalCord = optionalCord; } const optionalPublicImportMessage = - json[\\"optionalPublicImportMessage\\"] ?? - json.optional_public_import_message; + json.optionalPublicImportMessage ?? json.optional_public_import_message; if (optionalPublicImportMessage) { const m = PublicImportMessage.initialize(); PublicImportMessage._readMessageJSON(m, optionalPublicImportMessage); msg.optionalPublicImportMessage = m; } const optionalLazyMessage = - json[\\"optionalLazyMessage\\"] ?? json.optional_lazy_message; + json.optionalLazyMessage ?? json.optional_lazy_message; if (optionalLazyMessage) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, optionalLazyMessage); msg.optionalLazyMessage = m; } const optionalLazyImportMessage = - json[\\"optionalLazyImportMessage\\"] ?? json.optional_lazy_import_message; + json.optionalLazyImportMessage ?? json.optional_lazy_import_message; if (optionalLazyImportMessage) { const m = ImportMessage.initialize(); ImportMessage._readMessageJSON(m, optionalLazyImportMessage); msg.optionalLazyImportMessage = m; } - const repeatedInt32 = json[\\"repeatedInt32\\"] ?? json.repeated_int32; + const repeatedInt32 = json.repeatedInt32 ?? json.repeated_int32; if (repeatedInt32) { msg.repeatedInt32 = repeatedInt32; } - const repeatedInt64 = json[\\"repeatedInt64\\"] ?? json.repeated_int64; + const repeatedInt64 = json.repeatedInt64 ?? json.repeated_int64; if (repeatedInt64) { - msg.repeatedInt64 = repeatedInt64; + msg.repeatedInt64 = repeatedInt64.map(BigInt); } - const repeatedUint32 = json[\\"repeatedUint32\\"] ?? json.repeated_uint32; + const repeatedUint32 = json.repeatedUint32 ?? json.repeated_uint32; if (repeatedUint32) { msg.repeatedUint32 = repeatedUint32; } - const repeatedUint64 = json[\\"repeatedUint64\\"] ?? json.repeated_uint64; + const repeatedUint64 = json.repeatedUint64 ?? json.repeated_uint64; if (repeatedUint64) { - msg.repeatedUint64 = repeatedUint64; + msg.repeatedUint64 = repeatedUint64.map(BigInt); } - const repeatedSint32 = json[\\"repeatedSint32\\"] ?? json.repeated_sint32; + const repeatedSint32 = json.repeatedSint32 ?? json.repeated_sint32; if (repeatedSint32) { msg.repeatedSint32 = repeatedSint32; } - const repeatedSint64 = json[\\"repeatedSint64\\"] ?? json.repeated_sint64; + const repeatedSint64 = json.repeatedSint64 ?? json.repeated_sint64; if (repeatedSint64) { - msg.repeatedSint64 = repeatedSint64; + msg.repeatedSint64 = repeatedSint64.map(BigInt); } - const repeatedFixed32 = json[\\"repeatedFixed32\\"] ?? json.repeated_fixed32; + const repeatedFixed32 = json.repeatedFixed32 ?? json.repeated_fixed32; if (repeatedFixed32) { msg.repeatedFixed32 = repeatedFixed32; } - const repeatedFixed64 = json[\\"repeatedFixed64\\"] ?? json.repeated_fixed64; + const repeatedFixed64 = json.repeatedFixed64 ?? json.repeated_fixed64; if (repeatedFixed64) { - msg.repeatedFixed64 = repeatedFixed64; + msg.repeatedFixed64 = repeatedFixed64.map(BigInt); } - const repeatedSfixed32 = json[\\"repeatedSfixed32\\"] ?? json.repeated_sfixed32; + const repeatedSfixed32 = json.repeatedSfixed32 ?? json.repeated_sfixed32; if (repeatedSfixed32) { msg.repeatedSfixed32 = repeatedSfixed32; } - const repeatedSfixed64 = json[\\"repeatedSfixed64\\"] ?? json.repeated_sfixed64; + const repeatedSfixed64 = json.repeatedSfixed64 ?? json.repeated_sfixed64; if (repeatedSfixed64) { - msg.repeatedSfixed64 = repeatedSfixed64; + msg.repeatedSfixed64 = repeatedSfixed64.map(BigInt); } - const repeatedFloat = json[\\"repeatedFloat\\"] ?? json.repeated_float; + const repeatedFloat = json.repeatedFloat ?? json.repeated_float; if (repeatedFloat) { msg.repeatedFloat = repeatedFloat; } - const repeatedDouble = json[\\"repeatedDouble\\"] ?? json.repeated_double; + const repeatedDouble = json.repeatedDouble ?? json.repeated_double; if (repeatedDouble) { msg.repeatedDouble = repeatedDouble; } - const repeatedBool = json[\\"repeatedBool\\"] ?? json.repeated_bool; + const repeatedBool = json.repeatedBool ?? json.repeated_bool; if (repeatedBool) { msg.repeatedBool = repeatedBool; } - const repeatedString = json[\\"repeatedString\\"] ?? json.repeated_string; + const repeatedString = json.repeatedString ?? json.repeated_string; if (repeatedString) { msg.repeatedString = repeatedString; } - const repeatedBytes = json[\\"repeatedBytes\\"] ?? json.repeated_bytes; + const repeatedBytes = json.repeatedBytes ?? json.repeated_bytes; if (repeatedBytes) { msg.repeatedBytes = repeatedBytes; } const repeatedNestedMessage = - json[\\"repeatedNestedMessage\\"] ?? json.repeated_nested_message; + json.repeatedNestedMessage ?? json.repeated_nested_message; if (repeatedNestedMessage) { for (const item of repeatedNestedMessage) { const m = TestAllTypes.NestedMessage.initialize(); @@ -35705,7 +36631,7 @@ export const TestAllTypes = { } } const repeatedForeignMessage = - json[\\"repeatedForeignMessage\\"] ?? json.repeated_foreign_message; + json.repeatedForeignMessage ?? json.repeated_foreign_message; if (repeatedForeignMessage) { for (const item of repeatedForeignMessage) { const m = ForeignMessage.initialize(); @@ -35714,7 +36640,7 @@ export const TestAllTypes = { } } const repeatedImportMessage = - json[\\"repeatedImportMessage\\"] ?? json.repeated_import_message; + json.repeatedImportMessage ?? json.repeated_import_message; if (repeatedImportMessage) { for (const item of repeatedImportMessage) { const m = ImportMessage.initialize(); @@ -35723,26 +36649,26 @@ export const TestAllTypes = { } } const repeatedNestedEnum = - json[\\"repeatedNestedEnum\\"] ?? json.repeated_nested_enum; + json.repeatedNestedEnum ?? json.repeated_nested_enum; if (repeatedNestedEnum) { msg.repeatedNestedEnum = repeatedNestedEnum; } const repeatedForeignEnum = - json[\\"repeatedForeignEnum\\"] ?? json.repeated_foreign_enum; + json.repeatedForeignEnum ?? json.repeated_foreign_enum; if (repeatedForeignEnum) { msg.repeatedForeignEnum = repeatedForeignEnum; } const repeatedStringPiece = - json[\\"repeatedStringPiece\\"] ?? json.repeated_string_piece; + json.repeatedStringPiece ?? json.repeated_string_piece; if (repeatedStringPiece) { msg.repeatedStringPiece = repeatedStringPiece; } - const repeatedCord = json[\\"repeatedCord\\"] ?? json.repeated_cord; + const repeatedCord = json.repeatedCord ?? json.repeated_cord; if (repeatedCord) { msg.repeatedCord = repeatedCord; } const repeatedLazyMessage = - json[\\"repeatedLazyMessage\\"] ?? json.repeated_lazy_message; + json.repeatedLazyMessage ?? json.repeated_lazy_message; if (repeatedLazyMessage) { for (const item of repeatedLazyMessage) { const m = TestAllTypes.NestedMessage.initialize(); @@ -35750,22 +36676,22 @@ export const TestAllTypes = { msg.repeatedLazyMessage.push(m); } } - const oneofUint32 = json[\\"oneofUint32\\"] ?? json.oneof_uint32; + const oneofUint32 = json.oneofUint32 ?? json.oneof_uint32; if (oneofUint32) { msg.oneofUint32 = oneofUint32; } const oneofNestedMessage = - json[\\"oneofNestedMessage\\"] ?? json.oneof_nested_message; + json.oneofNestedMessage ?? json.oneof_nested_message; if (oneofNestedMessage) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, oneofNestedMessage); msg.oneofNestedMessage = m; } - const oneofString = json[\\"oneofString\\"] ?? json.oneof_string; + const oneofString = json.oneofString ?? json.oneof_string; if (oneofString) { msg.oneofString = oneofString; } - const oneofBytes = json[\\"oneofBytes\\"] ?? json.oneof_bytes; + const oneofBytes = json.oneofBytes ?? json.oneof_bytes; if (oneofBytes) { msg.oneofBytes = oneofBytes; } @@ -35837,9 +36763,9 @@ export const TestAllTypes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.bb) { - json[\\"bb\\"] = msg.bb; + json.bb = msg.bb; } return json; }, @@ -35868,7 +36794,7 @@ export const TestAllTypes = { * @private */ _readMessageJSON: function (msg, json) { - const bb = json[\\"bb\\"] ?? json.bb; + const bb = json.bb ?? json.bb; if (bb) { msg.bb = bb; } @@ -35945,31 +36871,31 @@ export const TestPackedTypes = { writer.writeRepeatedInt32(90, msg.packedInt32); } if (msg.packedInt64?.length) { - writer.writeRepeatedInt64String(91, msg.packedInt64); + writer.writeRepeatedInt64String(91, msg.packedInt64.toString()); } if (msg.packedUint32?.length) { writer.writeRepeatedUint32(92, msg.packedUint32); } if (msg.packedUint64?.length) { - writer.writeRepeatedUint64String(93, msg.packedUint64); + writer.writeRepeatedUint64String(93, msg.packedUint64.toString()); } if (msg.packedSint32?.length) { writer.writeRepeatedSint32(94, msg.packedSint32); } if (msg.packedSint64?.length) { - writer.writeRepeatedSint64String(95, msg.packedSint64); + writer.writeRepeatedSint64String(95, msg.packedSint64.toString()); } if (msg.packedFixed32?.length) { writer.writeRepeatedFixed32(96, msg.packedFixed32); } if (msg.packedFixed64?.length) { - writer.writeRepeatedFixed64String(97, msg.packedFixed64); + writer.writeRepeatedFixed64String(97, msg.packedFixed64.toString()); } if (msg.packedSfixed32?.length) { writer.writeRepeatedSfixed32(98, msg.packedSfixed32); } if (msg.packedSfixed64?.length) { - writer.writeRepeatedSfixed64(99, msg.packedSfixed64); + writer.writeRepeatedSfixed64(99, msg.packedSfixed64.toString()); } if (msg.packedFloat?.length) { writer.writeRepeatedFloat(100, msg.packedFloat); @@ -35990,48 +36916,48 @@ export const TestPackedTypes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.packedInt32?.length) { - json[\\"packedInt32\\"] = msg.packedInt32; + json.packedInt32 = msg.packedInt32; } if (msg.packedInt64?.length) { - json[\\"packedInt64\\"] = msg.packedInt64; + json.packedInt64 = msg.packedInt64.map((x) => x.toString()); } if (msg.packedUint32?.length) { - json[\\"packedUint32\\"] = msg.packedUint32; + json.packedUint32 = msg.packedUint32; } if (msg.packedUint64?.length) { - json[\\"packedUint64\\"] = msg.packedUint64; + json.packedUint64 = msg.packedUint64.map((x) => x.toString()); } if (msg.packedSint32?.length) { - json[\\"packedSint32\\"] = msg.packedSint32; + json.packedSint32 = msg.packedSint32; } if (msg.packedSint64?.length) { - json[\\"packedSint64\\"] = msg.packedSint64; + json.packedSint64 = msg.packedSint64.map((x) => x.toString()); } if (msg.packedFixed32?.length) { - json[\\"packedFixed32\\"] = msg.packedFixed32; + json.packedFixed32 = msg.packedFixed32; } if (msg.packedFixed64?.length) { - json[\\"packedFixed64\\"] = msg.packedFixed64; + json.packedFixed64 = msg.packedFixed64.map((x) => x.toString()); } if (msg.packedSfixed32?.length) { - json[\\"packedSfixed32\\"] = msg.packedSfixed32; + json.packedSfixed32 = msg.packedSfixed32; } if (msg.packedSfixed64?.length) { - json[\\"packedSfixed64\\"] = msg.packedSfixed64; + json.packedSfixed64 = msg.packedSfixed64.map((x) => x.toString()); } if (msg.packedFloat?.length) { - json[\\"packedFloat\\"] = msg.packedFloat; + json.packedFloat = msg.packedFloat; } if (msg.packedDouble?.length) { - json[\\"packedDouble\\"] = msg.packedDouble; + json.packedDouble = msg.packedDouble; } if (msg.packedBool?.length) { - json[\\"packedBool\\"] = msg.packedBool; + json.packedBool = msg.packedBool; } if (msg.packedEnum?.length) { - json[\\"packedEnum\\"] = msg.packedEnum; + json.packedEnum = msg.packedEnum; } return json; }, @@ -36048,7 +36974,7 @@ export const TestPackedTypes = { break; } case 91: { - msg.packedInt64.push(reader.readInt64String()); + msg.packedInt64 = reader.readInt64String().map(BigInt); break; } case 92: { @@ -36056,7 +36982,7 @@ export const TestPackedTypes = { break; } case 93: { - msg.packedUint64.push(reader.readUint64String()); + msg.packedUint64 = reader.readUint64String().map(BigInt); break; } case 94: { @@ -36064,7 +36990,7 @@ export const TestPackedTypes = { break; } case 95: { - msg.packedSint64.push(reader.readSint64()); + msg.packedSint64 = reader.readSint64().map(BigInt); break; } case 96: { @@ -36072,7 +36998,7 @@ export const TestPackedTypes = { break; } case 97: { - msg.packedFixed64.push(reader.readFixed64String()); + msg.packedFixed64 = reader.readFixed64String().map(BigInt); break; } case 98: { @@ -36080,7 +37006,7 @@ export const TestPackedTypes = { break; } case 99: { - msg.packedSfixed64.push(reader.readSfixed64()); + msg.packedSfixed64 = reader.readSfixed64().map(BigInt); break; } case 100: { @@ -36112,59 +37038,59 @@ export const TestPackedTypes = { * @private */ _readMessageJSON: function (msg, json) { - const packedInt32 = json[\\"packedInt32\\"] ?? json.packed_int32; + const packedInt32 = json.packedInt32 ?? json.packed_int32; if (packedInt32) { msg.packedInt32 = packedInt32; } - const packedInt64 = json[\\"packedInt64\\"] ?? json.packed_int64; + const packedInt64 = json.packedInt64 ?? json.packed_int64; if (packedInt64) { - msg.packedInt64 = packedInt64; + msg.packedInt64 = packedInt64.map(BigInt); } - const packedUint32 = json[\\"packedUint32\\"] ?? json.packed_uint32; + const packedUint32 = json.packedUint32 ?? json.packed_uint32; if (packedUint32) { msg.packedUint32 = packedUint32; } - const packedUint64 = json[\\"packedUint64\\"] ?? json.packed_uint64; + const packedUint64 = json.packedUint64 ?? json.packed_uint64; if (packedUint64) { - msg.packedUint64 = packedUint64; + msg.packedUint64 = packedUint64.map(BigInt); } - const packedSint32 = json[\\"packedSint32\\"] ?? json.packed_sint32; + const packedSint32 = json.packedSint32 ?? json.packed_sint32; if (packedSint32) { msg.packedSint32 = packedSint32; } - const packedSint64 = json[\\"packedSint64\\"] ?? json.packed_sint64; + const packedSint64 = json.packedSint64 ?? json.packed_sint64; if (packedSint64) { - msg.packedSint64 = packedSint64; + msg.packedSint64 = packedSint64.map(BigInt); } - const packedFixed32 = json[\\"packedFixed32\\"] ?? json.packed_fixed32; + const packedFixed32 = json.packedFixed32 ?? json.packed_fixed32; if (packedFixed32) { msg.packedFixed32 = packedFixed32; } - const packedFixed64 = json[\\"packedFixed64\\"] ?? json.packed_fixed64; + const packedFixed64 = json.packedFixed64 ?? json.packed_fixed64; if (packedFixed64) { - msg.packedFixed64 = packedFixed64; + msg.packedFixed64 = packedFixed64.map(BigInt); } - const packedSfixed32 = json[\\"packedSfixed32\\"] ?? json.packed_sfixed32; + const packedSfixed32 = json.packedSfixed32 ?? json.packed_sfixed32; if (packedSfixed32) { msg.packedSfixed32 = packedSfixed32; } - const packedSfixed64 = json[\\"packedSfixed64\\"] ?? json.packed_sfixed64; + const packedSfixed64 = json.packedSfixed64 ?? json.packed_sfixed64; if (packedSfixed64) { - msg.packedSfixed64 = packedSfixed64; + msg.packedSfixed64 = packedSfixed64.map(BigInt); } - const packedFloat = json[\\"packedFloat\\"] ?? json.packed_float; + const packedFloat = json.packedFloat ?? json.packed_float; if (packedFloat) { msg.packedFloat = packedFloat; } - const packedDouble = json[\\"packedDouble\\"] ?? json.packed_double; + const packedDouble = json.packedDouble ?? json.packed_double; if (packedDouble) { msg.packedDouble = packedDouble; } - const packedBool = json[\\"packedBool\\"] ?? json.packed_bool; + const packedBool = json.packedBool ?? json.packed_bool; if (packedBool) { msg.packedBool = packedBool; } - const packedEnum = json[\\"packedEnum\\"] ?? json.packed_enum; + const packedEnum = json.packedEnum ?? json.packed_enum; if (packedEnum) { msg.packedEnum = packedEnum; } @@ -36242,31 +37168,31 @@ export const TestUnpackedTypes = { writer.writeRepeatedInt32(1, msg.repeatedInt32); } if (msg.repeatedInt64?.length) { - writer.writeRepeatedInt64String(2, msg.repeatedInt64); + writer.writeRepeatedInt64String(2, msg.repeatedInt64.toString()); } if (msg.repeatedUint32?.length) { writer.writeRepeatedUint32(3, msg.repeatedUint32); } if (msg.repeatedUint64?.length) { - writer.writeRepeatedUint64String(4, msg.repeatedUint64); + writer.writeRepeatedUint64String(4, msg.repeatedUint64.toString()); } if (msg.repeatedSint32?.length) { writer.writeRepeatedSint32(5, msg.repeatedSint32); } if (msg.repeatedSint64?.length) { - writer.writeRepeatedSint64String(6, msg.repeatedSint64); + writer.writeRepeatedSint64String(6, msg.repeatedSint64.toString()); } if (msg.repeatedFixed32?.length) { writer.writeRepeatedFixed32(7, msg.repeatedFixed32); } if (msg.repeatedFixed64?.length) { - writer.writeRepeatedFixed64String(8, msg.repeatedFixed64); + writer.writeRepeatedFixed64String(8, msg.repeatedFixed64.toString()); } if (msg.repeatedSfixed32?.length) { writer.writeRepeatedSfixed32(9, msg.repeatedSfixed32); } if (msg.repeatedSfixed64?.length) { - writer.writeRepeatedSfixed64(10, msg.repeatedSfixed64); + writer.writeRepeatedSfixed64(10, msg.repeatedSfixed64.toString()); } if (msg.repeatedFloat?.length) { writer.writeRepeatedFloat(11, msg.repeatedFloat); @@ -36287,48 +37213,48 @@ export const TestUnpackedTypes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.repeatedInt32?.length) { - json[\\"repeatedInt32\\"] = msg.repeatedInt32; + json.repeatedInt32 = msg.repeatedInt32; } if (msg.repeatedInt64?.length) { - json[\\"repeatedInt64\\"] = msg.repeatedInt64; + json.repeatedInt64 = msg.repeatedInt64.map((x) => x.toString()); } if (msg.repeatedUint32?.length) { - json[\\"repeatedUint32\\"] = msg.repeatedUint32; + json.repeatedUint32 = msg.repeatedUint32; } if (msg.repeatedUint64?.length) { - json[\\"repeatedUint64\\"] = msg.repeatedUint64; + json.repeatedUint64 = msg.repeatedUint64.map((x) => x.toString()); } if (msg.repeatedSint32?.length) { - json[\\"repeatedSint32\\"] = msg.repeatedSint32; + json.repeatedSint32 = msg.repeatedSint32; } if (msg.repeatedSint64?.length) { - json[\\"repeatedSint64\\"] = msg.repeatedSint64; + json.repeatedSint64 = msg.repeatedSint64.map((x) => x.toString()); } if (msg.repeatedFixed32?.length) { - json[\\"repeatedFixed32\\"] = msg.repeatedFixed32; + json.repeatedFixed32 = msg.repeatedFixed32; } if (msg.repeatedFixed64?.length) { - json[\\"repeatedFixed64\\"] = msg.repeatedFixed64; + json.repeatedFixed64 = msg.repeatedFixed64.map((x) => x.toString()); } if (msg.repeatedSfixed32?.length) { - json[\\"repeatedSfixed32\\"] = msg.repeatedSfixed32; + json.repeatedSfixed32 = msg.repeatedSfixed32; } if (msg.repeatedSfixed64?.length) { - json[\\"repeatedSfixed64\\"] = msg.repeatedSfixed64; + json.repeatedSfixed64 = msg.repeatedSfixed64.map((x) => x.toString()); } if (msg.repeatedFloat?.length) { - json[\\"repeatedFloat\\"] = msg.repeatedFloat; + json.repeatedFloat = msg.repeatedFloat; } if (msg.repeatedDouble?.length) { - json[\\"repeatedDouble\\"] = msg.repeatedDouble; + json.repeatedDouble = msg.repeatedDouble; } if (msg.repeatedBool?.length) { - json[\\"repeatedBool\\"] = msg.repeatedBool; + json.repeatedBool = msg.repeatedBool; } if (msg.repeatedNestedEnum?.length) { - json[\\"repeatedNestedEnum\\"] = msg.repeatedNestedEnum; + json.repeatedNestedEnum = msg.repeatedNestedEnum; } return json; }, @@ -36345,7 +37271,7 @@ export const TestUnpackedTypes = { break; } case 2: { - msg.repeatedInt64.push(reader.readInt64String()); + msg.repeatedInt64 = reader.readInt64String().map(BigInt); break; } case 3: { @@ -36353,7 +37279,7 @@ export const TestUnpackedTypes = { break; } case 4: { - msg.repeatedUint64.push(reader.readUint64String()); + msg.repeatedUint64 = reader.readUint64String().map(BigInt); break; } case 5: { @@ -36361,7 +37287,7 @@ export const TestUnpackedTypes = { break; } case 6: { - msg.repeatedSint64.push(reader.readSint64()); + msg.repeatedSint64 = reader.readSint64().map(BigInt); break; } case 7: { @@ -36369,7 +37295,7 @@ export const TestUnpackedTypes = { break; } case 8: { - msg.repeatedFixed64.push(reader.readFixed64String()); + msg.repeatedFixed64 = reader.readFixed64String().map(BigInt); break; } case 9: { @@ -36377,7 +37303,7 @@ export const TestUnpackedTypes = { break; } case 10: { - msg.repeatedSfixed64.push(reader.readSfixed64()); + msg.repeatedSfixed64 = reader.readSfixed64().map(BigInt); break; } case 11: { @@ -36409,60 +37335,60 @@ export const TestUnpackedTypes = { * @private */ _readMessageJSON: function (msg, json) { - const repeatedInt32 = json[\\"repeatedInt32\\"] ?? json.repeated_int32; + const repeatedInt32 = json.repeatedInt32 ?? json.repeated_int32; if (repeatedInt32) { msg.repeatedInt32 = repeatedInt32; } - const repeatedInt64 = json[\\"repeatedInt64\\"] ?? json.repeated_int64; + const repeatedInt64 = json.repeatedInt64 ?? json.repeated_int64; if (repeatedInt64) { - msg.repeatedInt64 = repeatedInt64; + msg.repeatedInt64 = repeatedInt64.map(BigInt); } - const repeatedUint32 = json[\\"repeatedUint32\\"] ?? json.repeated_uint32; + const repeatedUint32 = json.repeatedUint32 ?? json.repeated_uint32; if (repeatedUint32) { msg.repeatedUint32 = repeatedUint32; } - const repeatedUint64 = json[\\"repeatedUint64\\"] ?? json.repeated_uint64; + const repeatedUint64 = json.repeatedUint64 ?? json.repeated_uint64; if (repeatedUint64) { - msg.repeatedUint64 = repeatedUint64; + msg.repeatedUint64 = repeatedUint64.map(BigInt); } - const repeatedSint32 = json[\\"repeatedSint32\\"] ?? json.repeated_sint32; + const repeatedSint32 = json.repeatedSint32 ?? json.repeated_sint32; if (repeatedSint32) { msg.repeatedSint32 = repeatedSint32; } - const repeatedSint64 = json[\\"repeatedSint64\\"] ?? json.repeated_sint64; + const repeatedSint64 = json.repeatedSint64 ?? json.repeated_sint64; if (repeatedSint64) { - msg.repeatedSint64 = repeatedSint64; + msg.repeatedSint64 = repeatedSint64.map(BigInt); } - const repeatedFixed32 = json[\\"repeatedFixed32\\"] ?? json.repeated_fixed32; + const repeatedFixed32 = json.repeatedFixed32 ?? json.repeated_fixed32; if (repeatedFixed32) { msg.repeatedFixed32 = repeatedFixed32; } - const repeatedFixed64 = json[\\"repeatedFixed64\\"] ?? json.repeated_fixed64; + const repeatedFixed64 = json.repeatedFixed64 ?? json.repeated_fixed64; if (repeatedFixed64) { - msg.repeatedFixed64 = repeatedFixed64; + msg.repeatedFixed64 = repeatedFixed64.map(BigInt); } - const repeatedSfixed32 = json[\\"repeatedSfixed32\\"] ?? json.repeated_sfixed32; + const repeatedSfixed32 = json.repeatedSfixed32 ?? json.repeated_sfixed32; if (repeatedSfixed32) { msg.repeatedSfixed32 = repeatedSfixed32; } - const repeatedSfixed64 = json[\\"repeatedSfixed64\\"] ?? json.repeated_sfixed64; + const repeatedSfixed64 = json.repeatedSfixed64 ?? json.repeated_sfixed64; if (repeatedSfixed64) { - msg.repeatedSfixed64 = repeatedSfixed64; + msg.repeatedSfixed64 = repeatedSfixed64.map(BigInt); } - const repeatedFloat = json[\\"repeatedFloat\\"] ?? json.repeated_float; + const repeatedFloat = json.repeatedFloat ?? json.repeated_float; if (repeatedFloat) { msg.repeatedFloat = repeatedFloat; } - const repeatedDouble = json[\\"repeatedDouble\\"] ?? json.repeated_double; + const repeatedDouble = json.repeatedDouble ?? json.repeated_double; if (repeatedDouble) { msg.repeatedDouble = repeatedDouble; } - const repeatedBool = json[\\"repeatedBool\\"] ?? json.repeated_bool; + const repeatedBool = json.repeatedBool ?? json.repeated_bool; if (repeatedBool) { msg.repeatedBool = repeatedBool; } const repeatedNestedEnum = - json[\\"repeatedNestedEnum\\"] ?? json.repeated_nested_enum; + json.repeatedNestedEnum ?? json.repeated_nested_enum; if (repeatedNestedEnum) { msg.repeatedNestedEnum = repeatedNestedEnum; } @@ -36537,17 +37463,17 @@ export const NestedTestAllTypes = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.child) { const child = NestedTestAllTypes._writeMessageJSON(msg.child); if (Object.keys(child).length > 0) { - json[\\"child\\"] = child; + json.child = child; } } if (msg.payload) { const payload = TestAllTypes._writeMessageJSON(msg.payload); if (Object.keys(payload).length > 0) { - json[\\"payload\\"] = payload; + json.payload = payload; } } return json; @@ -36581,13 +37507,13 @@ export const NestedTestAllTypes = { * @private */ _readMessageJSON: function (msg, json) { - const child = json[\\"child\\"] ?? json.child; + const child = json.child ?? json.child; if (child) { const m = NestedTestAllTypes.initialize(); NestedTestAllTypes._readMessageJSON(m, child); msg.child = m; } - const payload = json[\\"payload\\"] ?? json.payload; + const payload = json.payload ?? json.payload; if (payload) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, payload); @@ -36658,9 +37584,9 @@ export const ForeignMessage = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.c) { - json[\\"c\\"] = msg.c; + json.c = msg.c; } return json; }, @@ -36689,7 +37615,7 @@ export const ForeignMessage = { * @private */ _readMessageJSON: function (msg, json) { - const c = json[\\"c\\"] ?? json.c; + const c = json.c ?? json.c; if (c) { msg.c = c; } @@ -36808,9 +37734,9 @@ export const TestMessageWithDummy = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.dummy) { - json[\\"dummy\\"] = msg.dummy; + json.dummy = msg.dummy; } return json; }, @@ -36839,7 +37765,7 @@ export const TestMessageWithDummy = { * @private */ _readMessageJSON: function (msg, json) { - const dummy = json[\\"dummy\\"] ?? json.dummy; + const dummy = json.dummy ?? json.dummy; if (dummy) { msg.dummy = dummy; } @@ -36906,9 +37832,9 @@ export const TestOneof2 = { * @private */ _writeMessageJSON: function (msg) { - const json: Record = {}; + const json = {}; if (msg.fooEnum != undefined) { - json[\\"fooEnum\\"] = msg.fooEnum; + json.fooEnum = msg.fooEnum; } return json; }, @@ -36937,7 +37863,7 @@ export const TestOneof2 = { * @private */ _readMessageJSON: function (msg, json) { - const fooEnum = json[\\"fooEnum\\"] ?? json.foo_enum; + const fooEnum = json.fooEnum ?? json.foo_enum; if (fooEnum) { msg.fooEnum = fooEnum; } @@ -37223,7 +38149,7 @@ export const PublicImportMessage = { ): Record { const json: Record = {}; if (msg.e) { - json[\\"e\\"] = msg.e; + json.e = msg.e; } return json; }, @@ -37258,7 +38184,7 @@ export const PublicImportMessage = { msg: PublicImportMessage, json: any ): PublicImportMessage { - const e = json[\\"e\\"] ?? json.e; + const e = json.e ?? json.e; if (e) { msg.e = e; } @@ -37384,7 +38310,7 @@ export const ImportMessage = { ): Record { const json: Record = {}; if (msg.d) { - json[\\"d\\"] = msg.d; + json.d = msg.d; } return json; }, @@ -37416,7 +38342,7 @@ export const ImportMessage = { * @private */ _readMessageJSON: function (msg: ImportMessage, json: any): ImportMessage { - const d = json[\\"d\\"] ?? json.d; + const d = json.d ?? json.d; if (d) { msg.d = d; } @@ -37579,15 +38505,15 @@ export interface TestAllTypes { * Singular */ optionalInt32: number; - optionalInt64: string; + optionalInt64: bigint; optionalUint32: number; - optionalUint64: string; + optionalUint64: bigint; optionalSint32: number; - optionalSint64: string; + optionalSint64: bigint; optionalFixed32: number; - optionalFixed64: string; + optionalFixed64: bigint; optionalSfixed32: number; - optionalSfixed64: string; + optionalSfixed64: bigint; optionalFloat: number; optionalDouble: number; optionalBool: boolean; @@ -37610,15 +38536,15 @@ export interface TestAllTypes { /** * Repeated */ - repeatedInt64: string[]; + repeatedInt64: bigint[]; repeatedUint32: number[]; - repeatedUint64: string[]; + repeatedUint64: bigint[]; repeatedSint32: number[]; - repeatedSint64: string[]; + repeatedSint64: bigint[]; repeatedFixed32: number[]; - repeatedFixed64: string[]; + repeatedFixed64: bigint[]; repeatedSfixed32: number[]; - repeatedSfixed64: string[]; + repeatedSfixed64: bigint[]; repeatedFloat: number[]; repeatedDouble: number[]; repeatedBool: boolean[]; @@ -37634,18 +38560,18 @@ export interface TestAllTypes { repeatedCord: string[]; repeatedLazyMessage: TestAllTypes.NestedMessage[]; defaultInt32: number; - defaultInt64: string; + defaultInt64: bigint; /** * Singular with defaults */ defaultUint32: number; - defaultUint64: string; + defaultUint64: bigint; defaultSint32: number; - defaultSint64: string; + defaultSint64: bigint; defaultFixed32: number; - defaultFixed64: string; + defaultFixed64: bigint; defaultSfixed32: number; - defaultSfixed64: string; + defaultSfixed64: bigint; defaultFloat: number; defaultDouble: number; defaultBool: boolean; @@ -37967,14 +38893,14 @@ export interface TestCamelCaseFieldNames { */ export interface TestFieldOrderings { myString: string; - myInt: string; + myInt: bigint; myFloat: number; optionalNestedMessage: TestFieldOrderings.NestedMessage; } export namespace TestFieldOrderings { export interface NestedMessage { - oo: string; + oo: bigint; /** * The field name \\"b\\" fails to compile in proto1 because it conflicts with * a local variable named \\"b\\" in one of the generated methods. Doh. @@ -38001,11 +38927,11 @@ export namespace TestExtensionOrderings2 { export interface TestExtremeDefaultValues { escapedBytes: Uint8Array; largeUint32: number; - largeUint64: string; + largeUint64: bigint; smallInt32: number; - smallInt64: string; + smallInt64: bigint; reallySmallInt32: number; - reallySmallInt64: string; + reallySmallInt64: bigint; /** * The default value here is UTF-8 for \\"\\\\u1234\\". (We could also just type * the UTF-8 text directly into this text file rather than escape it, but @@ -38087,11 +39013,11 @@ export interface Uint32Message { } export interface Int64Message { - data: string; + data: bigint; } export interface Uint64Message { - data: string; + data: bigint; } export interface BoolMessage { @@ -38160,7 +39086,7 @@ export namespace TestOneof2 { } export interface NestedMessage { - quxInt: string; + quxInt: bigint; corgeInt: number[]; } } @@ -38179,15 +39105,15 @@ export namespace TestRequiredOneof { export interface TestPackedTypes { packedInt32: number[]; - packedInt64: string[]; + packedInt64: bigint[]; packedUint32: number[]; - packedUint64: string[]; + packedUint64: bigint[]; packedSint32: number[]; - packedSint64: string[]; + packedSint64: bigint[]; packedFixed32: number[]; - packedFixed64: string[]; + packedFixed64: bigint[]; packedSfixed32: number[]; - packedSfixed64: string[]; + packedSfixed64: bigint[]; packedFloat: number[]; packedDouble: number[]; packedBool: boolean[]; @@ -38200,15 +39126,15 @@ export interface TestPackedTypes { */ export interface TestUnpackedTypes { unpackedInt32: number[]; - unpackedInt64: string[]; + unpackedInt64: bigint[]; unpackedUint32: number[]; - unpackedUint64: string[]; + unpackedUint64: bigint[]; unpackedSint32: number[]; - unpackedSint64: string[]; + unpackedSint64: bigint[]; unpackedFixed32: number[]; - unpackedFixed64: string[]; + unpackedFixed64: bigint[]; unpackedSfixed32: number[]; - unpackedSfixed64: string[]; + unpackedSfixed64: bigint[]; unpackedFloat: number[]; unpackedDouble: number[]; unpackedBool: boolean[]; @@ -38257,13 +39183,13 @@ export interface TestRepeatedScalarDifferentTagSizes { /** * These have two-byte tags. */ - repeatedFixed64: string[]; - repeatedInt64: string[]; + repeatedFixed64: bigint[]; + repeatedInt64: bigint[]; /** * Three byte tags. */ repeatedFloat: number[]; - repeatedUint64: string[]; + repeatedUint64: bigint[]; } /** @@ -38560,15 +39486,15 @@ export const TestAllTypes = { initialize: function (): TestAllTypes { return { optionalInt32: 0, - optionalInt64: \\"\\", + optionalInt64: 0n, optionalUint32: 0, - optionalUint64: \\"\\", + optionalUint64: 0n, optionalSint32: 0, - optionalSint64: \\"\\", + optionalSint64: 0n, optionalFixed32: 0, - optionalFixed64: \\"\\", + optionalFixed64: 0n, optionalSfixed32: 0, - optionalSfixed64: \\"\\", + optionalSfixed64: 0n, optionalFloat: 0, optionalDouble: 0, optionalBool: false, @@ -38609,15 +39535,15 @@ export const TestAllTypes = { repeatedCord: [], repeatedLazyMessage: [], defaultInt32: 0, - defaultInt64: \\"\\", + defaultInt64: 0n, defaultUint32: 0, - defaultUint64: \\"\\", + defaultUint64: 0n, defaultSint32: 0, - defaultSint64: \\"\\", + defaultSint64: 0n, defaultFixed32: 0, - defaultFixed64: \\"\\", + defaultFixed64: 0n, defaultSfixed32: 0, - defaultSfixed64: \\"\\", + defaultSfixed64: 0n, defaultFloat: 0, defaultDouble: 0, defaultBool: false, @@ -38643,31 +39569,31 @@ export const TestAllTypes = { writer.writeInt32(1, msg.optionalInt32); } if (msg.optionalInt64) { - writer.writeInt64String(2, msg.optionalInt64); + writer.writeInt64String(2, msg.optionalInt64.toString()); } if (msg.optionalUint32) { writer.writeUint32(3, msg.optionalUint32); } if (msg.optionalUint64) { - writer.writeUint64String(4, msg.optionalUint64); + writer.writeUint64String(4, msg.optionalUint64.toString()); } if (msg.optionalSint32) { writer.writeSint32(5, msg.optionalSint32); } if (msg.optionalSint64) { - writer.writeSint64String(6, msg.optionalSint64); + writer.writeSint64String(6, msg.optionalSint64.toString()); } if (msg.optionalFixed32) { writer.writeFixed32(7, msg.optionalFixed32); } if (msg.optionalFixed64) { - writer.writeFixed64String(8, msg.optionalFixed64); + writer.writeFixed64String(8, msg.optionalFixed64.toString()); } if (msg.optionalSfixed32) { writer.writeSfixed32(9, msg.optionalSfixed32); } if (msg.optionalSfixed64) { - writer.writeSfixed64(10, msg.optionalSfixed64); + writer.writeSfixed64(10, msg.optionalSfixed64.toString()); } if (msg.optionalFloat) { writer.writeFloat(11, msg.optionalFloat); @@ -38738,31 +39664,31 @@ export const TestAllTypes = { writer.writeRepeatedInt32(31, msg.repeatedInt32); } if (msg.repeatedInt64?.length) { - writer.writeRepeatedInt64String(32, msg.repeatedInt64); + writer.writeRepeatedInt64String(32, msg.repeatedInt64.toString()); } if (msg.repeatedUint32?.length) { writer.writeRepeatedUint32(33, msg.repeatedUint32); } if (msg.repeatedUint64?.length) { - writer.writeRepeatedUint64String(34, msg.repeatedUint64); + writer.writeRepeatedUint64String(34, msg.repeatedUint64.toString()); } if (msg.repeatedSint32?.length) { writer.writeRepeatedSint32(35, msg.repeatedSint32); } if (msg.repeatedSint64?.length) { - writer.writeRepeatedSint64String(36, msg.repeatedSint64); + writer.writeRepeatedSint64String(36, msg.repeatedSint64.toString()); } if (msg.repeatedFixed32?.length) { writer.writeRepeatedFixed32(37, msg.repeatedFixed32); } if (msg.repeatedFixed64?.length) { - writer.writeRepeatedFixed64String(38, msg.repeatedFixed64); + writer.writeRepeatedFixed64String(38, msg.repeatedFixed64.toString()); } if (msg.repeatedSfixed32?.length) { writer.writeRepeatedSfixed32(39, msg.repeatedSfixed32); } if (msg.repeatedSfixed64?.length) { - writer.writeRepeatedSfixed64(40, msg.repeatedSfixed64); + writer.writeRepeatedSfixed64(40, msg.repeatedSfixed64.toString()); } if (msg.repeatedFloat?.length) { writer.writeRepeatedFloat(41, msg.repeatedFloat); @@ -38826,31 +39752,31 @@ export const TestAllTypes = { writer.writeInt32(61, msg.defaultInt32); } if (msg.defaultInt64) { - writer.writeInt64String(62, msg.defaultInt64); + writer.writeInt64String(62, msg.defaultInt64.toString()); } if (msg.defaultUint32) { writer.writeUint32(63, msg.defaultUint32); } if (msg.defaultUint64) { - writer.writeUint64String(64, msg.defaultUint64); + writer.writeUint64String(64, msg.defaultUint64.toString()); } if (msg.defaultSint32) { writer.writeSint32(65, msg.defaultSint32); } if (msg.defaultSint64) { - writer.writeSint64String(66, msg.defaultSint64); + writer.writeSint64String(66, msg.defaultSint64.toString()); } if (msg.defaultFixed32) { writer.writeFixed32(67, msg.defaultFixed32); } if (msg.defaultFixed64) { - writer.writeFixed64String(68, msg.defaultFixed64); + writer.writeFixed64String(68, msg.defaultFixed64.toString()); } if (msg.defaultSfixed32) { writer.writeSfixed32(69, msg.defaultSfixed32); } if (msg.defaultSfixed64) { - writer.writeSfixed64(70, msg.defaultSfixed64); + writer.writeSfixed64(70, msg.defaultSfixed64.toString()); } if (msg.defaultFloat) { writer.writeFloat(71, msg.defaultFloat); @@ -38909,55 +39835,55 @@ export const TestAllTypes = { ): Record { const json: Record = {}; if (msg.optionalInt32) { - json[\\"optionalInt32\\"] = msg.optionalInt32; + json.optionalInt32 = msg.optionalInt32; } if (msg.optionalInt64) { - json[\\"optionalInt64\\"] = msg.optionalInt64; + json.optionalInt64 = msg.optionalInt64.toString(); } if (msg.optionalUint32) { - json[\\"optionalUint32\\"] = msg.optionalUint32; + json.optionalUint32 = msg.optionalUint32; } if (msg.optionalUint64) { - json[\\"optionalUint64\\"] = msg.optionalUint64; + json.optionalUint64 = msg.optionalUint64.toString(); } if (msg.optionalSint32) { - json[\\"optionalSint32\\"] = msg.optionalSint32; + json.optionalSint32 = msg.optionalSint32; } if (msg.optionalSint64) { - json[\\"optionalSint64\\"] = msg.optionalSint64; + json.optionalSint64 = msg.optionalSint64.toString(); } if (msg.optionalFixed32) { - json[\\"optionalFixed32\\"] = msg.optionalFixed32; + json.optionalFixed32 = msg.optionalFixed32; } if (msg.optionalFixed64) { - json[\\"optionalFixed64\\"] = msg.optionalFixed64; + json.optionalFixed64 = msg.optionalFixed64.toString(); } if (msg.optionalSfixed32) { - json[\\"optionalSfixed32\\"] = msg.optionalSfixed32; + json.optionalSfixed32 = msg.optionalSfixed32; } if (msg.optionalSfixed64) { - json[\\"optionalSfixed64\\"] = msg.optionalSfixed64; + json.optionalSfixed64 = msg.optionalSfixed64.toString(); } if (msg.optionalFloat) { - json[\\"optionalFloat\\"] = msg.optionalFloat; + json.optionalFloat = msg.optionalFloat; } if (msg.optionalDouble) { - json[\\"optionalDouble\\"] = msg.optionalDouble; + json.optionalDouble = msg.optionalDouble; } if (msg.optionalBool) { - json[\\"optionalBool\\"] = msg.optionalBool; + json.optionalBool = msg.optionalBool; } if (msg.optionalString) { - json[\\"optionalString\\"] = msg.optionalString; + json.optionalString = msg.optionalString; } if (msg.optionalBytes) { - json[\\"optionalBytes\\"] = msg.optionalBytes; + json.optionalBytes = msg.optionalBytes; } if (msg.optionalNestedMessage) { const optionalNestedMessage = TestAllTypes.NestedMessage._writeMessageJSON(msg.optionalNestedMessage); if (Object.keys(optionalNestedMessage).length > 0) { - json[\\"optionalNestedMessage\\"] = optionalNestedMessage; + json.optionalNestedMessage = optionalNestedMessage; } } if (msg.optionalForeignMessage) { @@ -38965,7 +39891,7 @@ export const TestAllTypes = { msg.optionalForeignMessage ); if (Object.keys(optionalForeignMessage).length > 0) { - json[\\"optionalForeignMessage\\"] = optionalForeignMessage; + json.optionalForeignMessage = optionalForeignMessage; } } if (msg.optionalImportMessage) { @@ -38973,30 +39899,30 @@ export const TestAllTypes = { msg.optionalImportMessage ); if (Object.keys(optionalImportMessage).length > 0) { - json[\\"optionalImportMessage\\"] = optionalImportMessage; + json.optionalImportMessage = optionalImportMessage; } } if (msg.optionalNestedEnum) { - json[\\"optionalNestedEnum\\"] = msg.optionalNestedEnum; + json.optionalNestedEnum = msg.optionalNestedEnum; } if (msg.optionalForeignEnum) { - json[\\"optionalForeignEnum\\"] = msg.optionalForeignEnum; + json.optionalForeignEnum = msg.optionalForeignEnum; } if (msg.optionalImportEnum) { - json[\\"optionalImportEnum\\"] = msg.optionalImportEnum; + json.optionalImportEnum = msg.optionalImportEnum; } if (msg.optionalStringPiece) { - json[\\"optionalStringPiece\\"] = msg.optionalStringPiece; + json.optionalStringPiece = msg.optionalStringPiece; } if (msg.optionalCord) { - json[\\"optionalCord\\"] = msg.optionalCord; + json.optionalCord = msg.optionalCord; } if (msg.optionalPublicImportMessage) { const optionalPublicImportMessage = PublicImportMessage._writeMessageJSON( msg.optionalPublicImportMessage ); if (Object.keys(optionalPublicImportMessage).length > 0) { - json[\\"optionalPublicImportMessage\\"] = optionalPublicImportMessage; + json.optionalPublicImportMessage = optionalPublicImportMessage; } } if (msg.optionalLazyMessage) { @@ -39004,165 +39930,165 @@ export const TestAllTypes = { msg.optionalLazyMessage ); if (Object.keys(optionalLazyMessage).length > 0) { - json[\\"optionalLazyMessage\\"] = optionalLazyMessage; + json.optionalLazyMessage = optionalLazyMessage; } } if (msg.repeatedInt32?.length) { - json[\\"repeatedInt32\\"] = msg.repeatedInt32; + json.repeatedInt32 = msg.repeatedInt32; } if (msg.repeatedInt64?.length) { - json[\\"repeatedInt64\\"] = msg.repeatedInt64; + json.repeatedInt64 = msg.repeatedInt64.map((x) => x.toString()); } if (msg.repeatedUint32?.length) { - json[\\"repeatedUint32\\"] = msg.repeatedUint32; + json.repeatedUint32 = msg.repeatedUint32; } if (msg.repeatedUint64?.length) { - json[\\"repeatedUint64\\"] = msg.repeatedUint64; + json.repeatedUint64 = msg.repeatedUint64.map((x) => x.toString()); } if (msg.repeatedSint32?.length) { - json[\\"repeatedSint32\\"] = msg.repeatedSint32; + json.repeatedSint32 = msg.repeatedSint32; } if (msg.repeatedSint64?.length) { - json[\\"repeatedSint64\\"] = msg.repeatedSint64; + json.repeatedSint64 = msg.repeatedSint64.map((x) => x.toString()); } if (msg.repeatedFixed32?.length) { - json[\\"repeatedFixed32\\"] = msg.repeatedFixed32; + json.repeatedFixed32 = msg.repeatedFixed32; } if (msg.repeatedFixed64?.length) { - json[\\"repeatedFixed64\\"] = msg.repeatedFixed64; + json.repeatedFixed64 = msg.repeatedFixed64.map((x) => x.toString()); } if (msg.repeatedSfixed32?.length) { - json[\\"repeatedSfixed32\\"] = msg.repeatedSfixed32; + json.repeatedSfixed32 = msg.repeatedSfixed32; } if (msg.repeatedSfixed64?.length) { - json[\\"repeatedSfixed64\\"] = msg.repeatedSfixed64; + json.repeatedSfixed64 = msg.repeatedSfixed64.map((x) => x.toString()); } if (msg.repeatedFloat?.length) { - json[\\"repeatedFloat\\"] = msg.repeatedFloat; + json.repeatedFloat = msg.repeatedFloat; } if (msg.repeatedDouble?.length) { - json[\\"repeatedDouble\\"] = msg.repeatedDouble; + json.repeatedDouble = msg.repeatedDouble; } if (msg.repeatedBool?.length) { - json[\\"repeatedBool\\"] = msg.repeatedBool; + json.repeatedBool = msg.repeatedBool; } if (msg.repeatedString?.length) { - json[\\"repeatedString\\"] = msg.repeatedString; + json.repeatedString = msg.repeatedString; } if (msg.repeatedBytes?.length) { - json[\\"repeatedBytes\\"] = msg.repeatedBytes; + json.repeatedBytes = msg.repeatedBytes; } if (msg.repeatedNestedMessage?.length) { - json[\\"repeatedNestedMessage\\"] = msg.repeatedNestedMessage.map( + json.repeatedNestedMessage = msg.repeatedNestedMessage.map( TestAllTypes.NestedMessage._writeMessageJSON ); } if (msg.repeatedForeignMessage?.length) { - json[\\"repeatedForeignMessage\\"] = msg.repeatedForeignMessage.map( + json.repeatedForeignMessage = msg.repeatedForeignMessage.map( ForeignMessage._writeMessageJSON ); } if (msg.repeatedImportMessage?.length) { - json[\\"repeatedImportMessage\\"] = msg.repeatedImportMessage.map( + json.repeatedImportMessage = msg.repeatedImportMessage.map( ImportMessage._writeMessageJSON ); } if (msg.repeatedNestedEnum?.length) { - json[\\"repeatedNestedEnum\\"] = msg.repeatedNestedEnum; + json.repeatedNestedEnum = msg.repeatedNestedEnum; } if (msg.repeatedForeignEnum?.length) { - json[\\"repeatedForeignEnum\\"] = msg.repeatedForeignEnum; + json.repeatedForeignEnum = msg.repeatedForeignEnum; } if (msg.repeatedImportEnum?.length) { - json[\\"repeatedImportEnum\\"] = msg.repeatedImportEnum; + json.repeatedImportEnum = msg.repeatedImportEnum; } if (msg.repeatedStringPiece?.length) { - json[\\"repeatedStringPiece\\"] = msg.repeatedStringPiece; + json.repeatedStringPiece = msg.repeatedStringPiece; } if (msg.repeatedCord?.length) { - json[\\"repeatedCord\\"] = msg.repeatedCord; + json.repeatedCord = msg.repeatedCord; } if (msg.repeatedLazyMessage?.length) { - json[\\"repeatedLazyMessage\\"] = msg.repeatedLazyMessage.map( + json.repeatedLazyMessage = msg.repeatedLazyMessage.map( TestAllTypes.NestedMessage._writeMessageJSON ); } if (msg.defaultInt32) { - json[\\"defaultInt32\\"] = msg.defaultInt32; + json.defaultInt32 = msg.defaultInt32; } if (msg.defaultInt64) { - json[\\"defaultInt64\\"] = msg.defaultInt64; + json.defaultInt64 = msg.defaultInt64.toString(); } if (msg.defaultUint32) { - json[\\"defaultUint32\\"] = msg.defaultUint32; + json.defaultUint32 = msg.defaultUint32; } if (msg.defaultUint64) { - json[\\"defaultUint64\\"] = msg.defaultUint64; + json.defaultUint64 = msg.defaultUint64.toString(); } if (msg.defaultSint32) { - json[\\"defaultSint32\\"] = msg.defaultSint32; + json.defaultSint32 = msg.defaultSint32; } if (msg.defaultSint64) { - json[\\"defaultSint64\\"] = msg.defaultSint64; + json.defaultSint64 = msg.defaultSint64.toString(); } if (msg.defaultFixed32) { - json[\\"defaultFixed32\\"] = msg.defaultFixed32; + json.defaultFixed32 = msg.defaultFixed32; } if (msg.defaultFixed64) { - json[\\"defaultFixed64\\"] = msg.defaultFixed64; + json.defaultFixed64 = msg.defaultFixed64.toString(); } if (msg.defaultSfixed32) { - json[\\"defaultSfixed32\\"] = msg.defaultSfixed32; + json.defaultSfixed32 = msg.defaultSfixed32; } if (msg.defaultSfixed64) { - json[\\"defaultSfixed64\\"] = msg.defaultSfixed64; + json.defaultSfixed64 = msg.defaultSfixed64.toString(); } if (msg.defaultFloat) { - json[\\"defaultFloat\\"] = msg.defaultFloat; + json.defaultFloat = msg.defaultFloat; } if (msg.defaultDouble) { - json[\\"defaultDouble\\"] = msg.defaultDouble; + json.defaultDouble = msg.defaultDouble; } if (msg.defaultBool) { - json[\\"defaultBool\\"] = msg.defaultBool; + json.defaultBool = msg.defaultBool; } if (msg.defaultString) { - json[\\"defaultString\\"] = msg.defaultString; + json.defaultString = msg.defaultString; } if (msg.defaultBytes) { - json[\\"defaultBytes\\"] = msg.defaultBytes; + json.defaultBytes = msg.defaultBytes; } if (msg.defaultNestedEnum) { - json[\\"defaultNestedEnum\\"] = msg.defaultNestedEnum; + json.defaultNestedEnum = msg.defaultNestedEnum; } if (msg.defaultForeignEnum) { - json[\\"defaultForeignEnum\\"] = msg.defaultForeignEnum; + json.defaultForeignEnum = msg.defaultForeignEnum; } if (msg.defaultImportEnum) { - json[\\"defaultImportEnum\\"] = msg.defaultImportEnum; + json.defaultImportEnum = msg.defaultImportEnum; } if (msg.defaultStringPiece) { - json[\\"defaultStringPiece\\"] = msg.defaultStringPiece; + json.defaultStringPiece = msg.defaultStringPiece; } if (msg.defaultCord) { - json[\\"defaultCord\\"] = msg.defaultCord; + json.defaultCord = msg.defaultCord; } if (msg.oneofUint32 != undefined) { - json[\\"oneofUint32\\"] = msg.oneofUint32; + json.oneofUint32 = msg.oneofUint32; } if (msg.oneofNestedMessage != undefined) { const oneofNestedMessage = TestAllTypes.NestedMessage._writeMessageJSON( msg.oneofNestedMessage ); if (Object.keys(oneofNestedMessage).length > 0) { - json[\\"oneofNestedMessage\\"] = oneofNestedMessage; + json.oneofNestedMessage = oneofNestedMessage; } } if (msg.oneofString != undefined) { - json[\\"oneofString\\"] = msg.oneofString; + json.oneofString = msg.oneofString; } if (msg.oneofBytes != undefined) { - json[\\"oneofBytes\\"] = msg.oneofBytes; + json.oneofBytes = msg.oneofBytes; } return json; }, @@ -39182,7 +40108,7 @@ export const TestAllTypes = { break; } case 2: { - msg.optionalInt64 = reader.readInt64String(); + msg.optionalInt64 = BigInt(reader.readInt64String()); break; } case 3: { @@ -39190,7 +40116,7 @@ export const TestAllTypes = { break; } case 4: { - msg.optionalUint64 = reader.readUint64String(); + msg.optionalUint64 = BigInt(reader.readUint64String()); break; } case 5: { @@ -39198,7 +40124,7 @@ export const TestAllTypes = { break; } case 6: { - msg.optionalSint64 = reader.readSint64(); + msg.optionalSint64 = BigInt(reader.readSint64()); break; } case 7: { @@ -39206,7 +40132,7 @@ export const TestAllTypes = { break; } case 8: { - msg.optionalFixed64 = reader.readFixed64String(); + msg.optionalFixed64 = BigInt(reader.readFixed64String()); break; } case 9: { @@ -39214,7 +40140,7 @@ export const TestAllTypes = { break; } case 10: { - msg.optionalSfixed64 = reader.readSfixed64(); + msg.optionalSfixed64 = BigInt(reader.readSfixed64()); break; } case 11: { @@ -39297,7 +40223,7 @@ export const TestAllTypes = { break; } case 32: { - msg.repeatedInt64.push(reader.readInt64String()); + msg.repeatedInt64 = reader.readInt64String().map(BigInt); break; } case 33: { @@ -39305,7 +40231,7 @@ export const TestAllTypes = { break; } case 34: { - msg.repeatedUint64.push(reader.readUint64String()); + msg.repeatedUint64 = reader.readUint64String().map(BigInt); break; } case 35: { @@ -39313,7 +40239,7 @@ export const TestAllTypes = { break; } case 36: { - msg.repeatedSint64.push(reader.readSint64()); + msg.repeatedSint64 = reader.readSint64().map(BigInt); break; } case 37: { @@ -39321,7 +40247,7 @@ export const TestAllTypes = { break; } case 38: { - msg.repeatedFixed64.push(reader.readFixed64String()); + msg.repeatedFixed64 = reader.readFixed64String().map(BigInt); break; } case 39: { @@ -39329,7 +40255,7 @@ export const TestAllTypes = { break; } case 40: { - msg.repeatedSfixed64.push(reader.readSfixed64()); + msg.repeatedSfixed64 = reader.readSfixed64().map(BigInt); break; } case 41: { @@ -39403,7 +40329,7 @@ export const TestAllTypes = { break; } case 62: { - msg.defaultInt64 = reader.readInt64String(); + msg.defaultInt64 = BigInt(reader.readInt64String()); break; } case 63: { @@ -39411,7 +40337,7 @@ export const TestAllTypes = { break; } case 64: { - msg.defaultUint64 = reader.readUint64String(); + msg.defaultUint64 = BigInt(reader.readUint64String()); break; } case 65: { @@ -39419,7 +40345,7 @@ export const TestAllTypes = { break; } case 66: { - msg.defaultSint64 = reader.readSint64(); + msg.defaultSint64 = BigInt(reader.readSint64()); break; } case 67: { @@ -39427,7 +40353,7 @@ export const TestAllTypes = { break; } case 68: { - msg.defaultFixed64 = reader.readFixed64String(); + msg.defaultFixed64 = BigInt(reader.readFixed64String()); break; } case 69: { @@ -39435,7 +40361,7 @@ export const TestAllTypes = { break; } case 70: { - msg.defaultSfixed64 = reader.readSfixed64(); + msg.defaultSfixed64 = BigInt(reader.readSfixed64()); break; } case 71: { @@ -39510,188 +40436,187 @@ export const TestAllTypes = { * @private */ _readMessageJSON: function (msg: TestAllTypes, json: any): TestAllTypes { - const optionalInt32 = json[\\"optionalInt32\\"] ?? json.optional_int32; + const optionalInt32 = json.optionalInt32 ?? json.optional_int32; if (optionalInt32) { msg.optionalInt32 = optionalInt32; } - const optionalInt64 = json[\\"optionalInt64\\"] ?? json.optional_int64; + const optionalInt64 = json.optionalInt64 ?? json.optional_int64; if (optionalInt64) { - msg.optionalInt64 = optionalInt64; + msg.optionalInt64 = BigInt(optionalInt64); } - const optionalUint32 = json[\\"optionalUint32\\"] ?? json.optional_uint32; + const optionalUint32 = json.optionalUint32 ?? json.optional_uint32; if (optionalUint32) { msg.optionalUint32 = optionalUint32; } - const optionalUint64 = json[\\"optionalUint64\\"] ?? json.optional_uint64; + const optionalUint64 = json.optionalUint64 ?? json.optional_uint64; if (optionalUint64) { - msg.optionalUint64 = optionalUint64; + msg.optionalUint64 = BigInt(optionalUint64); } - const optionalSint32 = json[\\"optionalSint32\\"] ?? json.optional_sint32; + const optionalSint32 = json.optionalSint32 ?? json.optional_sint32; if (optionalSint32) { msg.optionalSint32 = optionalSint32; } - const optionalSint64 = json[\\"optionalSint64\\"] ?? json.optional_sint64; + const optionalSint64 = json.optionalSint64 ?? json.optional_sint64; if (optionalSint64) { - msg.optionalSint64 = optionalSint64; + msg.optionalSint64 = BigInt(optionalSint64); } - const optionalFixed32 = json[\\"optionalFixed32\\"] ?? json.optional_fixed32; + const optionalFixed32 = json.optionalFixed32 ?? json.optional_fixed32; if (optionalFixed32) { msg.optionalFixed32 = optionalFixed32; } - const optionalFixed64 = json[\\"optionalFixed64\\"] ?? json.optional_fixed64; + const optionalFixed64 = json.optionalFixed64 ?? json.optional_fixed64; if (optionalFixed64) { - msg.optionalFixed64 = optionalFixed64; + msg.optionalFixed64 = BigInt(optionalFixed64); } - const optionalSfixed32 = json[\\"optionalSfixed32\\"] ?? json.optional_sfixed32; + const optionalSfixed32 = json.optionalSfixed32 ?? json.optional_sfixed32; if (optionalSfixed32) { msg.optionalSfixed32 = optionalSfixed32; } - const optionalSfixed64 = json[\\"optionalSfixed64\\"] ?? json.optional_sfixed64; + const optionalSfixed64 = json.optionalSfixed64 ?? json.optional_sfixed64; if (optionalSfixed64) { - msg.optionalSfixed64 = optionalSfixed64; + msg.optionalSfixed64 = BigInt(optionalSfixed64); } - const optionalFloat = json[\\"optionalFloat\\"] ?? json.optional_float; + const optionalFloat = json.optionalFloat ?? json.optional_float; if (optionalFloat) { msg.optionalFloat = optionalFloat; } - const optionalDouble = json[\\"optionalDouble\\"] ?? json.optional_double; + const optionalDouble = json.optionalDouble ?? json.optional_double; if (optionalDouble) { msg.optionalDouble = optionalDouble; } - const optionalBool = json[\\"optionalBool\\"] ?? json.optional_bool; + const optionalBool = json.optionalBool ?? json.optional_bool; if (optionalBool) { msg.optionalBool = optionalBool; } - const optionalString = json[\\"optionalString\\"] ?? json.optional_string; + const optionalString = json.optionalString ?? json.optional_string; if (optionalString) { msg.optionalString = optionalString; } - const optionalBytes = json[\\"optionalBytes\\"] ?? json.optional_bytes; + const optionalBytes = json.optionalBytes ?? json.optional_bytes; if (optionalBytes) { msg.optionalBytes = optionalBytes; } const optionalNestedMessage = - json[\\"optionalNestedMessage\\"] ?? json.optional_nested_message; + json.optionalNestedMessage ?? json.optional_nested_message; if (optionalNestedMessage) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, optionalNestedMessage); msg.optionalNestedMessage = m; } const optionalForeignMessage = - json[\\"optionalForeignMessage\\"] ?? json.optional_foreign_message; + json.optionalForeignMessage ?? json.optional_foreign_message; if (optionalForeignMessage) { const m = ForeignMessage.initialize(); ForeignMessage._readMessageJSON(m, optionalForeignMessage); msg.optionalForeignMessage = m; } const optionalImportMessage = - json[\\"optionalImportMessage\\"] ?? json.optional_import_message; + json.optionalImportMessage ?? json.optional_import_message; if (optionalImportMessage) { const m = ImportMessage.initialize(); ImportMessage._readMessageJSON(m, optionalImportMessage); msg.optionalImportMessage = m; } const optionalNestedEnum = - json[\\"optionalNestedEnum\\"] ?? json.optional_nested_enum; + json.optionalNestedEnum ?? json.optional_nested_enum; if (optionalNestedEnum) { msg.optionalNestedEnum = optionalNestedEnum; } const optionalForeignEnum = - json[\\"optionalForeignEnum\\"] ?? json.optional_foreign_enum; + json.optionalForeignEnum ?? json.optional_foreign_enum; if (optionalForeignEnum) { msg.optionalForeignEnum = optionalForeignEnum; } const optionalImportEnum = - json[\\"optionalImportEnum\\"] ?? json.optional_import_enum; + json.optionalImportEnum ?? json.optional_import_enum; if (optionalImportEnum) { msg.optionalImportEnum = optionalImportEnum; } const optionalStringPiece = - json[\\"optionalStringPiece\\"] ?? json.optional_string_piece; + json.optionalStringPiece ?? json.optional_string_piece; if (optionalStringPiece) { msg.optionalStringPiece = optionalStringPiece; } - const optionalCord = json[\\"optionalCord\\"] ?? json.optional_cord; + const optionalCord = json.optionalCord ?? json.optional_cord; if (optionalCord) { msg.optionalCord = optionalCord; } const optionalPublicImportMessage = - json[\\"optionalPublicImportMessage\\"] ?? - json.optional_public_import_message; + json.optionalPublicImportMessage ?? json.optional_public_import_message; if (optionalPublicImportMessage) { const m = PublicImportMessage.initialize(); PublicImportMessage._readMessageJSON(m, optionalPublicImportMessage); msg.optionalPublicImportMessage = m; } const optionalLazyMessage = - json[\\"optionalLazyMessage\\"] ?? json.optional_lazy_message; + json.optionalLazyMessage ?? json.optional_lazy_message; if (optionalLazyMessage) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, optionalLazyMessage); msg.optionalLazyMessage = m; } - const repeatedInt32 = json[\\"repeatedInt32\\"] ?? json.repeated_int32; + const repeatedInt32 = json.repeatedInt32 ?? json.repeated_int32; if (repeatedInt32) { msg.repeatedInt32 = repeatedInt32; } - const repeatedInt64 = json[\\"repeatedInt64\\"] ?? json.repeated_int64; + const repeatedInt64 = json.repeatedInt64 ?? json.repeated_int64; if (repeatedInt64) { - msg.repeatedInt64 = repeatedInt64; + msg.repeatedInt64 = repeatedInt64.map(BigInt); } - const repeatedUint32 = json[\\"repeatedUint32\\"] ?? json.repeated_uint32; + const repeatedUint32 = json.repeatedUint32 ?? json.repeated_uint32; if (repeatedUint32) { msg.repeatedUint32 = repeatedUint32; } - const repeatedUint64 = json[\\"repeatedUint64\\"] ?? json.repeated_uint64; + const repeatedUint64 = json.repeatedUint64 ?? json.repeated_uint64; if (repeatedUint64) { - msg.repeatedUint64 = repeatedUint64; + msg.repeatedUint64 = repeatedUint64.map(BigInt); } - const repeatedSint32 = json[\\"repeatedSint32\\"] ?? json.repeated_sint32; + const repeatedSint32 = json.repeatedSint32 ?? json.repeated_sint32; if (repeatedSint32) { msg.repeatedSint32 = repeatedSint32; } - const repeatedSint64 = json[\\"repeatedSint64\\"] ?? json.repeated_sint64; + const repeatedSint64 = json.repeatedSint64 ?? json.repeated_sint64; if (repeatedSint64) { - msg.repeatedSint64 = repeatedSint64; + msg.repeatedSint64 = repeatedSint64.map(BigInt); } - const repeatedFixed32 = json[\\"repeatedFixed32\\"] ?? json.repeated_fixed32; + const repeatedFixed32 = json.repeatedFixed32 ?? json.repeated_fixed32; if (repeatedFixed32) { msg.repeatedFixed32 = repeatedFixed32; } - const repeatedFixed64 = json[\\"repeatedFixed64\\"] ?? json.repeated_fixed64; + const repeatedFixed64 = json.repeatedFixed64 ?? json.repeated_fixed64; if (repeatedFixed64) { - msg.repeatedFixed64 = repeatedFixed64; + msg.repeatedFixed64 = repeatedFixed64.map(BigInt); } - const repeatedSfixed32 = json[\\"repeatedSfixed32\\"] ?? json.repeated_sfixed32; + const repeatedSfixed32 = json.repeatedSfixed32 ?? json.repeated_sfixed32; if (repeatedSfixed32) { msg.repeatedSfixed32 = repeatedSfixed32; } - const repeatedSfixed64 = json[\\"repeatedSfixed64\\"] ?? json.repeated_sfixed64; + const repeatedSfixed64 = json.repeatedSfixed64 ?? json.repeated_sfixed64; if (repeatedSfixed64) { - msg.repeatedSfixed64 = repeatedSfixed64; + msg.repeatedSfixed64 = repeatedSfixed64.map(BigInt); } - const repeatedFloat = json[\\"repeatedFloat\\"] ?? json.repeated_float; + const repeatedFloat = json.repeatedFloat ?? json.repeated_float; if (repeatedFloat) { msg.repeatedFloat = repeatedFloat; } - const repeatedDouble = json[\\"repeatedDouble\\"] ?? json.repeated_double; + const repeatedDouble = json.repeatedDouble ?? json.repeated_double; if (repeatedDouble) { msg.repeatedDouble = repeatedDouble; } - const repeatedBool = json[\\"repeatedBool\\"] ?? json.repeated_bool; + const repeatedBool = json.repeatedBool ?? json.repeated_bool; if (repeatedBool) { msg.repeatedBool = repeatedBool; } - const repeatedString = json[\\"repeatedString\\"] ?? json.repeated_string; + const repeatedString = json.repeatedString ?? json.repeated_string; if (repeatedString) { msg.repeatedString = repeatedString; } - const repeatedBytes = json[\\"repeatedBytes\\"] ?? json.repeated_bytes; + const repeatedBytes = json.repeatedBytes ?? json.repeated_bytes; if (repeatedBytes) { msg.repeatedBytes = repeatedBytes; } const repeatedNestedMessage = - json[\\"repeatedNestedMessage\\"] ?? json.repeated_nested_message; + json.repeatedNestedMessage ?? json.repeated_nested_message; if (repeatedNestedMessage) { for (const item of repeatedNestedMessage) { const m = TestAllTypes.NestedMessage.initialize(); @@ -39700,7 +40625,7 @@ export const TestAllTypes = { } } const repeatedForeignMessage = - json[\\"repeatedForeignMessage\\"] ?? json.repeated_foreign_message; + json.repeatedForeignMessage ?? json.repeated_foreign_message; if (repeatedForeignMessage) { for (const item of repeatedForeignMessage) { const m = ForeignMessage.initialize(); @@ -39709,7 +40634,7 @@ export const TestAllTypes = { } } const repeatedImportMessage = - json[\\"repeatedImportMessage\\"] ?? json.repeated_import_message; + json.repeatedImportMessage ?? json.repeated_import_message; if (repeatedImportMessage) { for (const item of repeatedImportMessage) { const m = ImportMessage.initialize(); @@ -39718,31 +40643,31 @@ export const TestAllTypes = { } } const repeatedNestedEnum = - json[\\"repeatedNestedEnum\\"] ?? json.repeated_nested_enum; + json.repeatedNestedEnum ?? json.repeated_nested_enum; if (repeatedNestedEnum) { msg.repeatedNestedEnum = repeatedNestedEnum; } const repeatedForeignEnum = - json[\\"repeatedForeignEnum\\"] ?? json.repeated_foreign_enum; + json.repeatedForeignEnum ?? json.repeated_foreign_enum; if (repeatedForeignEnum) { msg.repeatedForeignEnum = repeatedForeignEnum; } const repeatedImportEnum = - json[\\"repeatedImportEnum\\"] ?? json.repeated_import_enum; + json.repeatedImportEnum ?? json.repeated_import_enum; if (repeatedImportEnum) { msg.repeatedImportEnum = repeatedImportEnum; } const repeatedStringPiece = - json[\\"repeatedStringPiece\\"] ?? json.repeated_string_piece; + json.repeatedStringPiece ?? json.repeated_string_piece; if (repeatedStringPiece) { msg.repeatedStringPiece = repeatedStringPiece; } - const repeatedCord = json[\\"repeatedCord\\"] ?? json.repeated_cord; + const repeatedCord = json.repeatedCord ?? json.repeated_cord; if (repeatedCord) { msg.repeatedCord = repeatedCord; } const repeatedLazyMessage = - json[\\"repeatedLazyMessage\\"] ?? json.repeated_lazy_message; + json.repeatedLazyMessage ?? json.repeated_lazy_message; if (repeatedLazyMessage) { for (const item of repeatedLazyMessage) { const m = TestAllTypes.NestedMessage.initialize(); @@ -39750,106 +40675,106 @@ export const TestAllTypes = { msg.repeatedLazyMessage.push(m); } } - const defaultInt32 = json[\\"defaultInt32\\"] ?? json.default_int32; + const defaultInt32 = json.defaultInt32 ?? json.default_int32; if (defaultInt32) { msg.defaultInt32 = defaultInt32; } - const defaultInt64 = json[\\"defaultInt64\\"] ?? json.default_int64; + const defaultInt64 = json.defaultInt64 ?? json.default_int64; if (defaultInt64) { - msg.defaultInt64 = defaultInt64; + msg.defaultInt64 = BigInt(defaultInt64); } - const defaultUint32 = json[\\"defaultUint32\\"] ?? json.default_uint32; + const defaultUint32 = json.defaultUint32 ?? json.default_uint32; if (defaultUint32) { msg.defaultUint32 = defaultUint32; } - const defaultUint64 = json[\\"defaultUint64\\"] ?? json.default_uint64; + const defaultUint64 = json.defaultUint64 ?? json.default_uint64; if (defaultUint64) { - msg.defaultUint64 = defaultUint64; + msg.defaultUint64 = BigInt(defaultUint64); } - const defaultSint32 = json[\\"defaultSint32\\"] ?? json.default_sint32; + const defaultSint32 = json.defaultSint32 ?? json.default_sint32; if (defaultSint32) { msg.defaultSint32 = defaultSint32; } - const defaultSint64 = json[\\"defaultSint64\\"] ?? json.default_sint64; + const defaultSint64 = json.defaultSint64 ?? json.default_sint64; if (defaultSint64) { - msg.defaultSint64 = defaultSint64; + msg.defaultSint64 = BigInt(defaultSint64); } - const defaultFixed32 = json[\\"defaultFixed32\\"] ?? json.default_fixed32; + const defaultFixed32 = json.defaultFixed32 ?? json.default_fixed32; if (defaultFixed32) { msg.defaultFixed32 = defaultFixed32; } - const defaultFixed64 = json[\\"defaultFixed64\\"] ?? json.default_fixed64; + const defaultFixed64 = json.defaultFixed64 ?? json.default_fixed64; if (defaultFixed64) { - msg.defaultFixed64 = defaultFixed64; + msg.defaultFixed64 = BigInt(defaultFixed64); } - const defaultSfixed32 = json[\\"defaultSfixed32\\"] ?? json.default_sfixed32; + const defaultSfixed32 = json.defaultSfixed32 ?? json.default_sfixed32; if (defaultSfixed32) { msg.defaultSfixed32 = defaultSfixed32; } - const defaultSfixed64 = json[\\"defaultSfixed64\\"] ?? json.default_sfixed64; + const defaultSfixed64 = json.defaultSfixed64 ?? json.default_sfixed64; if (defaultSfixed64) { - msg.defaultSfixed64 = defaultSfixed64; + msg.defaultSfixed64 = BigInt(defaultSfixed64); } - const defaultFloat = json[\\"defaultFloat\\"] ?? json.default_float; + const defaultFloat = json.defaultFloat ?? json.default_float; if (defaultFloat) { msg.defaultFloat = defaultFloat; } - const defaultDouble = json[\\"defaultDouble\\"] ?? json.default_double; + const defaultDouble = json.defaultDouble ?? json.default_double; if (defaultDouble) { msg.defaultDouble = defaultDouble; } - const defaultBool = json[\\"defaultBool\\"] ?? json.default_bool; + const defaultBool = json.defaultBool ?? json.default_bool; if (defaultBool) { msg.defaultBool = defaultBool; } - const defaultString = json[\\"defaultString\\"] ?? json.default_string; + const defaultString = json.defaultString ?? json.default_string; if (defaultString) { msg.defaultString = defaultString; } - const defaultBytes = json[\\"defaultBytes\\"] ?? json.default_bytes; + const defaultBytes = json.defaultBytes ?? json.default_bytes; if (defaultBytes) { msg.defaultBytes = defaultBytes; } const defaultNestedEnum = - json[\\"defaultNestedEnum\\"] ?? json.default_nested_enum; + json.defaultNestedEnum ?? json.default_nested_enum; if (defaultNestedEnum) { msg.defaultNestedEnum = defaultNestedEnum; } const defaultForeignEnum = - json[\\"defaultForeignEnum\\"] ?? json.default_foreign_enum; + json.defaultForeignEnum ?? json.default_foreign_enum; if (defaultForeignEnum) { msg.defaultForeignEnum = defaultForeignEnum; } const defaultImportEnum = - json[\\"defaultImportEnum\\"] ?? json.default_import_enum; + json.defaultImportEnum ?? json.default_import_enum; if (defaultImportEnum) { msg.defaultImportEnum = defaultImportEnum; } const defaultStringPiece = - json[\\"defaultStringPiece\\"] ?? json.default_string_piece; + json.defaultStringPiece ?? json.default_string_piece; if (defaultStringPiece) { msg.defaultStringPiece = defaultStringPiece; } - const defaultCord = json[\\"defaultCord\\"] ?? json.default_cord; + const defaultCord = json.defaultCord ?? json.default_cord; if (defaultCord) { msg.defaultCord = defaultCord; } - const oneofUint32 = json[\\"oneofUint32\\"] ?? json.oneof_uint32; + const oneofUint32 = json.oneofUint32 ?? json.oneof_uint32; if (oneofUint32) { msg.oneofUint32 = oneofUint32; } const oneofNestedMessage = - json[\\"oneofNestedMessage\\"] ?? json.oneof_nested_message; + json.oneofNestedMessage ?? json.oneof_nested_message; if (oneofNestedMessage) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, oneofNestedMessage); msg.oneofNestedMessage = m; } - const oneofString = json[\\"oneofString\\"] ?? json.oneof_string; + const oneofString = json.oneofString ?? json.oneof_string; if (oneofString) { msg.oneofString = oneofString; } - const oneofBytes = json[\\"oneofBytes\\"] ?? json.oneof_bytes; + const oneofBytes = json.oneofBytes ?? json.oneof_bytes; if (oneofBytes) { msg.oneofBytes = oneofBytes; } @@ -39932,7 +40857,7 @@ export const TestAllTypes = { ): Record { const json: Record = {}; if (msg.bb) { - json[\\"bb\\"] = msg.bb; + json.bb = msg.bb; } return json; }, @@ -39967,7 +40892,7 @@ export const TestAllTypes = { msg: TestAllTypes.NestedMessage, json: any ): TestAllTypes.NestedMessage { - const bb = json[\\"bb\\"] ?? json.bb; + const bb = json.bb ?? json.bb; if (bb) { msg.bb = bb; } @@ -40049,7 +40974,7 @@ export const TestAllTypes = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -40084,7 +41009,7 @@ export const TestAllTypes = { msg: TestAllTypes.OptionalGroup, json: any ): TestAllTypes.OptionalGroup { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -40166,7 +41091,7 @@ export const TestAllTypes = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -40201,7 +41126,7 @@ export const TestAllTypes = { msg: TestAllTypes.RepeatedGroup, json: any ): TestAllTypes.RepeatedGroup { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -40298,17 +41223,17 @@ export const NestedTestAllTypes = { if (msg.child) { const child = NestedTestAllTypes._writeMessageJSON(msg.child); if (Object.keys(child).length > 0) { - json[\\"child\\"] = child; + json.child = child; } } if (msg.payload) { const payload = TestAllTypes._writeMessageJSON(msg.payload); if (Object.keys(payload).length > 0) { - json[\\"payload\\"] = payload; + json.payload = payload; } } if (msg.repeatedChild?.length) { - json[\\"repeatedChild\\"] = msg.repeatedChild.map( + json.repeatedChild = msg.repeatedChild.map( NestedTestAllTypes._writeMessageJSON ); } @@ -40355,19 +41280,19 @@ export const NestedTestAllTypes = { msg: NestedTestAllTypes, json: any ): NestedTestAllTypes { - const child = json[\\"child\\"] ?? json.child; + const child = json.child ?? json.child; if (child) { const m = NestedTestAllTypes.initialize(); NestedTestAllTypes._readMessageJSON(m, child); msg.child = m; } - const payload = json[\\"payload\\"] ?? json.payload; + const payload = json.payload ?? json.payload; if (payload) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, payload); msg.payload = m; } - const repeatedChild = json[\\"repeatedChild\\"] ?? json.repeated_child; + const repeatedChild = json.repeatedChild ?? json.repeated_child; if (repeatedChild) { for (const item of repeatedChild) { const m = NestedTestAllTypes.initialize(); @@ -40456,10 +41381,10 @@ export const TestDeprecatedFields = { ): Record { const json: Record = {}; if (msg.deprecatedInt32) { - json[\\"deprecatedInt32\\"] = msg.deprecatedInt32; + json.deprecatedInt32 = msg.deprecatedInt32; } if (msg.deprecatedInt32InOneof != undefined) { - json[\\"deprecatedInt32InOneof\\"] = msg.deprecatedInt32InOneof; + json.deprecatedInt32InOneof = msg.deprecatedInt32InOneof; } return json; }, @@ -40498,12 +41423,12 @@ export const TestDeprecatedFields = { msg: TestDeprecatedFields, json: any ): TestDeprecatedFields { - const deprecatedInt32 = json[\\"deprecatedInt32\\"] ?? json.deprecated_int32; + const deprecatedInt32 = json.deprecatedInt32 ?? json.deprecated_int32; if (deprecatedInt32) { msg.deprecatedInt32 = deprecatedInt32; } const deprecatedInt32InOneof = - json[\\"deprecatedInt32InOneof\\"] ?? json.deprecated_int32_in_oneof; + json.deprecatedInt32InOneof ?? json.deprecated_int32_in_oneof; if (deprecatedInt32InOneof) { msg.deprecatedInt32InOneof = deprecatedInt32InOneof; } @@ -40638,10 +41563,10 @@ export const ForeignMessage = { ): Record { const json: Record = {}; if (msg.c) { - json[\\"c\\"] = msg.c; + json.c = msg.c; } if (msg.d) { - json[\\"d\\"] = msg.d; + json.d = msg.d; } return json; }, @@ -40677,11 +41602,11 @@ export const ForeignMessage = { * @private */ _readMessageJSON: function (msg: ForeignMessage, json: any): ForeignMessage { - const c = json[\\"c\\"] ?? json.c; + const c = json.c ?? json.c; if (c) { msg.c = c; } - const d = json[\\"d\\"] ?? json.d; + const d = json.d ?? json.d; if (d) { msg.d = d; } @@ -40873,7 +41798,7 @@ export const OptionalGroup_extension = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -40908,7 +41833,7 @@ export const OptionalGroup_extension = { msg: OptionalGroup_extension, json: any ): OptionalGroup_extension { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -40990,7 +41915,7 @@ export const RepeatedGroup_extension = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -41025,7 +41950,7 @@ export const RepeatedGroup_extension = { msg: RepeatedGroup_extension, json: any ): RepeatedGroup_extension { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -41098,7 +42023,7 @@ export const TestGroup = { ): Record { const json: Record = {}; if (msg.optionalForeignEnum) { - json[\\"optionalForeignEnum\\"] = msg.optionalForeignEnum; + json.optionalForeignEnum = msg.optionalForeignEnum; } return json; }, @@ -41128,7 +42053,7 @@ export const TestGroup = { */ _readMessageJSON: function (msg: TestGroup, json: any): TestGroup { const optionalForeignEnum = - json[\\"optionalForeignEnum\\"] ?? json.optional_foreign_enum; + json.optionalForeignEnum ?? json.optional_foreign_enum; if (optionalForeignEnum) { msg.optionalForeignEnum = optionalForeignEnum; } @@ -41209,7 +42134,7 @@ export const TestGroup = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -41244,7 +42169,7 @@ export const TestGroup = { msg: TestGroup.OptionalGroup, json: any ): TestGroup.OptionalGroup { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -41442,7 +42367,7 @@ export const TestNestedExtension = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -41477,7 +42402,7 @@ export const TestNestedExtension = { msg: TestNestedExtension.OptionalGroup_extension, json: any ): TestNestedExtension.OptionalGroup_extension { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -41572,17 +42497,17 @@ export const TestChildExtension = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } if (msg.b) { - json[\\"b\\"] = msg.b; + json.b = msg.b; } if (msg.optionalExtension) { const optionalExtension = TestAllExtensions._writeMessageJSON( msg.optionalExtension ); if (Object.keys(optionalExtension).length > 0) { - json[\\"optionalExtension\\"] = optionalExtension; + json.optionalExtension = optionalExtension; } } return json; @@ -41629,16 +42554,15 @@ export const TestChildExtension = { msg: TestChildExtension, json: any ): TestChildExtension { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } - const b = json[\\"b\\"] ?? json.b; + const b = json.b ?? json.b; if (b) { msg.b = b; } - const optionalExtension = - json[\\"optionalExtension\\"] ?? json.optional_extension; + const optionalExtension = json.optionalExtension ?? json.optional_extension; if (optionalExtension) { const m = TestAllExtensions.initialize(); TestAllExtensions._readMessageJSON(m, optionalExtension); @@ -41844,103 +42768,103 @@ export const TestRequired = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } if (msg.dummy2) { - json[\\"dummy2\\"] = msg.dummy2; + json.dummy2 = msg.dummy2; } if (msg.b) { - json[\\"b\\"] = msg.b; + json.b = msg.b; } if (msg.dummy4) { - json[\\"dummy4\\"] = msg.dummy4; + json.dummy4 = msg.dummy4; } if (msg.dummy5) { - json[\\"dummy5\\"] = msg.dummy5; + json.dummy5 = msg.dummy5; } if (msg.dummy6) { - json[\\"dummy6\\"] = msg.dummy6; + json.dummy6 = msg.dummy6; } if (msg.dummy7) { - json[\\"dummy7\\"] = msg.dummy7; + json.dummy7 = msg.dummy7; } if (msg.dummy8) { - json[\\"dummy8\\"] = msg.dummy8; + json.dummy8 = msg.dummy8; } if (msg.dummy9) { - json[\\"dummy9\\"] = msg.dummy9; + json.dummy9 = msg.dummy9; } if (msg.dummy10) { - json[\\"dummy10\\"] = msg.dummy10; + json.dummy10 = msg.dummy10; } if (msg.dummy11) { - json[\\"dummy11\\"] = msg.dummy11; + json.dummy11 = msg.dummy11; } if (msg.dummy12) { - json[\\"dummy12\\"] = msg.dummy12; + json.dummy12 = msg.dummy12; } if (msg.dummy13) { - json[\\"dummy13\\"] = msg.dummy13; + json.dummy13 = msg.dummy13; } if (msg.dummy14) { - json[\\"dummy14\\"] = msg.dummy14; + json.dummy14 = msg.dummy14; } if (msg.dummy15) { - json[\\"dummy15\\"] = msg.dummy15; + json.dummy15 = msg.dummy15; } if (msg.dummy16) { - json[\\"dummy16\\"] = msg.dummy16; + json.dummy16 = msg.dummy16; } if (msg.dummy17) { - json[\\"dummy17\\"] = msg.dummy17; + json.dummy17 = msg.dummy17; } if (msg.dummy18) { - json[\\"dummy18\\"] = msg.dummy18; + json.dummy18 = msg.dummy18; } if (msg.dummy19) { - json[\\"dummy19\\"] = msg.dummy19; + json.dummy19 = msg.dummy19; } if (msg.dummy20) { - json[\\"dummy20\\"] = msg.dummy20; + json.dummy20 = msg.dummy20; } if (msg.dummy21) { - json[\\"dummy21\\"] = msg.dummy21; + json.dummy21 = msg.dummy21; } if (msg.dummy22) { - json[\\"dummy22\\"] = msg.dummy22; + json.dummy22 = msg.dummy22; } if (msg.dummy23) { - json[\\"dummy23\\"] = msg.dummy23; + json.dummy23 = msg.dummy23; } if (msg.dummy24) { - json[\\"dummy24\\"] = msg.dummy24; + json.dummy24 = msg.dummy24; } if (msg.dummy25) { - json[\\"dummy25\\"] = msg.dummy25; + json.dummy25 = msg.dummy25; } if (msg.dummy26) { - json[\\"dummy26\\"] = msg.dummy26; + json.dummy26 = msg.dummy26; } if (msg.dummy27) { - json[\\"dummy27\\"] = msg.dummy27; + json.dummy27 = msg.dummy27; } if (msg.dummy28) { - json[\\"dummy28\\"] = msg.dummy28; + json.dummy28 = msg.dummy28; } if (msg.dummy29) { - json[\\"dummy29\\"] = msg.dummy29; + json.dummy29 = msg.dummy29; } if (msg.dummy30) { - json[\\"dummy30\\"] = msg.dummy30; + json.dummy30 = msg.dummy30; } if (msg.dummy31) { - json[\\"dummy31\\"] = msg.dummy31; + json.dummy31 = msg.dummy31; } if (msg.dummy32) { - json[\\"dummy32\\"] = msg.dummy32; + json.dummy32 = msg.dummy32; } if (msg.c) { - json[\\"c\\"] = msg.c; + json.c = msg.c; } return json; }, @@ -42100,135 +43024,135 @@ export const TestRequired = { * @private */ _readMessageJSON: function (msg: TestRequired, json: any): TestRequired { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } - const dummy2 = json[\\"dummy2\\"] ?? json.dummy2; + const dummy2 = json.dummy2 ?? json.dummy2; if (dummy2) { msg.dummy2 = dummy2; } - const b = json[\\"b\\"] ?? json.b; + const b = json.b ?? json.b; if (b) { msg.b = b; } - const dummy4 = json[\\"dummy4\\"] ?? json.dummy4; + const dummy4 = json.dummy4 ?? json.dummy4; if (dummy4) { msg.dummy4 = dummy4; } - const dummy5 = json[\\"dummy5\\"] ?? json.dummy5; + const dummy5 = json.dummy5 ?? json.dummy5; if (dummy5) { msg.dummy5 = dummy5; } - const dummy6 = json[\\"dummy6\\"] ?? json.dummy6; + const dummy6 = json.dummy6 ?? json.dummy6; if (dummy6) { msg.dummy6 = dummy6; } - const dummy7 = json[\\"dummy7\\"] ?? json.dummy7; + const dummy7 = json.dummy7 ?? json.dummy7; if (dummy7) { msg.dummy7 = dummy7; } - const dummy8 = json[\\"dummy8\\"] ?? json.dummy8; + const dummy8 = json.dummy8 ?? json.dummy8; if (dummy8) { msg.dummy8 = dummy8; } - const dummy9 = json[\\"dummy9\\"] ?? json.dummy9; + const dummy9 = json.dummy9 ?? json.dummy9; if (dummy9) { msg.dummy9 = dummy9; } - const dummy10 = json[\\"dummy10\\"] ?? json.dummy10; + const dummy10 = json.dummy10 ?? json.dummy10; if (dummy10) { msg.dummy10 = dummy10; } - const dummy11 = json[\\"dummy11\\"] ?? json.dummy11; + const dummy11 = json.dummy11 ?? json.dummy11; if (dummy11) { msg.dummy11 = dummy11; } - const dummy12 = json[\\"dummy12\\"] ?? json.dummy12; + const dummy12 = json.dummy12 ?? json.dummy12; if (dummy12) { msg.dummy12 = dummy12; } - const dummy13 = json[\\"dummy13\\"] ?? json.dummy13; + const dummy13 = json.dummy13 ?? json.dummy13; if (dummy13) { msg.dummy13 = dummy13; } - const dummy14 = json[\\"dummy14\\"] ?? json.dummy14; + const dummy14 = json.dummy14 ?? json.dummy14; if (dummy14) { msg.dummy14 = dummy14; } - const dummy15 = json[\\"dummy15\\"] ?? json.dummy15; + const dummy15 = json.dummy15 ?? json.dummy15; if (dummy15) { msg.dummy15 = dummy15; } - const dummy16 = json[\\"dummy16\\"] ?? json.dummy16; + const dummy16 = json.dummy16 ?? json.dummy16; if (dummy16) { msg.dummy16 = dummy16; } - const dummy17 = json[\\"dummy17\\"] ?? json.dummy17; + const dummy17 = json.dummy17 ?? json.dummy17; if (dummy17) { msg.dummy17 = dummy17; } - const dummy18 = json[\\"dummy18\\"] ?? json.dummy18; + const dummy18 = json.dummy18 ?? json.dummy18; if (dummy18) { msg.dummy18 = dummy18; } - const dummy19 = json[\\"dummy19\\"] ?? json.dummy19; + const dummy19 = json.dummy19 ?? json.dummy19; if (dummy19) { msg.dummy19 = dummy19; } - const dummy20 = json[\\"dummy20\\"] ?? json.dummy20; + const dummy20 = json.dummy20 ?? json.dummy20; if (dummy20) { msg.dummy20 = dummy20; } - const dummy21 = json[\\"dummy21\\"] ?? json.dummy21; + const dummy21 = json.dummy21 ?? json.dummy21; if (dummy21) { msg.dummy21 = dummy21; } - const dummy22 = json[\\"dummy22\\"] ?? json.dummy22; + const dummy22 = json.dummy22 ?? json.dummy22; if (dummy22) { msg.dummy22 = dummy22; } - const dummy23 = json[\\"dummy23\\"] ?? json.dummy23; + const dummy23 = json.dummy23 ?? json.dummy23; if (dummy23) { msg.dummy23 = dummy23; } - const dummy24 = json[\\"dummy24\\"] ?? json.dummy24; + const dummy24 = json.dummy24 ?? json.dummy24; if (dummy24) { msg.dummy24 = dummy24; } - const dummy25 = json[\\"dummy25\\"] ?? json.dummy25; + const dummy25 = json.dummy25 ?? json.dummy25; if (dummy25) { msg.dummy25 = dummy25; } - const dummy26 = json[\\"dummy26\\"] ?? json.dummy26; + const dummy26 = json.dummy26 ?? json.dummy26; if (dummy26) { msg.dummy26 = dummy26; } - const dummy27 = json[\\"dummy27\\"] ?? json.dummy27; + const dummy27 = json.dummy27 ?? json.dummy27; if (dummy27) { msg.dummy27 = dummy27; } - const dummy28 = json[\\"dummy28\\"] ?? json.dummy28; + const dummy28 = json.dummy28 ?? json.dummy28; if (dummy28) { msg.dummy28 = dummy28; } - const dummy29 = json[\\"dummy29\\"] ?? json.dummy29; + const dummy29 = json.dummy29 ?? json.dummy29; if (dummy29) { msg.dummy29 = dummy29; } - const dummy30 = json[\\"dummy30\\"] ?? json.dummy30; + const dummy30 = json.dummy30 ?? json.dummy30; if (dummy30) { msg.dummy30 = dummy30; } - const dummy31 = json[\\"dummy31\\"] ?? json.dummy31; + const dummy31 = json.dummy31 ?? json.dummy31; if (dummy31) { msg.dummy31 = dummy31; } - const dummy32 = json[\\"dummy32\\"] ?? json.dummy32; + const dummy32 = json.dummy32 ?? json.dummy32; if (dummy32) { msg.dummy32 = dummy32; } - const c = json[\\"c\\"] ?? json.c; + const c = json.c ?? json.c; if (c) { msg.c = c; } @@ -42326,16 +43250,16 @@ export const TestRequiredForeign = { msg.optionalMessage ); if (Object.keys(optionalMessage).length > 0) { - json[\\"optionalMessage\\"] = optionalMessage; + json.optionalMessage = optionalMessage; } } if (msg.repeatedMessage?.length) { - json[\\"repeatedMessage\\"] = msg.repeatedMessage.map( + json.repeatedMessage = msg.repeatedMessage.map( TestRequired._writeMessageJSON ); } if (msg.dummy) { - json[\\"dummy\\"] = msg.dummy; + json.dummy = msg.dummy; } return json; }, @@ -42380,13 +43304,13 @@ export const TestRequiredForeign = { msg: TestRequiredForeign, json: any ): TestRequiredForeign { - const optionalMessage = json[\\"optionalMessage\\"] ?? json.optional_message; + const optionalMessage = json.optionalMessage ?? json.optional_message; if (optionalMessage) { const m = TestRequired.initialize(); TestRequired._readMessageJSON(m, optionalMessage); msg.optionalMessage = m; } - const repeatedMessage = json[\\"repeatedMessage\\"] ?? json.repeated_message; + const repeatedMessage = json.repeatedMessage ?? json.repeated_message; if (repeatedMessage) { for (const item of repeatedMessage) { const m = TestRequired.initialize(); @@ -42394,7 +43318,7 @@ export const TestRequiredForeign = { msg.repeatedMessage.push(m); } } - const dummy = json[\\"dummy\\"] ?? json.dummy; + const dummy = json.dummy ?? json.dummy; if (dummy) { msg.dummy = dummy; } @@ -42492,11 +43416,11 @@ export const TestRequiredMessage = { msg.optionalMessage ); if (Object.keys(optionalMessage).length > 0) { - json[\\"optionalMessage\\"] = optionalMessage; + json.optionalMessage = optionalMessage; } } if (msg.repeatedMessage?.length) { - json[\\"repeatedMessage\\"] = msg.repeatedMessage.map( + json.repeatedMessage = msg.repeatedMessage.map( TestRequired._writeMessageJSON ); } @@ -42505,7 +43429,7 @@ export const TestRequiredMessage = { msg.requiredMessage ); if (Object.keys(requiredMessage).length > 0) { - json[\\"requiredMessage\\"] = requiredMessage; + json.requiredMessage = requiredMessage; } } return json; @@ -42551,13 +43475,13 @@ export const TestRequiredMessage = { msg: TestRequiredMessage, json: any ): TestRequiredMessage { - const optionalMessage = json[\\"optionalMessage\\"] ?? json.optional_message; + const optionalMessage = json.optionalMessage ?? json.optional_message; if (optionalMessage) { const m = TestRequired.initialize(); TestRequired._readMessageJSON(m, optionalMessage); msg.optionalMessage = m; } - const repeatedMessage = json[\\"repeatedMessage\\"] ?? json.repeated_message; + const repeatedMessage = json.repeatedMessage ?? json.repeated_message; if (repeatedMessage) { for (const item of repeatedMessage) { const m = TestRequired.initialize(); @@ -42565,7 +43489,7 @@ export const TestRequiredMessage = { msg.repeatedMessage.push(m); } } - const requiredMessage = json[\\"requiredMessage\\"] ?? json.required_message; + const requiredMessage = json.requiredMessage ?? json.required_message; if (requiredMessage) { const m = TestRequired.initialize(); TestRequired._readMessageJSON(m, requiredMessage); @@ -42653,7 +43577,7 @@ export const TestForeignNested = { msg.foreignNested ); if (Object.keys(foreignNested).length > 0) { - json[\\"foreignNested\\"] = foreignNested; + json.foreignNested = foreignNested; } } return json; @@ -42692,7 +43616,7 @@ export const TestForeignNested = { msg: TestForeignNested, json: any ): TestForeignNested { - const foreignNested = json[\\"foreignNested\\"] ?? json.foreign_nested; + const foreignNested = json.foreignNested ?? json.foreign_nested; if (foreignNested) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, foreignNested); @@ -42938,7 +43862,7 @@ export const TestPickleNestedMessage = { ): Record { const json: Record = {}; if (msg.bb) { - json[\\"bb\\"] = msg.bb; + json.bb = msg.bb; } return json; }, @@ -42973,7 +43897,7 @@ export const TestPickleNestedMessage = { msg: TestPickleNestedMessage.NestedMessage, json: any ): TestPickleNestedMessage.NestedMessage { - const bb = json[\\"bb\\"] ?? json.bb; + const bb = json.bb ?? json.bb; if (bb) { msg.bb = bb; } @@ -43061,7 +43985,7 @@ export const TestPickleNestedMessage = { ): Record { const json: Record = {}; if (msg.cc) { - json[\\"cc\\"] = msg.cc; + json.cc = msg.cc; } return json; }, @@ -43096,7 +44020,7 @@ export const TestPickleNestedMessage = { msg: TestPickleNestedMessage.NestedMessage.NestedNestedMessage, json: any ): TestPickleNestedMessage.NestedMessage.NestedNestedMessage { - const cc = json[\\"cc\\"] ?? json.cc; + const cc = json.cc ?? json.cc; if (cc) { msg.cc = cc; } @@ -43239,10 +44163,10 @@ export const TestReallyLargeTagNumber = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } if (msg.bb) { - json[\\"bb\\"] = msg.bb; + json.bb = msg.bb; } return json; }, @@ -43281,11 +44205,11 @@ export const TestReallyLargeTagNumber = { msg: TestReallyLargeTagNumber, json: any ): TestReallyLargeTagNumber { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } - const bb = json[\\"bb\\"] ?? json.bb; + const bb = json.bb ?? json.bb; if (bb) { msg.bb = bb; } @@ -43373,11 +44297,11 @@ export const TestRecursiveMessage = { if (msg.a) { const a = TestRecursiveMessage._writeMessageJSON(msg.a); if (Object.keys(a).length > 0) { - json[\\"a\\"] = a; + json.a = a; } } if (msg.i) { - json[\\"i\\"] = msg.i; + json.i = msg.i; } return json; }, @@ -43416,13 +44340,13 @@ export const TestRecursiveMessage = { msg: TestRecursiveMessage, json: any ): TestRecursiveMessage { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { const m = TestRecursiveMessage.initialize(); TestRecursiveMessage._readMessageJSON(m, a); msg.a = m; } - const i = json[\\"i\\"] ?? json.i; + const i = json.i ?? json.i; if (i) { msg.i = i; } @@ -43506,7 +44430,7 @@ export const TestMutualRecursionA = { if (msg.bb) { const bb = TestMutualRecursionB._writeMessageJSON(msg.bb); if (Object.keys(bb).length > 0) { - json[\\"bb\\"] = bb; + json.bb = bb; } } return json; @@ -43542,7 +44466,7 @@ export const TestMutualRecursionA = { msg: TestMutualRecursionA, json: any ): TestMutualRecursionA { - const bb = json[\\"bb\\"] ?? json.bb; + const bb = json.bb ?? json.bb; if (bb) { const m = TestMutualRecursionB.initialize(); TestMutualRecursionB._readMessageJSON(m, bb); @@ -43627,7 +44551,7 @@ export const TestMutualRecursionA = { if (msg.b) { const b = TestMutualRecursionB._writeMessageJSON(msg.b); if (Object.keys(b).length > 0) { - json[\\"b\\"] = b; + json.b = b; } } return json; @@ -43663,7 +44587,7 @@ export const TestMutualRecursionA = { msg: TestMutualRecursionA.SubMessage, json: any ): TestMutualRecursionA.SubMessage { - const b = json[\\"b\\"] ?? json.b; + const b = json.b ?? json.b; if (b) { const m = TestMutualRecursionB.initialize(); TestMutualRecursionB._readMessageJSON(m, b); @@ -43759,13 +44683,13 @@ export const TestMutualRecursionA = { msg.subMessage ); if (Object.keys(subMessage).length > 0) { - json[\\"subMessage\\"] = subMessage; + json.subMessage = subMessage; } } if (msg.notInThisScc) { const notInThisScc = TestAllTypes._writeMessageJSON(msg.notInThisScc); if (Object.keys(notInThisScc).length > 0) { - json[\\"notInThisScc\\"] = notInThisScc; + json.notInThisScc = notInThisScc; } } return json; @@ -43808,13 +44732,13 @@ export const TestMutualRecursionA = { msg: TestMutualRecursionA.SubGroup, json: any ): TestMutualRecursionA.SubGroup { - const subMessage = json[\\"subMessage\\"] ?? json.sub_message; + const subMessage = json.subMessage ?? json.sub_message; if (subMessage) { const m = TestMutualRecursionA.SubMessage.initialize(); TestMutualRecursionA.SubMessage._readMessageJSON(m, subMessage); msg.subMessage = m; } - const notInThisScc = json[\\"notInThisScc\\"] ?? json.not_in_this_scc; + const notInThisScc = json.notInThisScc ?? json.not_in_this_scc; if (notInThisScc) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, notInThisScc); @@ -43905,11 +44829,11 @@ export const TestMutualRecursionB = { if (msg.a) { const a = TestMutualRecursionA._writeMessageJSON(msg.a); if (Object.keys(a).length > 0) { - json[\\"a\\"] = a; + json.a = a; } } if (msg.optionalInt32) { - json[\\"optionalInt32\\"] = msg.optionalInt32; + json.optionalInt32 = msg.optionalInt32; } return json; }, @@ -43948,13 +44872,13 @@ export const TestMutualRecursionB = { msg: TestMutualRecursionB, json: any ): TestMutualRecursionB { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { const m = TestMutualRecursionA.initialize(); TestMutualRecursionA._readMessageJSON(m, a); msg.a = m; } - const optionalInt32 = json[\\"optionalInt32\\"] ?? json.optional_int32; + const optionalInt32 = json.optionalInt32 ?? json.optional_int32; if (optionalInt32) { msg.optionalInt32 = optionalInt32; } @@ -44040,7 +44964,7 @@ export const TestIsInitialized = { msg.subMessage ); if (Object.keys(subMessage).length > 0) { - json[\\"subMessage\\"] = subMessage; + json.subMessage = subMessage; } } return json; @@ -44079,7 +45003,7 @@ export const TestIsInitialized = { msg: TestIsInitialized, json: any ): TestIsInitialized { - const subMessage = json[\\"subMessage\\"] ?? json.sub_message; + const subMessage = json.subMessage ?? json.sub_message; if (subMessage) { const m = TestIsInitialized.SubMessage.initialize(); TestIsInitialized.SubMessage._readMessageJSON(m, subMessage); @@ -44220,7 +45144,7 @@ export const TestIsInitialized = { ): Record { const json: Record = {}; if (msg.i) { - json[\\"i\\"] = msg.i; + json.i = msg.i; } return json; }, @@ -44255,7 +45179,7 @@ export const TestIsInitialized = { msg: TestIsInitialized.SubMessage.SubGroup, json: any ): TestIsInitialized.SubMessage.SubGroup { - const i = json[\\"i\\"] ?? json.i; + const i = json.i ?? json.i; if (i) { msg.i = i; } @@ -44339,7 +45263,7 @@ export const TestDupFieldNumber = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -44374,7 +45298,7 @@ export const TestDupFieldNumber = { msg: TestDupFieldNumber, json: any ): TestDupFieldNumber { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -44449,7 +45373,7 @@ export const TestDupFieldNumber = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -44484,7 +45408,7 @@ export const TestDupFieldNumber = { msg: TestDupFieldNumber.Foo, json: any ): TestDupFieldNumber.Foo { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -44560,7 +45484,7 @@ export const TestDupFieldNumber = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -44595,7 +45519,7 @@ export const TestDupFieldNumber = { msg: TestDupFieldNumber.Bar, json: any ): TestDupFieldNumber.Bar { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -44674,7 +45598,7 @@ export const TestEagerMessage = { if (msg.subMessage) { const subMessage = TestAllTypes._writeMessageJSON(msg.subMessage); if (Object.keys(subMessage).length > 0) { - json[\\"subMessage\\"] = subMessage; + json.subMessage = subMessage; } } return json; @@ -44710,7 +45634,7 @@ export const TestEagerMessage = { msg: TestEagerMessage, json: any ): TestEagerMessage { - const subMessage = json[\\"subMessage\\"] ?? json.sub_message; + const subMessage = json.subMessage ?? json.sub_message; if (subMessage) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, subMessage); @@ -44790,7 +45714,7 @@ export const TestLazyMessage = { if (msg.subMessage) { const subMessage = TestAllTypes._writeMessageJSON(msg.subMessage); if (Object.keys(subMessage).length > 0) { - json[\\"subMessage\\"] = subMessage; + json.subMessage = subMessage; } } return json; @@ -44826,7 +45750,7 @@ export const TestLazyMessage = { msg: TestLazyMessage, json: any ): TestLazyMessage { - const subMessage = json[\\"subMessage\\"] ?? json.sub_message; + const subMessage = json.subMessage ?? json.sub_message; if (subMessage) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, subMessage); @@ -44920,7 +45844,7 @@ export const TestNestedMessageHasBits = { msg.optionalNestedMessage ); if (Object.keys(optionalNestedMessage).length > 0) { - json[\\"optionalNestedMessage\\"] = optionalNestedMessage; + json.optionalNestedMessage = optionalNestedMessage; } } return json; @@ -44960,7 +45884,7 @@ export const TestNestedMessageHasBits = { json: any ): TestNestedMessageHasBits { const optionalNestedMessage = - json[\\"optionalNestedMessage\\"] ?? json.optional_nested_message; + json.optionalNestedMessage ?? json.optional_nested_message; if (optionalNestedMessage) { const m = TestNestedMessageHasBits.NestedMessage.initialize(); TestNestedMessageHasBits.NestedMessage._readMessageJSON( @@ -45058,10 +45982,10 @@ export const TestNestedMessageHasBits = { ): Record { const json: Record = {}; if (msg.nestedmessageRepeatedInt32?.length) { - json[\\"nestedmessageRepeatedInt32\\"] = msg.nestedmessageRepeatedInt32; + json.nestedmessageRepeatedInt32 = msg.nestedmessageRepeatedInt32; } if (msg.nestedmessageRepeatedForeignmessage?.length) { - json[\\"nestedmessageRepeatedForeignmessage\\"] = + json.nestedmessageRepeatedForeignmessage = msg.nestedmessageRepeatedForeignmessage.map( ForeignMessage._writeMessageJSON ); @@ -45106,12 +46030,12 @@ export const TestNestedMessageHasBits = { json: any ): TestNestedMessageHasBits.NestedMessage { const nestedmessageRepeatedInt32 = - json[\\"nestedmessageRepeatedInt32\\"] ?? json.nestedmessage_repeated_int32; + json.nestedmessageRepeatedInt32 ?? json.nestedmessage_repeated_int32; if (nestedmessageRepeatedInt32) { msg.nestedmessageRepeatedInt32 = nestedmessageRepeatedInt32; } const nestedmessageRepeatedForeignmessage = - json[\\"nestedmessageRepeatedForeignmessage\\"] ?? + json.nestedmessageRepeatedForeignmessage ?? json.nestedmessage_repeated_foreignmessage; if (nestedmessageRepeatedForeignmessage) { for (const item of nestedmessageRepeatedForeignmessage) { @@ -45247,45 +46171,45 @@ export const TestCamelCaseFieldNames = { ): Record { const json: Record = {}; if (msg.PrimitiveField) { - json[\\"PrimitiveField\\"] = msg.PrimitiveField; + json.PrimitiveField = msg.PrimitiveField; } if (msg.StringField) { - json[\\"StringField\\"] = msg.StringField; + json.StringField = msg.StringField; } if (msg.EnumField) { - json[\\"EnumField\\"] = msg.EnumField; + json.EnumField = msg.EnumField; } if (msg.MessageField) { const MessageField = ForeignMessage._writeMessageJSON(msg.MessageField); if (Object.keys(MessageField).length > 0) { - json[\\"MessageField\\"] = MessageField; + json.MessageField = MessageField; } } if (msg.StringPieceField) { - json[\\"StringPieceField\\"] = msg.StringPieceField; + json.StringPieceField = msg.StringPieceField; } if (msg.CordField) { - json[\\"CordField\\"] = msg.CordField; + json.CordField = msg.CordField; } if (msg.RepeatedPrimitiveField?.length) { - json[\\"RepeatedPrimitiveField\\"] = msg.RepeatedPrimitiveField; + json.RepeatedPrimitiveField = msg.RepeatedPrimitiveField; } if (msg.RepeatedStringField?.length) { - json[\\"RepeatedStringField\\"] = msg.RepeatedStringField; + json.RepeatedStringField = msg.RepeatedStringField; } if (msg.RepeatedEnumField?.length) { - json[\\"RepeatedEnumField\\"] = msg.RepeatedEnumField; + json.RepeatedEnumField = msg.RepeatedEnumField; } if (msg.RepeatedMessageField?.length) { - json[\\"RepeatedMessageField\\"] = msg.RepeatedMessageField.map( + json.RepeatedMessageField = msg.RepeatedMessageField.map( ForeignMessage._writeMessageJSON ); } if (msg.RepeatedStringPieceField?.length) { - json[\\"RepeatedStringPieceField\\"] = msg.RepeatedStringPieceField; + json.RepeatedStringPieceField = msg.RepeatedStringPieceField; } if (msg.RepeatedCordField?.length) { - json[\\"RepeatedCordField\\"] = msg.RepeatedCordField; + json.RepeatedCordField = msg.RepeatedCordField; } return json; }, @@ -45366,49 +46290,48 @@ export const TestCamelCaseFieldNames = { msg: TestCamelCaseFieldNames, json: any ): TestCamelCaseFieldNames { - const PrimitiveField = json[\\"PrimitiveField\\"] ?? json.PrimitiveField; + const PrimitiveField = json.PrimitiveField ?? json.PrimitiveField; if (PrimitiveField) { msg.PrimitiveField = PrimitiveField; } - const StringField = json[\\"StringField\\"] ?? json.StringField; + const StringField = json.StringField ?? json.StringField; if (StringField) { msg.StringField = StringField; } - const EnumField = json[\\"EnumField\\"] ?? json.EnumField; + const EnumField = json.EnumField ?? json.EnumField; if (EnumField) { msg.EnumField = EnumField; } - const MessageField = json[\\"MessageField\\"] ?? json.MessageField; + const MessageField = json.MessageField ?? json.MessageField; if (MessageField) { const m = ForeignMessage.initialize(); ForeignMessage._readMessageJSON(m, MessageField); msg.MessageField = m; } - const StringPieceField = json[\\"StringPieceField\\"] ?? json.StringPieceField; + const StringPieceField = json.StringPieceField ?? json.StringPieceField; if (StringPieceField) { msg.StringPieceField = StringPieceField; } - const CordField = json[\\"CordField\\"] ?? json.CordField; + const CordField = json.CordField ?? json.CordField; if (CordField) { msg.CordField = CordField; } const RepeatedPrimitiveField = - json[\\"RepeatedPrimitiveField\\"] ?? json.RepeatedPrimitiveField; + json.RepeatedPrimitiveField ?? json.RepeatedPrimitiveField; if (RepeatedPrimitiveField) { msg.RepeatedPrimitiveField = RepeatedPrimitiveField; } const RepeatedStringField = - json[\\"RepeatedStringField\\"] ?? json.RepeatedStringField; + json.RepeatedStringField ?? json.RepeatedStringField; if (RepeatedStringField) { msg.RepeatedStringField = RepeatedStringField; } - const RepeatedEnumField = - json[\\"RepeatedEnumField\\"] ?? json.RepeatedEnumField; + const RepeatedEnumField = json.RepeatedEnumField ?? json.RepeatedEnumField; if (RepeatedEnumField) { msg.RepeatedEnumField = RepeatedEnumField; } const RepeatedMessageField = - json[\\"RepeatedMessageField\\"] ?? json.RepeatedMessageField; + json.RepeatedMessageField ?? json.RepeatedMessageField; if (RepeatedMessageField) { for (const item of RepeatedMessageField) { const m = ForeignMessage.initialize(); @@ -45417,12 +46340,11 @@ export const TestCamelCaseFieldNames = { } } const RepeatedStringPieceField = - json[\\"RepeatedStringPieceField\\"] ?? json.RepeatedStringPieceField; + json.RepeatedStringPieceField ?? json.RepeatedStringPieceField; if (RepeatedStringPieceField) { msg.RepeatedStringPieceField = RepeatedStringPieceField; } - const RepeatedCordField = - json[\\"RepeatedCordField\\"] ?? json.RepeatedCordField; + const RepeatedCordField = json.RepeatedCordField ?? json.RepeatedCordField; if (RepeatedCordField) { msg.RepeatedCordField = RepeatedCordField; } @@ -45480,7 +46402,7 @@ export const TestFieldOrderings = { initialize: function (): TestFieldOrderings { return { myString: \\"\\", - myInt: \\"\\", + myInt: 0n, myFloat: 0, optionalNestedMessage: TestFieldOrderings.NestedMessage.initialize(), }; @@ -45497,7 +46419,7 @@ export const TestFieldOrderings = { writer.writeString(11, msg.myString); } if (msg.myInt) { - writer.writeInt64String(1, msg.myInt); + writer.writeInt64String(1, msg.myInt.toString()); } if (msg.myFloat) { writer.writeFloat(101, msg.myFloat); @@ -45520,13 +46442,13 @@ export const TestFieldOrderings = { ): Record { const json: Record = {}; if (msg.myString) { - json[\\"myString\\"] = msg.myString; + json.myString = msg.myString; } if (msg.myInt) { - json[\\"myInt\\"] = msg.myInt; + json.myInt = msg.myInt.toString(); } if (msg.myFloat) { - json[\\"myFloat\\"] = msg.myFloat; + json.myFloat = msg.myFloat; } if (msg.optionalNestedMessage) { const optionalNestedMessage = @@ -45534,7 +46456,7 @@ export const TestFieldOrderings = { msg.optionalNestedMessage ); if (Object.keys(optionalNestedMessage).length > 0) { - json[\\"optionalNestedMessage\\"] = optionalNestedMessage; + json.optionalNestedMessage = optionalNestedMessage; } } return json; @@ -45555,7 +46477,7 @@ export const TestFieldOrderings = { break; } case 1: { - msg.myInt = reader.readInt64String(); + msg.myInt = BigInt(reader.readInt64String()); break; } case 101: { @@ -45585,20 +46507,20 @@ export const TestFieldOrderings = { msg: TestFieldOrderings, json: any ): TestFieldOrderings { - const myString = json[\\"myString\\"] ?? json.my_string; + const myString = json.myString ?? json.my_string; if (myString) { msg.myString = myString; } - const myInt = json[\\"myInt\\"] ?? json.my_int; + const myInt = json.myInt ?? json.my_int; if (myInt) { - msg.myInt = myInt; + msg.myInt = BigInt(myInt); } - const myFloat = json[\\"myFloat\\"] ?? json.my_float; + const myFloat = json.myFloat ?? json.my_float; if (myFloat) { msg.myFloat = myFloat; } const optionalNestedMessage = - json[\\"optionalNestedMessage\\"] ?? json.optional_nested_message; + json.optionalNestedMessage ?? json.optional_nested_message; if (optionalNestedMessage) { const m = TestFieldOrderings.NestedMessage.initialize(); TestFieldOrderings.NestedMessage._readMessageJSON( @@ -45659,7 +46581,7 @@ export const TestFieldOrderings = { */ initialize: function (): TestFieldOrderings.NestedMessage { return { - oo: \\"\\", + oo: 0n, bb: 0, }; }, @@ -45672,7 +46594,7 @@ export const TestFieldOrderings = { writer: BinaryWriter ): BinaryWriter { if (msg.oo) { - writer.writeInt64String(2, msg.oo); + writer.writeInt64String(2, msg.oo.toString()); } if (msg.bb) { writer.writeInt32(1, msg.bb); @@ -45688,10 +46610,10 @@ export const TestFieldOrderings = { ): Record { const json: Record = {}; if (msg.oo) { - json[\\"oo\\"] = msg.oo; + json.oo = msg.oo.toString(); } if (msg.bb) { - json[\\"bb\\"] = msg.bb; + json.bb = msg.bb; } return json; }, @@ -45707,7 +46629,7 @@ export const TestFieldOrderings = { const field = reader.getFieldNumber(); switch (field) { case 2: { - msg.oo = reader.readInt64String(); + msg.oo = BigInt(reader.readInt64String()); break; } case 1: { @@ -45730,11 +46652,11 @@ export const TestFieldOrderings = { msg: TestFieldOrderings.NestedMessage, json: any ): TestFieldOrderings.NestedMessage { - const oo = json[\\"oo\\"] ?? json.oo; + const oo = json.oo ?? json.oo; if (oo) { - msg.oo = oo; + msg.oo = BigInt(oo); } - const bb = json[\\"bb\\"] ?? json.bb; + const bb = json.bb ?? json.bb; if (bb) { msg.bb = bb; } @@ -45817,7 +46739,7 @@ export const TestExtensionOrderings1 = { ): Record { const json: Record = {}; if (msg.myString) { - json[\\"myString\\"] = msg.myString; + json.myString = msg.myString; } return json; }, @@ -45852,7 +46774,7 @@ export const TestExtensionOrderings1 = { msg: TestExtensionOrderings1, json: any ): TestExtensionOrderings1 { - const myString = json[\\"myString\\"] ?? json.my_string; + const myString = json.myString ?? json.my_string; if (myString) { msg.myString = myString; } @@ -45934,7 +46856,7 @@ export const TestExtensionOrderings2 = { ): Record { const json: Record = {}; if (msg.myString) { - json[\\"myString\\"] = msg.myString; + json.myString = msg.myString; } return json; }, @@ -45969,7 +46891,7 @@ export const TestExtensionOrderings2 = { msg: TestExtensionOrderings2, json: any ): TestExtensionOrderings2 { - const myString = json[\\"myString\\"] ?? json.my_string; + const myString = json.myString ?? json.my_string; if (myString) { msg.myString = myString; } @@ -46056,7 +46978,7 @@ export const TestExtensionOrderings2 = { ): Record { const json: Record = {}; if (msg.myString) { - json[\\"myString\\"] = msg.myString; + json.myString = msg.myString; } return json; }, @@ -46091,7 +47013,7 @@ export const TestExtensionOrderings2 = { msg: TestExtensionOrderings2.TestExtensionOrderings3, json: any ): TestExtensionOrderings2.TestExtensionOrderings3 { - const myString = json[\\"myString\\"] ?? json.my_string; + const myString = json.myString ?? json.my_string; if (myString) { msg.myString = myString; } @@ -46151,11 +47073,11 @@ export const TestExtremeDefaultValues = { return { escapedBytes: new Uint8Array(), largeUint32: 0, - largeUint64: \\"\\", + largeUint64: 0n, smallInt32: 0, - smallInt64: \\"\\", + smallInt64: 0n, reallySmallInt32: 0, - reallySmallInt64: \\"\\", + reallySmallInt64: 0n, utf8String: \\"\\", zeroFloat: 0, oneFloat: 0, @@ -46193,19 +47115,19 @@ export const TestExtremeDefaultValues = { writer.writeUint32(2, msg.largeUint32); } if (msg.largeUint64) { - writer.writeUint64String(3, msg.largeUint64); + writer.writeUint64String(3, msg.largeUint64.toString()); } if (msg.smallInt32) { writer.writeInt32(4, msg.smallInt32); } if (msg.smallInt64) { - writer.writeInt64String(5, msg.smallInt64); + writer.writeInt64String(5, msg.smallInt64.toString()); } if (msg.reallySmallInt32) { writer.writeInt32(21, msg.reallySmallInt32); } if (msg.reallySmallInt64) { - writer.writeInt64String(22, msg.reallySmallInt64); + writer.writeInt64String(22, msg.reallySmallInt64.toString()); } if (msg.utf8String) { writer.writeString(6, msg.utf8String); @@ -46278,85 +47200,85 @@ export const TestExtremeDefaultValues = { ): Record { const json: Record = {}; if (msg.escapedBytes) { - json[\\"escapedBytes\\"] = msg.escapedBytes; + json.escapedBytes = msg.escapedBytes; } if (msg.largeUint32) { - json[\\"largeUint32\\"] = msg.largeUint32; + json.largeUint32 = msg.largeUint32; } if (msg.largeUint64) { - json[\\"largeUint64\\"] = msg.largeUint64; + json.largeUint64 = msg.largeUint64.toString(); } if (msg.smallInt32) { - json[\\"smallInt32\\"] = msg.smallInt32; + json.smallInt32 = msg.smallInt32; } if (msg.smallInt64) { - json[\\"smallInt64\\"] = msg.smallInt64; + json.smallInt64 = msg.smallInt64.toString(); } if (msg.reallySmallInt32) { - json[\\"reallySmallInt32\\"] = msg.reallySmallInt32; + json.reallySmallInt32 = msg.reallySmallInt32; } if (msg.reallySmallInt64) { - json[\\"reallySmallInt64\\"] = msg.reallySmallInt64; + json.reallySmallInt64 = msg.reallySmallInt64.toString(); } if (msg.utf8String) { - json[\\"utf8String\\"] = msg.utf8String; + json.utf8String = msg.utf8String; } if (msg.zeroFloat) { - json[\\"zeroFloat\\"] = msg.zeroFloat; + json.zeroFloat = msg.zeroFloat; } if (msg.oneFloat) { - json[\\"oneFloat\\"] = msg.oneFloat; + json.oneFloat = msg.oneFloat; } if (msg.smallFloat) { - json[\\"smallFloat\\"] = msg.smallFloat; + json.smallFloat = msg.smallFloat; } if (msg.negativeOneFloat) { - json[\\"negativeOneFloat\\"] = msg.negativeOneFloat; + json.negativeOneFloat = msg.negativeOneFloat; } if (msg.negativeFloat) { - json[\\"negativeFloat\\"] = msg.negativeFloat; + json.negativeFloat = msg.negativeFloat; } if (msg.largeFloat) { - json[\\"largeFloat\\"] = msg.largeFloat; + json.largeFloat = msg.largeFloat; } if (msg.smallNegativeFloat) { - json[\\"smallNegativeFloat\\"] = msg.smallNegativeFloat; + json.smallNegativeFloat = msg.smallNegativeFloat; } if (msg.infDouble) { - json[\\"infDouble\\"] = msg.infDouble; + json.infDouble = msg.infDouble; } if (msg.negInfDouble) { - json[\\"negInfDouble\\"] = msg.negInfDouble; + json.negInfDouble = msg.negInfDouble; } if (msg.nanDouble) { - json[\\"nanDouble\\"] = msg.nanDouble; + json.nanDouble = msg.nanDouble; } if (msg.infFloat) { - json[\\"infFloat\\"] = msg.infFloat; + json.infFloat = msg.infFloat; } if (msg.negInfFloat) { - json[\\"negInfFloat\\"] = msg.negInfFloat; + json.negInfFloat = msg.negInfFloat; } if (msg.nanFloat) { - json[\\"nanFloat\\"] = msg.nanFloat; + json.nanFloat = msg.nanFloat; } if (msg.cppTrigraph) { - json[\\"cppTrigraph\\"] = msg.cppTrigraph; + json.cppTrigraph = msg.cppTrigraph; } if (msg.stringWithZero) { - json[\\"stringWithZero\\"] = msg.stringWithZero; + json.stringWithZero = msg.stringWithZero; } if (msg.bytesWithZero) { - json[\\"bytesWithZero\\"] = msg.bytesWithZero; + json.bytesWithZero = msg.bytesWithZero; } if (msg.stringPieceWithZero) { - json[\\"stringPieceWithZero\\"] = msg.stringPieceWithZero; + json.stringPieceWithZero = msg.stringPieceWithZero; } if (msg.cordWithZero) { - json[\\"cordWithZero\\"] = msg.cordWithZero; + json.cordWithZero = msg.cordWithZero; } if (msg.replacementString) { - json[\\"replacementString\\"] = msg.replacementString; + json.replacementString = msg.replacementString; } return json; }, @@ -46380,7 +47302,7 @@ export const TestExtremeDefaultValues = { break; } case 3: { - msg.largeUint64 = reader.readUint64String(); + msg.largeUint64 = BigInt(reader.readUint64String()); break; } case 4: { @@ -46388,7 +47310,7 @@ export const TestExtremeDefaultValues = { break; } case 5: { - msg.smallInt64 = reader.readInt64String(); + msg.smallInt64 = BigInt(reader.readInt64String()); break; } case 21: { @@ -46396,7 +47318,7 @@ export const TestExtremeDefaultValues = { break; } case 22: { - msg.reallySmallInt64 = reader.readInt64String(); + msg.reallySmallInt64 = BigInt(reader.readInt64String()); break; } case 6: { @@ -46495,117 +47417,113 @@ export const TestExtremeDefaultValues = { msg: TestExtremeDefaultValues, json: any ): TestExtremeDefaultValues { - const escapedBytes = json[\\"escapedBytes\\"] ?? json.escaped_bytes; + const escapedBytes = json.escapedBytes ?? json.escaped_bytes; if (escapedBytes) { msg.escapedBytes = escapedBytes; } - const largeUint32 = json[\\"largeUint32\\"] ?? json.large_uint32; + const largeUint32 = json.largeUint32 ?? json.large_uint32; if (largeUint32) { msg.largeUint32 = largeUint32; } - const largeUint64 = json[\\"largeUint64\\"] ?? json.large_uint64; + const largeUint64 = json.largeUint64 ?? json.large_uint64; if (largeUint64) { - msg.largeUint64 = largeUint64; + msg.largeUint64 = BigInt(largeUint64); } - const smallInt32 = json[\\"smallInt32\\"] ?? json.small_int32; + const smallInt32 = json.smallInt32 ?? json.small_int32; if (smallInt32) { msg.smallInt32 = smallInt32; } - const smallInt64 = json[\\"smallInt64\\"] ?? json.small_int64; + const smallInt64 = json.smallInt64 ?? json.small_int64; if (smallInt64) { - msg.smallInt64 = smallInt64; + msg.smallInt64 = BigInt(smallInt64); } - const reallySmallInt32 = - json[\\"reallySmallInt32\\"] ?? json.really_small_int32; + const reallySmallInt32 = json.reallySmallInt32 ?? json.really_small_int32; if (reallySmallInt32) { msg.reallySmallInt32 = reallySmallInt32; } - const reallySmallInt64 = - json[\\"reallySmallInt64\\"] ?? json.really_small_int64; + const reallySmallInt64 = json.reallySmallInt64 ?? json.really_small_int64; if (reallySmallInt64) { - msg.reallySmallInt64 = reallySmallInt64; + msg.reallySmallInt64 = BigInt(reallySmallInt64); } - const utf8String = json[\\"utf8String\\"] ?? json.utf8_string; + const utf8String = json.utf8String ?? json.utf8_string; if (utf8String) { msg.utf8String = utf8String; } - const zeroFloat = json[\\"zeroFloat\\"] ?? json.zero_float; + const zeroFloat = json.zeroFloat ?? json.zero_float; if (zeroFloat) { msg.zeroFloat = zeroFloat; } - const oneFloat = json[\\"oneFloat\\"] ?? json.one_float; + const oneFloat = json.oneFloat ?? json.one_float; if (oneFloat) { msg.oneFloat = oneFloat; } - const smallFloat = json[\\"smallFloat\\"] ?? json.small_float; + const smallFloat = json.smallFloat ?? json.small_float; if (smallFloat) { msg.smallFloat = smallFloat; } - const negativeOneFloat = - json[\\"negativeOneFloat\\"] ?? json.negative_one_float; + const negativeOneFloat = json.negativeOneFloat ?? json.negative_one_float; if (negativeOneFloat) { msg.negativeOneFloat = negativeOneFloat; } - const negativeFloat = json[\\"negativeFloat\\"] ?? json.negative_float; + const negativeFloat = json.negativeFloat ?? json.negative_float; if (negativeFloat) { msg.negativeFloat = negativeFloat; } - const largeFloat = json[\\"largeFloat\\"] ?? json.large_float; + const largeFloat = json.largeFloat ?? json.large_float; if (largeFloat) { msg.largeFloat = largeFloat; } const smallNegativeFloat = - json[\\"smallNegativeFloat\\"] ?? json.small_negative_float; + json.smallNegativeFloat ?? json.small_negative_float; if (smallNegativeFloat) { msg.smallNegativeFloat = smallNegativeFloat; } - const infDouble = json[\\"infDouble\\"] ?? json.inf_double; + const infDouble = json.infDouble ?? json.inf_double; if (infDouble) { msg.infDouble = infDouble; } - const negInfDouble = json[\\"negInfDouble\\"] ?? json.neg_inf_double; + const negInfDouble = json.negInfDouble ?? json.neg_inf_double; if (negInfDouble) { msg.negInfDouble = negInfDouble; } - const nanDouble = json[\\"nanDouble\\"] ?? json.nan_double; + const nanDouble = json.nanDouble ?? json.nan_double; if (nanDouble) { msg.nanDouble = nanDouble; } - const infFloat = json[\\"infFloat\\"] ?? json.inf_float; + const infFloat = json.infFloat ?? json.inf_float; if (infFloat) { msg.infFloat = infFloat; } - const negInfFloat = json[\\"negInfFloat\\"] ?? json.neg_inf_float; + const negInfFloat = json.negInfFloat ?? json.neg_inf_float; if (negInfFloat) { msg.negInfFloat = negInfFloat; } - const nanFloat = json[\\"nanFloat\\"] ?? json.nan_float; + const nanFloat = json.nanFloat ?? json.nan_float; if (nanFloat) { msg.nanFloat = nanFloat; } - const cppTrigraph = json[\\"cppTrigraph\\"] ?? json.cpp_trigraph; + const cppTrigraph = json.cppTrigraph ?? json.cpp_trigraph; if (cppTrigraph) { msg.cppTrigraph = cppTrigraph; } - const stringWithZero = json[\\"stringWithZero\\"] ?? json.string_with_zero; + const stringWithZero = json.stringWithZero ?? json.string_with_zero; if (stringWithZero) { msg.stringWithZero = stringWithZero; } - const bytesWithZero = json[\\"bytesWithZero\\"] ?? json.bytes_with_zero; + const bytesWithZero = json.bytesWithZero ?? json.bytes_with_zero; if (bytesWithZero) { msg.bytesWithZero = bytesWithZero; } const stringPieceWithZero = - json[\\"stringPieceWithZero\\"] ?? json.string_piece_with_zero; + json.stringPieceWithZero ?? json.string_piece_with_zero; if (stringPieceWithZero) { msg.stringPieceWithZero = stringPieceWithZero; } - const cordWithZero = json[\\"cordWithZero\\"] ?? json.cord_with_zero; + const cordWithZero = json.cordWithZero ?? json.cord_with_zero; if (cordWithZero) { msg.cordWithZero = cordWithZero; } - const replacementString = - json[\\"replacementString\\"] ?? json.replacement_string; + const replacementString = json.replacementString ?? json.replacement_string; if (replacementString) { msg.replacementString = replacementString; } @@ -46683,7 +47601,7 @@ export const SparseEnumMessage = { ): Record { const json: Record = {}; if (msg.sparseEnum) { - json[\\"sparseEnum\\"] = msg.sparseEnum; + json.sparseEnum = msg.sparseEnum; } return json; }, @@ -46718,7 +47636,7 @@ export const SparseEnumMessage = { msg: SparseEnumMessage, json: any ): SparseEnumMessage { - const sparseEnum = json[\\"sparseEnum\\"] ?? json.sparse_enum; + const sparseEnum = json.sparseEnum ?? json.sparse_enum; if (sparseEnum) { msg.sparseEnum = sparseEnum; } @@ -46791,7 +47709,7 @@ export const OneString = { ): Record { const json: Record = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -46820,7 +47738,7 @@ export const OneString = { * @private */ _readMessageJSON: function (msg: OneString, json: any): OneString { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -46896,7 +47814,7 @@ export const MoreString = { ): Record { const json: Record = {}; if (msg.data?.length) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -46925,7 +47843,7 @@ export const MoreString = { * @private */ _readMessageJSON: function (msg: MoreString, json: any): MoreString { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -46998,7 +47916,7 @@ export const OneBytes = { ): Record { const json: Record = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -47027,7 +47945,7 @@ export const OneBytes = { * @private */ _readMessageJSON: function (msg: OneBytes, json: any): OneBytes { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -47100,7 +48018,7 @@ export const MoreBytes = { ): Record { const json: Record = {}; if (msg.data?.length) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -47129,7 +48047,7 @@ export const MoreBytes = { * @private */ _readMessageJSON: function (msg: MoreBytes, json: any): MoreBytes { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -47205,7 +48123,7 @@ export const Int32Message = { ): Record { const json: Record = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -47237,7 +48155,7 @@ export const Int32Message = { * @private */ _readMessageJSON: function (msg: Int32Message, json: any): Int32Message { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -47313,7 +48231,7 @@ export const Uint32Message = { ): Record { const json: Record = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -47345,7 +48263,7 @@ export const Uint32Message = { * @private */ _readMessageJSON: function (msg: Uint32Message, json: any): Uint32Message { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -47396,7 +48314,7 @@ export const Int64Message = { */ initialize: function (): Int64Message { return { - data: \\"\\", + data: 0n, }; }, @@ -47408,7 +48326,7 @@ export const Int64Message = { writer: BinaryWriter ): BinaryWriter { if (msg.data) { - writer.writeInt64String(1, msg.data); + writer.writeInt64String(1, msg.data.toString()); } return writer; }, @@ -47421,7 +48339,7 @@ export const Int64Message = { ): Record { const json: Record = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data.toString(); } return json; }, @@ -47437,7 +48355,7 @@ export const Int64Message = { const field = reader.getFieldNumber(); switch (field) { case 1: { - msg.data = reader.readInt64String(); + msg.data = BigInt(reader.readInt64String()); break; } default: { @@ -47453,9 +48371,9 @@ export const Int64Message = { * @private */ _readMessageJSON: function (msg: Int64Message, json: any): Int64Message { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { - msg.data = data; + msg.data = BigInt(data); } return msg; }, @@ -47504,7 +48422,7 @@ export const Uint64Message = { */ initialize: function (): Uint64Message { return { - data: \\"\\", + data: 0n, }; }, @@ -47516,7 +48434,7 @@ export const Uint64Message = { writer: BinaryWriter ): BinaryWriter { if (msg.data) { - writer.writeUint64String(1, msg.data); + writer.writeUint64String(1, msg.data.toString()); } return writer; }, @@ -47529,7 +48447,7 @@ export const Uint64Message = { ): Record { const json: Record = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data.toString(); } return json; }, @@ -47545,7 +48463,7 @@ export const Uint64Message = { const field = reader.getFieldNumber(); switch (field) { case 1: { - msg.data = reader.readUint64String(); + msg.data = BigInt(reader.readUint64String()); break; } default: { @@ -47561,9 +48479,9 @@ export const Uint64Message = { * @private */ _readMessageJSON: function (msg: Uint64Message, json: any): Uint64Message { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { - msg.data = data; + msg.data = BigInt(data); } return msg; }, @@ -47637,7 +48555,7 @@ export const BoolMessage = { ): Record { const json: Record = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -47666,7 +48584,7 @@ export const BoolMessage = { * @private */ _readMessageJSON: function (msg: BoolMessage, json: any): BoolMessage { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -47745,15 +48663,15 @@ export const TestOneof = { ): Record { const json: Record = {}; if (msg.fooInt != undefined) { - json[\\"fooInt\\"] = msg.fooInt; + json.fooInt = msg.fooInt; } if (msg.fooString != undefined) { - json[\\"fooString\\"] = msg.fooString; + json.fooString = msg.fooString; } if (msg.fooMessage != undefined) { const fooMessage = TestAllTypes._writeMessageJSON(msg.fooMessage); if (Object.keys(fooMessage).length > 0) { - json[\\"fooMessage\\"] = fooMessage; + json.fooMessage = fooMessage; } } return json; @@ -47791,15 +48709,15 @@ export const TestOneof = { * @private */ _readMessageJSON: function (msg: TestOneof, json: any): TestOneof { - const fooInt = json[\\"fooInt\\"] ?? json.foo_int; + const fooInt = json.fooInt ?? json.foo_int; if (fooInt) { msg.fooInt = fooInt; } - const fooString = json[\\"fooString\\"] ?? json.foo_string; + const fooString = json.fooString ?? json.foo_string; if (fooString) { msg.fooString = fooString; } - const fooMessage = json[\\"fooMessage\\"] ?? json.foo_message; + const fooMessage = json.fooMessage ?? json.foo_message; if (fooMessage) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, fooMessage); @@ -47880,10 +48798,10 @@ export const TestOneof = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } if (msg.b) { - json[\\"b\\"] = msg.b; + json.b = msg.b; } return json; }, @@ -47922,11 +48840,11 @@ export const TestOneof = { msg: TestOneof.FooGroup, json: any ): TestOneof.FooGroup { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } - const b = json[\\"b\\"] ?? json.b; + const b = json.b ?? json.b; if (b) { msg.b = b; } @@ -48019,15 +48937,15 @@ export const TestOneofBackwardsCompatible = { ): Record { const json: Record = {}; if (msg.fooInt) { - json[\\"fooInt\\"] = msg.fooInt; + json.fooInt = msg.fooInt; } if (msg.fooString) { - json[\\"fooString\\"] = msg.fooString; + json.fooString = msg.fooString; } if (msg.fooMessage) { const fooMessage = TestAllTypes._writeMessageJSON(msg.fooMessage); if (Object.keys(fooMessage).length > 0) { - json[\\"fooMessage\\"] = fooMessage; + json.fooMessage = fooMessage; } } return json; @@ -48071,15 +48989,15 @@ export const TestOneofBackwardsCompatible = { msg: TestOneofBackwardsCompatible, json: any ): TestOneofBackwardsCompatible { - const fooInt = json[\\"fooInt\\"] ?? json.foo_int; + const fooInt = json.fooInt ?? json.foo_int; if (fooInt) { msg.fooInt = fooInt; } - const fooString = json[\\"fooString\\"] ?? json.foo_string; + const fooString = json.fooString ?? json.foo_string; if (fooString) { msg.fooString = fooString; } - const fooMessage = json[\\"fooMessage\\"] ?? json.foo_message; + const fooMessage = json.fooMessage ?? json.foo_message; if (fooMessage) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, fooMessage); @@ -48168,10 +49086,10 @@ export const TestOneofBackwardsCompatible = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } if (msg.b) { - json[\\"b\\"] = msg.b; + json.b = msg.b; } return json; }, @@ -48210,11 +49128,11 @@ export const TestOneofBackwardsCompatible = { msg: TestOneofBackwardsCompatible.FooGroup, json: any ): TestOneofBackwardsCompatible.FooGroup { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } - const b = json[\\"b\\"] ?? json.b; + const b = json.b ?? json.b; if (b) { msg.b = b; } @@ -48359,29 +49277,29 @@ export const TestOneof2 = { ): Record { const json: Record = {}; if (msg.fooInt != undefined) { - json[\\"fooInt\\"] = msg.fooInt; + json.fooInt = msg.fooInt; } if (msg.fooString != undefined) { - json[\\"fooString\\"] = msg.fooString; + json.fooString = msg.fooString; } if (msg.fooCord != undefined) { - json[\\"fooCord\\"] = msg.fooCord; + json.fooCord = msg.fooCord; } if (msg.fooStringPiece != undefined) { - json[\\"fooStringPiece\\"] = msg.fooStringPiece; + json.fooStringPiece = msg.fooStringPiece; } if (msg.fooBytes != undefined) { - json[\\"fooBytes\\"] = msg.fooBytes; + json.fooBytes = msg.fooBytes; } if (msg.fooEnum != undefined) { - json[\\"fooEnum\\"] = msg.fooEnum; + json.fooEnum = msg.fooEnum; } if (msg.fooMessage != undefined) { const fooMessage = TestOneof2.NestedMessage._writeMessageJSON( msg.fooMessage ); if (Object.keys(fooMessage).length > 0) { - json[\\"fooMessage\\"] = fooMessage; + json.fooMessage = fooMessage; } } if (msg.fooLazyMessage != undefined) { @@ -48389,45 +49307,44 @@ export const TestOneof2 = { msg.fooLazyMessage ); if (Object.keys(fooLazyMessage).length > 0) { - json[\\"fooLazyMessage\\"] = fooLazyMessage; + json.fooLazyMessage = fooLazyMessage; } } if (msg.barInt != undefined) { - json[\\"barInt\\"] = msg.barInt; + json.barInt = msg.barInt; } if (msg.barString != undefined) { - json[\\"barString\\"] = msg.barString; + json.barString = msg.barString; } if (msg.barCord != undefined) { - json[\\"barCord\\"] = msg.barCord; + json.barCord = msg.barCord; } if (msg.barStringPiece != undefined) { - json[\\"barStringPiece\\"] = msg.barStringPiece; + json.barStringPiece = msg.barStringPiece; } if (msg.barBytes != undefined) { - json[\\"barBytes\\"] = msg.barBytes; + json.barBytes = msg.barBytes; } if (msg.barEnum != undefined) { - json[\\"barEnum\\"] = msg.barEnum; + json.barEnum = msg.barEnum; } if (msg.barStringWithEmptyDefault != undefined) { - json[\\"barStringWithEmptyDefault\\"] = msg.barStringWithEmptyDefault; + json.barStringWithEmptyDefault = msg.barStringWithEmptyDefault; } if (msg.barCordWithEmptyDefault != undefined) { - json[\\"barCordWithEmptyDefault\\"] = msg.barCordWithEmptyDefault; + json.barCordWithEmptyDefault = msg.barCordWithEmptyDefault; } if (msg.barStringPieceWithEmptyDefault != undefined) { - json[\\"barStringPieceWithEmptyDefault\\"] = - msg.barStringPieceWithEmptyDefault; + json.barStringPieceWithEmptyDefault = msg.barStringPieceWithEmptyDefault; } if (msg.barBytesWithEmptyDefault != undefined) { - json[\\"barBytesWithEmptyDefault\\"] = msg.barBytesWithEmptyDefault; + json.barBytesWithEmptyDefault = msg.barBytesWithEmptyDefault; } if (msg.bazInt) { - json[\\"bazInt\\"] = msg.bazInt; + json.bazInt = msg.bazInt; } if (msg.bazString) { - json[\\"bazString\\"] = msg.bazString; + json.bazString = msg.bazString; } return json; }, @@ -48538,92 +49455,92 @@ export const TestOneof2 = { * @private */ _readMessageJSON: function (msg: TestOneof2, json: any): TestOneof2 { - const fooInt = json[\\"fooInt\\"] ?? json.foo_int; + const fooInt = json.fooInt ?? json.foo_int; if (fooInt) { msg.fooInt = fooInt; } - const fooString = json[\\"fooString\\"] ?? json.foo_string; + const fooString = json.fooString ?? json.foo_string; if (fooString) { msg.fooString = fooString; } - const fooCord = json[\\"fooCord\\"] ?? json.foo_cord; + const fooCord = json.fooCord ?? json.foo_cord; if (fooCord) { msg.fooCord = fooCord; } - const fooStringPiece = json[\\"fooStringPiece\\"] ?? json.foo_string_piece; + const fooStringPiece = json.fooStringPiece ?? json.foo_string_piece; if (fooStringPiece) { msg.fooStringPiece = fooStringPiece; } - const fooBytes = json[\\"fooBytes\\"] ?? json.foo_bytes; + const fooBytes = json.fooBytes ?? json.foo_bytes; if (fooBytes) { msg.fooBytes = fooBytes; } - const fooEnum = json[\\"fooEnum\\"] ?? json.foo_enum; + const fooEnum = json.fooEnum ?? json.foo_enum; if (fooEnum) { msg.fooEnum = fooEnum; } - const fooMessage = json[\\"fooMessage\\"] ?? json.foo_message; + const fooMessage = json.fooMessage ?? json.foo_message; if (fooMessage) { const m = TestOneof2.NestedMessage.initialize(); TestOneof2.NestedMessage._readMessageJSON(m, fooMessage); msg.fooMessage = m; } - const fooLazyMessage = json[\\"fooLazyMessage\\"] ?? json.foo_lazy_message; + const fooLazyMessage = json.fooLazyMessage ?? json.foo_lazy_message; if (fooLazyMessage) { const m = TestOneof2.NestedMessage.initialize(); TestOneof2.NestedMessage._readMessageJSON(m, fooLazyMessage); msg.fooLazyMessage = m; } - const barInt = json[\\"barInt\\"] ?? json.bar_int; + const barInt = json.barInt ?? json.bar_int; if (barInt) { msg.barInt = barInt; } - const barString = json[\\"barString\\"] ?? json.bar_string; + const barString = json.barString ?? json.bar_string; if (barString) { msg.barString = barString; } - const barCord = json[\\"barCord\\"] ?? json.bar_cord; + const barCord = json.barCord ?? json.bar_cord; if (barCord) { msg.barCord = barCord; } - const barStringPiece = json[\\"barStringPiece\\"] ?? json.bar_string_piece; + const barStringPiece = json.barStringPiece ?? json.bar_string_piece; if (barStringPiece) { msg.barStringPiece = barStringPiece; } - const barBytes = json[\\"barBytes\\"] ?? json.bar_bytes; + const barBytes = json.barBytes ?? json.bar_bytes; if (barBytes) { msg.barBytes = barBytes; } - const barEnum = json[\\"barEnum\\"] ?? json.bar_enum; + const barEnum = json.barEnum ?? json.bar_enum; if (barEnum) { msg.barEnum = barEnum; } const barStringWithEmptyDefault = - json[\\"barStringWithEmptyDefault\\"] ?? json.bar_string_with_empty_default; + json.barStringWithEmptyDefault ?? json.bar_string_with_empty_default; if (barStringWithEmptyDefault) { msg.barStringWithEmptyDefault = barStringWithEmptyDefault; } const barCordWithEmptyDefault = - json[\\"barCordWithEmptyDefault\\"] ?? json.bar_cord_with_empty_default; + json.barCordWithEmptyDefault ?? json.bar_cord_with_empty_default; if (barCordWithEmptyDefault) { msg.barCordWithEmptyDefault = barCordWithEmptyDefault; } const barStringPieceWithEmptyDefault = - json[\\"barStringPieceWithEmptyDefault\\"] ?? + json.barStringPieceWithEmptyDefault ?? json.bar_string_piece_with_empty_default; if (barStringPieceWithEmptyDefault) { msg.barStringPieceWithEmptyDefault = barStringPieceWithEmptyDefault; } const barBytesWithEmptyDefault = - json[\\"barBytesWithEmptyDefault\\"] ?? json.bar_bytes_with_empty_default; + json.barBytesWithEmptyDefault ?? json.bar_bytes_with_empty_default; if (barBytesWithEmptyDefault) { msg.barBytesWithEmptyDefault = barBytesWithEmptyDefault; } - const bazInt = json[\\"bazInt\\"] ?? json.baz_int; + const bazInt = json.bazInt ?? json.baz_int; if (bazInt) { msg.bazInt = bazInt; } - const bazString = json[\\"bazString\\"] ?? json.baz_string; + const bazString = json.bazString ?? json.baz_string; if (bazString) { msg.bazString = bazString; } @@ -48704,10 +49621,10 @@ export const TestOneof2 = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } if (msg.b) { - json[\\"b\\"] = msg.b; + json.b = msg.b; } return json; }, @@ -48746,11 +49663,11 @@ export const TestOneof2 = { msg: TestOneof2.FooGroup, json: any ): TestOneof2.FooGroup { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } - const b = json[\\"b\\"] ?? json.b; + const b = json.b ?? json.b; if (b) { msg.b = b; } @@ -48807,7 +49724,7 @@ export const TestOneof2 = { */ initialize: function (): TestOneof2.NestedMessage { return { - quxInt: \\"\\", + quxInt: 0n, corgeInt: [], }; }, @@ -48820,7 +49737,7 @@ export const TestOneof2 = { writer: BinaryWriter ): BinaryWriter { if (msg.quxInt) { - writer.writeInt64String(1, msg.quxInt); + writer.writeInt64String(1, msg.quxInt.toString()); } if (msg.corgeInt?.length) { writer.writeRepeatedInt32(2, msg.corgeInt); @@ -48836,10 +49753,10 @@ export const TestOneof2 = { ): Record { const json: Record = {}; if (msg.quxInt) { - json[\\"quxInt\\"] = msg.quxInt; + json.quxInt = msg.quxInt.toString(); } if (msg.corgeInt?.length) { - json[\\"corgeInt\\"] = msg.corgeInt; + json.corgeInt = msg.corgeInt; } return json; }, @@ -48855,7 +49772,7 @@ export const TestOneof2 = { const field = reader.getFieldNumber(); switch (field) { case 1: { - msg.quxInt = reader.readInt64String(); + msg.quxInt = BigInt(reader.readInt64String()); break; } case 2: { @@ -48878,11 +49795,11 @@ export const TestOneof2 = { msg: TestOneof2.NestedMessage, json: any ): TestOneof2.NestedMessage { - const quxInt = json[\\"quxInt\\"] ?? json.qux_int; + const quxInt = json.quxInt ?? json.qux_int; if (quxInt) { - msg.quxInt = quxInt; + msg.quxInt = BigInt(quxInt); } - const corgeInt = json[\\"corgeInt\\"] ?? json.corge_int; + const corgeInt = json.corgeInt ?? json.corge_int; if (corgeInt) { msg.corgeInt = corgeInt; } @@ -48971,17 +49888,17 @@ export const TestRequiredOneof = { ): Record { const json: Record = {}; if (msg.fooInt != undefined) { - json[\\"fooInt\\"] = msg.fooInt; + json.fooInt = msg.fooInt; } if (msg.fooString != undefined) { - json[\\"fooString\\"] = msg.fooString; + json.fooString = msg.fooString; } if (msg.fooMessage != undefined) { const fooMessage = TestRequiredOneof.NestedMessage._writeMessageJSON( msg.fooMessage ); if (Object.keys(fooMessage).length > 0) { - json[\\"fooMessage\\"] = fooMessage; + json.fooMessage = fooMessage; } } return json; @@ -49028,15 +49945,15 @@ export const TestRequiredOneof = { msg: TestRequiredOneof, json: any ): TestRequiredOneof { - const fooInt = json[\\"fooInt\\"] ?? json.foo_int; + const fooInt = json.fooInt ?? json.foo_int; if (fooInt) { msg.fooInt = fooInt; } - const fooString = json[\\"fooString\\"] ?? json.foo_string; + const fooString = json.fooString ?? json.foo_string; if (fooString) { msg.fooString = fooString; } - const fooMessage = json[\\"fooMessage\\"] ?? json.foo_message; + const fooMessage = json.fooMessage ?? json.foo_message; if (fooMessage) { const m = TestRequiredOneof.NestedMessage.initialize(); TestRequiredOneof.NestedMessage._readMessageJSON(m, fooMessage); @@ -49119,7 +50036,7 @@ export const TestRequiredOneof = { ): Record { const json: Record = {}; if (msg.requiredDouble) { - json[\\"requiredDouble\\"] = msg.requiredDouble; + json.requiredDouble = msg.requiredDouble; } return json; }, @@ -49154,7 +50071,7 @@ export const TestRequiredOneof = { msg: TestRequiredOneof.NestedMessage, json: any ): TestRequiredOneof.NestedMessage { - const requiredDouble = json[\\"requiredDouble\\"] ?? json.required_double; + const requiredDouble = json.requiredDouble ?? json.required_double; if (requiredDouble) { msg.requiredDouble = requiredDouble; } @@ -49234,31 +50151,31 @@ export const TestPackedTypes = { writer.writeRepeatedInt32(90, msg.packedInt32); } if (msg.packedInt64?.length) { - writer.writeRepeatedInt64String(91, msg.packedInt64); + writer.writeRepeatedInt64String(91, msg.packedInt64.toString()); } if (msg.packedUint32?.length) { writer.writeRepeatedUint32(92, msg.packedUint32); } if (msg.packedUint64?.length) { - writer.writeRepeatedUint64String(93, msg.packedUint64); + writer.writeRepeatedUint64String(93, msg.packedUint64.toString()); } if (msg.packedSint32?.length) { writer.writeRepeatedSint32(94, msg.packedSint32); } if (msg.packedSint64?.length) { - writer.writeRepeatedSint64String(95, msg.packedSint64); + writer.writeRepeatedSint64String(95, msg.packedSint64.toString()); } if (msg.packedFixed32?.length) { writer.writeRepeatedFixed32(96, msg.packedFixed32); } if (msg.packedFixed64?.length) { - writer.writeRepeatedFixed64String(97, msg.packedFixed64); + writer.writeRepeatedFixed64String(97, msg.packedFixed64.toString()); } if (msg.packedSfixed32?.length) { writer.writeRepeatedSfixed32(98, msg.packedSfixed32); } if (msg.packedSfixed64?.length) { - writer.writeRepeatedSfixed64(99, msg.packedSfixed64); + writer.writeRepeatedSfixed64(99, msg.packedSfixed64.toString()); } if (msg.packedFloat?.length) { writer.writeRepeatedFloat(100, msg.packedFloat); @@ -49283,46 +50200,46 @@ export const TestPackedTypes = { ): Record { const json: Record = {}; if (msg.packedInt32?.length) { - json[\\"packedInt32\\"] = msg.packedInt32; + json.packedInt32 = msg.packedInt32; } if (msg.packedInt64?.length) { - json[\\"packedInt64\\"] = msg.packedInt64; + json.packedInt64 = msg.packedInt64.map((x) => x.toString()); } if (msg.packedUint32?.length) { - json[\\"packedUint32\\"] = msg.packedUint32; + json.packedUint32 = msg.packedUint32; } if (msg.packedUint64?.length) { - json[\\"packedUint64\\"] = msg.packedUint64; + json.packedUint64 = msg.packedUint64.map((x) => x.toString()); } if (msg.packedSint32?.length) { - json[\\"packedSint32\\"] = msg.packedSint32; + json.packedSint32 = msg.packedSint32; } if (msg.packedSint64?.length) { - json[\\"packedSint64\\"] = msg.packedSint64; + json.packedSint64 = msg.packedSint64.map((x) => x.toString()); } if (msg.packedFixed32?.length) { - json[\\"packedFixed32\\"] = msg.packedFixed32; + json.packedFixed32 = msg.packedFixed32; } if (msg.packedFixed64?.length) { - json[\\"packedFixed64\\"] = msg.packedFixed64; + json.packedFixed64 = msg.packedFixed64.map((x) => x.toString()); } if (msg.packedSfixed32?.length) { - json[\\"packedSfixed32\\"] = msg.packedSfixed32; + json.packedSfixed32 = msg.packedSfixed32; } if (msg.packedSfixed64?.length) { - json[\\"packedSfixed64\\"] = msg.packedSfixed64; + json.packedSfixed64 = msg.packedSfixed64.map((x) => x.toString()); } if (msg.packedFloat?.length) { - json[\\"packedFloat\\"] = msg.packedFloat; + json.packedFloat = msg.packedFloat; } if (msg.packedDouble?.length) { - json[\\"packedDouble\\"] = msg.packedDouble; + json.packedDouble = msg.packedDouble; } if (msg.packedBool?.length) { - json[\\"packedBool\\"] = msg.packedBool; + json.packedBool = msg.packedBool; } if (msg.packedEnum?.length) { - json[\\"packedEnum\\"] = msg.packedEnum; + json.packedEnum = msg.packedEnum; } return json; }, @@ -49342,7 +50259,7 @@ export const TestPackedTypes = { break; } case 91: { - msg.packedInt64.push(reader.readInt64String()); + msg.packedInt64 = reader.readInt64String().map(BigInt); break; } case 92: { @@ -49350,7 +50267,7 @@ export const TestPackedTypes = { break; } case 93: { - msg.packedUint64.push(reader.readUint64String()); + msg.packedUint64 = reader.readUint64String().map(BigInt); break; } case 94: { @@ -49358,7 +50275,7 @@ export const TestPackedTypes = { break; } case 95: { - msg.packedSint64.push(reader.readSint64()); + msg.packedSint64 = reader.readSint64().map(BigInt); break; } case 96: { @@ -49366,7 +50283,7 @@ export const TestPackedTypes = { break; } case 97: { - msg.packedFixed64.push(reader.readFixed64String()); + msg.packedFixed64 = reader.readFixed64String().map(BigInt); break; } case 98: { @@ -49374,7 +50291,7 @@ export const TestPackedTypes = { break; } case 99: { - msg.packedSfixed64.push(reader.readSfixed64()); + msg.packedSfixed64 = reader.readSfixed64().map(BigInt); break; } case 100: { @@ -49409,59 +50326,59 @@ export const TestPackedTypes = { msg: TestPackedTypes, json: any ): TestPackedTypes { - const packedInt32 = json[\\"packedInt32\\"] ?? json.packed_int32; + const packedInt32 = json.packedInt32 ?? json.packed_int32; if (packedInt32) { msg.packedInt32 = packedInt32; } - const packedInt64 = json[\\"packedInt64\\"] ?? json.packed_int64; + const packedInt64 = json.packedInt64 ?? json.packed_int64; if (packedInt64) { - msg.packedInt64 = packedInt64; + msg.packedInt64 = packedInt64.map(BigInt); } - const packedUint32 = json[\\"packedUint32\\"] ?? json.packed_uint32; + const packedUint32 = json.packedUint32 ?? json.packed_uint32; if (packedUint32) { msg.packedUint32 = packedUint32; } - const packedUint64 = json[\\"packedUint64\\"] ?? json.packed_uint64; + const packedUint64 = json.packedUint64 ?? json.packed_uint64; if (packedUint64) { - msg.packedUint64 = packedUint64; + msg.packedUint64 = packedUint64.map(BigInt); } - const packedSint32 = json[\\"packedSint32\\"] ?? json.packed_sint32; + const packedSint32 = json.packedSint32 ?? json.packed_sint32; if (packedSint32) { msg.packedSint32 = packedSint32; } - const packedSint64 = json[\\"packedSint64\\"] ?? json.packed_sint64; + const packedSint64 = json.packedSint64 ?? json.packed_sint64; if (packedSint64) { - msg.packedSint64 = packedSint64; + msg.packedSint64 = packedSint64.map(BigInt); } - const packedFixed32 = json[\\"packedFixed32\\"] ?? json.packed_fixed32; + const packedFixed32 = json.packedFixed32 ?? json.packed_fixed32; if (packedFixed32) { msg.packedFixed32 = packedFixed32; } - const packedFixed64 = json[\\"packedFixed64\\"] ?? json.packed_fixed64; + const packedFixed64 = json.packedFixed64 ?? json.packed_fixed64; if (packedFixed64) { - msg.packedFixed64 = packedFixed64; + msg.packedFixed64 = packedFixed64.map(BigInt); } - const packedSfixed32 = json[\\"packedSfixed32\\"] ?? json.packed_sfixed32; + const packedSfixed32 = json.packedSfixed32 ?? json.packed_sfixed32; if (packedSfixed32) { msg.packedSfixed32 = packedSfixed32; } - const packedSfixed64 = json[\\"packedSfixed64\\"] ?? json.packed_sfixed64; + const packedSfixed64 = json.packedSfixed64 ?? json.packed_sfixed64; if (packedSfixed64) { - msg.packedSfixed64 = packedSfixed64; + msg.packedSfixed64 = packedSfixed64.map(BigInt); } - const packedFloat = json[\\"packedFloat\\"] ?? json.packed_float; + const packedFloat = json.packedFloat ?? json.packed_float; if (packedFloat) { msg.packedFloat = packedFloat; } - const packedDouble = json[\\"packedDouble\\"] ?? json.packed_double; + const packedDouble = json.packedDouble ?? json.packed_double; if (packedDouble) { msg.packedDouble = packedDouble; } - const packedBool = json[\\"packedBool\\"] ?? json.packed_bool; + const packedBool = json.packedBool ?? json.packed_bool; if (packedBool) { msg.packedBool = packedBool; } - const packedEnum = json[\\"packedEnum\\"] ?? json.packed_enum; + const packedEnum = json.packedEnum ?? json.packed_enum; if (packedEnum) { msg.packedEnum = packedEnum; } @@ -49542,31 +50459,31 @@ export const TestUnpackedTypes = { writer.writeRepeatedInt32(90, msg.unpackedInt32); } if (msg.unpackedInt64?.length) { - writer.writeRepeatedInt64String(91, msg.unpackedInt64); + writer.writeRepeatedInt64String(91, msg.unpackedInt64.toString()); } if (msg.unpackedUint32?.length) { writer.writeRepeatedUint32(92, msg.unpackedUint32); } if (msg.unpackedUint64?.length) { - writer.writeRepeatedUint64String(93, msg.unpackedUint64); + writer.writeRepeatedUint64String(93, msg.unpackedUint64.toString()); } if (msg.unpackedSint32?.length) { writer.writeRepeatedSint32(94, msg.unpackedSint32); } if (msg.unpackedSint64?.length) { - writer.writeRepeatedSint64String(95, msg.unpackedSint64); + writer.writeRepeatedSint64String(95, msg.unpackedSint64.toString()); } if (msg.unpackedFixed32?.length) { writer.writeRepeatedFixed32(96, msg.unpackedFixed32); } if (msg.unpackedFixed64?.length) { - writer.writeRepeatedFixed64String(97, msg.unpackedFixed64); + writer.writeRepeatedFixed64String(97, msg.unpackedFixed64.toString()); } if (msg.unpackedSfixed32?.length) { writer.writeRepeatedSfixed32(98, msg.unpackedSfixed32); } if (msg.unpackedSfixed64?.length) { - writer.writeRepeatedSfixed64(99, msg.unpackedSfixed64); + writer.writeRepeatedSfixed64(99, msg.unpackedSfixed64.toString()); } if (msg.unpackedFloat?.length) { writer.writeRepeatedFloat(100, msg.unpackedFloat); @@ -49591,46 +50508,46 @@ export const TestUnpackedTypes = { ): Record { const json: Record = {}; if (msg.unpackedInt32?.length) { - json[\\"unpackedInt32\\"] = msg.unpackedInt32; + json.unpackedInt32 = msg.unpackedInt32; } if (msg.unpackedInt64?.length) { - json[\\"unpackedInt64\\"] = msg.unpackedInt64; + json.unpackedInt64 = msg.unpackedInt64.map((x) => x.toString()); } if (msg.unpackedUint32?.length) { - json[\\"unpackedUint32\\"] = msg.unpackedUint32; + json.unpackedUint32 = msg.unpackedUint32; } if (msg.unpackedUint64?.length) { - json[\\"unpackedUint64\\"] = msg.unpackedUint64; + json.unpackedUint64 = msg.unpackedUint64.map((x) => x.toString()); } if (msg.unpackedSint32?.length) { - json[\\"unpackedSint32\\"] = msg.unpackedSint32; + json.unpackedSint32 = msg.unpackedSint32; } if (msg.unpackedSint64?.length) { - json[\\"unpackedSint64\\"] = msg.unpackedSint64; + json.unpackedSint64 = msg.unpackedSint64.map((x) => x.toString()); } if (msg.unpackedFixed32?.length) { - json[\\"unpackedFixed32\\"] = msg.unpackedFixed32; + json.unpackedFixed32 = msg.unpackedFixed32; } if (msg.unpackedFixed64?.length) { - json[\\"unpackedFixed64\\"] = msg.unpackedFixed64; + json.unpackedFixed64 = msg.unpackedFixed64.map((x) => x.toString()); } if (msg.unpackedSfixed32?.length) { - json[\\"unpackedSfixed32\\"] = msg.unpackedSfixed32; + json.unpackedSfixed32 = msg.unpackedSfixed32; } if (msg.unpackedSfixed64?.length) { - json[\\"unpackedSfixed64\\"] = msg.unpackedSfixed64; + json.unpackedSfixed64 = msg.unpackedSfixed64.map((x) => x.toString()); } if (msg.unpackedFloat?.length) { - json[\\"unpackedFloat\\"] = msg.unpackedFloat; + json.unpackedFloat = msg.unpackedFloat; } if (msg.unpackedDouble?.length) { - json[\\"unpackedDouble\\"] = msg.unpackedDouble; + json.unpackedDouble = msg.unpackedDouble; } if (msg.unpackedBool?.length) { - json[\\"unpackedBool\\"] = msg.unpackedBool; + json.unpackedBool = msg.unpackedBool; } if (msg.unpackedEnum?.length) { - json[\\"unpackedEnum\\"] = msg.unpackedEnum; + json.unpackedEnum = msg.unpackedEnum; } return json; }, @@ -49650,7 +50567,7 @@ export const TestUnpackedTypes = { break; } case 91: { - msg.unpackedInt64.push(reader.readInt64String()); + msg.unpackedInt64 = reader.readInt64String().map(BigInt); break; } case 92: { @@ -49658,7 +50575,7 @@ export const TestUnpackedTypes = { break; } case 93: { - msg.unpackedUint64.push(reader.readUint64String()); + msg.unpackedUint64 = reader.readUint64String().map(BigInt); break; } case 94: { @@ -49666,7 +50583,7 @@ export const TestUnpackedTypes = { break; } case 95: { - msg.unpackedSint64.push(reader.readSint64()); + msg.unpackedSint64 = reader.readSint64().map(BigInt); break; } case 96: { @@ -49674,7 +50591,7 @@ export const TestUnpackedTypes = { break; } case 97: { - msg.unpackedFixed64.push(reader.readFixed64String()); + msg.unpackedFixed64 = reader.readFixed64String().map(BigInt); break; } case 98: { @@ -49682,7 +50599,7 @@ export const TestUnpackedTypes = { break; } case 99: { - msg.unpackedSfixed64.push(reader.readSfixed64()); + msg.unpackedSfixed64 = reader.readSfixed64().map(BigInt); break; } case 100: { @@ -49717,59 +50634,59 @@ export const TestUnpackedTypes = { msg: TestUnpackedTypes, json: any ): TestUnpackedTypes { - const unpackedInt32 = json[\\"unpackedInt32\\"] ?? json.unpacked_int32; + const unpackedInt32 = json.unpackedInt32 ?? json.unpacked_int32; if (unpackedInt32) { msg.unpackedInt32 = unpackedInt32; } - const unpackedInt64 = json[\\"unpackedInt64\\"] ?? json.unpacked_int64; + const unpackedInt64 = json.unpackedInt64 ?? json.unpacked_int64; if (unpackedInt64) { - msg.unpackedInt64 = unpackedInt64; + msg.unpackedInt64 = unpackedInt64.map(BigInt); } - const unpackedUint32 = json[\\"unpackedUint32\\"] ?? json.unpacked_uint32; + const unpackedUint32 = json.unpackedUint32 ?? json.unpacked_uint32; if (unpackedUint32) { msg.unpackedUint32 = unpackedUint32; } - const unpackedUint64 = json[\\"unpackedUint64\\"] ?? json.unpacked_uint64; + const unpackedUint64 = json.unpackedUint64 ?? json.unpacked_uint64; if (unpackedUint64) { - msg.unpackedUint64 = unpackedUint64; + msg.unpackedUint64 = unpackedUint64.map(BigInt); } - const unpackedSint32 = json[\\"unpackedSint32\\"] ?? json.unpacked_sint32; + const unpackedSint32 = json.unpackedSint32 ?? json.unpacked_sint32; if (unpackedSint32) { msg.unpackedSint32 = unpackedSint32; } - const unpackedSint64 = json[\\"unpackedSint64\\"] ?? json.unpacked_sint64; + const unpackedSint64 = json.unpackedSint64 ?? json.unpacked_sint64; if (unpackedSint64) { - msg.unpackedSint64 = unpackedSint64; + msg.unpackedSint64 = unpackedSint64.map(BigInt); } - const unpackedFixed32 = json[\\"unpackedFixed32\\"] ?? json.unpacked_fixed32; + const unpackedFixed32 = json.unpackedFixed32 ?? json.unpacked_fixed32; if (unpackedFixed32) { msg.unpackedFixed32 = unpackedFixed32; } - const unpackedFixed64 = json[\\"unpackedFixed64\\"] ?? json.unpacked_fixed64; + const unpackedFixed64 = json.unpackedFixed64 ?? json.unpacked_fixed64; if (unpackedFixed64) { - msg.unpackedFixed64 = unpackedFixed64; + msg.unpackedFixed64 = unpackedFixed64.map(BigInt); } - const unpackedSfixed32 = json[\\"unpackedSfixed32\\"] ?? json.unpacked_sfixed32; + const unpackedSfixed32 = json.unpackedSfixed32 ?? json.unpacked_sfixed32; if (unpackedSfixed32) { msg.unpackedSfixed32 = unpackedSfixed32; } - const unpackedSfixed64 = json[\\"unpackedSfixed64\\"] ?? json.unpacked_sfixed64; + const unpackedSfixed64 = json.unpackedSfixed64 ?? json.unpacked_sfixed64; if (unpackedSfixed64) { - msg.unpackedSfixed64 = unpackedSfixed64; + msg.unpackedSfixed64 = unpackedSfixed64.map(BigInt); } - const unpackedFloat = json[\\"unpackedFloat\\"] ?? json.unpacked_float; + const unpackedFloat = json.unpackedFloat ?? json.unpacked_float; if (unpackedFloat) { msg.unpackedFloat = unpackedFloat; } - const unpackedDouble = json[\\"unpackedDouble\\"] ?? json.unpacked_double; + const unpackedDouble = json.unpackedDouble ?? json.unpacked_double; if (unpackedDouble) { msg.unpackedDouble = unpackedDouble; } - const unpackedBool = json[\\"unpackedBool\\"] ?? json.unpacked_bool; + const unpackedBool = json.unpackedBool ?? json.unpacked_bool; if (unpackedBool) { msg.unpackedBool = unpackedBool; } - const unpackedEnum = json[\\"unpackedEnum\\"] ?? json.unpacked_enum; + const unpackedEnum = json.unpackedEnum ?? json.unpacked_enum; if (unpackedEnum) { msg.unpackedEnum = unpackedEnum; } @@ -49994,20 +50911,20 @@ export const TestDynamicExtensions = { ): Record { const json: Record = {}; if (msg.scalarExtension) { - json[\\"scalarExtension\\"] = msg.scalarExtension; + json.scalarExtension = msg.scalarExtension; } if (msg.enumExtension) { - json[\\"enumExtension\\"] = msg.enumExtension; + json.enumExtension = msg.enumExtension; } if (msg.dynamicEnumExtension) { - json[\\"dynamicEnumExtension\\"] = msg.dynamicEnumExtension; + json.dynamicEnumExtension = msg.dynamicEnumExtension; } if (msg.messageExtension) { const messageExtension = ForeignMessage._writeMessageJSON( msg.messageExtension ); if (Object.keys(messageExtension).length > 0) { - json[\\"messageExtension\\"] = messageExtension; + json.messageExtension = messageExtension; } } if (msg.dynamicMessageExtension) { @@ -50016,14 +50933,14 @@ export const TestDynamicExtensions = { msg.dynamicMessageExtension ); if (Object.keys(dynamicMessageExtension).length > 0) { - json[\\"dynamicMessageExtension\\"] = dynamicMessageExtension; + json.dynamicMessageExtension = dynamicMessageExtension; } } if (msg.repeatedExtension?.length) { - json[\\"repeatedExtension\\"] = msg.repeatedExtension; + json.repeatedExtension = msg.repeatedExtension; } if (msg.packedExtension?.length) { - json[\\"packedExtension\\"] = msg.packedExtension; + json.packedExtension = msg.packedExtension; } return json; }, @@ -50086,27 +51003,27 @@ export const TestDynamicExtensions = { msg: TestDynamicExtensions, json: any ): TestDynamicExtensions { - const scalarExtension = json[\\"scalarExtension\\"] ?? json.scalar_extension; + const scalarExtension = json.scalarExtension ?? json.scalar_extension; if (scalarExtension) { msg.scalarExtension = scalarExtension; } - const enumExtension = json[\\"enumExtension\\"] ?? json.enum_extension; + const enumExtension = json.enumExtension ?? json.enum_extension; if (enumExtension) { msg.enumExtension = enumExtension; } const dynamicEnumExtension = - json[\\"dynamicEnumExtension\\"] ?? json.dynamic_enum_extension; + json.dynamicEnumExtension ?? json.dynamic_enum_extension; if (dynamicEnumExtension) { msg.dynamicEnumExtension = dynamicEnumExtension; } - const messageExtension = json[\\"messageExtension\\"] ?? json.message_extension; + const messageExtension = json.messageExtension ?? json.message_extension; if (messageExtension) { const m = ForeignMessage.initialize(); ForeignMessage._readMessageJSON(m, messageExtension); msg.messageExtension = m; } const dynamicMessageExtension = - json[\\"dynamicMessageExtension\\"] ?? json.dynamic_message_extension; + json.dynamicMessageExtension ?? json.dynamic_message_extension; if (dynamicMessageExtension) { const m = TestDynamicExtensions.DynamicMessageType.initialize(); TestDynamicExtensions.DynamicMessageType._readMessageJSON( @@ -50115,12 +51032,11 @@ export const TestDynamicExtensions = { ); msg.dynamicMessageExtension = m; } - const repeatedExtension = - json[\\"repeatedExtension\\"] ?? json.repeated_extension; + const repeatedExtension = json.repeatedExtension ?? json.repeated_extension; if (repeatedExtension) { msg.repeatedExtension = repeatedExtension; } - const packedExtension = json[\\"packedExtension\\"] ?? json.packed_extension; + const packedExtension = json.packedExtension ?? json.packed_extension; if (packedExtension) { msg.packedExtension = packedExtension; } @@ -50213,7 +51129,7 @@ export const TestDynamicExtensions = { ): Record { const json: Record = {}; if (msg.dynamicField) { - json[\\"dynamicField\\"] = msg.dynamicField; + json.dynamicField = msg.dynamicField; } return json; }, @@ -50248,7 +51164,7 @@ export const TestDynamicExtensions = { msg: TestDynamicExtensions.DynamicMessageType, json: any ): TestDynamicExtensions.DynamicMessageType { - const dynamicField = json[\\"dynamicField\\"] ?? json.dynamic_field; + const dynamicField = json.dynamicField ?? json.dynamic_field; if (dynamicField) { msg.dynamicField = dynamicField; } @@ -50331,16 +51247,16 @@ export const TestRepeatedScalarDifferentTagSizes = { writer.writeRepeatedInt32(13, msg.repeatedInt32); } if (msg.repeatedFixed64?.length) { - writer.writeRepeatedFixed64String(2046, msg.repeatedFixed64); + writer.writeRepeatedFixed64String(2046, msg.repeatedFixed64.toString()); } if (msg.repeatedInt64?.length) { - writer.writeRepeatedInt64String(2047, msg.repeatedInt64); + writer.writeRepeatedInt64String(2047, msg.repeatedInt64.toString()); } if (msg.repeatedFloat?.length) { writer.writeRepeatedFloat(262142, msg.repeatedFloat); } if (msg.repeatedUint64?.length) { - writer.writeRepeatedUint64String(262143, msg.repeatedUint64); + writer.writeRepeatedUint64String(262143, msg.repeatedUint64.toString()); } return writer; }, @@ -50353,22 +51269,22 @@ export const TestRepeatedScalarDifferentTagSizes = { ): Record { const json: Record = {}; if (msg.repeatedFixed32?.length) { - json[\\"repeatedFixed32\\"] = msg.repeatedFixed32; + json.repeatedFixed32 = msg.repeatedFixed32; } if (msg.repeatedInt32?.length) { - json[\\"repeatedInt32\\"] = msg.repeatedInt32; + json.repeatedInt32 = msg.repeatedInt32; } if (msg.repeatedFixed64?.length) { - json[\\"repeatedFixed64\\"] = msg.repeatedFixed64; + json.repeatedFixed64 = msg.repeatedFixed64.map((x) => x.toString()); } if (msg.repeatedInt64?.length) { - json[\\"repeatedInt64\\"] = msg.repeatedInt64; + json.repeatedInt64 = msg.repeatedInt64.map((x) => x.toString()); } if (msg.repeatedFloat?.length) { - json[\\"repeatedFloat\\"] = msg.repeatedFloat; + json.repeatedFloat = msg.repeatedFloat; } if (msg.repeatedUint64?.length) { - json[\\"repeatedUint64\\"] = msg.repeatedUint64; + json.repeatedUint64 = msg.repeatedUint64.map((x) => x.toString()); } return json; }, @@ -50392,11 +51308,11 @@ export const TestRepeatedScalarDifferentTagSizes = { break; } case 2046: { - msg.repeatedFixed64.push(reader.readFixed64String()); + msg.repeatedFixed64 = reader.readFixed64String().map(BigInt); break; } case 2047: { - msg.repeatedInt64.push(reader.readInt64String()); + msg.repeatedInt64 = reader.readInt64String().map(BigInt); break; } case 262142: { @@ -50404,7 +51320,7 @@ export const TestRepeatedScalarDifferentTagSizes = { break; } case 262143: { - msg.repeatedUint64.push(reader.readUint64String()); + msg.repeatedUint64 = reader.readUint64String().map(BigInt); break; } default: { @@ -50423,29 +51339,29 @@ export const TestRepeatedScalarDifferentTagSizes = { msg: TestRepeatedScalarDifferentTagSizes, json: any ): TestRepeatedScalarDifferentTagSizes { - const repeatedFixed32 = json[\\"repeatedFixed32\\"] ?? json.repeated_fixed32; + const repeatedFixed32 = json.repeatedFixed32 ?? json.repeated_fixed32; if (repeatedFixed32) { msg.repeatedFixed32 = repeatedFixed32; } - const repeatedInt32 = json[\\"repeatedInt32\\"] ?? json.repeated_int32; + const repeatedInt32 = json.repeatedInt32 ?? json.repeated_int32; if (repeatedInt32) { msg.repeatedInt32 = repeatedInt32; } - const repeatedFixed64 = json[\\"repeatedFixed64\\"] ?? json.repeated_fixed64; + const repeatedFixed64 = json.repeatedFixed64 ?? json.repeated_fixed64; if (repeatedFixed64) { - msg.repeatedFixed64 = repeatedFixed64; + msg.repeatedFixed64 = repeatedFixed64.map(BigInt); } - const repeatedInt64 = json[\\"repeatedInt64\\"] ?? json.repeated_int64; + const repeatedInt64 = json.repeatedInt64 ?? json.repeated_int64; if (repeatedInt64) { - msg.repeatedInt64 = repeatedInt64; + msg.repeatedInt64 = repeatedInt64.map(BigInt); } - const repeatedFloat = json[\\"repeatedFloat\\"] ?? json.repeated_float; + const repeatedFloat = json.repeatedFloat ?? json.repeated_float; if (repeatedFloat) { msg.repeatedFloat = repeatedFloat; } - const repeatedUint64 = json[\\"repeatedUint64\\"] ?? json.repeated_uint64; + const repeatedUint64 = json.repeatedUint64 ?? json.repeated_uint64; if (repeatedUint64) { - msg.repeatedUint64 = repeatedUint64; + msg.repeatedUint64 = repeatedUint64.map(BigInt); } return msg; }, @@ -50535,7 +51451,7 @@ export const TestParsingMerge = { msg.requiredAllTypes ); if (Object.keys(requiredAllTypes).length > 0) { - json[\\"requiredAllTypes\\"] = requiredAllTypes; + json.requiredAllTypes = requiredAllTypes; } } if (msg.optionalAllTypes) { @@ -50543,11 +51459,11 @@ export const TestParsingMerge = { msg.optionalAllTypes ); if (Object.keys(optionalAllTypes).length > 0) { - json[\\"optionalAllTypes\\"] = optionalAllTypes; + json.optionalAllTypes = optionalAllTypes; } } if (msg.repeatedAllTypes?.length) { - json[\\"repeatedAllTypes\\"] = msg.repeatedAllTypes.map( + json.repeatedAllTypes = msg.repeatedAllTypes.map( TestAllTypes._writeMessageJSON ); } @@ -50594,22 +51510,19 @@ export const TestParsingMerge = { msg: TestParsingMerge, json: any ): TestParsingMerge { - const requiredAllTypes = - json[\\"requiredAllTypes\\"] ?? json.required_all_types; + const requiredAllTypes = json.requiredAllTypes ?? json.required_all_types; if (requiredAllTypes) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, requiredAllTypes); msg.requiredAllTypes = m; } - const optionalAllTypes = - json[\\"optionalAllTypes\\"] ?? json.optional_all_types; + const optionalAllTypes = json.optionalAllTypes ?? json.optional_all_types; if (optionalAllTypes) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, optionalAllTypes); msg.optionalAllTypes = m; } - const repeatedAllTypes = - json[\\"repeatedAllTypes\\"] ?? json.repeated_all_types; + const repeatedAllTypes = json.repeatedAllTypes ?? json.repeated_all_types; if (repeatedAllTypes) { for (const item of repeatedAllTypes) { const m = TestAllTypes.initialize(); @@ -50736,19 +51649,19 @@ export const TestParsingMerge = { ): Record { const json: Record = {}; if (msg.field1?.length) { - json[\\"field1\\"] = msg.field1.map(TestAllTypes._writeMessageJSON); + json.field1 = msg.field1.map(TestAllTypes._writeMessageJSON); } if (msg.field2?.length) { - json[\\"field2\\"] = msg.field2.map(TestAllTypes._writeMessageJSON); + json.field2 = msg.field2.map(TestAllTypes._writeMessageJSON); } if (msg.field3?.length) { - json[\\"field3\\"] = msg.field3.map(TestAllTypes._writeMessageJSON); + json.field3 = msg.field3.map(TestAllTypes._writeMessageJSON); } if (msg.ext1?.length) { - json[\\"ext1\\"] = msg.ext1.map(TestAllTypes._writeMessageJSON); + json.ext1 = msg.ext1.map(TestAllTypes._writeMessageJSON); } if (msg.ext2?.length) { - json[\\"ext2\\"] = msg.ext2.map(TestAllTypes._writeMessageJSON); + json.ext2 = msg.ext2.map(TestAllTypes._writeMessageJSON); } return json; }, @@ -50809,7 +51722,7 @@ export const TestParsingMerge = { msg: TestParsingMerge.RepeatedFieldsGenerator, json: any ): TestParsingMerge.RepeatedFieldsGenerator { - const field1 = json[\\"field1\\"] ?? json.field1; + const field1 = json.field1 ?? json.field1; if (field1) { for (const item of field1) { const m = TestAllTypes.initialize(); @@ -50817,7 +51730,7 @@ export const TestParsingMerge = { msg.field1.push(m); } } - const field2 = json[\\"field2\\"] ?? json.field2; + const field2 = json.field2 ?? json.field2; if (field2) { for (const item of field2) { const m = TestAllTypes.initialize(); @@ -50825,7 +51738,7 @@ export const TestParsingMerge = { msg.field2.push(m); } } - const field3 = json[\\"field3\\"] ?? json.field3; + const field3 = json.field3 ?? json.field3; if (field3) { for (const item of field3) { const m = TestAllTypes.initialize(); @@ -50833,7 +51746,7 @@ export const TestParsingMerge = { msg.field3.push(m); } } - const ext1 = json[\\"ext1\\"] ?? json.ext1; + const ext1 = json.ext1 ?? json.ext1; if (ext1) { for (const item of ext1) { const m = TestAllTypes.initialize(); @@ -50841,7 +51754,7 @@ export const TestParsingMerge = { msg.ext1.push(m); } } - const ext2 = json[\\"ext2\\"] ?? json.ext2; + const ext2 = json.ext2 ?? json.ext2; if (ext2) { for (const item of ext2) { const m = TestAllTypes.initialize(); @@ -50934,7 +51847,7 @@ export const TestParsingMerge = { if (msg.field1) { const field1 = TestAllTypes._writeMessageJSON(msg.field1); if (Object.keys(field1).length > 0) { - json[\\"field1\\"] = field1; + json.field1 = field1; } } return json; @@ -50970,7 +51883,7 @@ export const TestParsingMerge = { msg: TestParsingMerge.RepeatedFieldsGenerator.Group1, json: any ): TestParsingMerge.RepeatedFieldsGenerator.Group1 { - const field1 = json[\\"field1\\"] ?? json.field1; + const field1 = json.field1 ?? json.field1; if (field1) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, field1); @@ -51062,7 +51975,7 @@ export const TestParsingMerge = { if (msg.field1) { const field1 = TestAllTypes._writeMessageJSON(msg.field1); if (Object.keys(field1).length > 0) { - json[\\"field1\\"] = field1; + json.field1 = field1; } } return json; @@ -51098,7 +52011,7 @@ export const TestParsingMerge = { msg: TestParsingMerge.RepeatedFieldsGenerator.Group2, json: any ): TestParsingMerge.RepeatedFieldsGenerator.Group2 { - const field1 = json[\\"field1\\"] ?? json.field1; + const field1 = json.field1 ?? json.field1; if (field1) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, field1); @@ -51191,7 +52104,7 @@ export const TestParsingMerge = { msg.optionalGroupAllTypes ); if (Object.keys(optionalGroupAllTypes).length > 0) { - json[\\"optionalGroupAllTypes\\"] = optionalGroupAllTypes; + json.optionalGroupAllTypes = optionalGroupAllTypes; } } return json; @@ -51231,7 +52144,7 @@ export const TestParsingMerge = { json: any ): TestParsingMerge.OptionalGroup { const optionalGroupAllTypes = - json[\\"optionalGroupAllTypes\\"] ?? json.optional_group_all_types; + json.optionalGroupAllTypes ?? json.optional_group_all_types; if (optionalGroupAllTypes) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, optionalGroupAllTypes); @@ -51323,7 +52236,7 @@ export const TestParsingMerge = { msg.repeatedGroupAllTypes ); if (Object.keys(repeatedGroupAllTypes).length > 0) { - json[\\"repeatedGroupAllTypes\\"] = repeatedGroupAllTypes; + json.repeatedGroupAllTypes = repeatedGroupAllTypes; } } return json; @@ -51363,7 +52276,7 @@ export const TestParsingMerge = { json: any ): TestParsingMerge.RepeatedGroup { const repeatedGroupAllTypes = - json[\\"repeatedGroupAllTypes\\"] ?? json.repeated_group_all_types; + json.repeatedGroupAllTypes ?? json.repeated_group_all_types; if (repeatedGroupAllTypes) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, repeatedGroupAllTypes); @@ -51448,7 +52361,7 @@ export const TestCommentInjectionMessage = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -51483,7 +52396,7 @@ export const TestCommentInjectionMessage = { msg: TestCommentInjectionMessage, json: any ): TestCommentInjectionMessage { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -51877,25 +52790,25 @@ export const TestJsonName = { ): Record { const json: Record = {}; if (msg.fieldName1) { - json[\\"fieldName1\\"] = msg.fieldName1; + json.fieldName1 = msg.fieldName1; } if (msg.fieldName2) { - json[\\"fieldName2\\"] = msg.fieldName2; + json.fieldName2 = msg.fieldName2; } if (msg.FieldName3) { - json[\\"FieldName3\\"] = msg.FieldName3; + json.FieldName3 = msg.FieldName3; } if (msg.FieldName4) { - json[\\"FieldName4\\"] = msg.FieldName4; + json.FieldName4 = msg.FieldName4; } if (msg.FIELDNAME5) { - json[\\"FIELDNAME5\\"] = msg.FIELDNAME5; + json.FIELDNAME5 = msg.FIELDNAME5; } if (msg.fieldName6) { json[\\"@type\\"] = msg.fieldName6; } if (msg.fieldname7) { - json[\\"fieldname7\\"] = msg.fieldname7; + json.fieldname7 = msg.fieldname7; } return json; }, @@ -51951,23 +52864,23 @@ export const TestJsonName = { * @private */ _readMessageJSON: function (msg: TestJsonName, json: any): TestJsonName { - const fieldName1 = json[\\"fieldName1\\"] ?? json.field_name1; + const fieldName1 = json.fieldName1 ?? json.field_name1; if (fieldName1) { msg.fieldName1 = fieldName1; } - const fieldName2 = json[\\"fieldName2\\"] ?? json.fieldName2; + const fieldName2 = json.fieldName2 ?? json.fieldName2; if (fieldName2) { msg.fieldName2 = fieldName2; } - const FieldName3 = json[\\"FieldName3\\"] ?? json.FieldName3; + const FieldName3 = json.FieldName3 ?? json.FieldName3; if (FieldName3) { msg.FieldName3 = FieldName3; } - const FieldName4 = json[\\"FieldName4\\"] ?? json._field_name4; + const FieldName4 = json.FieldName4 ?? json._field_name4; if (FieldName4) { msg.FieldName4 = FieldName4; } - const FIELDNAME5 = json[\\"FIELDNAME5\\"] ?? json.FIELD_NAME5; + const FIELDNAME5 = json.FIELDNAME5 ?? json.FIELD_NAME5; if (FIELDNAME5) { msg.FIELDNAME5 = FIELDNAME5; } @@ -51975,7 +52888,7 @@ export const TestJsonName = { if (fieldName6) { msg.fieldName6 = fieldName6; } - const fieldname7 = json[\\"fieldname7\\"] ?? json.fieldname7; + const fieldname7 = json.fieldname7 ?? json.fieldname7; if (fieldname7) { msg.fieldname7 = fieldname7; } @@ -52081,11 +52994,13 @@ export const TestHugeFieldNumbers = { ); } if (msg.stringStringMap) { - for (const key in msg.stringStringMap) { - writer.writeMessage(536870010, {}, (_, mapWriter) => { - mapWriter.writeString(1, key as unknown as string); - mapWriter.writeString(2, msg.stringStringMap![key]); - }); + for (const [key, value] of Object.entries(msg.stringStringMap)) { + if (key && value) { + writer.writeMessage(536870010, {}, (_, mapWriter) => { + mapWriter.writeString(1, key as any); + mapWriter.writeString(2, value); + }); + } } } if (msg.oneofUint32 != undefined) { @@ -52115,55 +53030,61 @@ export const TestHugeFieldNumbers = { ): Record { const json: Record = {}; if (msg.optionalInt32) { - json[\\"optionalInt32\\"] = msg.optionalInt32; + json.optionalInt32 = msg.optionalInt32; } if (msg.fixed32) { - json[\\"fixed32\\"] = msg.fixed32; + json.fixed32 = msg.fixed32; } if (msg.repeatedInt32?.length) { - json[\\"repeatedInt32\\"] = msg.repeatedInt32; + json.repeatedInt32 = msg.repeatedInt32; } if (msg.packedInt32?.length) { - json[\\"packedInt32\\"] = msg.packedInt32; + json.packedInt32 = msg.packedInt32; } if (msg.optionalEnum) { - json[\\"optionalEnum\\"] = msg.optionalEnum; + json.optionalEnum = msg.optionalEnum; } if (msg.optionalString) { - json[\\"optionalString\\"] = msg.optionalString; + json.optionalString = msg.optionalString; } if (msg.optionalBytes) { - json[\\"optionalBytes\\"] = msg.optionalBytes; + json.optionalBytes = msg.optionalBytes; } if (msg.optionalMessage) { const optionalMessage = ForeignMessage._writeMessageJSON( msg.optionalMessage ); if (Object.keys(optionalMessage).length > 0) { - json[\\"optionalMessage\\"] = optionalMessage; + json.optionalMessage = optionalMessage; } } if (msg.stringStringMap) { - if (Object.keys(msg.stringStringMap).length > 0) { - json[\\"stringStringMap\\"] = msg.stringStringMap; + if (msg.stringStringMap) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.stringStringMap)) { + if (key && value) { + map[key] = value; + json.stringStringMap = map; + } + } } } if (msg.oneofUint32 != undefined) { - json[\\"oneofUint32\\"] = msg.oneofUint32; + json.oneofUint32 = msg.oneofUint32; } if (msg.oneofTestAllTypes != undefined) { const oneofTestAllTypes = TestAllTypes._writeMessageJSON( msg.oneofTestAllTypes ); if (Object.keys(oneofTestAllTypes).length > 0) { - json[\\"oneofTestAllTypes\\"] = oneofTestAllTypes; + json.oneofTestAllTypes = oneofTestAllTypes; } } if (msg.oneofString != undefined) { - json[\\"oneofString\\"] = msg.oneofString; + json.oneofString = msg.oneofString; } if (msg.oneofBytes != undefined) { - json[\\"oneofBytes\\"] = msg.oneofBytes; + json.oneofBytes = msg.oneofBytes; } return json; }, @@ -52265,60 +53186,62 @@ export const TestHugeFieldNumbers = { msg: TestHugeFieldNumbers, json: any ): TestHugeFieldNumbers { - const optionalInt32 = json[\\"optionalInt32\\"] ?? json.optional_int32; + const optionalInt32 = json.optionalInt32 ?? json.optional_int32; if (optionalInt32) { msg.optionalInt32 = optionalInt32; } - const fixed32 = json[\\"fixed32\\"] ?? json.fixed_32; + const fixed32 = json.fixed32 ?? json.fixed_32; if (fixed32) { msg.fixed32 = fixed32; } - const repeatedInt32 = json[\\"repeatedInt32\\"] ?? json.repeated_int32; + const repeatedInt32 = json.repeatedInt32 ?? json.repeated_int32; if (repeatedInt32) { msg.repeatedInt32 = repeatedInt32; } - const packedInt32 = json[\\"packedInt32\\"] ?? json.packed_int32; + const packedInt32 = json.packedInt32 ?? json.packed_int32; if (packedInt32) { msg.packedInt32 = packedInt32; } - const optionalEnum = json[\\"optionalEnum\\"] ?? json.optional_enum; + const optionalEnum = json.optionalEnum ?? json.optional_enum; if (optionalEnum) { msg.optionalEnum = optionalEnum; } - const optionalString = json[\\"optionalString\\"] ?? json.optional_string; + const optionalString = json.optionalString ?? json.optional_string; if (optionalString) { msg.optionalString = optionalString; } - const optionalBytes = json[\\"optionalBytes\\"] ?? json.optional_bytes; + const optionalBytes = json.optionalBytes ?? json.optional_bytes; if (optionalBytes) { msg.optionalBytes = optionalBytes; } - const optionalMessage = json[\\"optionalMessage\\"] ?? json.optional_message; + const optionalMessage = json.optionalMessage ?? json.optional_message; if (optionalMessage) { const m = ForeignMessage.initialize(); ForeignMessage._readMessageJSON(m, optionalMessage); msg.optionalMessage = m; } - const stringStringMap = json[\\"stringStringMap\\"] ?? json.string_string_map; + const stringStringMap = json.stringStringMap ?? json.string_string_map; if (stringStringMap) { - msg.stringStringMap = stringStringMap; + for (const [key, value] of Object.entries(stringStringMap)) { + msg.stringStringMap[key] = value; + } } - const oneofUint32 = json[\\"oneofUint32\\"] ?? json.oneof_uint32; + const oneofUint32 = json.oneofUint32 ?? json.oneof_uint32; if (oneofUint32) { msg.oneofUint32 = oneofUint32; } const oneofTestAllTypes = - json[\\"oneofTestAllTypes\\"] ?? json.oneof_test_all_types; + json.oneofTestAllTypes ?? json.oneof_test_all_types; if (oneofTestAllTypes) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, oneofTestAllTypes); msg.oneofTestAllTypes = m; } - const oneofString = json[\\"oneofString\\"] ?? json.oneof_string; + const oneofString = json.oneofString ?? json.oneof_string; if (oneofString) { msg.oneofString = oneofString; } - const oneofBytes = json[\\"oneofBytes\\"] ?? json.oneof_bytes; + const oneofBytes = json.oneofBytes ?? json.oneof_bytes; if (oneofBytes) { msg.oneofBytes = oneofBytes; } @@ -52399,7 +53322,7 @@ export const TestHugeFieldNumbers = { ): Record { const json: Record = {}; if (msg.groupA) { - json[\\"groupA\\"] = msg.groupA; + json.groupA = msg.groupA; } return json; }, @@ -52434,7 +53357,7 @@ export const TestHugeFieldNumbers = { msg: TestHugeFieldNumbers.OptionalGroup, json: any ): TestHugeFieldNumbers.OptionalGroup { - const groupA = json[\\"groupA\\"] ?? json.group_a; + const groupA = json.groupA ?? json.group_a; if (groupA) { msg.groupA = groupA; } @@ -52549,31 +53472,31 @@ export const TestExtensionInsideTable = { ): Record { const json: Record = {}; if (msg.field1) { - json[\\"field1\\"] = msg.field1; + json.field1 = msg.field1; } if (msg.field2) { - json[\\"field2\\"] = msg.field2; + json.field2 = msg.field2; } if (msg.field3) { - json[\\"field3\\"] = msg.field3; + json.field3 = msg.field3; } if (msg.field4) { - json[\\"field4\\"] = msg.field4; + json.field4 = msg.field4; } if (msg.field6) { - json[\\"field6\\"] = msg.field6; + json.field6 = msg.field6; } if (msg.field7) { - json[\\"field7\\"] = msg.field7; + json.field7 = msg.field7; } if (msg.field8) { - json[\\"field8\\"] = msg.field8; + json.field8 = msg.field8; } if (msg.field9) { - json[\\"field9\\"] = msg.field9; + json.field9 = msg.field9; } if (msg.field10) { - json[\\"field10\\"] = msg.field10; + json.field10 = msg.field10; } return json; }, @@ -52640,39 +53563,39 @@ export const TestExtensionInsideTable = { msg: TestExtensionInsideTable, json: any ): TestExtensionInsideTable { - const field1 = json[\\"field1\\"] ?? json.field1; + const field1 = json.field1 ?? json.field1; if (field1) { msg.field1 = field1; } - const field2 = json[\\"field2\\"] ?? json.field2; + const field2 = json.field2 ?? json.field2; if (field2) { msg.field2 = field2; } - const field3 = json[\\"field3\\"] ?? json.field3; + const field3 = json.field3 ?? json.field3; if (field3) { msg.field3 = field3; } - const field4 = json[\\"field4\\"] ?? json.field4; + const field4 = json.field4 ?? json.field4; if (field4) { msg.field4 = field4; } - const field6 = json[\\"field6\\"] ?? json.field6; + const field6 = json.field6 ?? json.field6; if (field6) { msg.field6 = field6; } - const field7 = json[\\"field7\\"] ?? json.field7; + const field7 = json.field7 ?? json.field7; if (field7) { msg.field7 = field7; } - const field8 = json[\\"field8\\"] ?? json.field8; + const field8 = json.field8 ?? json.field8; if (field8) { msg.field8 = field8; } - const field9 = json[\\"field9\\"] ?? json.field9; + const field9 = json.field9 ?? json.field9; if (field9) { msg.field9 = field9; } - const field10 = json[\\"field10\\"] ?? json.field10; + const field10 = json.field10 ?? json.field10; if (field10) { msg.field10 = field10; } @@ -52766,16 +53689,16 @@ export const TestExtensionRangeSerialize = { ): Record { const json: Record = {}; if (msg.fooOne) { - json[\\"fooOne\\"] = msg.fooOne; + json.fooOne = msg.fooOne; } if (msg.fooTwo) { - json[\\"fooTwo\\"] = msg.fooTwo; + json.fooTwo = msg.fooTwo; } if (msg.fooThree) { - json[\\"fooThree\\"] = msg.fooThree; + json.fooThree = msg.fooThree; } if (msg.fooFour) { - json[\\"fooFour\\"] = msg.fooFour; + json.fooFour = msg.fooFour; } return json; }, @@ -52822,19 +53745,19 @@ export const TestExtensionRangeSerialize = { msg: TestExtensionRangeSerialize, json: any ): TestExtensionRangeSerialize { - const fooOne = json[\\"fooOne\\"] ?? json.foo_one; + const fooOne = json.fooOne ?? json.foo_one; if (fooOne) { msg.fooOne = fooOne; } - const fooTwo = json[\\"fooTwo\\"] ?? json.foo_two; + const fooTwo = json.fooTwo ?? json.foo_two; if (fooTwo) { msg.fooTwo = fooTwo; } - const fooThree = json[\\"fooThree\\"] ?? json.foo_three; + const fooThree = json.fooThree ?? json.foo_three; if (fooThree) { msg.fooThree = fooThree; } - const fooFour = json[\\"fooFour\\"] ?? json.foo_four; + const fooFour = json.fooFour ?? json.foo_four; if (fooFour) { msg.fooFour = fooFour; } @@ -52877,15 +53800,15 @@ export type MapEnum = typeof MapEnum[keyof typeof MapEnum]; */ export interface TestMap { mapInt32Int32: Record; - mapInt64Int64: Record; + mapInt64Int64: Record; mapUint32Uint32: Record; - mapUint64Uint64: Record; + mapUint64Uint64: Record; mapSint32Sint32: Record; - mapSint64Sint64: Record; + mapSint64Sint64: Record; mapFixed32Fixed32: Record; - mapFixed64Fixed64: Record; + mapFixed64Fixed64: Record; mapSfixed32Sfixed32: Record; - mapSfixed64Sfixed64: Record; + mapSfixed64Sfixed64: Record; mapInt32Float: Record; mapInt32Double: Record; mapBoolBool: Record; @@ -52922,15 +53845,15 @@ export interface TestRequiredMessageMap { export interface TestArenaMap { mapInt32Int32: Record; - mapInt64Int64: Record; + mapInt64Int64: Record; mapUint32Uint32: Record; - mapUint64Uint64: Record; + mapUint64Uint64: Record; mapSint32Sint32: Record; - mapSint64Sint64: Record; + mapSint64Sint64: Record; mapFixed32Fixed32: Record; - mapFixed64Fixed64: Record; + mapFixed64Fixed64: Record; mapSfixed32Sfixed32: Record; - mapSfixed64Sfixed64: Record; + mapSfixed64Sfixed64: Record; mapInt32Float: Record; mapInt32Double: Record; mapBoolBool: Record; @@ -53025,155 +53948,193 @@ export const TestMap = { writer: BinaryWriter ): BinaryWriter { if (msg.mapInt32Int32) { - for (const key in msg.mapInt32Int32) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeInt32(2, msg.mapInt32Int32![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Int32)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeInt32(2, value); + }); + } } } if (msg.mapInt64Int64) { - for (const key in msg.mapInt64Int64) { - writer.writeMessage(2, {}, (_, mapWriter) => { - mapWriter.writeInt64String(1, key as unknown as string); - mapWriter.writeInt64String(2, msg.mapInt64Int64![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt64Int64)) { + if (key && value) { + writer.writeMessage(2, {}, (_, mapWriter) => { + mapWriter.writeInt64String(1, key as any); + mapWriter.writeInt64String(2, value.toString()); + }); + } } } if (msg.mapUint32Uint32) { - for (const key in msg.mapUint32Uint32) { - writer.writeMessage(3, {}, (_, mapWriter) => { - mapWriter.writeUint32(1, key as unknown as number); - mapWriter.writeUint32(2, msg.mapUint32Uint32![key]); - }); + for (const [key, value] of Object.entries(msg.mapUint32Uint32)) { + if (key && value) { + writer.writeMessage(3, {}, (_, mapWriter) => { + mapWriter.writeUint32(1, key as any); + mapWriter.writeUint32(2, value); + }); + } } } if (msg.mapUint64Uint64) { - for (const key in msg.mapUint64Uint64) { - writer.writeMessage(4, {}, (_, mapWriter) => { - mapWriter.writeUint64String(1, key as unknown as string); - mapWriter.writeUint64String(2, msg.mapUint64Uint64![key]); - }); + for (const [key, value] of Object.entries(msg.mapUint64Uint64)) { + if (key && value) { + writer.writeMessage(4, {}, (_, mapWriter) => { + mapWriter.writeUint64String(1, key as any); + mapWriter.writeUint64String(2, value.toString()); + }); + } } } if (msg.mapSint32Sint32) { - for (const key in msg.mapSint32Sint32) { - writer.writeMessage(5, {}, (_, mapWriter) => { - mapWriter.writeSint32(1, key as unknown as number); - mapWriter.writeSint32(2, msg.mapSint32Sint32![key]); - }); + for (const [key, value] of Object.entries(msg.mapSint32Sint32)) { + if (key && value) { + writer.writeMessage(5, {}, (_, mapWriter) => { + mapWriter.writeSint32(1, key as any); + mapWriter.writeSint32(2, value); + }); + } } } if (msg.mapSint64Sint64) { - for (const key in msg.mapSint64Sint64) { - writer.writeMessage(6, {}, (_, mapWriter) => { - mapWriter.writeSint64String(1, key as unknown as string); - mapWriter.writeSint64String(2, msg.mapSint64Sint64![key]); - }); + for (const [key, value] of Object.entries(msg.mapSint64Sint64)) { + if (key && value) { + writer.writeMessage(6, {}, (_, mapWriter) => { + mapWriter.writeSint64String(1, key as any); + mapWriter.writeSint64String(2, value.toString()); + }); + } } } if (msg.mapFixed32Fixed32) { - for (const key in msg.mapFixed32Fixed32) { - writer.writeMessage(7, {}, (_, mapWriter) => { - mapWriter.writeFixed32(1, key as unknown as number); - mapWriter.writeFixed32(2, msg.mapFixed32Fixed32![key]); - }); + for (const [key, value] of Object.entries(msg.mapFixed32Fixed32)) { + if (key && value) { + writer.writeMessage(7, {}, (_, mapWriter) => { + mapWriter.writeFixed32(1, key as any); + mapWriter.writeFixed32(2, value); + }); + } } } if (msg.mapFixed64Fixed64) { - for (const key in msg.mapFixed64Fixed64) { - writer.writeMessage(8, {}, (_, mapWriter) => { - mapWriter.writeFixed64String(1, key as unknown as string); - mapWriter.writeFixed64String(2, msg.mapFixed64Fixed64![key]); - }); + for (const [key, value] of Object.entries(msg.mapFixed64Fixed64)) { + if (key && value) { + writer.writeMessage(8, {}, (_, mapWriter) => { + mapWriter.writeFixed64String(1, key as any); + mapWriter.writeFixed64String(2, value.toString()); + }); + } } } if (msg.mapSfixed32Sfixed32) { - for (const key in msg.mapSfixed32Sfixed32) { - writer.writeMessage(9, {}, (_, mapWriter) => { - mapWriter.writeSfixed32(1, key as unknown as number); - mapWriter.writeSfixed32(2, msg.mapSfixed32Sfixed32![key]); - }); + for (const [key, value] of Object.entries(msg.mapSfixed32Sfixed32)) { + if (key && value) { + writer.writeMessage(9, {}, (_, mapWriter) => { + mapWriter.writeSfixed32(1, key as any); + mapWriter.writeSfixed32(2, value); + }); + } } } if (msg.mapSfixed64Sfixed64) { - for (const key in msg.mapSfixed64Sfixed64) { - writer.writeMessage(10, {}, (_, mapWriter) => { - mapWriter.writeSfixed64(1, key as unknown as string); - mapWriter.writeSfixed64(2, msg.mapSfixed64Sfixed64![key]); - }); + for (const [key, value] of Object.entries(msg.mapSfixed64Sfixed64)) { + if (key && value) { + writer.writeMessage(10, {}, (_, mapWriter) => { + mapWriter.writeSfixed64(1, key as any); + mapWriter.writeSfixed64(2, value.toString()); + }); + } } } if (msg.mapInt32Float) { - for (const key in msg.mapInt32Float) { - writer.writeMessage(11, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeFloat(2, msg.mapInt32Float![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Float)) { + if (key && value) { + writer.writeMessage(11, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeFloat(2, value); + }); + } } } if (msg.mapInt32Double) { - for (const key in msg.mapInt32Double) { - writer.writeMessage(12, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeDouble(2, msg.mapInt32Double![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Double)) { + if (key && value) { + writer.writeMessage(12, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeDouble(2, value); + }); + } } } if (msg.mapBoolBool) { - for (const key in msg.mapBoolBool) { - writer.writeMessage(13, {}, (_, mapWriter) => { - mapWriter.writeBool(1, key as unknown as boolean); - mapWriter.writeBool(2, msg.mapBoolBool![key]); - }); + for (const [key, value] of Object.entries(msg.mapBoolBool)) { + if (key && value) { + writer.writeMessage(13, {}, (_, mapWriter) => { + mapWriter.writeBool(1, key as any); + mapWriter.writeBool(2, value); + }); + } } } if (msg.mapStringString) { - for (const key in msg.mapStringString) { - writer.writeMessage(14, {}, (_, mapWriter) => { - mapWriter.writeString(1, key as unknown as string); - mapWriter.writeString(2, msg.mapStringString![key]); - }); + for (const [key, value] of Object.entries(msg.mapStringString)) { + if (key && value) { + writer.writeMessage(14, {}, (_, mapWriter) => { + mapWriter.writeString(1, key as any); + mapWriter.writeString(2, value); + }); + } } } if (msg.mapInt32Bytes) { - for (const key in msg.mapInt32Bytes) { - writer.writeMessage(15, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeBytes(2, msg.mapInt32Bytes![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Bytes)) { + if (key && value) { + writer.writeMessage(15, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeBytes(2, value); + }); + } } } if (msg.mapInt32Enum) { - for (const key in msg.mapInt32Enum) { - writer.writeMessage(16, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeEnum(2, msg.mapInt32Enum![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Enum)) { + if (key && value) { + writer.writeMessage(16, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeEnum(2, value as MapEnum); + }); + } } } if (msg.mapInt32ForeignMessage) { - for (const key in msg.mapInt32ForeignMessage) { - writer.writeMessage(17, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeMessage(2, msg.mapInt32ForeignMessage![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32ForeignMessage)) { + if (key && value) { + writer.writeMessage(17, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeMessage(2, value, ForeignMessage._writeMessage); + }); + } } } if (msg.mapStringForeignMessage) { - for (const key in msg.mapStringForeignMessage) { - writer.writeMessage(18, {}, (_, mapWriter) => { - mapWriter.writeString(1, key as unknown as string); - mapWriter.writeMessage(2, msg.mapStringForeignMessage![key]); - }); + for (const [key, value] of Object.entries(msg.mapStringForeignMessage)) { + if (key && value) { + writer.writeMessage(18, {}, (_, mapWriter) => { + mapWriter.writeString(1, key as any); + mapWriter.writeMessage(2, value, ForeignMessage._writeMessage); + }); + } } } if (msg.mapInt32AllTypes) { - for (const key in msg.mapInt32AllTypes) { - writer.writeMessage(19, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeMessage(2, msg.mapInt32AllTypes![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32AllTypes)) { + if (key && value) { + writer.writeMessage(19, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeMessage(2, value, TestAllTypes._writeMessage); + }); + } } } return writer; @@ -53185,98 +54146,214 @@ export const TestMap = { _writeMessageJSON: function (msg: Partial): Record { const json: Record = {}; if (msg.mapInt32Int32) { - if (Object.keys(msg.mapInt32Int32).length > 0) { - json[\\"mapInt32Int32\\"] = msg.mapInt32Int32; + if (msg.mapInt32Int32) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32Int32)) { + if (key && value) { + map[key] = value; + json.mapInt32Int32 = map; + } + } } } if (msg.mapInt64Int64) { - if (Object.keys(msg.mapInt64Int64).length > 0) { - json[\\"mapInt64Int64\\"] = msg.mapInt64Int64; + if (msg.mapInt64Int64) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt64Int64)) { + if (key && value) { + map[key] = value.toString(); + json.mapInt64Int64 = map; + } + } } } if (msg.mapUint32Uint32) { - if (Object.keys(msg.mapUint32Uint32).length > 0) { - json[\\"mapUint32Uint32\\"] = msg.mapUint32Uint32; + if (msg.mapUint32Uint32) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapUint32Uint32)) { + if (key && value) { + map[key] = value; + json.mapUint32Uint32 = map; + } + } } } if (msg.mapUint64Uint64) { - if (Object.keys(msg.mapUint64Uint64).length > 0) { - json[\\"mapUint64Uint64\\"] = msg.mapUint64Uint64; + if (msg.mapUint64Uint64) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapUint64Uint64)) { + if (key && value) { + map[key] = value.toString(); + json.mapUint64Uint64 = map; + } + } } } if (msg.mapSint32Sint32) { - if (Object.keys(msg.mapSint32Sint32).length > 0) { - json[\\"mapSint32Sint32\\"] = msg.mapSint32Sint32; + if (msg.mapSint32Sint32) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapSint32Sint32)) { + if (key && value) { + map[key] = value; + json.mapSint32Sint32 = map; + } + } } } if (msg.mapSint64Sint64) { - if (Object.keys(msg.mapSint64Sint64).length > 0) { - json[\\"mapSint64Sint64\\"] = msg.mapSint64Sint64; + if (msg.mapSint64Sint64) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapSint64Sint64)) { + if (key && value) { + map[key] = value.toString(); + json.mapSint64Sint64 = map; + } + } } } if (msg.mapFixed32Fixed32) { - if (Object.keys(msg.mapFixed32Fixed32).length > 0) { - json[\\"mapFixed32Fixed32\\"] = msg.mapFixed32Fixed32; + if (msg.mapFixed32Fixed32) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapFixed32Fixed32)) { + if (key && value) { + map[key] = value; + json.mapFixed32Fixed32 = map; + } + } } } if (msg.mapFixed64Fixed64) { - if (Object.keys(msg.mapFixed64Fixed64).length > 0) { - json[\\"mapFixed64Fixed64\\"] = msg.mapFixed64Fixed64; + if (msg.mapFixed64Fixed64) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapFixed64Fixed64)) { + if (key && value) { + map[key] = value.toString(); + json.mapFixed64Fixed64 = map; + } + } } } if (msg.mapSfixed32Sfixed32) { - if (Object.keys(msg.mapSfixed32Sfixed32).length > 0) { - json[\\"mapSfixed32Sfixed32\\"] = msg.mapSfixed32Sfixed32; + if (msg.mapSfixed32Sfixed32) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapSfixed32Sfixed32)) { + if (key && value) { + map[key] = value; + json.mapSfixed32Sfixed32 = map; + } + } } } if (msg.mapSfixed64Sfixed64) { - if (Object.keys(msg.mapSfixed64Sfixed64).length > 0) { - json[\\"mapSfixed64Sfixed64\\"] = msg.mapSfixed64Sfixed64; + if (msg.mapSfixed64Sfixed64) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapSfixed64Sfixed64)) { + if (key && value) { + map[key] = value.toString(); + json.mapSfixed64Sfixed64 = map; + } + } } } if (msg.mapInt32Float) { - if (Object.keys(msg.mapInt32Float).length > 0) { - json[\\"mapInt32Float\\"] = msg.mapInt32Float; + if (msg.mapInt32Float) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32Float)) { + if (key && value) { + map[key] = value; + json.mapInt32Float = map; + } + } } } if (msg.mapInt32Double) { - if (Object.keys(msg.mapInt32Double).length > 0) { - json[\\"mapInt32Double\\"] = msg.mapInt32Double; + if (msg.mapInt32Double) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32Double)) { + if (key && value) { + map[key] = value; + json.mapInt32Double = map; + } + } } } if (msg.mapBoolBool) { - if (Object.keys(msg.mapBoolBool).length > 0) { - json[\\"mapBoolBool\\"] = msg.mapBoolBool; + if (msg.mapBoolBool) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapBoolBool)) { + if (key && value) { + map[key] = value; + json.mapBoolBool = map; + } + } } } if (msg.mapStringString) { - if (Object.keys(msg.mapStringString).length > 0) { - json[\\"mapStringString\\"] = msg.mapStringString; + if (msg.mapStringString) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapStringString)) { + if (key && value) { + map[key] = value; + json.mapStringString = map; + } + } } } if (msg.mapInt32Bytes) { - if (Object.keys(msg.mapInt32Bytes).length > 0) { - json[\\"mapInt32Bytes\\"] = msg.mapInt32Bytes; + if (msg.mapInt32Bytes) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32Bytes)) { + if (key && value) { + map[key] = value; + json.mapInt32Bytes = map; + } + } } } if (msg.mapInt32Enum) { - if (Object.keys(msg.mapInt32Enum).length > 0) { - json[\\"mapInt32Enum\\"] = msg.mapInt32Enum; + if (msg.mapInt32Enum) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32Enum)) { + if (key && value) { + map[key] = value; + json.mapInt32Enum = map; + } + } } } if (msg.mapInt32ForeignMessage) { - if (Object.keys(msg.mapInt32ForeignMessage).length > 0) { - json[\\"mapInt32ForeignMessage\\"] = msg.mapInt32ForeignMessage; + if (msg.mapInt32ForeignMessage) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32ForeignMessage)) { + if (key && value) { + map[key] = ForeignMessage._writeMessageJSON(value); + json.mapInt32ForeignMessage = map; + } + } } } if (msg.mapStringForeignMessage) { - if (Object.keys(msg.mapStringForeignMessage).length > 0) { - json[\\"mapStringForeignMessage\\"] = msg.mapStringForeignMessage; + if (msg.mapStringForeignMessage) { + const map: Record = {}; + for (const [key, value] of Object.entries( + msg.mapStringForeignMessage + )) { + if (key && value) { + map[key] = ForeignMessage._writeMessageJSON(value); + json.mapStringForeignMessage = map; + } + } } } if (msg.mapInt32AllTypes) { - if (Object.keys(msg.mapInt32AllTypes).length > 0) { - json[\\"mapInt32AllTypes\\"] = msg.mapInt32AllTypes; + if (msg.mapInt32AllTypes) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32AllTypes)) { + if (key && value) { + map[key] = TestAllTypes._writeMessageJSON(value); + json.mapInt32AllTypes = map; + } + } } } return json; @@ -53314,8 +54391,8 @@ export const TestMap = { } case 2: { reader.readMessage(undefined, () => { - let key: string | undefined; - let value = \\"\\"; + let key: bigint | undefined; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -53324,7 +54401,7 @@ export const TestMap = { break; } case 2: { - value = reader.readInt64String(); + value = BigInt(reader.readInt64String()); break; } } @@ -53360,8 +54437,8 @@ export const TestMap = { } case 4: { reader.readMessage(undefined, () => { - let key: string | undefined; - let value = \\"\\"; + let key: bigint | undefined; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -53370,7 +54447,7 @@ export const TestMap = { break; } case 2: { - value = reader.readUint64String(); + value = BigInt(reader.readUint64String()); break; } } @@ -53406,8 +54483,8 @@ export const TestMap = { } case 6: { reader.readMessage(undefined, () => { - let key: string | undefined; - let value = \\"\\"; + let key: bigint | undefined; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -53416,7 +54493,7 @@ export const TestMap = { break; } case 2: { - value = reader.readSint64(); + value = BigInt(reader.readSint64()); break; } } @@ -53452,8 +54529,8 @@ export const TestMap = { } case 8: { reader.readMessage(undefined, () => { - let key: string | undefined; - let value = \\"\\"; + let key: bigint | undefined; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -53462,7 +54539,7 @@ export const TestMap = { break; } case 2: { - value = reader.readFixed64String(); + value = BigInt(reader.readFixed64String()); break; } } @@ -53498,8 +54575,8 @@ export const TestMap = { } case 10: { reader.readMessage(undefined, () => { - let key: string | undefined; - let value = \\"\\"; + let key: bigint | undefined; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -53508,7 +54585,7 @@ export const TestMap = { break; } case 2: { - value = reader.readSfixed64(); + value = BigInt(reader.readSfixed64()); break; } } @@ -53646,7 +54723,7 @@ export const TestMap = { break; } case 2: { - value = reader.readEnum(); + value = reader.readEnum() as MapEnum; break; } } @@ -53669,7 +54746,10 @@ export const TestMap = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + ForeignMessage.initialize(), + ForeignMessage._readMessage + ); break; } } @@ -53692,7 +54772,10 @@ export const TestMap = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + ForeignMessage.initialize(), + ForeignMessage._readMessage + ); break; } } @@ -53715,7 +54798,10 @@ export const TestMap = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + TestAllTypes.initialize(), + TestAllTypes._readMessage + ); break; } } @@ -53739,88 +54825,134 @@ export const TestMap = { * @private */ _readMessageJSON: function (msg: TestMap, json: any): TestMap { - const mapInt32Int32 = json[\\"mapInt32Int32\\"] ?? json.map_int32_int32; + const mapInt32Int32 = json.mapInt32Int32 ?? json.map_int32_int32; if (mapInt32Int32) { - msg.mapInt32Int32 = mapInt32Int32; + for (const [key, value] of Object.entries(mapInt32Int32)) { + msg.mapInt32Int32[key] = value; + } } - const mapInt64Int64 = json[\\"mapInt64Int64\\"] ?? json.map_int64_int64; + const mapInt64Int64 = json.mapInt64Int64 ?? json.map_int64_int64; if (mapInt64Int64) { - msg.mapInt64Int64 = mapInt64Int64; + for (const [key, value] of Object.entries(mapInt64Int64)) { + msg.mapInt64Int64[key] = BigInt(value as string); + } } - const mapUint32Uint32 = json[\\"mapUint32Uint32\\"] ?? json.map_uint32_uint32; + const mapUint32Uint32 = json.mapUint32Uint32 ?? json.map_uint32_uint32; if (mapUint32Uint32) { - msg.mapUint32Uint32 = mapUint32Uint32; + for (const [key, value] of Object.entries(mapUint32Uint32)) { + msg.mapUint32Uint32[key] = value; + } } - const mapUint64Uint64 = json[\\"mapUint64Uint64\\"] ?? json.map_uint64_uint64; + const mapUint64Uint64 = json.mapUint64Uint64 ?? json.map_uint64_uint64; if (mapUint64Uint64) { - msg.mapUint64Uint64 = mapUint64Uint64; + for (const [key, value] of Object.entries(mapUint64Uint64)) { + msg.mapUint64Uint64[key] = BigInt(value as string); + } } - const mapSint32Sint32 = json[\\"mapSint32Sint32\\"] ?? json.map_sint32_sint32; + const mapSint32Sint32 = json.mapSint32Sint32 ?? json.map_sint32_sint32; if (mapSint32Sint32) { - msg.mapSint32Sint32 = mapSint32Sint32; + for (const [key, value] of Object.entries(mapSint32Sint32)) { + msg.mapSint32Sint32[key] = value; + } } - const mapSint64Sint64 = json[\\"mapSint64Sint64\\"] ?? json.map_sint64_sint64; + const mapSint64Sint64 = json.mapSint64Sint64 ?? json.map_sint64_sint64; if (mapSint64Sint64) { - msg.mapSint64Sint64 = mapSint64Sint64; + for (const [key, value] of Object.entries(mapSint64Sint64)) { + msg.mapSint64Sint64[key] = BigInt(value as string); + } } const mapFixed32Fixed32 = - json[\\"mapFixed32Fixed32\\"] ?? json.map_fixed32_fixed32; + json.mapFixed32Fixed32 ?? json.map_fixed32_fixed32; if (mapFixed32Fixed32) { - msg.mapFixed32Fixed32 = mapFixed32Fixed32; + for (const [key, value] of Object.entries(mapFixed32Fixed32)) { + msg.mapFixed32Fixed32[key] = value; + } } const mapFixed64Fixed64 = - json[\\"mapFixed64Fixed64\\"] ?? json.map_fixed64_fixed64; + json.mapFixed64Fixed64 ?? json.map_fixed64_fixed64; if (mapFixed64Fixed64) { - msg.mapFixed64Fixed64 = mapFixed64Fixed64; + for (const [key, value] of Object.entries(mapFixed64Fixed64)) { + msg.mapFixed64Fixed64[key] = BigInt(value as string); + } } const mapSfixed32Sfixed32 = - json[\\"mapSfixed32Sfixed32\\"] ?? json.map_sfixed32_sfixed32; + json.mapSfixed32Sfixed32 ?? json.map_sfixed32_sfixed32; if (mapSfixed32Sfixed32) { - msg.mapSfixed32Sfixed32 = mapSfixed32Sfixed32; + for (const [key, value] of Object.entries(mapSfixed32Sfixed32)) { + msg.mapSfixed32Sfixed32[key] = value; + } } const mapSfixed64Sfixed64 = - json[\\"mapSfixed64Sfixed64\\"] ?? json.map_sfixed64_sfixed64; + json.mapSfixed64Sfixed64 ?? json.map_sfixed64_sfixed64; if (mapSfixed64Sfixed64) { - msg.mapSfixed64Sfixed64 = mapSfixed64Sfixed64; + for (const [key, value] of Object.entries(mapSfixed64Sfixed64)) { + msg.mapSfixed64Sfixed64[key] = BigInt(value as string); + } } - const mapInt32Float = json[\\"mapInt32Float\\"] ?? json.map_int32_float; + const mapInt32Float = json.mapInt32Float ?? json.map_int32_float; if (mapInt32Float) { - msg.mapInt32Float = mapInt32Float; + for (const [key, value] of Object.entries(mapInt32Float)) { + msg.mapInt32Float[key] = value; + } } - const mapInt32Double = json[\\"mapInt32Double\\"] ?? json.map_int32_double; + const mapInt32Double = json.mapInt32Double ?? json.map_int32_double; if (mapInt32Double) { - msg.mapInt32Double = mapInt32Double; + for (const [key, value] of Object.entries(mapInt32Double)) { + msg.mapInt32Double[key] = value; + } } - const mapBoolBool = json[\\"mapBoolBool\\"] ?? json.map_bool_bool; + const mapBoolBool = json.mapBoolBool ?? json.map_bool_bool; if (mapBoolBool) { - msg.mapBoolBool = mapBoolBool; + for (const [key, value] of Object.entries(mapBoolBool)) { + msg.mapBoolBool[key] = value; + } } - const mapStringString = json[\\"mapStringString\\"] ?? json.map_string_string; + const mapStringString = json.mapStringString ?? json.map_string_string; if (mapStringString) { - msg.mapStringString = mapStringString; + for (const [key, value] of Object.entries(mapStringString)) { + msg.mapStringString[key] = value; + } } - const mapInt32Bytes = json[\\"mapInt32Bytes\\"] ?? json.map_int32_bytes; + const mapInt32Bytes = json.mapInt32Bytes ?? json.map_int32_bytes; if (mapInt32Bytes) { - msg.mapInt32Bytes = mapInt32Bytes; + for (const [key, value] of Object.entries(mapInt32Bytes)) { + msg.mapInt32Bytes[key] = value; + } } - const mapInt32Enum = json[\\"mapInt32Enum\\"] ?? json.map_int32_enum; + const mapInt32Enum = json.mapInt32Enum ?? json.map_int32_enum; if (mapInt32Enum) { - msg.mapInt32Enum = mapInt32Enum; + for (const [key, value] of Object.entries(mapInt32Enum)) { + msg.mapInt32Enum[key] = value as MapEnum; + } } const mapInt32ForeignMessage = - json[\\"mapInt32ForeignMessage\\"] ?? json.map_int32_foreign_message; + json.mapInt32ForeignMessage ?? json.map_int32_foreign_message; if (mapInt32ForeignMessage) { - msg.mapInt32ForeignMessage = mapInt32ForeignMessage; + for (const [key, value] of Object.entries(mapInt32ForeignMessage)) { + msg.mapInt32ForeignMessage[key] = ForeignMessage._readMessageJSON( + ForeignMessage.initialize(), + value + ); + } } const mapStringForeignMessage = - json[\\"mapStringForeignMessage\\"] ?? json.map_string_foreign_message; + json.mapStringForeignMessage ?? json.map_string_foreign_message; if (mapStringForeignMessage) { - msg.mapStringForeignMessage = mapStringForeignMessage; + for (const [key, value] of Object.entries(mapStringForeignMessage)) { + msg.mapStringForeignMessage[key] = ForeignMessage._readMessageJSON( + ForeignMessage.initialize(), + value + ); + } } - const mapInt32AllTypes = - json[\\"mapInt32AllTypes\\"] ?? json.map_int32_all_types; + const mapInt32AllTypes = json.mapInt32AllTypes ?? json.map_int32_all_types; if (mapInt32AllTypes) { - msg.mapInt32AllTypes = mapInt32AllTypes; + for (const [key, value] of Object.entries(mapInt32AllTypes)) { + msg.mapInt32AllTypes[key] = TestAllTypes._readMessageJSON( + TestAllTypes.initialize(), + value + ); + } } return msg; }, @@ -53898,7 +55030,7 @@ export const TestMapSubmessage = { if (msg.testMap) { const testMap = TestMap._writeMessageJSON(msg.testMap); if (Object.keys(testMap).length > 0) { - json[\\"testMap\\"] = testMap; + json.testMap = testMap; } } return json; @@ -53934,7 +55066,7 @@ export const TestMapSubmessage = { msg: TestMapSubmessage, json: any ): TestMapSubmessage { - const testMap = json[\\"testMap\\"] ?? json.test_map; + const testMap = json.testMap ?? json.test_map; if (testMap) { const m = TestMap.initialize(); TestMap._readMessageJSON(m, testMap); @@ -53999,11 +55131,13 @@ export const TestMessageMap = { writer: BinaryWriter ): BinaryWriter { if (msg.mapInt32Message) { - for (const key in msg.mapInt32Message) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeMessage(2, msg.mapInt32Message![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Message)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeMessage(2, value, TestAllTypes._writeMessage); + }); + } } } return writer; @@ -54017,8 +55151,14 @@ export const TestMessageMap = { ): Record { const json: Record = {}; if (msg.mapInt32Message) { - if (Object.keys(msg.mapInt32Message).length > 0) { - json[\\"mapInt32Message\\"] = msg.mapInt32Message; + if (msg.mapInt32Message) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32Message)) { + if (key && value) { + map[key] = TestAllTypes._writeMessageJSON(value); + json.mapInt32Message = map; + } + } } } return json; @@ -54046,7 +55186,10 @@ export const TestMessageMap = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + TestAllTypes.initialize(), + TestAllTypes._readMessage + ); break; } } @@ -54070,9 +55213,14 @@ export const TestMessageMap = { * @private */ _readMessageJSON: function (msg: TestMessageMap, json: any): TestMessageMap { - const mapInt32Message = json[\\"mapInt32Message\\"] ?? json.map_int32_message; + const mapInt32Message = json.mapInt32Message ?? json.map_int32_message; if (mapInt32Message) { - msg.mapInt32Message = mapInt32Message; + for (const [key, value] of Object.entries(mapInt32Message)) { + msg.mapInt32Message[key] = TestAllTypes._readMessageJSON( + TestAllTypes.initialize(), + value + ); + } } return msg; }, @@ -54134,19 +55282,23 @@ export const TestSameTypeMap = { writer: BinaryWriter ): BinaryWriter { if (msg.map1) { - for (const key in msg.map1) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeInt32(2, msg.map1![key]); - }); + for (const [key, value] of Object.entries(msg.map1)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeInt32(2, value); + }); + } } } if (msg.map2) { - for (const key in msg.map2) { - writer.writeMessage(2, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeInt32(2, msg.map2![key]); - }); + for (const [key, value] of Object.entries(msg.map2)) { + if (key && value) { + writer.writeMessage(2, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeInt32(2, value); + }); + } } } return writer; @@ -54160,13 +55312,25 @@ export const TestSameTypeMap = { ): Record { const json: Record = {}; if (msg.map1) { - if (Object.keys(msg.map1).length > 0) { - json[\\"map1\\"] = msg.map1; + if (msg.map1) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.map1)) { + if (key && value) { + map[key] = value; + json.map1 = map; + } + } } } if (msg.map2) { - if (Object.keys(msg.map2).length > 0) { - json[\\"map2\\"] = msg.map2; + if (msg.map2) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.map2)) { + if (key && value) { + map[key] = value; + json.map2 = map; + } + } } } return json; @@ -54244,13 +55408,17 @@ export const TestSameTypeMap = { msg: TestSameTypeMap, json: any ): TestSameTypeMap { - const map1 = json[\\"map1\\"] ?? json.map1; + const map1 = json.map1 ?? json.map1; if (map1) { - msg.map1 = map1; + for (const [key, value] of Object.entries(map1)) { + msg.map1[key] = value; + } } - const map2 = json[\\"map2\\"] ?? json.map2; + const map2 = json.map2 ?? json.map2; if (map2) { - msg.map2 = map2; + for (const [key, value] of Object.entries(map2)) { + msg.map2[key] = value; + } } return msg; }, @@ -54317,11 +55485,13 @@ export const TestRequiredMessageMap = { writer: BinaryWriter ): BinaryWriter { if (msg.mapField) { - for (const key in msg.mapField) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeMessage(2, msg.mapField![key]); - }); + for (const [key, value] of Object.entries(msg.mapField)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeMessage(2, value, TestRequired._writeMessage); + }); + } } } return writer; @@ -54335,8 +55505,14 @@ export const TestRequiredMessageMap = { ): Record { const json: Record = {}; if (msg.mapField) { - if (Object.keys(msg.mapField).length > 0) { - json[\\"mapField\\"] = msg.mapField; + if (msg.mapField) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapField)) { + if (key && value) { + map[key] = TestRequired._writeMessageJSON(value); + json.mapField = map; + } + } } } return json; @@ -54364,7 +55540,10 @@ export const TestRequiredMessageMap = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + TestRequired.initialize(), + TestRequired._readMessage + ); break; } } @@ -54391,9 +55570,14 @@ export const TestRequiredMessageMap = { msg: TestRequiredMessageMap, json: any ): TestRequiredMessageMap { - const mapField = json[\\"mapField\\"] ?? json.map_field; + const mapField = json.mapField ?? json.map_field; if (mapField) { - msg.mapField = mapField; + for (const [key, value] of Object.entries(mapField)) { + msg.mapField[key] = TestRequired._readMessageJSON( + TestRequired.initialize(), + value + ); + } } return msg; }, @@ -54470,139 +55654,173 @@ export const TestArenaMap = { writer: BinaryWriter ): BinaryWriter { if (msg.mapInt32Int32) { - for (const key in msg.mapInt32Int32) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeInt32(2, msg.mapInt32Int32![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Int32)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeInt32(2, value); + }); + } } } if (msg.mapInt64Int64) { - for (const key in msg.mapInt64Int64) { - writer.writeMessage(2, {}, (_, mapWriter) => { - mapWriter.writeInt64String(1, key as unknown as string); - mapWriter.writeInt64String(2, msg.mapInt64Int64![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt64Int64)) { + if (key && value) { + writer.writeMessage(2, {}, (_, mapWriter) => { + mapWriter.writeInt64String(1, key as any); + mapWriter.writeInt64String(2, value.toString()); + }); + } } } if (msg.mapUint32Uint32) { - for (const key in msg.mapUint32Uint32) { - writer.writeMessage(3, {}, (_, mapWriter) => { - mapWriter.writeUint32(1, key as unknown as number); - mapWriter.writeUint32(2, msg.mapUint32Uint32![key]); - }); + for (const [key, value] of Object.entries(msg.mapUint32Uint32)) { + if (key && value) { + writer.writeMessage(3, {}, (_, mapWriter) => { + mapWriter.writeUint32(1, key as any); + mapWriter.writeUint32(2, value); + }); + } } } if (msg.mapUint64Uint64) { - for (const key in msg.mapUint64Uint64) { - writer.writeMessage(4, {}, (_, mapWriter) => { - mapWriter.writeUint64String(1, key as unknown as string); - mapWriter.writeUint64String(2, msg.mapUint64Uint64![key]); - }); + for (const [key, value] of Object.entries(msg.mapUint64Uint64)) { + if (key && value) { + writer.writeMessage(4, {}, (_, mapWriter) => { + mapWriter.writeUint64String(1, key as any); + mapWriter.writeUint64String(2, value.toString()); + }); + } } } if (msg.mapSint32Sint32) { - for (const key in msg.mapSint32Sint32) { - writer.writeMessage(5, {}, (_, mapWriter) => { - mapWriter.writeSint32(1, key as unknown as number); - mapWriter.writeSint32(2, msg.mapSint32Sint32![key]); - }); + for (const [key, value] of Object.entries(msg.mapSint32Sint32)) { + if (key && value) { + writer.writeMessage(5, {}, (_, mapWriter) => { + mapWriter.writeSint32(1, key as any); + mapWriter.writeSint32(2, value); + }); + } } } if (msg.mapSint64Sint64) { - for (const key in msg.mapSint64Sint64) { - writer.writeMessage(6, {}, (_, mapWriter) => { - mapWriter.writeSint64String(1, key as unknown as string); - mapWriter.writeSint64String(2, msg.mapSint64Sint64![key]); - }); + for (const [key, value] of Object.entries(msg.mapSint64Sint64)) { + if (key && value) { + writer.writeMessage(6, {}, (_, mapWriter) => { + mapWriter.writeSint64String(1, key as any); + mapWriter.writeSint64String(2, value.toString()); + }); + } } } if (msg.mapFixed32Fixed32) { - for (const key in msg.mapFixed32Fixed32) { - writer.writeMessage(7, {}, (_, mapWriter) => { - mapWriter.writeFixed32(1, key as unknown as number); - mapWriter.writeFixed32(2, msg.mapFixed32Fixed32![key]); - }); + for (const [key, value] of Object.entries(msg.mapFixed32Fixed32)) { + if (key && value) { + writer.writeMessage(7, {}, (_, mapWriter) => { + mapWriter.writeFixed32(1, key as any); + mapWriter.writeFixed32(2, value); + }); + } } } if (msg.mapFixed64Fixed64) { - for (const key in msg.mapFixed64Fixed64) { - writer.writeMessage(8, {}, (_, mapWriter) => { - mapWriter.writeFixed64String(1, key as unknown as string); - mapWriter.writeFixed64String(2, msg.mapFixed64Fixed64![key]); - }); + for (const [key, value] of Object.entries(msg.mapFixed64Fixed64)) { + if (key && value) { + writer.writeMessage(8, {}, (_, mapWriter) => { + mapWriter.writeFixed64String(1, key as any); + mapWriter.writeFixed64String(2, value.toString()); + }); + } } } if (msg.mapSfixed32Sfixed32) { - for (const key in msg.mapSfixed32Sfixed32) { - writer.writeMessage(9, {}, (_, mapWriter) => { - mapWriter.writeSfixed32(1, key as unknown as number); - mapWriter.writeSfixed32(2, msg.mapSfixed32Sfixed32![key]); - }); + for (const [key, value] of Object.entries(msg.mapSfixed32Sfixed32)) { + if (key && value) { + writer.writeMessage(9, {}, (_, mapWriter) => { + mapWriter.writeSfixed32(1, key as any); + mapWriter.writeSfixed32(2, value); + }); + } } } if (msg.mapSfixed64Sfixed64) { - for (const key in msg.mapSfixed64Sfixed64) { - writer.writeMessage(10, {}, (_, mapWriter) => { - mapWriter.writeSfixed64(1, key as unknown as string); - mapWriter.writeSfixed64(2, msg.mapSfixed64Sfixed64![key]); - }); + for (const [key, value] of Object.entries(msg.mapSfixed64Sfixed64)) { + if (key && value) { + writer.writeMessage(10, {}, (_, mapWriter) => { + mapWriter.writeSfixed64(1, key as any); + mapWriter.writeSfixed64(2, value.toString()); + }); + } } } if (msg.mapInt32Float) { - for (const key in msg.mapInt32Float) { - writer.writeMessage(11, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeFloat(2, msg.mapInt32Float![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Float)) { + if (key && value) { + writer.writeMessage(11, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeFloat(2, value); + }); + } } } if (msg.mapInt32Double) { - for (const key in msg.mapInt32Double) { - writer.writeMessage(12, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeDouble(2, msg.mapInt32Double![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Double)) { + if (key && value) { + writer.writeMessage(12, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeDouble(2, value); + }); + } } } if (msg.mapBoolBool) { - for (const key in msg.mapBoolBool) { - writer.writeMessage(13, {}, (_, mapWriter) => { - mapWriter.writeBool(1, key as unknown as boolean); - mapWriter.writeBool(2, msg.mapBoolBool![key]); - }); + for (const [key, value] of Object.entries(msg.mapBoolBool)) { + if (key && value) { + writer.writeMessage(13, {}, (_, mapWriter) => { + mapWriter.writeBool(1, key as any); + mapWriter.writeBool(2, value); + }); + } } } if (msg.mapStringString) { - for (const key in msg.mapStringString) { - writer.writeMessage(14, {}, (_, mapWriter) => { - mapWriter.writeString(1, key as unknown as string); - mapWriter.writeString(2, msg.mapStringString![key]); - }); + for (const [key, value] of Object.entries(msg.mapStringString)) { + if (key && value) { + writer.writeMessage(14, {}, (_, mapWriter) => { + mapWriter.writeString(1, key as any); + mapWriter.writeString(2, value); + }); + } } } if (msg.mapInt32Bytes) { - for (const key in msg.mapInt32Bytes) { - writer.writeMessage(15, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeBytes(2, msg.mapInt32Bytes![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Bytes)) { + if (key && value) { + writer.writeMessage(15, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeBytes(2, value); + }); + } } } if (msg.mapInt32Enum) { - for (const key in msg.mapInt32Enum) { - writer.writeMessage(16, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeEnum(2, msg.mapInt32Enum![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Enum)) { + if (key && value) { + writer.writeMessage(16, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeEnum(2, value as MapEnum); + }); + } } } if (msg.mapInt32ForeignMessage) { - for (const key in msg.mapInt32ForeignMessage) { - writer.writeMessage(17, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeMessage(2, msg.mapInt32ForeignMessage![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32ForeignMessage)) { + if (key && value) { + writer.writeMessage(17, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeMessage(2, value, ForeignMessage._writeMessage); + }); + } } } return writer; @@ -54616,88 +55834,190 @@ export const TestArenaMap = { ): Record { const json: Record = {}; if (msg.mapInt32Int32) { - if (Object.keys(msg.mapInt32Int32).length > 0) { - json[\\"mapInt32Int32\\"] = msg.mapInt32Int32; + if (msg.mapInt32Int32) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32Int32)) { + if (key && value) { + map[key] = value; + json.mapInt32Int32 = map; + } + } } } if (msg.mapInt64Int64) { - if (Object.keys(msg.mapInt64Int64).length > 0) { - json[\\"mapInt64Int64\\"] = msg.mapInt64Int64; + if (msg.mapInt64Int64) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt64Int64)) { + if (key && value) { + map[key] = value.toString(); + json.mapInt64Int64 = map; + } + } } } if (msg.mapUint32Uint32) { - if (Object.keys(msg.mapUint32Uint32).length > 0) { - json[\\"mapUint32Uint32\\"] = msg.mapUint32Uint32; + if (msg.mapUint32Uint32) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapUint32Uint32)) { + if (key && value) { + map[key] = value; + json.mapUint32Uint32 = map; + } + } } } if (msg.mapUint64Uint64) { - if (Object.keys(msg.mapUint64Uint64).length > 0) { - json[\\"mapUint64Uint64\\"] = msg.mapUint64Uint64; + if (msg.mapUint64Uint64) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapUint64Uint64)) { + if (key && value) { + map[key] = value.toString(); + json.mapUint64Uint64 = map; + } + } } } if (msg.mapSint32Sint32) { - if (Object.keys(msg.mapSint32Sint32).length > 0) { - json[\\"mapSint32Sint32\\"] = msg.mapSint32Sint32; + if (msg.mapSint32Sint32) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapSint32Sint32)) { + if (key && value) { + map[key] = value; + json.mapSint32Sint32 = map; + } + } } } if (msg.mapSint64Sint64) { - if (Object.keys(msg.mapSint64Sint64).length > 0) { - json[\\"mapSint64Sint64\\"] = msg.mapSint64Sint64; + if (msg.mapSint64Sint64) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapSint64Sint64)) { + if (key && value) { + map[key] = value.toString(); + json.mapSint64Sint64 = map; + } + } } } if (msg.mapFixed32Fixed32) { - if (Object.keys(msg.mapFixed32Fixed32).length > 0) { - json[\\"mapFixed32Fixed32\\"] = msg.mapFixed32Fixed32; + if (msg.mapFixed32Fixed32) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapFixed32Fixed32)) { + if (key && value) { + map[key] = value; + json.mapFixed32Fixed32 = map; + } + } } } if (msg.mapFixed64Fixed64) { - if (Object.keys(msg.mapFixed64Fixed64).length > 0) { - json[\\"mapFixed64Fixed64\\"] = msg.mapFixed64Fixed64; + if (msg.mapFixed64Fixed64) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapFixed64Fixed64)) { + if (key && value) { + map[key] = value.toString(); + json.mapFixed64Fixed64 = map; + } + } } } if (msg.mapSfixed32Sfixed32) { - if (Object.keys(msg.mapSfixed32Sfixed32).length > 0) { - json[\\"mapSfixed32Sfixed32\\"] = msg.mapSfixed32Sfixed32; + if (msg.mapSfixed32Sfixed32) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapSfixed32Sfixed32)) { + if (key && value) { + map[key] = value; + json.mapSfixed32Sfixed32 = map; + } + } } } if (msg.mapSfixed64Sfixed64) { - if (Object.keys(msg.mapSfixed64Sfixed64).length > 0) { - json[\\"mapSfixed64Sfixed64\\"] = msg.mapSfixed64Sfixed64; + if (msg.mapSfixed64Sfixed64) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapSfixed64Sfixed64)) { + if (key && value) { + map[key] = value.toString(); + json.mapSfixed64Sfixed64 = map; + } + } } } if (msg.mapInt32Float) { - if (Object.keys(msg.mapInt32Float).length > 0) { - json[\\"mapInt32Float\\"] = msg.mapInt32Float; + if (msg.mapInt32Float) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32Float)) { + if (key && value) { + map[key] = value; + json.mapInt32Float = map; + } + } } } if (msg.mapInt32Double) { - if (Object.keys(msg.mapInt32Double).length > 0) { - json[\\"mapInt32Double\\"] = msg.mapInt32Double; + if (msg.mapInt32Double) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32Double)) { + if (key && value) { + map[key] = value; + json.mapInt32Double = map; + } + } } } if (msg.mapBoolBool) { - if (Object.keys(msg.mapBoolBool).length > 0) { - json[\\"mapBoolBool\\"] = msg.mapBoolBool; + if (msg.mapBoolBool) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapBoolBool)) { + if (key && value) { + map[key] = value; + json.mapBoolBool = map; + } + } } } if (msg.mapStringString) { - if (Object.keys(msg.mapStringString).length > 0) { - json[\\"mapStringString\\"] = msg.mapStringString; + if (msg.mapStringString) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapStringString)) { + if (key && value) { + map[key] = value; + json.mapStringString = map; + } + } } } if (msg.mapInt32Bytes) { - if (Object.keys(msg.mapInt32Bytes).length > 0) { - json[\\"mapInt32Bytes\\"] = msg.mapInt32Bytes; + if (msg.mapInt32Bytes) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32Bytes)) { + if (key && value) { + map[key] = value; + json.mapInt32Bytes = map; + } + } } } if (msg.mapInt32Enum) { - if (Object.keys(msg.mapInt32Enum).length > 0) { - json[\\"mapInt32Enum\\"] = msg.mapInt32Enum; + if (msg.mapInt32Enum) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32Enum)) { + if (key && value) { + map[key] = value; + json.mapInt32Enum = map; + } + } } } if (msg.mapInt32ForeignMessage) { - if (Object.keys(msg.mapInt32ForeignMessage).length > 0) { - json[\\"mapInt32ForeignMessage\\"] = msg.mapInt32ForeignMessage; + if (msg.mapInt32ForeignMessage) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32ForeignMessage)) { + if (key && value) { + map[key] = ForeignMessage._writeMessageJSON(value); + json.mapInt32ForeignMessage = map; + } + } } } return json; @@ -54738,8 +56058,8 @@ export const TestArenaMap = { } case 2: { reader.readMessage(undefined, () => { - let key: string | undefined; - let value = \\"\\"; + let key: bigint | undefined; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -54748,7 +56068,7 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readInt64String(); + value = BigInt(reader.readInt64String()); break; } } @@ -54784,8 +56104,8 @@ export const TestArenaMap = { } case 4: { reader.readMessage(undefined, () => { - let key: string | undefined; - let value = \\"\\"; + let key: bigint | undefined; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -54794,7 +56114,7 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readUint64String(); + value = BigInt(reader.readUint64String()); break; } } @@ -54830,8 +56150,8 @@ export const TestArenaMap = { } case 6: { reader.readMessage(undefined, () => { - let key: string | undefined; - let value = \\"\\"; + let key: bigint | undefined; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -54840,7 +56160,7 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readSint64(); + value = BigInt(reader.readSint64()); break; } } @@ -54876,8 +56196,8 @@ export const TestArenaMap = { } case 8: { reader.readMessage(undefined, () => { - let key: string | undefined; - let value = \\"\\"; + let key: bigint | undefined; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -54886,7 +56206,7 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readFixed64String(); + value = BigInt(reader.readFixed64String()); break; } } @@ -54922,8 +56242,8 @@ export const TestArenaMap = { } case 10: { reader.readMessage(undefined, () => { - let key: string | undefined; - let value = \\"\\"; + let key: bigint | undefined; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -54932,7 +56252,7 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readSfixed64(); + value = BigInt(reader.readSfixed64()); break; } } @@ -55070,7 +56390,7 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readEnum(); + value = reader.readEnum() as MapEnum; break; } } @@ -55093,7 +56413,10 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + ForeignMessage.initialize(), + ForeignMessage._readMessage + ); break; } } @@ -55117,78 +56440,115 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function (msg: TestArenaMap, json: any): TestArenaMap { - const mapInt32Int32 = json[\\"mapInt32Int32\\"] ?? json.map_int32_int32; + const mapInt32Int32 = json.mapInt32Int32 ?? json.map_int32_int32; if (mapInt32Int32) { - msg.mapInt32Int32 = mapInt32Int32; + for (const [key, value] of Object.entries(mapInt32Int32)) { + msg.mapInt32Int32[key] = value; + } } - const mapInt64Int64 = json[\\"mapInt64Int64\\"] ?? json.map_int64_int64; + const mapInt64Int64 = json.mapInt64Int64 ?? json.map_int64_int64; if (mapInt64Int64) { - msg.mapInt64Int64 = mapInt64Int64; + for (const [key, value] of Object.entries(mapInt64Int64)) { + msg.mapInt64Int64[key] = BigInt(value as string); + } } - const mapUint32Uint32 = json[\\"mapUint32Uint32\\"] ?? json.map_uint32_uint32; + const mapUint32Uint32 = json.mapUint32Uint32 ?? json.map_uint32_uint32; if (mapUint32Uint32) { - msg.mapUint32Uint32 = mapUint32Uint32; + for (const [key, value] of Object.entries(mapUint32Uint32)) { + msg.mapUint32Uint32[key] = value; + } } - const mapUint64Uint64 = json[\\"mapUint64Uint64\\"] ?? json.map_uint64_uint64; + const mapUint64Uint64 = json.mapUint64Uint64 ?? json.map_uint64_uint64; if (mapUint64Uint64) { - msg.mapUint64Uint64 = mapUint64Uint64; + for (const [key, value] of Object.entries(mapUint64Uint64)) { + msg.mapUint64Uint64[key] = BigInt(value as string); + } } - const mapSint32Sint32 = json[\\"mapSint32Sint32\\"] ?? json.map_sint32_sint32; + const mapSint32Sint32 = json.mapSint32Sint32 ?? json.map_sint32_sint32; if (mapSint32Sint32) { - msg.mapSint32Sint32 = mapSint32Sint32; + for (const [key, value] of Object.entries(mapSint32Sint32)) { + msg.mapSint32Sint32[key] = value; + } } - const mapSint64Sint64 = json[\\"mapSint64Sint64\\"] ?? json.map_sint64_sint64; + const mapSint64Sint64 = json.mapSint64Sint64 ?? json.map_sint64_sint64; if (mapSint64Sint64) { - msg.mapSint64Sint64 = mapSint64Sint64; + for (const [key, value] of Object.entries(mapSint64Sint64)) { + msg.mapSint64Sint64[key] = BigInt(value as string); + } } const mapFixed32Fixed32 = - json[\\"mapFixed32Fixed32\\"] ?? json.map_fixed32_fixed32; + json.mapFixed32Fixed32 ?? json.map_fixed32_fixed32; if (mapFixed32Fixed32) { - msg.mapFixed32Fixed32 = mapFixed32Fixed32; + for (const [key, value] of Object.entries(mapFixed32Fixed32)) { + msg.mapFixed32Fixed32[key] = value; + } } const mapFixed64Fixed64 = - json[\\"mapFixed64Fixed64\\"] ?? json.map_fixed64_fixed64; + json.mapFixed64Fixed64 ?? json.map_fixed64_fixed64; if (mapFixed64Fixed64) { - msg.mapFixed64Fixed64 = mapFixed64Fixed64; + for (const [key, value] of Object.entries(mapFixed64Fixed64)) { + msg.mapFixed64Fixed64[key] = BigInt(value as string); + } } const mapSfixed32Sfixed32 = - json[\\"mapSfixed32Sfixed32\\"] ?? json.map_sfixed32_sfixed32; + json.mapSfixed32Sfixed32 ?? json.map_sfixed32_sfixed32; if (mapSfixed32Sfixed32) { - msg.mapSfixed32Sfixed32 = mapSfixed32Sfixed32; + for (const [key, value] of Object.entries(mapSfixed32Sfixed32)) { + msg.mapSfixed32Sfixed32[key] = value; + } } const mapSfixed64Sfixed64 = - json[\\"mapSfixed64Sfixed64\\"] ?? json.map_sfixed64_sfixed64; + json.mapSfixed64Sfixed64 ?? json.map_sfixed64_sfixed64; if (mapSfixed64Sfixed64) { - msg.mapSfixed64Sfixed64 = mapSfixed64Sfixed64; + for (const [key, value] of Object.entries(mapSfixed64Sfixed64)) { + msg.mapSfixed64Sfixed64[key] = BigInt(value as string); + } } - const mapInt32Float = json[\\"mapInt32Float\\"] ?? json.map_int32_float; + const mapInt32Float = json.mapInt32Float ?? json.map_int32_float; if (mapInt32Float) { - msg.mapInt32Float = mapInt32Float; + for (const [key, value] of Object.entries(mapInt32Float)) { + msg.mapInt32Float[key] = value; + } } - const mapInt32Double = json[\\"mapInt32Double\\"] ?? json.map_int32_double; + const mapInt32Double = json.mapInt32Double ?? json.map_int32_double; if (mapInt32Double) { - msg.mapInt32Double = mapInt32Double; + for (const [key, value] of Object.entries(mapInt32Double)) { + msg.mapInt32Double[key] = value; + } } - const mapBoolBool = json[\\"mapBoolBool\\"] ?? json.map_bool_bool; + const mapBoolBool = json.mapBoolBool ?? json.map_bool_bool; if (mapBoolBool) { - msg.mapBoolBool = mapBoolBool; + for (const [key, value] of Object.entries(mapBoolBool)) { + msg.mapBoolBool[key] = value; + } } - const mapStringString = json[\\"mapStringString\\"] ?? json.map_string_string; + const mapStringString = json.mapStringString ?? json.map_string_string; if (mapStringString) { - msg.mapStringString = mapStringString; + for (const [key, value] of Object.entries(mapStringString)) { + msg.mapStringString[key] = value; + } } - const mapInt32Bytes = json[\\"mapInt32Bytes\\"] ?? json.map_int32_bytes; + const mapInt32Bytes = json.mapInt32Bytes ?? json.map_int32_bytes; if (mapInt32Bytes) { - msg.mapInt32Bytes = mapInt32Bytes; + for (const [key, value] of Object.entries(mapInt32Bytes)) { + msg.mapInt32Bytes[key] = value; + } } - const mapInt32Enum = json[\\"mapInt32Enum\\"] ?? json.map_int32_enum; + const mapInt32Enum = json.mapInt32Enum ?? json.map_int32_enum; if (mapInt32Enum) { - msg.mapInt32Enum = mapInt32Enum; + for (const [key, value] of Object.entries(mapInt32Enum)) { + msg.mapInt32Enum[key] = value as MapEnum; + } } const mapInt32ForeignMessage = - json[\\"mapInt32ForeignMessage\\"] ?? json.map_int32_foreign_message; + json.mapInt32ForeignMessage ?? json.map_int32_foreign_message; if (mapInt32ForeignMessage) { - msg.mapInt32ForeignMessage = mapInt32ForeignMessage; + for (const [key, value] of Object.entries(mapInt32ForeignMessage)) { + msg.mapInt32ForeignMessage[key] = ForeignMessage._readMessageJSON( + ForeignMessage.initialize(), + value + ); + } } return msg; }, @@ -55257,11 +56617,13 @@ export const MessageContainingMapCalledEntry = { writer: BinaryWriter ): BinaryWriter { if (msg.entry) { - for (const key in msg.entry) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeInt32(2, msg.entry![key]); - }); + for (const [key, value] of Object.entries(msg.entry)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeInt32(2, value); + }); + } } } return writer; @@ -55275,8 +56637,14 @@ export const MessageContainingMapCalledEntry = { ): Record { const json: Record = {}; if (msg.entry) { - if (Object.keys(msg.entry).length > 0) { - json[\\"entry\\"] = msg.entry; + if (msg.entry) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.entry)) { + if (key && value) { + map[key] = value; + json.entry = map; + } + } } } return json; @@ -55331,9 +56699,11 @@ export const MessageContainingMapCalledEntry = { msg: MessageContainingMapCalledEntry, json: any ): MessageContainingMapCalledEntry { - const entry = json[\\"entry\\"] ?? json.entry; + const entry = json.entry ?? json.entry; if (entry) { - msg.entry = entry; + for (const [key, value] of Object.entries(entry)) { + msg.entry[key] = value; + } } return msg; }, @@ -55400,11 +56770,17 @@ export const TestRecursiveMapMessage = { writer: BinaryWriter ): BinaryWriter { if (msg.a) { - for (const key in msg.a) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeString(1, key as unknown as string); - mapWriter.writeMessage(2, msg.a![key]); - }); + for (const [key, value] of Object.entries(msg.a)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeString(1, key as any); + mapWriter.writeMessage( + 2, + value, + TestRecursiveMapMessage._writeMessage + ); + }); + } } } return writer; @@ -55418,8 +56794,14 @@ export const TestRecursiveMapMessage = { ): Record { const json: Record = {}; if (msg.a) { - if (Object.keys(msg.a).length > 0) { - json[\\"a\\"] = msg.a; + if (msg.a) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.a)) { + if (key && value) { + map[key] = TestRecursiveMapMessage._writeMessageJSON(value); + json.a = map; + } + } } } return json; @@ -55447,7 +56829,10 @@ export const TestRecursiveMapMessage = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + TestRecursiveMapMessage.initialize(), + TestRecursiveMapMessage._readMessage + ); break; } } @@ -55474,9 +56859,14 @@ export const TestRecursiveMapMessage = { msg: TestRecursiveMapMessage, json: any ): TestRecursiveMapMessage { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { - msg.a = a; + for (const [key, value] of Object.entries(a)) { + msg.a[key] = TestRecursiveMapMessage._readMessageJSON( + TestRecursiveMapMessage.initialize(), + value + ); + } } return msg; }, @@ -55522,15 +56912,15 @@ export interface TestAllTypes { * Singular */ optionalInt32: number; - optionalInt64: string; + optionalInt64: bigint; optionalUint32: number; - optionalUint64: string; + optionalUint64: bigint; optionalSint32: number; - optionalSint64: string; + optionalSint64: bigint; optionalFixed32: number; - optionalFixed64: string; + optionalFixed64: bigint; optionalSfixed32: number; - optionalSfixed64: string; + optionalSfixed64: bigint; optionalFloat: number; optionalDouble: number; optionalBool: boolean; @@ -55553,15 +56943,15 @@ export interface TestAllTypes { * Repeated */ repeatedInt32: number[]; - repeatedInt64: string[]; + repeatedInt64: bigint[]; repeatedUint32: number[]; - repeatedUint64: string[]; + repeatedUint64: bigint[]; repeatedSint32: number[]; - repeatedSint64: string[]; + repeatedSint64: bigint[]; repeatedFixed32: number[]; - repeatedFixed64: string[]; + repeatedFixed64: bigint[]; repeatedSfixed32: number[]; - repeatedSfixed64: string[]; + repeatedSfixed64: bigint[]; repeatedFloat: number[]; repeatedDouble: number[]; repeatedBool: boolean[]; @@ -55597,15 +56987,15 @@ export namespace TestAllTypes { export interface TestPackedTypes { packedInt32: number[]; - packedInt64: string[]; + packedInt64: bigint[]; packedUint32: number[]; - packedUint64: string[]; + packedUint64: bigint[]; packedSint32: number[]; - packedSint64: string[]; + packedSint64: bigint[]; packedFixed32: number[]; - packedFixed64: string[]; + packedFixed64: bigint[]; packedSfixed32: number[]; - packedSfixed64: string[]; + packedSfixed64: bigint[]; packedFloat: number[]; packedDouble: number[]; packedBool: boolean[]; @@ -55617,15 +57007,15 @@ export interface TestPackedTypes { */ export interface TestUnpackedTypes { repeatedInt32: number[]; - repeatedInt64: string[]; + repeatedInt64: bigint[]; repeatedUint32: number[]; - repeatedUint64: string[]; + repeatedUint64: bigint[]; repeatedSint32: number[]; - repeatedSint64: string[]; + repeatedSint64: bigint[]; repeatedFixed32: number[]; - repeatedFixed64: string[]; + repeatedFixed64: bigint[]; repeatedSfixed32: number[]; - repeatedSfixed64: string[]; + repeatedSfixed64: bigint[]; repeatedFloat: number[]; repeatedDouble: number[]; repeatedBool: boolean[]; @@ -55732,15 +57122,15 @@ export const TestAllTypes = { initialize: function (): TestAllTypes { return { optionalInt32: 0, - optionalInt64: \\"\\", + optionalInt64: 0n, optionalUint32: 0, - optionalUint64: \\"\\", + optionalUint64: 0n, optionalSint32: 0, - optionalSint64: \\"\\", + optionalSint64: 0n, optionalFixed32: 0, - optionalFixed64: \\"\\", + optionalFixed64: 0n, optionalSfixed32: 0, - optionalSfixed64: \\"\\", + optionalSfixed64: 0n, optionalFloat: 0, optionalDouble: 0, optionalBool: false, @@ -55794,31 +57184,31 @@ export const TestAllTypes = { writer.writeInt32(1, msg.optionalInt32); } if (msg.optionalInt64) { - writer.writeInt64String(2, msg.optionalInt64); + writer.writeInt64String(2, msg.optionalInt64.toString()); } if (msg.optionalUint32) { writer.writeUint32(3, msg.optionalUint32); } if (msg.optionalUint64) { - writer.writeUint64String(4, msg.optionalUint64); + writer.writeUint64String(4, msg.optionalUint64.toString()); } if (msg.optionalSint32) { writer.writeSint32(5, msg.optionalSint32); } if (msg.optionalSint64) { - writer.writeSint64String(6, msg.optionalSint64); + writer.writeSint64String(6, msg.optionalSint64.toString()); } if (msg.optionalFixed32) { writer.writeFixed32(7, msg.optionalFixed32); } if (msg.optionalFixed64) { - writer.writeFixed64String(8, msg.optionalFixed64); + writer.writeFixed64String(8, msg.optionalFixed64.toString()); } if (msg.optionalSfixed32) { writer.writeSfixed32(9, msg.optionalSfixed32); } if (msg.optionalSfixed64) { - writer.writeSfixed64(10, msg.optionalSfixed64); + writer.writeSfixed64(10, msg.optionalSfixed64.toString()); } if (msg.optionalFloat) { writer.writeFloat(11, msg.optionalFloat); @@ -55893,31 +57283,31 @@ export const TestAllTypes = { writer.writeRepeatedInt32(31, msg.repeatedInt32); } if (msg.repeatedInt64?.length) { - writer.writeRepeatedInt64String(32, msg.repeatedInt64); + writer.writeRepeatedInt64String(32, msg.repeatedInt64.toString()); } if (msg.repeatedUint32?.length) { writer.writeRepeatedUint32(33, msg.repeatedUint32); } if (msg.repeatedUint64?.length) { - writer.writeRepeatedUint64String(34, msg.repeatedUint64); + writer.writeRepeatedUint64String(34, msg.repeatedUint64.toString()); } if (msg.repeatedSint32?.length) { writer.writeRepeatedSint32(35, msg.repeatedSint32); } if (msg.repeatedSint64?.length) { - writer.writeRepeatedSint64String(36, msg.repeatedSint64); + writer.writeRepeatedSint64String(36, msg.repeatedSint64.toString()); } if (msg.repeatedFixed32?.length) { writer.writeRepeatedFixed32(37, msg.repeatedFixed32); } if (msg.repeatedFixed64?.length) { - writer.writeRepeatedFixed64String(38, msg.repeatedFixed64); + writer.writeRepeatedFixed64String(38, msg.repeatedFixed64.toString()); } if (msg.repeatedSfixed32?.length) { writer.writeRepeatedSfixed32(39, msg.repeatedSfixed32); } if (msg.repeatedSfixed64?.length) { - writer.writeRepeatedSfixed64(40, msg.repeatedSfixed64); + writer.writeRepeatedSfixed64(40, msg.repeatedSfixed64.toString()); } if (msg.repeatedFloat?.length) { writer.writeRepeatedFloat(41, msg.repeatedFloat); @@ -56001,55 +57391,55 @@ export const TestAllTypes = { ): Record { const json: Record = {}; if (msg.optionalInt32) { - json[\\"optionalInt32\\"] = msg.optionalInt32; + json.optionalInt32 = msg.optionalInt32; } if (msg.optionalInt64) { - json[\\"optionalInt64\\"] = msg.optionalInt64; + json.optionalInt64 = msg.optionalInt64.toString(); } if (msg.optionalUint32) { - json[\\"optionalUint32\\"] = msg.optionalUint32; + json.optionalUint32 = msg.optionalUint32; } if (msg.optionalUint64) { - json[\\"optionalUint64\\"] = msg.optionalUint64; + json.optionalUint64 = msg.optionalUint64.toString(); } if (msg.optionalSint32) { - json[\\"optionalSint32\\"] = msg.optionalSint32; + json.optionalSint32 = msg.optionalSint32; } if (msg.optionalSint64) { - json[\\"optionalSint64\\"] = msg.optionalSint64; + json.optionalSint64 = msg.optionalSint64.toString(); } if (msg.optionalFixed32) { - json[\\"optionalFixed32\\"] = msg.optionalFixed32; + json.optionalFixed32 = msg.optionalFixed32; } if (msg.optionalFixed64) { - json[\\"optionalFixed64\\"] = msg.optionalFixed64; + json.optionalFixed64 = msg.optionalFixed64.toString(); } if (msg.optionalSfixed32) { - json[\\"optionalSfixed32\\"] = msg.optionalSfixed32; + json.optionalSfixed32 = msg.optionalSfixed32; } if (msg.optionalSfixed64) { - json[\\"optionalSfixed64\\"] = msg.optionalSfixed64; + json.optionalSfixed64 = msg.optionalSfixed64.toString(); } if (msg.optionalFloat) { - json[\\"optionalFloat\\"] = msg.optionalFloat; + json.optionalFloat = msg.optionalFloat; } if (msg.optionalDouble) { - json[\\"optionalDouble\\"] = msg.optionalDouble; + json.optionalDouble = msg.optionalDouble; } if (msg.optionalBool) { - json[\\"optionalBool\\"] = msg.optionalBool; + json.optionalBool = msg.optionalBool; } if (msg.optionalString) { - json[\\"optionalString\\"] = msg.optionalString; + json.optionalString = msg.optionalString; } if (msg.optionalBytes) { - json[\\"optionalBytes\\"] = msg.optionalBytes; + json.optionalBytes = msg.optionalBytes; } if (msg.optionalNestedMessage) { const optionalNestedMessage = TestAllTypes.NestedMessage._writeMessageJSON(msg.optionalNestedMessage); if (Object.keys(optionalNestedMessage).length > 0) { - json[\\"optionalNestedMessage\\"] = optionalNestedMessage; + json.optionalNestedMessage = optionalNestedMessage; } } if (msg.optionalForeignMessage) { @@ -56057,7 +57447,7 @@ export const TestAllTypes = { msg.optionalForeignMessage ); if (Object.keys(optionalForeignMessage).length > 0) { - json[\\"optionalForeignMessage\\"] = optionalForeignMessage; + json.optionalForeignMessage = optionalForeignMessage; } } if (msg.optionalImportMessage) { @@ -56065,27 +57455,27 @@ export const TestAllTypes = { msg.optionalImportMessage ); if (Object.keys(optionalImportMessage).length > 0) { - json[\\"optionalImportMessage\\"] = optionalImportMessage; + json.optionalImportMessage = optionalImportMessage; } } if (msg.optionalNestedEnum) { - json[\\"optionalNestedEnum\\"] = msg.optionalNestedEnum; + json.optionalNestedEnum = msg.optionalNestedEnum; } if (msg.optionalForeignEnum) { - json[\\"optionalForeignEnum\\"] = msg.optionalForeignEnum; + json.optionalForeignEnum = msg.optionalForeignEnum; } if (msg.optionalStringPiece) { - json[\\"optionalStringPiece\\"] = msg.optionalStringPiece; + json.optionalStringPiece = msg.optionalStringPiece; } if (msg.optionalCord) { - json[\\"optionalCord\\"] = msg.optionalCord; + json.optionalCord = msg.optionalCord; } if (msg.optionalPublicImportMessage) { const optionalPublicImportMessage = PublicImportMessage._writeMessageJSON( msg.optionalPublicImportMessage ); if (Object.keys(optionalPublicImportMessage).length > 0) { - json[\\"optionalPublicImportMessage\\"] = optionalPublicImportMessage; + json.optionalPublicImportMessage = optionalPublicImportMessage; } } if (msg.optionalLazyMessage) { @@ -56093,7 +57483,7 @@ export const TestAllTypes = { msg.optionalLazyMessage ); if (Object.keys(optionalLazyMessage).length > 0) { - json[\\"optionalLazyMessage\\"] = optionalLazyMessage; + json.optionalLazyMessage = optionalLazyMessage; } } if (msg.optionalLazyImportMessage) { @@ -56101,102 +57491,102 @@ export const TestAllTypes = { msg.optionalLazyImportMessage ); if (Object.keys(optionalLazyImportMessage).length > 0) { - json[\\"optionalLazyImportMessage\\"] = optionalLazyImportMessage; + json.optionalLazyImportMessage = optionalLazyImportMessage; } } if (msg.repeatedInt32?.length) { - json[\\"repeatedInt32\\"] = msg.repeatedInt32; + json.repeatedInt32 = msg.repeatedInt32; } if (msg.repeatedInt64?.length) { - json[\\"repeatedInt64\\"] = msg.repeatedInt64; + json.repeatedInt64 = msg.repeatedInt64.map((x) => x.toString()); } if (msg.repeatedUint32?.length) { - json[\\"repeatedUint32\\"] = msg.repeatedUint32; + json.repeatedUint32 = msg.repeatedUint32; } if (msg.repeatedUint64?.length) { - json[\\"repeatedUint64\\"] = msg.repeatedUint64; + json.repeatedUint64 = msg.repeatedUint64.map((x) => x.toString()); } if (msg.repeatedSint32?.length) { - json[\\"repeatedSint32\\"] = msg.repeatedSint32; + json.repeatedSint32 = msg.repeatedSint32; } if (msg.repeatedSint64?.length) { - json[\\"repeatedSint64\\"] = msg.repeatedSint64; + json.repeatedSint64 = msg.repeatedSint64.map((x) => x.toString()); } if (msg.repeatedFixed32?.length) { - json[\\"repeatedFixed32\\"] = msg.repeatedFixed32; + json.repeatedFixed32 = msg.repeatedFixed32; } if (msg.repeatedFixed64?.length) { - json[\\"repeatedFixed64\\"] = msg.repeatedFixed64; + json.repeatedFixed64 = msg.repeatedFixed64.map((x) => x.toString()); } if (msg.repeatedSfixed32?.length) { - json[\\"repeatedSfixed32\\"] = msg.repeatedSfixed32; + json.repeatedSfixed32 = msg.repeatedSfixed32; } if (msg.repeatedSfixed64?.length) { - json[\\"repeatedSfixed64\\"] = msg.repeatedSfixed64; + json.repeatedSfixed64 = msg.repeatedSfixed64.map((x) => x.toString()); } if (msg.repeatedFloat?.length) { - json[\\"repeatedFloat\\"] = msg.repeatedFloat; + json.repeatedFloat = msg.repeatedFloat; } if (msg.repeatedDouble?.length) { - json[\\"repeatedDouble\\"] = msg.repeatedDouble; + json.repeatedDouble = msg.repeatedDouble; } if (msg.repeatedBool?.length) { - json[\\"repeatedBool\\"] = msg.repeatedBool; + json.repeatedBool = msg.repeatedBool; } if (msg.repeatedString?.length) { - json[\\"repeatedString\\"] = msg.repeatedString; + json.repeatedString = msg.repeatedString; } if (msg.repeatedBytes?.length) { - json[\\"repeatedBytes\\"] = msg.repeatedBytes; + json.repeatedBytes = msg.repeatedBytes; } if (msg.repeatedNestedMessage?.length) { - json[\\"repeatedNestedMessage\\"] = msg.repeatedNestedMessage.map( + json.repeatedNestedMessage = msg.repeatedNestedMessage.map( TestAllTypes.NestedMessage._writeMessageJSON ); } if (msg.repeatedForeignMessage?.length) { - json[\\"repeatedForeignMessage\\"] = msg.repeatedForeignMessage.map( + json.repeatedForeignMessage = msg.repeatedForeignMessage.map( ForeignMessage._writeMessageJSON ); } if (msg.repeatedImportMessage?.length) { - json[\\"repeatedImportMessage\\"] = msg.repeatedImportMessage.map( + json.repeatedImportMessage = msg.repeatedImportMessage.map( ImportMessage._writeMessageJSON ); } if (msg.repeatedNestedEnum?.length) { - json[\\"repeatedNestedEnum\\"] = msg.repeatedNestedEnum; + json.repeatedNestedEnum = msg.repeatedNestedEnum; } if (msg.repeatedForeignEnum?.length) { - json[\\"repeatedForeignEnum\\"] = msg.repeatedForeignEnum; + json.repeatedForeignEnum = msg.repeatedForeignEnum; } if (msg.repeatedStringPiece?.length) { - json[\\"repeatedStringPiece\\"] = msg.repeatedStringPiece; + json.repeatedStringPiece = msg.repeatedStringPiece; } if (msg.repeatedCord?.length) { - json[\\"repeatedCord\\"] = msg.repeatedCord; + json.repeatedCord = msg.repeatedCord; } if (msg.repeatedLazyMessage?.length) { - json[\\"repeatedLazyMessage\\"] = msg.repeatedLazyMessage.map( + json.repeatedLazyMessage = msg.repeatedLazyMessage.map( TestAllTypes.NestedMessage._writeMessageJSON ); } if (msg.oneofUint32 != undefined) { - json[\\"oneofUint32\\"] = msg.oneofUint32; + json.oneofUint32 = msg.oneofUint32; } if (msg.oneofNestedMessage != undefined) { const oneofNestedMessage = TestAllTypes.NestedMessage._writeMessageJSON( msg.oneofNestedMessage ); if (Object.keys(oneofNestedMessage).length > 0) { - json[\\"oneofNestedMessage\\"] = oneofNestedMessage; + json.oneofNestedMessage = oneofNestedMessage; } } if (msg.oneofString != undefined) { - json[\\"oneofString\\"] = msg.oneofString; + json.oneofString = msg.oneofString; } if (msg.oneofBytes != undefined) { - json[\\"oneofBytes\\"] = msg.oneofBytes; + json.oneofBytes = msg.oneofBytes; } return json; }, @@ -56216,7 +57606,7 @@ export const TestAllTypes = { break; } case 2: { - msg.optionalInt64 = reader.readInt64String(); + msg.optionalInt64 = BigInt(reader.readInt64String()); break; } case 3: { @@ -56224,7 +57614,7 @@ export const TestAllTypes = { break; } case 4: { - msg.optionalUint64 = reader.readUint64String(); + msg.optionalUint64 = BigInt(reader.readUint64String()); break; } case 5: { @@ -56232,7 +57622,7 @@ export const TestAllTypes = { break; } case 6: { - msg.optionalSint64 = reader.readSint64(); + msg.optionalSint64 = BigInt(reader.readSint64()); break; } case 7: { @@ -56240,7 +57630,7 @@ export const TestAllTypes = { break; } case 8: { - msg.optionalFixed64 = reader.readFixed64String(); + msg.optionalFixed64 = BigInt(reader.readFixed64String()); break; } case 9: { @@ -56248,7 +57638,7 @@ export const TestAllTypes = { break; } case 10: { - msg.optionalSfixed64 = reader.readSfixed64(); + msg.optionalSfixed64 = BigInt(reader.readSfixed64()); break; } case 11: { @@ -56334,7 +57724,7 @@ export const TestAllTypes = { break; } case 32: { - msg.repeatedInt64.push(reader.readInt64String()); + msg.repeatedInt64 = reader.readInt64String().map(BigInt); break; } case 33: { @@ -56342,7 +57732,7 @@ export const TestAllTypes = { break; } case 34: { - msg.repeatedUint64.push(reader.readUint64String()); + msg.repeatedUint64 = reader.readUint64String().map(BigInt); break; } case 35: { @@ -56350,7 +57740,7 @@ export const TestAllTypes = { break; } case 36: { - msg.repeatedSint64.push(reader.readSint64()); + msg.repeatedSint64 = reader.readSint64().map(BigInt); break; } case 37: { @@ -56358,7 +57748,7 @@ export const TestAllTypes = { break; } case 38: { - msg.repeatedFixed64.push(reader.readFixed64String()); + msg.repeatedFixed64 = reader.readFixed64String().map(BigInt); break; } case 39: { @@ -56366,7 +57756,7 @@ export const TestAllTypes = { break; } case 40: { - msg.repeatedSfixed64.push(reader.readSfixed64()); + msg.repeatedSfixed64 = reader.readSfixed64().map(BigInt); break; } case 41: { @@ -56463,190 +57853,189 @@ export const TestAllTypes = { * @private */ _readMessageJSON: function (msg: TestAllTypes, json: any): TestAllTypes { - const optionalInt32 = json[\\"optionalInt32\\"] ?? json.optional_int32; + const optionalInt32 = json.optionalInt32 ?? json.optional_int32; if (optionalInt32) { msg.optionalInt32 = optionalInt32; } - const optionalInt64 = json[\\"optionalInt64\\"] ?? json.optional_int64; + const optionalInt64 = json.optionalInt64 ?? json.optional_int64; if (optionalInt64) { - msg.optionalInt64 = optionalInt64; + msg.optionalInt64 = BigInt(optionalInt64); } - const optionalUint32 = json[\\"optionalUint32\\"] ?? json.optional_uint32; + const optionalUint32 = json.optionalUint32 ?? json.optional_uint32; if (optionalUint32) { msg.optionalUint32 = optionalUint32; } - const optionalUint64 = json[\\"optionalUint64\\"] ?? json.optional_uint64; + const optionalUint64 = json.optionalUint64 ?? json.optional_uint64; if (optionalUint64) { - msg.optionalUint64 = optionalUint64; + msg.optionalUint64 = BigInt(optionalUint64); } - const optionalSint32 = json[\\"optionalSint32\\"] ?? json.optional_sint32; + const optionalSint32 = json.optionalSint32 ?? json.optional_sint32; if (optionalSint32) { msg.optionalSint32 = optionalSint32; } - const optionalSint64 = json[\\"optionalSint64\\"] ?? json.optional_sint64; + const optionalSint64 = json.optionalSint64 ?? json.optional_sint64; if (optionalSint64) { - msg.optionalSint64 = optionalSint64; + msg.optionalSint64 = BigInt(optionalSint64); } - const optionalFixed32 = json[\\"optionalFixed32\\"] ?? json.optional_fixed32; + const optionalFixed32 = json.optionalFixed32 ?? json.optional_fixed32; if (optionalFixed32) { msg.optionalFixed32 = optionalFixed32; } - const optionalFixed64 = json[\\"optionalFixed64\\"] ?? json.optional_fixed64; + const optionalFixed64 = json.optionalFixed64 ?? json.optional_fixed64; if (optionalFixed64) { - msg.optionalFixed64 = optionalFixed64; + msg.optionalFixed64 = BigInt(optionalFixed64); } - const optionalSfixed32 = json[\\"optionalSfixed32\\"] ?? json.optional_sfixed32; + const optionalSfixed32 = json.optionalSfixed32 ?? json.optional_sfixed32; if (optionalSfixed32) { msg.optionalSfixed32 = optionalSfixed32; } - const optionalSfixed64 = json[\\"optionalSfixed64\\"] ?? json.optional_sfixed64; + const optionalSfixed64 = json.optionalSfixed64 ?? json.optional_sfixed64; if (optionalSfixed64) { - msg.optionalSfixed64 = optionalSfixed64; + msg.optionalSfixed64 = BigInt(optionalSfixed64); } - const optionalFloat = json[\\"optionalFloat\\"] ?? json.optional_float; + const optionalFloat = json.optionalFloat ?? json.optional_float; if (optionalFloat) { msg.optionalFloat = optionalFloat; } - const optionalDouble = json[\\"optionalDouble\\"] ?? json.optional_double; + const optionalDouble = json.optionalDouble ?? json.optional_double; if (optionalDouble) { msg.optionalDouble = optionalDouble; } - const optionalBool = json[\\"optionalBool\\"] ?? json.optional_bool; + const optionalBool = json.optionalBool ?? json.optional_bool; if (optionalBool) { msg.optionalBool = optionalBool; } - const optionalString = json[\\"optionalString\\"] ?? json.optional_string; + const optionalString = json.optionalString ?? json.optional_string; if (optionalString) { msg.optionalString = optionalString; } - const optionalBytes = json[\\"optionalBytes\\"] ?? json.optional_bytes; + const optionalBytes = json.optionalBytes ?? json.optional_bytes; if (optionalBytes) { msg.optionalBytes = optionalBytes; } const optionalNestedMessage = - json[\\"optionalNestedMessage\\"] ?? json.optional_nested_message; + json.optionalNestedMessage ?? json.optional_nested_message; if (optionalNestedMessage) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, optionalNestedMessage); msg.optionalNestedMessage = m; } const optionalForeignMessage = - json[\\"optionalForeignMessage\\"] ?? json.optional_foreign_message; + json.optionalForeignMessage ?? json.optional_foreign_message; if (optionalForeignMessage) { const m = ForeignMessage.initialize(); ForeignMessage._readMessageJSON(m, optionalForeignMessage); msg.optionalForeignMessage = m; } const optionalImportMessage = - json[\\"optionalImportMessage\\"] ?? json.optional_import_message; + json.optionalImportMessage ?? json.optional_import_message; if (optionalImportMessage) { const m = ImportMessage.initialize(); ImportMessage._readMessageJSON(m, optionalImportMessage); msg.optionalImportMessage = m; } const optionalNestedEnum = - json[\\"optionalNestedEnum\\"] ?? json.optional_nested_enum; + json.optionalNestedEnum ?? json.optional_nested_enum; if (optionalNestedEnum) { msg.optionalNestedEnum = optionalNestedEnum; } const optionalForeignEnum = - json[\\"optionalForeignEnum\\"] ?? json.optional_foreign_enum; + json.optionalForeignEnum ?? json.optional_foreign_enum; if (optionalForeignEnum) { msg.optionalForeignEnum = optionalForeignEnum; } const optionalStringPiece = - json[\\"optionalStringPiece\\"] ?? json.optional_string_piece; + json.optionalStringPiece ?? json.optional_string_piece; if (optionalStringPiece) { msg.optionalStringPiece = optionalStringPiece; } - const optionalCord = json[\\"optionalCord\\"] ?? json.optional_cord; + const optionalCord = json.optionalCord ?? json.optional_cord; if (optionalCord) { msg.optionalCord = optionalCord; } const optionalPublicImportMessage = - json[\\"optionalPublicImportMessage\\"] ?? - json.optional_public_import_message; + json.optionalPublicImportMessage ?? json.optional_public_import_message; if (optionalPublicImportMessage) { const m = PublicImportMessage.initialize(); PublicImportMessage._readMessageJSON(m, optionalPublicImportMessage); msg.optionalPublicImportMessage = m; } const optionalLazyMessage = - json[\\"optionalLazyMessage\\"] ?? json.optional_lazy_message; + json.optionalLazyMessage ?? json.optional_lazy_message; if (optionalLazyMessage) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, optionalLazyMessage); msg.optionalLazyMessage = m; } const optionalLazyImportMessage = - json[\\"optionalLazyImportMessage\\"] ?? json.optional_lazy_import_message; + json.optionalLazyImportMessage ?? json.optional_lazy_import_message; if (optionalLazyImportMessage) { const m = ImportMessage.initialize(); ImportMessage._readMessageJSON(m, optionalLazyImportMessage); msg.optionalLazyImportMessage = m; } - const repeatedInt32 = json[\\"repeatedInt32\\"] ?? json.repeated_int32; + const repeatedInt32 = json.repeatedInt32 ?? json.repeated_int32; if (repeatedInt32) { msg.repeatedInt32 = repeatedInt32; } - const repeatedInt64 = json[\\"repeatedInt64\\"] ?? json.repeated_int64; + const repeatedInt64 = json.repeatedInt64 ?? json.repeated_int64; if (repeatedInt64) { - msg.repeatedInt64 = repeatedInt64; + msg.repeatedInt64 = repeatedInt64.map(BigInt); } - const repeatedUint32 = json[\\"repeatedUint32\\"] ?? json.repeated_uint32; + const repeatedUint32 = json.repeatedUint32 ?? json.repeated_uint32; if (repeatedUint32) { msg.repeatedUint32 = repeatedUint32; } - const repeatedUint64 = json[\\"repeatedUint64\\"] ?? json.repeated_uint64; + const repeatedUint64 = json.repeatedUint64 ?? json.repeated_uint64; if (repeatedUint64) { - msg.repeatedUint64 = repeatedUint64; + msg.repeatedUint64 = repeatedUint64.map(BigInt); } - const repeatedSint32 = json[\\"repeatedSint32\\"] ?? json.repeated_sint32; + const repeatedSint32 = json.repeatedSint32 ?? json.repeated_sint32; if (repeatedSint32) { msg.repeatedSint32 = repeatedSint32; } - const repeatedSint64 = json[\\"repeatedSint64\\"] ?? json.repeated_sint64; + const repeatedSint64 = json.repeatedSint64 ?? json.repeated_sint64; if (repeatedSint64) { - msg.repeatedSint64 = repeatedSint64; + msg.repeatedSint64 = repeatedSint64.map(BigInt); } - const repeatedFixed32 = json[\\"repeatedFixed32\\"] ?? json.repeated_fixed32; + const repeatedFixed32 = json.repeatedFixed32 ?? json.repeated_fixed32; if (repeatedFixed32) { msg.repeatedFixed32 = repeatedFixed32; } - const repeatedFixed64 = json[\\"repeatedFixed64\\"] ?? json.repeated_fixed64; + const repeatedFixed64 = json.repeatedFixed64 ?? json.repeated_fixed64; if (repeatedFixed64) { - msg.repeatedFixed64 = repeatedFixed64; + msg.repeatedFixed64 = repeatedFixed64.map(BigInt); } - const repeatedSfixed32 = json[\\"repeatedSfixed32\\"] ?? json.repeated_sfixed32; + const repeatedSfixed32 = json.repeatedSfixed32 ?? json.repeated_sfixed32; if (repeatedSfixed32) { msg.repeatedSfixed32 = repeatedSfixed32; } - const repeatedSfixed64 = json[\\"repeatedSfixed64\\"] ?? json.repeated_sfixed64; + const repeatedSfixed64 = json.repeatedSfixed64 ?? json.repeated_sfixed64; if (repeatedSfixed64) { - msg.repeatedSfixed64 = repeatedSfixed64; + msg.repeatedSfixed64 = repeatedSfixed64.map(BigInt); } - const repeatedFloat = json[\\"repeatedFloat\\"] ?? json.repeated_float; + const repeatedFloat = json.repeatedFloat ?? json.repeated_float; if (repeatedFloat) { msg.repeatedFloat = repeatedFloat; } - const repeatedDouble = json[\\"repeatedDouble\\"] ?? json.repeated_double; + const repeatedDouble = json.repeatedDouble ?? json.repeated_double; if (repeatedDouble) { msg.repeatedDouble = repeatedDouble; } - const repeatedBool = json[\\"repeatedBool\\"] ?? json.repeated_bool; + const repeatedBool = json.repeatedBool ?? json.repeated_bool; if (repeatedBool) { msg.repeatedBool = repeatedBool; } - const repeatedString = json[\\"repeatedString\\"] ?? json.repeated_string; + const repeatedString = json.repeatedString ?? json.repeated_string; if (repeatedString) { msg.repeatedString = repeatedString; } - const repeatedBytes = json[\\"repeatedBytes\\"] ?? json.repeated_bytes; + const repeatedBytes = json.repeatedBytes ?? json.repeated_bytes; if (repeatedBytes) { msg.repeatedBytes = repeatedBytes; } const repeatedNestedMessage = - json[\\"repeatedNestedMessage\\"] ?? json.repeated_nested_message; + json.repeatedNestedMessage ?? json.repeated_nested_message; if (repeatedNestedMessage) { for (const item of repeatedNestedMessage) { const m = TestAllTypes.NestedMessage.initialize(); @@ -56655,7 +58044,7 @@ export const TestAllTypes = { } } const repeatedForeignMessage = - json[\\"repeatedForeignMessage\\"] ?? json.repeated_foreign_message; + json.repeatedForeignMessage ?? json.repeated_foreign_message; if (repeatedForeignMessage) { for (const item of repeatedForeignMessage) { const m = ForeignMessage.initialize(); @@ -56664,7 +58053,7 @@ export const TestAllTypes = { } } const repeatedImportMessage = - json[\\"repeatedImportMessage\\"] ?? json.repeated_import_message; + json.repeatedImportMessage ?? json.repeated_import_message; if (repeatedImportMessage) { for (const item of repeatedImportMessage) { const m = ImportMessage.initialize(); @@ -56673,26 +58062,26 @@ export const TestAllTypes = { } } const repeatedNestedEnum = - json[\\"repeatedNestedEnum\\"] ?? json.repeated_nested_enum; + json.repeatedNestedEnum ?? json.repeated_nested_enum; if (repeatedNestedEnum) { msg.repeatedNestedEnum = repeatedNestedEnum; } const repeatedForeignEnum = - json[\\"repeatedForeignEnum\\"] ?? json.repeated_foreign_enum; + json.repeatedForeignEnum ?? json.repeated_foreign_enum; if (repeatedForeignEnum) { msg.repeatedForeignEnum = repeatedForeignEnum; } const repeatedStringPiece = - json[\\"repeatedStringPiece\\"] ?? json.repeated_string_piece; + json.repeatedStringPiece ?? json.repeated_string_piece; if (repeatedStringPiece) { msg.repeatedStringPiece = repeatedStringPiece; } - const repeatedCord = json[\\"repeatedCord\\"] ?? json.repeated_cord; + const repeatedCord = json.repeatedCord ?? json.repeated_cord; if (repeatedCord) { msg.repeatedCord = repeatedCord; } const repeatedLazyMessage = - json[\\"repeatedLazyMessage\\"] ?? json.repeated_lazy_message; + json.repeatedLazyMessage ?? json.repeated_lazy_message; if (repeatedLazyMessage) { for (const item of repeatedLazyMessage) { const m = TestAllTypes.NestedMessage.initialize(); @@ -56700,22 +58089,22 @@ export const TestAllTypes = { msg.repeatedLazyMessage.push(m); } } - const oneofUint32 = json[\\"oneofUint32\\"] ?? json.oneof_uint32; + const oneofUint32 = json.oneofUint32 ?? json.oneof_uint32; if (oneofUint32) { msg.oneofUint32 = oneofUint32; } const oneofNestedMessage = - json[\\"oneofNestedMessage\\"] ?? json.oneof_nested_message; + json.oneofNestedMessage ?? json.oneof_nested_message; if (oneofNestedMessage) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, oneofNestedMessage); msg.oneofNestedMessage = m; } - const oneofString = json[\\"oneofString\\"] ?? json.oneof_string; + const oneofString = json.oneofString ?? json.oneof_string; if (oneofString) { msg.oneofString = oneofString; } - const oneofBytes = json[\\"oneofBytes\\"] ?? json.oneof_bytes; + const oneofBytes = json.oneofBytes ?? json.oneof_bytes; if (oneofBytes) { msg.oneofBytes = oneofBytes; } @@ -56798,7 +58187,7 @@ export const TestAllTypes = { ): Record { const json: Record = {}; if (msg.bb) { - json[\\"bb\\"] = msg.bb; + json.bb = msg.bb; } return json; }, @@ -56833,7 +58222,7 @@ export const TestAllTypes = { msg: TestAllTypes.NestedMessage, json: any ): TestAllTypes.NestedMessage { - const bb = json[\\"bb\\"] ?? json.bb; + const bb = json.bb ?? json.bb; if (bb) { msg.bb = bb; } @@ -56913,31 +58302,31 @@ export const TestPackedTypes = { writer.writeRepeatedInt32(90, msg.packedInt32); } if (msg.packedInt64?.length) { - writer.writeRepeatedInt64String(91, msg.packedInt64); + writer.writeRepeatedInt64String(91, msg.packedInt64.toString()); } if (msg.packedUint32?.length) { writer.writeRepeatedUint32(92, msg.packedUint32); } if (msg.packedUint64?.length) { - writer.writeRepeatedUint64String(93, msg.packedUint64); + writer.writeRepeatedUint64String(93, msg.packedUint64.toString()); } if (msg.packedSint32?.length) { writer.writeRepeatedSint32(94, msg.packedSint32); } if (msg.packedSint64?.length) { - writer.writeRepeatedSint64String(95, msg.packedSint64); + writer.writeRepeatedSint64String(95, msg.packedSint64.toString()); } if (msg.packedFixed32?.length) { writer.writeRepeatedFixed32(96, msg.packedFixed32); } if (msg.packedFixed64?.length) { - writer.writeRepeatedFixed64String(97, msg.packedFixed64); + writer.writeRepeatedFixed64String(97, msg.packedFixed64.toString()); } if (msg.packedSfixed32?.length) { writer.writeRepeatedSfixed32(98, msg.packedSfixed32); } if (msg.packedSfixed64?.length) { - writer.writeRepeatedSfixed64(99, msg.packedSfixed64); + writer.writeRepeatedSfixed64(99, msg.packedSfixed64.toString()); } if (msg.packedFloat?.length) { writer.writeRepeatedFloat(100, msg.packedFloat); @@ -56962,46 +58351,46 @@ export const TestPackedTypes = { ): Record { const json: Record = {}; if (msg.packedInt32?.length) { - json[\\"packedInt32\\"] = msg.packedInt32; + json.packedInt32 = msg.packedInt32; } if (msg.packedInt64?.length) { - json[\\"packedInt64\\"] = msg.packedInt64; + json.packedInt64 = msg.packedInt64.map((x) => x.toString()); } if (msg.packedUint32?.length) { - json[\\"packedUint32\\"] = msg.packedUint32; + json.packedUint32 = msg.packedUint32; } if (msg.packedUint64?.length) { - json[\\"packedUint64\\"] = msg.packedUint64; + json.packedUint64 = msg.packedUint64.map((x) => x.toString()); } if (msg.packedSint32?.length) { - json[\\"packedSint32\\"] = msg.packedSint32; + json.packedSint32 = msg.packedSint32; } if (msg.packedSint64?.length) { - json[\\"packedSint64\\"] = msg.packedSint64; + json.packedSint64 = msg.packedSint64.map((x) => x.toString()); } if (msg.packedFixed32?.length) { - json[\\"packedFixed32\\"] = msg.packedFixed32; + json.packedFixed32 = msg.packedFixed32; } if (msg.packedFixed64?.length) { - json[\\"packedFixed64\\"] = msg.packedFixed64; + json.packedFixed64 = msg.packedFixed64.map((x) => x.toString()); } if (msg.packedSfixed32?.length) { - json[\\"packedSfixed32\\"] = msg.packedSfixed32; + json.packedSfixed32 = msg.packedSfixed32; } if (msg.packedSfixed64?.length) { - json[\\"packedSfixed64\\"] = msg.packedSfixed64; + json.packedSfixed64 = msg.packedSfixed64.map((x) => x.toString()); } if (msg.packedFloat?.length) { - json[\\"packedFloat\\"] = msg.packedFloat; + json.packedFloat = msg.packedFloat; } if (msg.packedDouble?.length) { - json[\\"packedDouble\\"] = msg.packedDouble; + json.packedDouble = msg.packedDouble; } if (msg.packedBool?.length) { - json[\\"packedBool\\"] = msg.packedBool; + json.packedBool = msg.packedBool; } if (msg.packedEnum?.length) { - json[\\"packedEnum\\"] = msg.packedEnum; + json.packedEnum = msg.packedEnum; } return json; }, @@ -57021,7 +58410,7 @@ export const TestPackedTypes = { break; } case 91: { - msg.packedInt64.push(reader.readInt64String()); + msg.packedInt64 = reader.readInt64String().map(BigInt); break; } case 92: { @@ -57029,7 +58418,7 @@ export const TestPackedTypes = { break; } case 93: { - msg.packedUint64.push(reader.readUint64String()); + msg.packedUint64 = reader.readUint64String().map(BigInt); break; } case 94: { @@ -57037,7 +58426,7 @@ export const TestPackedTypes = { break; } case 95: { - msg.packedSint64.push(reader.readSint64()); + msg.packedSint64 = reader.readSint64().map(BigInt); break; } case 96: { @@ -57045,7 +58434,7 @@ export const TestPackedTypes = { break; } case 97: { - msg.packedFixed64.push(reader.readFixed64String()); + msg.packedFixed64 = reader.readFixed64String().map(BigInt); break; } case 98: { @@ -57053,7 +58442,7 @@ export const TestPackedTypes = { break; } case 99: { - msg.packedSfixed64.push(reader.readSfixed64()); + msg.packedSfixed64 = reader.readSfixed64().map(BigInt); break; } case 100: { @@ -57088,59 +58477,59 @@ export const TestPackedTypes = { msg: TestPackedTypes, json: any ): TestPackedTypes { - const packedInt32 = json[\\"packedInt32\\"] ?? json.packed_int32; + const packedInt32 = json.packedInt32 ?? json.packed_int32; if (packedInt32) { msg.packedInt32 = packedInt32; } - const packedInt64 = json[\\"packedInt64\\"] ?? json.packed_int64; + const packedInt64 = json.packedInt64 ?? json.packed_int64; if (packedInt64) { - msg.packedInt64 = packedInt64; + msg.packedInt64 = packedInt64.map(BigInt); } - const packedUint32 = json[\\"packedUint32\\"] ?? json.packed_uint32; + const packedUint32 = json.packedUint32 ?? json.packed_uint32; if (packedUint32) { msg.packedUint32 = packedUint32; } - const packedUint64 = json[\\"packedUint64\\"] ?? json.packed_uint64; + const packedUint64 = json.packedUint64 ?? json.packed_uint64; if (packedUint64) { - msg.packedUint64 = packedUint64; + msg.packedUint64 = packedUint64.map(BigInt); } - const packedSint32 = json[\\"packedSint32\\"] ?? json.packed_sint32; + const packedSint32 = json.packedSint32 ?? json.packed_sint32; if (packedSint32) { msg.packedSint32 = packedSint32; } - const packedSint64 = json[\\"packedSint64\\"] ?? json.packed_sint64; + const packedSint64 = json.packedSint64 ?? json.packed_sint64; if (packedSint64) { - msg.packedSint64 = packedSint64; + msg.packedSint64 = packedSint64.map(BigInt); } - const packedFixed32 = json[\\"packedFixed32\\"] ?? json.packed_fixed32; + const packedFixed32 = json.packedFixed32 ?? json.packed_fixed32; if (packedFixed32) { msg.packedFixed32 = packedFixed32; } - const packedFixed64 = json[\\"packedFixed64\\"] ?? json.packed_fixed64; + const packedFixed64 = json.packedFixed64 ?? json.packed_fixed64; if (packedFixed64) { - msg.packedFixed64 = packedFixed64; + msg.packedFixed64 = packedFixed64.map(BigInt); } - const packedSfixed32 = json[\\"packedSfixed32\\"] ?? json.packed_sfixed32; + const packedSfixed32 = json.packedSfixed32 ?? json.packed_sfixed32; if (packedSfixed32) { msg.packedSfixed32 = packedSfixed32; } - const packedSfixed64 = json[\\"packedSfixed64\\"] ?? json.packed_sfixed64; + const packedSfixed64 = json.packedSfixed64 ?? json.packed_sfixed64; if (packedSfixed64) { - msg.packedSfixed64 = packedSfixed64; + msg.packedSfixed64 = packedSfixed64.map(BigInt); } - const packedFloat = json[\\"packedFloat\\"] ?? json.packed_float; + const packedFloat = json.packedFloat ?? json.packed_float; if (packedFloat) { msg.packedFloat = packedFloat; } - const packedDouble = json[\\"packedDouble\\"] ?? json.packed_double; + const packedDouble = json.packedDouble ?? json.packed_double; if (packedDouble) { msg.packedDouble = packedDouble; } - const packedBool = json[\\"packedBool\\"] ?? json.packed_bool; + const packedBool = json.packedBool ?? json.packed_bool; if (packedBool) { msg.packedBool = packedBool; } - const packedEnum = json[\\"packedEnum\\"] ?? json.packed_enum; + const packedEnum = json.packedEnum ?? json.packed_enum; if (packedEnum) { msg.packedEnum = packedEnum; } @@ -57221,31 +58610,31 @@ export const TestUnpackedTypes = { writer.writeRepeatedInt32(1, msg.repeatedInt32); } if (msg.repeatedInt64?.length) { - writer.writeRepeatedInt64String(2, msg.repeatedInt64); + writer.writeRepeatedInt64String(2, msg.repeatedInt64.toString()); } if (msg.repeatedUint32?.length) { writer.writeRepeatedUint32(3, msg.repeatedUint32); } if (msg.repeatedUint64?.length) { - writer.writeRepeatedUint64String(4, msg.repeatedUint64); + writer.writeRepeatedUint64String(4, msg.repeatedUint64.toString()); } if (msg.repeatedSint32?.length) { writer.writeRepeatedSint32(5, msg.repeatedSint32); } if (msg.repeatedSint64?.length) { - writer.writeRepeatedSint64String(6, msg.repeatedSint64); + writer.writeRepeatedSint64String(6, msg.repeatedSint64.toString()); } if (msg.repeatedFixed32?.length) { writer.writeRepeatedFixed32(7, msg.repeatedFixed32); } if (msg.repeatedFixed64?.length) { - writer.writeRepeatedFixed64String(8, msg.repeatedFixed64); + writer.writeRepeatedFixed64String(8, msg.repeatedFixed64.toString()); } if (msg.repeatedSfixed32?.length) { writer.writeRepeatedSfixed32(9, msg.repeatedSfixed32); } if (msg.repeatedSfixed64?.length) { - writer.writeRepeatedSfixed64(10, msg.repeatedSfixed64); + writer.writeRepeatedSfixed64(10, msg.repeatedSfixed64.toString()); } if (msg.repeatedFloat?.length) { writer.writeRepeatedFloat(11, msg.repeatedFloat); @@ -57270,46 +58659,46 @@ export const TestUnpackedTypes = { ): Record { const json: Record = {}; if (msg.repeatedInt32?.length) { - json[\\"repeatedInt32\\"] = msg.repeatedInt32; + json.repeatedInt32 = msg.repeatedInt32; } if (msg.repeatedInt64?.length) { - json[\\"repeatedInt64\\"] = msg.repeatedInt64; + json.repeatedInt64 = msg.repeatedInt64.map((x) => x.toString()); } if (msg.repeatedUint32?.length) { - json[\\"repeatedUint32\\"] = msg.repeatedUint32; + json.repeatedUint32 = msg.repeatedUint32; } if (msg.repeatedUint64?.length) { - json[\\"repeatedUint64\\"] = msg.repeatedUint64; + json.repeatedUint64 = msg.repeatedUint64.map((x) => x.toString()); } if (msg.repeatedSint32?.length) { - json[\\"repeatedSint32\\"] = msg.repeatedSint32; + json.repeatedSint32 = msg.repeatedSint32; } if (msg.repeatedSint64?.length) { - json[\\"repeatedSint64\\"] = msg.repeatedSint64; + json.repeatedSint64 = msg.repeatedSint64.map((x) => x.toString()); } if (msg.repeatedFixed32?.length) { - json[\\"repeatedFixed32\\"] = msg.repeatedFixed32; + json.repeatedFixed32 = msg.repeatedFixed32; } if (msg.repeatedFixed64?.length) { - json[\\"repeatedFixed64\\"] = msg.repeatedFixed64; + json.repeatedFixed64 = msg.repeatedFixed64.map((x) => x.toString()); } if (msg.repeatedSfixed32?.length) { - json[\\"repeatedSfixed32\\"] = msg.repeatedSfixed32; + json.repeatedSfixed32 = msg.repeatedSfixed32; } if (msg.repeatedSfixed64?.length) { - json[\\"repeatedSfixed64\\"] = msg.repeatedSfixed64; + json.repeatedSfixed64 = msg.repeatedSfixed64.map((x) => x.toString()); } if (msg.repeatedFloat?.length) { - json[\\"repeatedFloat\\"] = msg.repeatedFloat; + json.repeatedFloat = msg.repeatedFloat; } if (msg.repeatedDouble?.length) { - json[\\"repeatedDouble\\"] = msg.repeatedDouble; + json.repeatedDouble = msg.repeatedDouble; } if (msg.repeatedBool?.length) { - json[\\"repeatedBool\\"] = msg.repeatedBool; + json.repeatedBool = msg.repeatedBool; } if (msg.repeatedNestedEnum?.length) { - json[\\"repeatedNestedEnum\\"] = msg.repeatedNestedEnum; + json.repeatedNestedEnum = msg.repeatedNestedEnum; } return json; }, @@ -57329,7 +58718,7 @@ export const TestUnpackedTypes = { break; } case 2: { - msg.repeatedInt64.push(reader.readInt64String()); + msg.repeatedInt64 = reader.readInt64String().map(BigInt); break; } case 3: { @@ -57337,7 +58726,7 @@ export const TestUnpackedTypes = { break; } case 4: { - msg.repeatedUint64.push(reader.readUint64String()); + msg.repeatedUint64 = reader.readUint64String().map(BigInt); break; } case 5: { @@ -57345,7 +58734,7 @@ export const TestUnpackedTypes = { break; } case 6: { - msg.repeatedSint64.push(reader.readSint64()); + msg.repeatedSint64 = reader.readSint64().map(BigInt); break; } case 7: { @@ -57353,7 +58742,7 @@ export const TestUnpackedTypes = { break; } case 8: { - msg.repeatedFixed64.push(reader.readFixed64String()); + msg.repeatedFixed64 = reader.readFixed64String().map(BigInt); break; } case 9: { @@ -57361,7 +58750,7 @@ export const TestUnpackedTypes = { break; } case 10: { - msg.repeatedSfixed64.push(reader.readSfixed64()); + msg.repeatedSfixed64 = reader.readSfixed64().map(BigInt); break; } case 11: { @@ -57398,60 +58787,60 @@ export const TestUnpackedTypes = { msg: TestUnpackedTypes, json: any ): TestUnpackedTypes { - const repeatedInt32 = json[\\"repeatedInt32\\"] ?? json.repeated_int32; + const repeatedInt32 = json.repeatedInt32 ?? json.repeated_int32; if (repeatedInt32) { msg.repeatedInt32 = repeatedInt32; } - const repeatedInt64 = json[\\"repeatedInt64\\"] ?? json.repeated_int64; + const repeatedInt64 = json.repeatedInt64 ?? json.repeated_int64; if (repeatedInt64) { - msg.repeatedInt64 = repeatedInt64; + msg.repeatedInt64 = repeatedInt64.map(BigInt); } - const repeatedUint32 = json[\\"repeatedUint32\\"] ?? json.repeated_uint32; + const repeatedUint32 = json.repeatedUint32 ?? json.repeated_uint32; if (repeatedUint32) { msg.repeatedUint32 = repeatedUint32; } - const repeatedUint64 = json[\\"repeatedUint64\\"] ?? json.repeated_uint64; + const repeatedUint64 = json.repeatedUint64 ?? json.repeated_uint64; if (repeatedUint64) { - msg.repeatedUint64 = repeatedUint64; + msg.repeatedUint64 = repeatedUint64.map(BigInt); } - const repeatedSint32 = json[\\"repeatedSint32\\"] ?? json.repeated_sint32; + const repeatedSint32 = json.repeatedSint32 ?? json.repeated_sint32; if (repeatedSint32) { msg.repeatedSint32 = repeatedSint32; } - const repeatedSint64 = json[\\"repeatedSint64\\"] ?? json.repeated_sint64; + const repeatedSint64 = json.repeatedSint64 ?? json.repeated_sint64; if (repeatedSint64) { - msg.repeatedSint64 = repeatedSint64; + msg.repeatedSint64 = repeatedSint64.map(BigInt); } - const repeatedFixed32 = json[\\"repeatedFixed32\\"] ?? json.repeated_fixed32; + const repeatedFixed32 = json.repeatedFixed32 ?? json.repeated_fixed32; if (repeatedFixed32) { msg.repeatedFixed32 = repeatedFixed32; } - const repeatedFixed64 = json[\\"repeatedFixed64\\"] ?? json.repeated_fixed64; + const repeatedFixed64 = json.repeatedFixed64 ?? json.repeated_fixed64; if (repeatedFixed64) { - msg.repeatedFixed64 = repeatedFixed64; + msg.repeatedFixed64 = repeatedFixed64.map(BigInt); } - const repeatedSfixed32 = json[\\"repeatedSfixed32\\"] ?? json.repeated_sfixed32; + const repeatedSfixed32 = json.repeatedSfixed32 ?? json.repeated_sfixed32; if (repeatedSfixed32) { msg.repeatedSfixed32 = repeatedSfixed32; } - const repeatedSfixed64 = json[\\"repeatedSfixed64\\"] ?? json.repeated_sfixed64; + const repeatedSfixed64 = json.repeatedSfixed64 ?? json.repeated_sfixed64; if (repeatedSfixed64) { - msg.repeatedSfixed64 = repeatedSfixed64; + msg.repeatedSfixed64 = repeatedSfixed64.map(BigInt); } - const repeatedFloat = json[\\"repeatedFloat\\"] ?? json.repeated_float; + const repeatedFloat = json.repeatedFloat ?? json.repeated_float; if (repeatedFloat) { msg.repeatedFloat = repeatedFloat; } - const repeatedDouble = json[\\"repeatedDouble\\"] ?? json.repeated_double; + const repeatedDouble = json.repeatedDouble ?? json.repeated_double; if (repeatedDouble) { msg.repeatedDouble = repeatedDouble; } - const repeatedBool = json[\\"repeatedBool\\"] ?? json.repeated_bool; + const repeatedBool = json.repeatedBool ?? json.repeated_bool; if (repeatedBool) { msg.repeatedBool = repeatedBool; } const repeatedNestedEnum = - json[\\"repeatedNestedEnum\\"] ?? json.repeated_nested_enum; + json.repeatedNestedEnum ?? json.repeated_nested_enum; if (repeatedNestedEnum) { msg.repeatedNestedEnum = repeatedNestedEnum; } @@ -57539,13 +58928,13 @@ export const NestedTestAllTypes = { if (msg.child) { const child = NestedTestAllTypes._writeMessageJSON(msg.child); if (Object.keys(child).length > 0) { - json[\\"child\\"] = child; + json.child = child; } } if (msg.payload) { const payload = TestAllTypes._writeMessageJSON(msg.payload); if (Object.keys(payload).length > 0) { - json[\\"payload\\"] = payload; + json.payload = payload; } } return json; @@ -57585,13 +58974,13 @@ export const NestedTestAllTypes = { msg: NestedTestAllTypes, json: any ): NestedTestAllTypes { - const child = json[\\"child\\"] ?? json.child; + const child = json.child ?? json.child; if (child) { const m = NestedTestAllTypes.initialize(); NestedTestAllTypes._readMessageJSON(m, child); msg.child = m; } - const payload = json[\\"payload\\"] ?? json.payload; + const payload = json.payload ?? json.payload; if (payload) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, payload); @@ -57669,7 +59058,7 @@ export const ForeignMessage = { ): Record { const json: Record = {}; if (msg.c) { - json[\\"c\\"] = msg.c; + json.c = msg.c; } return json; }, @@ -57701,7 +59090,7 @@ export const ForeignMessage = { * @private */ _readMessageJSON: function (msg: ForeignMessage, json: any): ForeignMessage { - const c = json[\\"c\\"] ?? json.c; + const c = json.c ?? json.c; if (c) { msg.c = c; } @@ -57834,7 +59223,7 @@ export const TestMessageWithDummy = { ): Record { const json: Record = {}; if (msg.dummy) { - json[\\"dummy\\"] = msg.dummy; + json.dummy = msg.dummy; } return json; }, @@ -57869,7 +59258,7 @@ export const TestMessageWithDummy = { msg: TestMessageWithDummy, json: any ): TestMessageWithDummy { - const dummy = json[\\"dummy\\"] ?? json.dummy; + const dummy = json.dummy ?? json.dummy; if (dummy) { msg.dummy = dummy; } @@ -57943,7 +59332,7 @@ export const TestOneof2 = { ): Record { const json: Record = {}; if (msg.fooEnum != undefined) { - json[\\"fooEnum\\"] = msg.fooEnum; + json.fooEnum = msg.fooEnum; } return json; }, @@ -57972,7 +59361,7 @@ export const TestOneof2 = { * @private */ _readMessageJSON: function (msg: TestOneof2, json: any): TestOneof2 { - const fooEnum = json[\\"fooEnum\\"] ?? json.foo_enum; + const fooEnum = json.fooEnum ?? json.foo_enum; if (fooEnum) { msg.fooEnum = fooEnum; } @@ -58258,7 +59647,7 @@ export const PublicImportMessage = { ): Record { const json: Record = {}; if (msg.e) { - json[\\"e\\"] = msg.e; + json.e = msg.e; } return json; }, @@ -58293,7 +59682,7 @@ export const PublicImportMessage = { msg: PublicImportMessage, json: any ): PublicImportMessage { - const e = json[\\"e\\"] ?? json.e; + const e = json.e ?? json.e; if (e) { msg.e = e; } @@ -58426,7 +59815,7 @@ export const ImportMessage = { ): Record { const json: Record = {}; if (msg.d) { - json[\\"d\\"] = msg.d; + json.d = msg.d; } return json; }, @@ -58458,7 +59847,7 @@ export const ImportMessage = { * @private */ _readMessageJSON: function (msg: ImportMessage, json: any): ImportMessage { - const d = json[\\"d\\"] ?? json.d; + const d = json.d ?? json.d; if (d) { msg.d = d; } @@ -58628,15 +60017,15 @@ export interface TestAllTypes { * Singular */ optionalInt32: number; - optionalInt64: string; + optionalInt64: bigint; optionalUint32: number; - optionalUint64: string; + optionalUint64: bigint; optionalSint32: number; - optionalSint64: string; + optionalSint64: bigint; optionalFixed32: number; - optionalFixed64: string; + optionalFixed64: bigint; optionalSfixed32: number; - optionalSfixed64: string; + optionalSfixed64: bigint; optionalFloat: number; optionalDouble: number; optionalBool: boolean; @@ -58659,15 +60048,15 @@ export interface TestAllTypes { /** * Repeated */ - repeatedInt64: string[]; + repeatedInt64: bigint[]; repeatedUint32: number[]; - repeatedUint64: string[]; + repeatedUint64: bigint[]; repeatedSint32: number[]; - repeatedSint64: string[]; + repeatedSint64: bigint[]; repeatedFixed32: number[]; - repeatedFixed64: string[]; + repeatedFixed64: bigint[]; repeatedSfixed32: number[]; - repeatedSfixed64: string[]; + repeatedSfixed64: bigint[]; repeatedFloat: number[]; repeatedDouble: number[]; repeatedBool: boolean[]; @@ -58683,18 +60072,18 @@ export interface TestAllTypes { repeatedCord: string[]; repeatedLazyMessage: TestAllTypes.NestedMessage[]; defaultInt32: number; - defaultInt64: string; + defaultInt64: bigint; /** * Singular with defaults */ defaultUint32: number; - defaultUint64: string; + defaultUint64: bigint; defaultSint32: number; - defaultSint64: string; + defaultSint64: bigint; defaultFixed32: number; - defaultFixed64: string; + defaultFixed64: bigint; defaultSfixed32: number; - defaultSfixed64: string; + defaultSfixed64: bigint; defaultFloat: number; defaultDouble: number; defaultBool: boolean; @@ -59016,14 +60405,14 @@ export interface TestCamelCaseFieldNames { */ export interface TestFieldOrderings { myString: string; - myInt: string; + myInt: bigint; myFloat: number; optionalNestedMessage: TestFieldOrderings.NestedMessage; } export namespace TestFieldOrderings { export interface NestedMessage { - oo: string; + oo: bigint; /** * The field name \\"b\\" fails to compile in proto1 because it conflicts with * a local variable named \\"b\\" in one of the generated methods. Doh. @@ -59050,11 +60439,11 @@ export namespace TestExtensionOrderings2 { export interface TestExtremeDefaultValues { escapedBytes: Uint8Array; largeUint32: number; - largeUint64: string; + largeUint64: bigint; smallInt32: number; - smallInt64: string; + smallInt64: bigint; reallySmallInt32: number; - reallySmallInt64: string; + reallySmallInt64: bigint; /** * The default value here is UTF-8 for \\"\\\\u1234\\". (We could also just type * the UTF-8 text directly into this text file rather than escape it, but @@ -59136,11 +60525,11 @@ export interface Uint32Message { } export interface Int64Message { - data: string; + data: bigint; } export interface Uint64Message { - data: string; + data: bigint; } export interface BoolMessage { @@ -59209,7 +60598,7 @@ export namespace TestOneof2 { } export interface NestedMessage { - quxInt: string; + quxInt: bigint; corgeInt: number[]; } } @@ -59228,15 +60617,15 @@ export namespace TestRequiredOneof { export interface TestPackedTypes { packedInt32: number[]; - packedInt64: string[]; + packedInt64: bigint[]; packedUint32: number[]; - packedUint64: string[]; + packedUint64: bigint[]; packedSint32: number[]; - packedSint64: string[]; + packedSint64: bigint[]; packedFixed32: number[]; - packedFixed64: string[]; + packedFixed64: bigint[]; packedSfixed32: number[]; - packedSfixed64: string[]; + packedSfixed64: bigint[]; packedFloat: number[]; packedDouble: number[]; packedBool: boolean[]; @@ -59249,15 +60638,15 @@ export interface TestPackedTypes { */ export interface TestUnpackedTypes { unpackedInt32: number[]; - unpackedInt64: string[]; + unpackedInt64: bigint[]; unpackedUint32: number[]; - unpackedUint64: string[]; + unpackedUint64: bigint[]; unpackedSint32: number[]; - unpackedSint64: string[]; + unpackedSint64: bigint[]; unpackedFixed32: number[]; - unpackedFixed64: string[]; + unpackedFixed64: bigint[]; unpackedSfixed32: number[]; - unpackedSfixed64: string[]; + unpackedSfixed64: bigint[]; unpackedFloat: number[]; unpackedDouble: number[]; unpackedBool: boolean[]; @@ -59306,13 +60695,13 @@ export interface TestRepeatedScalarDifferentTagSizes { /** * These have two-byte tags. */ - repeatedFixed64: string[]; - repeatedInt64: string[]; + repeatedFixed64: bigint[]; + repeatedInt64: bigint[]; /** * Three byte tags. */ repeatedFloat: number[]; - repeatedUint64: string[]; + repeatedUint64: bigint[]; } /** @@ -59609,15 +60998,15 @@ export const TestAllTypes = { initialize: function (): TestAllTypes { return { optionalInt32: 0, - optionalInt64: \\"\\", + optionalInt64: 0n, optionalUint32: 0, - optionalUint64: \\"\\", + optionalUint64: 0n, optionalSint32: 0, - optionalSint64: \\"\\", + optionalSint64: 0n, optionalFixed32: 0, - optionalFixed64: \\"\\", + optionalFixed64: 0n, optionalSfixed32: 0, - optionalSfixed64: \\"\\", + optionalSfixed64: 0n, optionalFloat: 0, optionalDouble: 0, optionalBool: false, @@ -59658,15 +61047,15 @@ export const TestAllTypes = { repeatedCord: [], repeatedLazyMessage: [], defaultInt32: 0, - defaultInt64: \\"\\", + defaultInt64: 0n, defaultUint32: 0, - defaultUint64: \\"\\", + defaultUint64: 0n, defaultSint32: 0, - defaultSint64: \\"\\", + defaultSint64: 0n, defaultFixed32: 0, - defaultFixed64: \\"\\", + defaultFixed64: 0n, defaultSfixed32: 0, - defaultSfixed64: \\"\\", + defaultSfixed64: 0n, defaultFloat: 0, defaultDouble: 0, defaultBool: false, @@ -59692,31 +61081,31 @@ export const TestAllTypes = { writer.writeInt32(1, msg.optionalInt32); } if (msg.optionalInt64) { - writer.writeInt64String(2, msg.optionalInt64); + writer.writeInt64String(2, msg.optionalInt64.toString()); } if (msg.optionalUint32) { writer.writeUint32(3, msg.optionalUint32); } if (msg.optionalUint64) { - writer.writeUint64String(4, msg.optionalUint64); + writer.writeUint64String(4, msg.optionalUint64.toString()); } if (msg.optionalSint32) { writer.writeSint32(5, msg.optionalSint32); } if (msg.optionalSint64) { - writer.writeSint64String(6, msg.optionalSint64); + writer.writeSint64String(6, msg.optionalSint64.toString()); } if (msg.optionalFixed32) { writer.writeFixed32(7, msg.optionalFixed32); } if (msg.optionalFixed64) { - writer.writeFixed64String(8, msg.optionalFixed64); + writer.writeFixed64String(8, msg.optionalFixed64.toString()); } if (msg.optionalSfixed32) { writer.writeSfixed32(9, msg.optionalSfixed32); } if (msg.optionalSfixed64) { - writer.writeSfixed64(10, msg.optionalSfixed64); + writer.writeSfixed64(10, msg.optionalSfixed64.toString()); } if (msg.optionalFloat) { writer.writeFloat(11, msg.optionalFloat); @@ -59787,31 +61176,31 @@ export const TestAllTypes = { writer.writeRepeatedInt32(31, msg.repeatedInt32); } if (msg.repeatedInt64?.length) { - writer.writeRepeatedInt64String(32, msg.repeatedInt64); + writer.writeRepeatedInt64String(32, msg.repeatedInt64.toString()); } if (msg.repeatedUint32?.length) { writer.writeRepeatedUint32(33, msg.repeatedUint32); } if (msg.repeatedUint64?.length) { - writer.writeRepeatedUint64String(34, msg.repeatedUint64); + writer.writeRepeatedUint64String(34, msg.repeatedUint64.toString()); } if (msg.repeatedSint32?.length) { writer.writeRepeatedSint32(35, msg.repeatedSint32); } if (msg.repeatedSint64?.length) { - writer.writeRepeatedSint64String(36, msg.repeatedSint64); + writer.writeRepeatedSint64String(36, msg.repeatedSint64.toString()); } if (msg.repeatedFixed32?.length) { writer.writeRepeatedFixed32(37, msg.repeatedFixed32); } if (msg.repeatedFixed64?.length) { - writer.writeRepeatedFixed64String(38, msg.repeatedFixed64); + writer.writeRepeatedFixed64String(38, msg.repeatedFixed64.toString()); } if (msg.repeatedSfixed32?.length) { writer.writeRepeatedSfixed32(39, msg.repeatedSfixed32); } if (msg.repeatedSfixed64?.length) { - writer.writeRepeatedSfixed64(40, msg.repeatedSfixed64); + writer.writeRepeatedSfixed64(40, msg.repeatedSfixed64.toString()); } if (msg.repeatedFloat?.length) { writer.writeRepeatedFloat(41, msg.repeatedFloat); @@ -59875,31 +61264,31 @@ export const TestAllTypes = { writer.writeInt32(61, msg.defaultInt32); } if (msg.defaultInt64) { - writer.writeInt64String(62, msg.defaultInt64); + writer.writeInt64String(62, msg.defaultInt64.toString()); } if (msg.defaultUint32) { writer.writeUint32(63, msg.defaultUint32); } if (msg.defaultUint64) { - writer.writeUint64String(64, msg.defaultUint64); + writer.writeUint64String(64, msg.defaultUint64.toString()); } if (msg.defaultSint32) { writer.writeSint32(65, msg.defaultSint32); } if (msg.defaultSint64) { - writer.writeSint64String(66, msg.defaultSint64); + writer.writeSint64String(66, msg.defaultSint64.toString()); } if (msg.defaultFixed32) { writer.writeFixed32(67, msg.defaultFixed32); } if (msg.defaultFixed64) { - writer.writeFixed64String(68, msg.defaultFixed64); + writer.writeFixed64String(68, msg.defaultFixed64.toString()); } if (msg.defaultSfixed32) { writer.writeSfixed32(69, msg.defaultSfixed32); } if (msg.defaultSfixed64) { - writer.writeSfixed64(70, msg.defaultSfixed64); + writer.writeSfixed64(70, msg.defaultSfixed64.toString()); } if (msg.defaultFloat) { writer.writeFloat(71, msg.defaultFloat); @@ -59958,55 +61347,55 @@ export const TestAllTypes = { ): Record { const json: Record = {}; if (msg.optionalInt32) { - json[\\"optionalInt32\\"] = msg.optionalInt32; + json.optionalInt32 = msg.optionalInt32; } if (msg.optionalInt64) { - json[\\"optionalInt64\\"] = msg.optionalInt64; + json.optionalInt64 = msg.optionalInt64.toString(); } if (msg.optionalUint32) { - json[\\"optionalUint32\\"] = msg.optionalUint32; + json.optionalUint32 = msg.optionalUint32; } if (msg.optionalUint64) { - json[\\"optionalUint64\\"] = msg.optionalUint64; + json.optionalUint64 = msg.optionalUint64.toString(); } if (msg.optionalSint32) { - json[\\"optionalSint32\\"] = msg.optionalSint32; + json.optionalSint32 = msg.optionalSint32; } if (msg.optionalSint64) { - json[\\"optionalSint64\\"] = msg.optionalSint64; + json.optionalSint64 = msg.optionalSint64.toString(); } if (msg.optionalFixed32) { - json[\\"optionalFixed32\\"] = msg.optionalFixed32; + json.optionalFixed32 = msg.optionalFixed32; } if (msg.optionalFixed64) { - json[\\"optionalFixed64\\"] = msg.optionalFixed64; + json.optionalFixed64 = msg.optionalFixed64.toString(); } if (msg.optionalSfixed32) { - json[\\"optionalSfixed32\\"] = msg.optionalSfixed32; + json.optionalSfixed32 = msg.optionalSfixed32; } if (msg.optionalSfixed64) { - json[\\"optionalSfixed64\\"] = msg.optionalSfixed64; + json.optionalSfixed64 = msg.optionalSfixed64.toString(); } if (msg.optionalFloat) { - json[\\"optionalFloat\\"] = msg.optionalFloat; + json.optionalFloat = msg.optionalFloat; } if (msg.optionalDouble) { - json[\\"optionalDouble\\"] = msg.optionalDouble; + json.optionalDouble = msg.optionalDouble; } if (msg.optionalBool) { - json[\\"optionalBool\\"] = msg.optionalBool; + json.optionalBool = msg.optionalBool; } if (msg.optionalString) { - json[\\"optionalString\\"] = msg.optionalString; + json.optionalString = msg.optionalString; } if (msg.optionalBytes) { - json[\\"optionalBytes\\"] = msg.optionalBytes; + json.optionalBytes = msg.optionalBytes; } if (msg.optionalNestedMessage) { const optionalNestedMessage = TestAllTypes.NestedMessage._writeMessageJSON(msg.optionalNestedMessage); if (Object.keys(optionalNestedMessage).length > 0) { - json[\\"optionalNestedMessage\\"] = optionalNestedMessage; + json.optionalNestedMessage = optionalNestedMessage; } } if (msg.optionalForeignMessage) { @@ -60014,7 +61403,7 @@ export const TestAllTypes = { msg.optionalForeignMessage ); if (Object.keys(optionalForeignMessage).length > 0) { - json[\\"optionalForeignMessage\\"] = optionalForeignMessage; + json.optionalForeignMessage = optionalForeignMessage; } } if (msg.optionalImportMessage) { @@ -60022,30 +61411,30 @@ export const TestAllTypes = { msg.optionalImportMessage ); if (Object.keys(optionalImportMessage).length > 0) { - json[\\"optionalImportMessage\\"] = optionalImportMessage; + json.optionalImportMessage = optionalImportMessage; } } if (msg.optionalNestedEnum) { - json[\\"optionalNestedEnum\\"] = msg.optionalNestedEnum; + json.optionalNestedEnum = msg.optionalNestedEnum; } if (msg.optionalForeignEnum) { - json[\\"optionalForeignEnum\\"] = msg.optionalForeignEnum; + json.optionalForeignEnum = msg.optionalForeignEnum; } if (msg.optionalImportEnum) { - json[\\"optionalImportEnum\\"] = msg.optionalImportEnum; + json.optionalImportEnum = msg.optionalImportEnum; } if (msg.optionalStringPiece) { - json[\\"optionalStringPiece\\"] = msg.optionalStringPiece; + json.optionalStringPiece = msg.optionalStringPiece; } if (msg.optionalCord) { - json[\\"optionalCord\\"] = msg.optionalCord; + json.optionalCord = msg.optionalCord; } if (msg.optionalPublicImportMessage) { const optionalPublicImportMessage = PublicImportMessage._writeMessageJSON( msg.optionalPublicImportMessage ); if (Object.keys(optionalPublicImportMessage).length > 0) { - json[\\"optionalPublicImportMessage\\"] = optionalPublicImportMessage; + json.optionalPublicImportMessage = optionalPublicImportMessage; } } if (msg.optionalLazyMessage) { @@ -60053,165 +61442,165 @@ export const TestAllTypes = { msg.optionalLazyMessage ); if (Object.keys(optionalLazyMessage).length > 0) { - json[\\"optionalLazyMessage\\"] = optionalLazyMessage; + json.optionalLazyMessage = optionalLazyMessage; } } if (msg.repeatedInt32?.length) { - json[\\"repeatedInt32\\"] = msg.repeatedInt32; + json.repeatedInt32 = msg.repeatedInt32; } if (msg.repeatedInt64?.length) { - json[\\"repeatedInt64\\"] = msg.repeatedInt64; + json.repeatedInt64 = msg.repeatedInt64.map((x) => x.toString()); } if (msg.repeatedUint32?.length) { - json[\\"repeatedUint32\\"] = msg.repeatedUint32; + json.repeatedUint32 = msg.repeatedUint32; } if (msg.repeatedUint64?.length) { - json[\\"repeatedUint64\\"] = msg.repeatedUint64; + json.repeatedUint64 = msg.repeatedUint64.map((x) => x.toString()); } if (msg.repeatedSint32?.length) { - json[\\"repeatedSint32\\"] = msg.repeatedSint32; + json.repeatedSint32 = msg.repeatedSint32; } if (msg.repeatedSint64?.length) { - json[\\"repeatedSint64\\"] = msg.repeatedSint64; + json.repeatedSint64 = msg.repeatedSint64.map((x) => x.toString()); } if (msg.repeatedFixed32?.length) { - json[\\"repeatedFixed32\\"] = msg.repeatedFixed32; + json.repeatedFixed32 = msg.repeatedFixed32; } if (msg.repeatedFixed64?.length) { - json[\\"repeatedFixed64\\"] = msg.repeatedFixed64; + json.repeatedFixed64 = msg.repeatedFixed64.map((x) => x.toString()); } if (msg.repeatedSfixed32?.length) { - json[\\"repeatedSfixed32\\"] = msg.repeatedSfixed32; + json.repeatedSfixed32 = msg.repeatedSfixed32; } if (msg.repeatedSfixed64?.length) { - json[\\"repeatedSfixed64\\"] = msg.repeatedSfixed64; + json.repeatedSfixed64 = msg.repeatedSfixed64.map((x) => x.toString()); } if (msg.repeatedFloat?.length) { - json[\\"repeatedFloat\\"] = msg.repeatedFloat; + json.repeatedFloat = msg.repeatedFloat; } if (msg.repeatedDouble?.length) { - json[\\"repeatedDouble\\"] = msg.repeatedDouble; + json.repeatedDouble = msg.repeatedDouble; } if (msg.repeatedBool?.length) { - json[\\"repeatedBool\\"] = msg.repeatedBool; + json.repeatedBool = msg.repeatedBool; } if (msg.repeatedString?.length) { - json[\\"repeatedString\\"] = msg.repeatedString; + json.repeatedString = msg.repeatedString; } if (msg.repeatedBytes?.length) { - json[\\"repeatedBytes\\"] = msg.repeatedBytes; + json.repeatedBytes = msg.repeatedBytes; } if (msg.repeatedNestedMessage?.length) { - json[\\"repeatedNestedMessage\\"] = msg.repeatedNestedMessage.map( + json.repeatedNestedMessage = msg.repeatedNestedMessage.map( TestAllTypes.NestedMessage._writeMessageJSON ); } if (msg.repeatedForeignMessage?.length) { - json[\\"repeatedForeignMessage\\"] = msg.repeatedForeignMessage.map( + json.repeatedForeignMessage = msg.repeatedForeignMessage.map( ForeignMessage._writeMessageJSON ); } if (msg.repeatedImportMessage?.length) { - json[\\"repeatedImportMessage\\"] = msg.repeatedImportMessage.map( + json.repeatedImportMessage = msg.repeatedImportMessage.map( ImportMessage._writeMessageJSON ); } if (msg.repeatedNestedEnum?.length) { - json[\\"repeatedNestedEnum\\"] = msg.repeatedNestedEnum; + json.repeatedNestedEnum = msg.repeatedNestedEnum; } if (msg.repeatedForeignEnum?.length) { - json[\\"repeatedForeignEnum\\"] = msg.repeatedForeignEnum; + json.repeatedForeignEnum = msg.repeatedForeignEnum; } if (msg.repeatedImportEnum?.length) { - json[\\"repeatedImportEnum\\"] = msg.repeatedImportEnum; + json.repeatedImportEnum = msg.repeatedImportEnum; } if (msg.repeatedStringPiece?.length) { - json[\\"repeatedStringPiece\\"] = msg.repeatedStringPiece; + json.repeatedStringPiece = msg.repeatedStringPiece; } if (msg.repeatedCord?.length) { - json[\\"repeatedCord\\"] = msg.repeatedCord; + json.repeatedCord = msg.repeatedCord; } if (msg.repeatedLazyMessage?.length) { - json[\\"repeatedLazyMessage\\"] = msg.repeatedLazyMessage.map( + json.repeatedLazyMessage = msg.repeatedLazyMessage.map( TestAllTypes.NestedMessage._writeMessageJSON ); } if (msg.defaultInt32) { - json[\\"defaultInt32\\"] = msg.defaultInt32; + json.defaultInt32 = msg.defaultInt32; } if (msg.defaultInt64) { - json[\\"defaultInt64\\"] = msg.defaultInt64; + json.defaultInt64 = msg.defaultInt64.toString(); } if (msg.defaultUint32) { - json[\\"defaultUint32\\"] = msg.defaultUint32; + json.defaultUint32 = msg.defaultUint32; } if (msg.defaultUint64) { - json[\\"defaultUint64\\"] = msg.defaultUint64; + json.defaultUint64 = msg.defaultUint64.toString(); } if (msg.defaultSint32) { - json[\\"defaultSint32\\"] = msg.defaultSint32; + json.defaultSint32 = msg.defaultSint32; } if (msg.defaultSint64) { - json[\\"defaultSint64\\"] = msg.defaultSint64; + json.defaultSint64 = msg.defaultSint64.toString(); } if (msg.defaultFixed32) { - json[\\"defaultFixed32\\"] = msg.defaultFixed32; + json.defaultFixed32 = msg.defaultFixed32; } if (msg.defaultFixed64) { - json[\\"defaultFixed64\\"] = msg.defaultFixed64; + json.defaultFixed64 = msg.defaultFixed64.toString(); } if (msg.defaultSfixed32) { - json[\\"defaultSfixed32\\"] = msg.defaultSfixed32; + json.defaultSfixed32 = msg.defaultSfixed32; } if (msg.defaultSfixed64) { - json[\\"defaultSfixed64\\"] = msg.defaultSfixed64; + json.defaultSfixed64 = msg.defaultSfixed64.toString(); } if (msg.defaultFloat) { - json[\\"defaultFloat\\"] = msg.defaultFloat; + json.defaultFloat = msg.defaultFloat; } if (msg.defaultDouble) { - json[\\"defaultDouble\\"] = msg.defaultDouble; + json.defaultDouble = msg.defaultDouble; } if (msg.defaultBool) { - json[\\"defaultBool\\"] = msg.defaultBool; + json.defaultBool = msg.defaultBool; } if (msg.defaultString) { - json[\\"defaultString\\"] = msg.defaultString; + json.defaultString = msg.defaultString; } if (msg.defaultBytes) { - json[\\"defaultBytes\\"] = msg.defaultBytes; + json.defaultBytes = msg.defaultBytes; } if (msg.defaultNestedEnum) { - json[\\"defaultNestedEnum\\"] = msg.defaultNestedEnum; + json.defaultNestedEnum = msg.defaultNestedEnum; } if (msg.defaultForeignEnum) { - json[\\"defaultForeignEnum\\"] = msg.defaultForeignEnum; + json.defaultForeignEnum = msg.defaultForeignEnum; } if (msg.defaultImportEnum) { - json[\\"defaultImportEnum\\"] = msg.defaultImportEnum; + json.defaultImportEnum = msg.defaultImportEnum; } if (msg.defaultStringPiece) { - json[\\"defaultStringPiece\\"] = msg.defaultStringPiece; + json.defaultStringPiece = msg.defaultStringPiece; } if (msg.defaultCord) { - json[\\"defaultCord\\"] = msg.defaultCord; + json.defaultCord = msg.defaultCord; } if (msg.oneofUint32 != undefined) { - json[\\"oneofUint32\\"] = msg.oneofUint32; + json.oneofUint32 = msg.oneofUint32; } if (msg.oneofNestedMessage != undefined) { const oneofNestedMessage = TestAllTypes.NestedMessage._writeMessageJSON( msg.oneofNestedMessage ); if (Object.keys(oneofNestedMessage).length > 0) { - json[\\"oneofNestedMessage\\"] = oneofNestedMessage; + json.oneofNestedMessage = oneofNestedMessage; } } if (msg.oneofString != undefined) { - json[\\"oneofString\\"] = msg.oneofString; + json.oneofString = msg.oneofString; } if (msg.oneofBytes != undefined) { - json[\\"oneofBytes\\"] = msg.oneofBytes; + json.oneofBytes = msg.oneofBytes; } return json; }, @@ -60231,7 +61620,7 @@ export const TestAllTypes = { break; } case 2: { - msg.optionalInt64 = reader.readInt64String(); + msg.optionalInt64 = BigInt(reader.readInt64String()); break; } case 3: { @@ -60239,7 +61628,7 @@ export const TestAllTypes = { break; } case 4: { - msg.optionalUint64 = reader.readUint64String(); + msg.optionalUint64 = BigInt(reader.readUint64String()); break; } case 5: { @@ -60247,7 +61636,7 @@ export const TestAllTypes = { break; } case 6: { - msg.optionalSint64 = reader.readSint64(); + msg.optionalSint64 = BigInt(reader.readSint64()); break; } case 7: { @@ -60255,7 +61644,7 @@ export const TestAllTypes = { break; } case 8: { - msg.optionalFixed64 = reader.readFixed64String(); + msg.optionalFixed64 = BigInt(reader.readFixed64String()); break; } case 9: { @@ -60263,7 +61652,7 @@ export const TestAllTypes = { break; } case 10: { - msg.optionalSfixed64 = reader.readSfixed64(); + msg.optionalSfixed64 = BigInt(reader.readSfixed64()); break; } case 11: { @@ -60346,7 +61735,7 @@ export const TestAllTypes = { break; } case 32: { - msg.repeatedInt64.push(reader.readInt64String()); + msg.repeatedInt64 = reader.readInt64String().map(BigInt); break; } case 33: { @@ -60354,7 +61743,7 @@ export const TestAllTypes = { break; } case 34: { - msg.repeatedUint64.push(reader.readUint64String()); + msg.repeatedUint64 = reader.readUint64String().map(BigInt); break; } case 35: { @@ -60362,7 +61751,7 @@ export const TestAllTypes = { break; } case 36: { - msg.repeatedSint64.push(reader.readSint64()); + msg.repeatedSint64 = reader.readSint64().map(BigInt); break; } case 37: { @@ -60370,7 +61759,7 @@ export const TestAllTypes = { break; } case 38: { - msg.repeatedFixed64.push(reader.readFixed64String()); + msg.repeatedFixed64 = reader.readFixed64String().map(BigInt); break; } case 39: { @@ -60378,7 +61767,7 @@ export const TestAllTypes = { break; } case 40: { - msg.repeatedSfixed64.push(reader.readSfixed64()); + msg.repeatedSfixed64 = reader.readSfixed64().map(BigInt); break; } case 41: { @@ -60452,7 +61841,7 @@ export const TestAllTypes = { break; } case 62: { - msg.defaultInt64 = reader.readInt64String(); + msg.defaultInt64 = BigInt(reader.readInt64String()); break; } case 63: { @@ -60460,7 +61849,7 @@ export const TestAllTypes = { break; } case 64: { - msg.defaultUint64 = reader.readUint64String(); + msg.defaultUint64 = BigInt(reader.readUint64String()); break; } case 65: { @@ -60468,7 +61857,7 @@ export const TestAllTypes = { break; } case 66: { - msg.defaultSint64 = reader.readSint64(); + msg.defaultSint64 = BigInt(reader.readSint64()); break; } case 67: { @@ -60476,7 +61865,7 @@ export const TestAllTypes = { break; } case 68: { - msg.defaultFixed64 = reader.readFixed64String(); + msg.defaultFixed64 = BigInt(reader.readFixed64String()); break; } case 69: { @@ -60484,7 +61873,7 @@ export const TestAllTypes = { break; } case 70: { - msg.defaultSfixed64 = reader.readSfixed64(); + msg.defaultSfixed64 = BigInt(reader.readSfixed64()); break; } case 71: { @@ -60559,188 +61948,187 @@ export const TestAllTypes = { * @private */ _readMessageJSON: function (msg: TestAllTypes, json: any): TestAllTypes { - const optionalInt32 = json[\\"optionalInt32\\"] ?? json.optional_int32; + const optionalInt32 = json.optionalInt32 ?? json.optional_int32; if (optionalInt32) { msg.optionalInt32 = optionalInt32; } - const optionalInt64 = json[\\"optionalInt64\\"] ?? json.optional_int64; + const optionalInt64 = json.optionalInt64 ?? json.optional_int64; if (optionalInt64) { - msg.optionalInt64 = optionalInt64; + msg.optionalInt64 = BigInt(optionalInt64); } - const optionalUint32 = json[\\"optionalUint32\\"] ?? json.optional_uint32; + const optionalUint32 = json.optionalUint32 ?? json.optional_uint32; if (optionalUint32) { msg.optionalUint32 = optionalUint32; } - const optionalUint64 = json[\\"optionalUint64\\"] ?? json.optional_uint64; + const optionalUint64 = json.optionalUint64 ?? json.optional_uint64; if (optionalUint64) { - msg.optionalUint64 = optionalUint64; + msg.optionalUint64 = BigInt(optionalUint64); } - const optionalSint32 = json[\\"optionalSint32\\"] ?? json.optional_sint32; + const optionalSint32 = json.optionalSint32 ?? json.optional_sint32; if (optionalSint32) { msg.optionalSint32 = optionalSint32; } - const optionalSint64 = json[\\"optionalSint64\\"] ?? json.optional_sint64; + const optionalSint64 = json.optionalSint64 ?? json.optional_sint64; if (optionalSint64) { - msg.optionalSint64 = optionalSint64; + msg.optionalSint64 = BigInt(optionalSint64); } - const optionalFixed32 = json[\\"optionalFixed32\\"] ?? json.optional_fixed32; + const optionalFixed32 = json.optionalFixed32 ?? json.optional_fixed32; if (optionalFixed32) { msg.optionalFixed32 = optionalFixed32; } - const optionalFixed64 = json[\\"optionalFixed64\\"] ?? json.optional_fixed64; + const optionalFixed64 = json.optionalFixed64 ?? json.optional_fixed64; if (optionalFixed64) { - msg.optionalFixed64 = optionalFixed64; + msg.optionalFixed64 = BigInt(optionalFixed64); } - const optionalSfixed32 = json[\\"optionalSfixed32\\"] ?? json.optional_sfixed32; + const optionalSfixed32 = json.optionalSfixed32 ?? json.optional_sfixed32; if (optionalSfixed32) { msg.optionalSfixed32 = optionalSfixed32; } - const optionalSfixed64 = json[\\"optionalSfixed64\\"] ?? json.optional_sfixed64; + const optionalSfixed64 = json.optionalSfixed64 ?? json.optional_sfixed64; if (optionalSfixed64) { - msg.optionalSfixed64 = optionalSfixed64; + msg.optionalSfixed64 = BigInt(optionalSfixed64); } - const optionalFloat = json[\\"optionalFloat\\"] ?? json.optional_float; + const optionalFloat = json.optionalFloat ?? json.optional_float; if (optionalFloat) { msg.optionalFloat = optionalFloat; } - const optionalDouble = json[\\"optionalDouble\\"] ?? json.optional_double; + const optionalDouble = json.optionalDouble ?? json.optional_double; if (optionalDouble) { msg.optionalDouble = optionalDouble; } - const optionalBool = json[\\"optionalBool\\"] ?? json.optional_bool; + const optionalBool = json.optionalBool ?? json.optional_bool; if (optionalBool) { msg.optionalBool = optionalBool; } - const optionalString = json[\\"optionalString\\"] ?? json.optional_string; + const optionalString = json.optionalString ?? json.optional_string; if (optionalString) { msg.optionalString = optionalString; } - const optionalBytes = json[\\"optionalBytes\\"] ?? json.optional_bytes; + const optionalBytes = json.optionalBytes ?? json.optional_bytes; if (optionalBytes) { msg.optionalBytes = optionalBytes; } const optionalNestedMessage = - json[\\"optionalNestedMessage\\"] ?? json.optional_nested_message; + json.optionalNestedMessage ?? json.optional_nested_message; if (optionalNestedMessage) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, optionalNestedMessage); msg.optionalNestedMessage = m; } const optionalForeignMessage = - json[\\"optionalForeignMessage\\"] ?? json.optional_foreign_message; + json.optionalForeignMessage ?? json.optional_foreign_message; if (optionalForeignMessage) { const m = ForeignMessage.initialize(); ForeignMessage._readMessageJSON(m, optionalForeignMessage); msg.optionalForeignMessage = m; } const optionalImportMessage = - json[\\"optionalImportMessage\\"] ?? json.optional_import_message; + json.optionalImportMessage ?? json.optional_import_message; if (optionalImportMessage) { const m = ImportMessage.initialize(); ImportMessage._readMessageJSON(m, optionalImportMessage); msg.optionalImportMessage = m; } const optionalNestedEnum = - json[\\"optionalNestedEnum\\"] ?? json.optional_nested_enum; + json.optionalNestedEnum ?? json.optional_nested_enum; if (optionalNestedEnum) { msg.optionalNestedEnum = optionalNestedEnum; } const optionalForeignEnum = - json[\\"optionalForeignEnum\\"] ?? json.optional_foreign_enum; + json.optionalForeignEnum ?? json.optional_foreign_enum; if (optionalForeignEnum) { msg.optionalForeignEnum = optionalForeignEnum; } const optionalImportEnum = - json[\\"optionalImportEnum\\"] ?? json.optional_import_enum; + json.optionalImportEnum ?? json.optional_import_enum; if (optionalImportEnum) { msg.optionalImportEnum = optionalImportEnum; } const optionalStringPiece = - json[\\"optionalStringPiece\\"] ?? json.optional_string_piece; + json.optionalStringPiece ?? json.optional_string_piece; if (optionalStringPiece) { msg.optionalStringPiece = optionalStringPiece; } - const optionalCord = json[\\"optionalCord\\"] ?? json.optional_cord; + const optionalCord = json.optionalCord ?? json.optional_cord; if (optionalCord) { msg.optionalCord = optionalCord; } const optionalPublicImportMessage = - json[\\"optionalPublicImportMessage\\"] ?? - json.optional_public_import_message; + json.optionalPublicImportMessage ?? json.optional_public_import_message; if (optionalPublicImportMessage) { const m = PublicImportMessage.initialize(); PublicImportMessage._readMessageJSON(m, optionalPublicImportMessage); msg.optionalPublicImportMessage = m; } const optionalLazyMessage = - json[\\"optionalLazyMessage\\"] ?? json.optional_lazy_message; + json.optionalLazyMessage ?? json.optional_lazy_message; if (optionalLazyMessage) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, optionalLazyMessage); msg.optionalLazyMessage = m; } - const repeatedInt32 = json[\\"repeatedInt32\\"] ?? json.repeated_int32; + const repeatedInt32 = json.repeatedInt32 ?? json.repeated_int32; if (repeatedInt32) { msg.repeatedInt32 = repeatedInt32; } - const repeatedInt64 = json[\\"repeatedInt64\\"] ?? json.repeated_int64; + const repeatedInt64 = json.repeatedInt64 ?? json.repeated_int64; if (repeatedInt64) { - msg.repeatedInt64 = repeatedInt64; + msg.repeatedInt64 = repeatedInt64.map(BigInt); } - const repeatedUint32 = json[\\"repeatedUint32\\"] ?? json.repeated_uint32; + const repeatedUint32 = json.repeatedUint32 ?? json.repeated_uint32; if (repeatedUint32) { msg.repeatedUint32 = repeatedUint32; } - const repeatedUint64 = json[\\"repeatedUint64\\"] ?? json.repeated_uint64; + const repeatedUint64 = json.repeatedUint64 ?? json.repeated_uint64; if (repeatedUint64) { - msg.repeatedUint64 = repeatedUint64; + msg.repeatedUint64 = repeatedUint64.map(BigInt); } - const repeatedSint32 = json[\\"repeatedSint32\\"] ?? json.repeated_sint32; + const repeatedSint32 = json.repeatedSint32 ?? json.repeated_sint32; if (repeatedSint32) { msg.repeatedSint32 = repeatedSint32; } - const repeatedSint64 = json[\\"repeatedSint64\\"] ?? json.repeated_sint64; + const repeatedSint64 = json.repeatedSint64 ?? json.repeated_sint64; if (repeatedSint64) { - msg.repeatedSint64 = repeatedSint64; + msg.repeatedSint64 = repeatedSint64.map(BigInt); } - const repeatedFixed32 = json[\\"repeatedFixed32\\"] ?? json.repeated_fixed32; + const repeatedFixed32 = json.repeatedFixed32 ?? json.repeated_fixed32; if (repeatedFixed32) { msg.repeatedFixed32 = repeatedFixed32; } - const repeatedFixed64 = json[\\"repeatedFixed64\\"] ?? json.repeated_fixed64; + const repeatedFixed64 = json.repeatedFixed64 ?? json.repeated_fixed64; if (repeatedFixed64) { - msg.repeatedFixed64 = repeatedFixed64; + msg.repeatedFixed64 = repeatedFixed64.map(BigInt); } - const repeatedSfixed32 = json[\\"repeatedSfixed32\\"] ?? json.repeated_sfixed32; + const repeatedSfixed32 = json.repeatedSfixed32 ?? json.repeated_sfixed32; if (repeatedSfixed32) { msg.repeatedSfixed32 = repeatedSfixed32; } - const repeatedSfixed64 = json[\\"repeatedSfixed64\\"] ?? json.repeated_sfixed64; + const repeatedSfixed64 = json.repeatedSfixed64 ?? json.repeated_sfixed64; if (repeatedSfixed64) { - msg.repeatedSfixed64 = repeatedSfixed64; + msg.repeatedSfixed64 = repeatedSfixed64.map(BigInt); } - const repeatedFloat = json[\\"repeatedFloat\\"] ?? json.repeated_float; + const repeatedFloat = json.repeatedFloat ?? json.repeated_float; if (repeatedFloat) { msg.repeatedFloat = repeatedFloat; } - const repeatedDouble = json[\\"repeatedDouble\\"] ?? json.repeated_double; + const repeatedDouble = json.repeatedDouble ?? json.repeated_double; if (repeatedDouble) { msg.repeatedDouble = repeatedDouble; } - const repeatedBool = json[\\"repeatedBool\\"] ?? json.repeated_bool; + const repeatedBool = json.repeatedBool ?? json.repeated_bool; if (repeatedBool) { msg.repeatedBool = repeatedBool; } - const repeatedString = json[\\"repeatedString\\"] ?? json.repeated_string; + const repeatedString = json.repeatedString ?? json.repeated_string; if (repeatedString) { msg.repeatedString = repeatedString; } - const repeatedBytes = json[\\"repeatedBytes\\"] ?? json.repeated_bytes; + const repeatedBytes = json.repeatedBytes ?? json.repeated_bytes; if (repeatedBytes) { msg.repeatedBytes = repeatedBytes; } const repeatedNestedMessage = - json[\\"repeatedNestedMessage\\"] ?? json.repeated_nested_message; + json.repeatedNestedMessage ?? json.repeated_nested_message; if (repeatedNestedMessage) { for (const item of repeatedNestedMessage) { const m = TestAllTypes.NestedMessage.initialize(); @@ -60749,7 +62137,7 @@ export const TestAllTypes = { } } const repeatedForeignMessage = - json[\\"repeatedForeignMessage\\"] ?? json.repeated_foreign_message; + json.repeatedForeignMessage ?? json.repeated_foreign_message; if (repeatedForeignMessage) { for (const item of repeatedForeignMessage) { const m = ForeignMessage.initialize(); @@ -60758,7 +62146,7 @@ export const TestAllTypes = { } } const repeatedImportMessage = - json[\\"repeatedImportMessage\\"] ?? json.repeated_import_message; + json.repeatedImportMessage ?? json.repeated_import_message; if (repeatedImportMessage) { for (const item of repeatedImportMessage) { const m = ImportMessage.initialize(); @@ -60767,31 +62155,31 @@ export const TestAllTypes = { } } const repeatedNestedEnum = - json[\\"repeatedNestedEnum\\"] ?? json.repeated_nested_enum; + json.repeatedNestedEnum ?? json.repeated_nested_enum; if (repeatedNestedEnum) { msg.repeatedNestedEnum = repeatedNestedEnum; } const repeatedForeignEnum = - json[\\"repeatedForeignEnum\\"] ?? json.repeated_foreign_enum; + json.repeatedForeignEnum ?? json.repeated_foreign_enum; if (repeatedForeignEnum) { msg.repeatedForeignEnum = repeatedForeignEnum; } const repeatedImportEnum = - json[\\"repeatedImportEnum\\"] ?? json.repeated_import_enum; + json.repeatedImportEnum ?? json.repeated_import_enum; if (repeatedImportEnum) { msg.repeatedImportEnum = repeatedImportEnum; } const repeatedStringPiece = - json[\\"repeatedStringPiece\\"] ?? json.repeated_string_piece; + json.repeatedStringPiece ?? json.repeated_string_piece; if (repeatedStringPiece) { msg.repeatedStringPiece = repeatedStringPiece; } - const repeatedCord = json[\\"repeatedCord\\"] ?? json.repeated_cord; + const repeatedCord = json.repeatedCord ?? json.repeated_cord; if (repeatedCord) { msg.repeatedCord = repeatedCord; } const repeatedLazyMessage = - json[\\"repeatedLazyMessage\\"] ?? json.repeated_lazy_message; + json.repeatedLazyMessage ?? json.repeated_lazy_message; if (repeatedLazyMessage) { for (const item of repeatedLazyMessage) { const m = TestAllTypes.NestedMessage.initialize(); @@ -60799,106 +62187,106 @@ export const TestAllTypes = { msg.repeatedLazyMessage.push(m); } } - const defaultInt32 = json[\\"defaultInt32\\"] ?? json.default_int32; + const defaultInt32 = json.defaultInt32 ?? json.default_int32; if (defaultInt32) { msg.defaultInt32 = defaultInt32; } - const defaultInt64 = json[\\"defaultInt64\\"] ?? json.default_int64; + const defaultInt64 = json.defaultInt64 ?? json.default_int64; if (defaultInt64) { - msg.defaultInt64 = defaultInt64; + msg.defaultInt64 = BigInt(defaultInt64); } - const defaultUint32 = json[\\"defaultUint32\\"] ?? json.default_uint32; + const defaultUint32 = json.defaultUint32 ?? json.default_uint32; if (defaultUint32) { msg.defaultUint32 = defaultUint32; } - const defaultUint64 = json[\\"defaultUint64\\"] ?? json.default_uint64; + const defaultUint64 = json.defaultUint64 ?? json.default_uint64; if (defaultUint64) { - msg.defaultUint64 = defaultUint64; + msg.defaultUint64 = BigInt(defaultUint64); } - const defaultSint32 = json[\\"defaultSint32\\"] ?? json.default_sint32; + const defaultSint32 = json.defaultSint32 ?? json.default_sint32; if (defaultSint32) { msg.defaultSint32 = defaultSint32; } - const defaultSint64 = json[\\"defaultSint64\\"] ?? json.default_sint64; + const defaultSint64 = json.defaultSint64 ?? json.default_sint64; if (defaultSint64) { - msg.defaultSint64 = defaultSint64; + msg.defaultSint64 = BigInt(defaultSint64); } - const defaultFixed32 = json[\\"defaultFixed32\\"] ?? json.default_fixed32; + const defaultFixed32 = json.defaultFixed32 ?? json.default_fixed32; if (defaultFixed32) { msg.defaultFixed32 = defaultFixed32; } - const defaultFixed64 = json[\\"defaultFixed64\\"] ?? json.default_fixed64; + const defaultFixed64 = json.defaultFixed64 ?? json.default_fixed64; if (defaultFixed64) { - msg.defaultFixed64 = defaultFixed64; + msg.defaultFixed64 = BigInt(defaultFixed64); } - const defaultSfixed32 = json[\\"defaultSfixed32\\"] ?? json.default_sfixed32; + const defaultSfixed32 = json.defaultSfixed32 ?? json.default_sfixed32; if (defaultSfixed32) { msg.defaultSfixed32 = defaultSfixed32; } - const defaultSfixed64 = json[\\"defaultSfixed64\\"] ?? json.default_sfixed64; + const defaultSfixed64 = json.defaultSfixed64 ?? json.default_sfixed64; if (defaultSfixed64) { - msg.defaultSfixed64 = defaultSfixed64; + msg.defaultSfixed64 = BigInt(defaultSfixed64); } - const defaultFloat = json[\\"defaultFloat\\"] ?? json.default_float; + const defaultFloat = json.defaultFloat ?? json.default_float; if (defaultFloat) { msg.defaultFloat = defaultFloat; } - const defaultDouble = json[\\"defaultDouble\\"] ?? json.default_double; + const defaultDouble = json.defaultDouble ?? json.default_double; if (defaultDouble) { msg.defaultDouble = defaultDouble; } - const defaultBool = json[\\"defaultBool\\"] ?? json.default_bool; + const defaultBool = json.defaultBool ?? json.default_bool; if (defaultBool) { msg.defaultBool = defaultBool; } - const defaultString = json[\\"defaultString\\"] ?? json.default_string; + const defaultString = json.defaultString ?? json.default_string; if (defaultString) { msg.defaultString = defaultString; } - const defaultBytes = json[\\"defaultBytes\\"] ?? json.default_bytes; + const defaultBytes = json.defaultBytes ?? json.default_bytes; if (defaultBytes) { msg.defaultBytes = defaultBytes; } const defaultNestedEnum = - json[\\"defaultNestedEnum\\"] ?? json.default_nested_enum; + json.defaultNestedEnum ?? json.default_nested_enum; if (defaultNestedEnum) { msg.defaultNestedEnum = defaultNestedEnum; } const defaultForeignEnum = - json[\\"defaultForeignEnum\\"] ?? json.default_foreign_enum; + json.defaultForeignEnum ?? json.default_foreign_enum; if (defaultForeignEnum) { msg.defaultForeignEnum = defaultForeignEnum; } const defaultImportEnum = - json[\\"defaultImportEnum\\"] ?? json.default_import_enum; + json.defaultImportEnum ?? json.default_import_enum; if (defaultImportEnum) { msg.defaultImportEnum = defaultImportEnum; } const defaultStringPiece = - json[\\"defaultStringPiece\\"] ?? json.default_string_piece; + json.defaultStringPiece ?? json.default_string_piece; if (defaultStringPiece) { msg.defaultStringPiece = defaultStringPiece; } - const defaultCord = json[\\"defaultCord\\"] ?? json.default_cord; + const defaultCord = json.defaultCord ?? json.default_cord; if (defaultCord) { msg.defaultCord = defaultCord; } - const oneofUint32 = json[\\"oneofUint32\\"] ?? json.oneof_uint32; + const oneofUint32 = json.oneofUint32 ?? json.oneof_uint32; if (oneofUint32) { msg.oneofUint32 = oneofUint32; } const oneofNestedMessage = - json[\\"oneofNestedMessage\\"] ?? json.oneof_nested_message; + json.oneofNestedMessage ?? json.oneof_nested_message; if (oneofNestedMessage) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, oneofNestedMessage); msg.oneofNestedMessage = m; } - const oneofString = json[\\"oneofString\\"] ?? json.oneof_string; + const oneofString = json.oneofString ?? json.oneof_string; if (oneofString) { msg.oneofString = oneofString; } - const oneofBytes = json[\\"oneofBytes\\"] ?? json.oneof_bytes; + const oneofBytes = json.oneofBytes ?? json.oneof_bytes; if (oneofBytes) { msg.oneofBytes = oneofBytes; } @@ -60981,7 +62369,7 @@ export const TestAllTypes = { ): Record { const json: Record = {}; if (msg.bb) { - json[\\"bb\\"] = msg.bb; + json.bb = msg.bb; } return json; }, @@ -61016,7 +62404,7 @@ export const TestAllTypes = { msg: TestAllTypes.NestedMessage, json: any ): TestAllTypes.NestedMessage { - const bb = json[\\"bb\\"] ?? json.bb; + const bb = json.bb ?? json.bb; if (bb) { msg.bb = bb; } @@ -61098,7 +62486,7 @@ export const TestAllTypes = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -61133,7 +62521,7 @@ export const TestAllTypes = { msg: TestAllTypes.OptionalGroup, json: any ): TestAllTypes.OptionalGroup { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -61215,7 +62603,7 @@ export const TestAllTypes = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -61250,7 +62638,7 @@ export const TestAllTypes = { msg: TestAllTypes.RepeatedGroup, json: any ): TestAllTypes.RepeatedGroup { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -61347,17 +62735,17 @@ export const NestedTestAllTypes = { if (msg.child) { const child = NestedTestAllTypes._writeMessageJSON(msg.child); if (Object.keys(child).length > 0) { - json[\\"child\\"] = child; + json.child = child; } } if (msg.payload) { const payload = TestAllTypes._writeMessageJSON(msg.payload); if (Object.keys(payload).length > 0) { - json[\\"payload\\"] = payload; + json.payload = payload; } } if (msg.repeatedChild?.length) { - json[\\"repeatedChild\\"] = msg.repeatedChild.map( + json.repeatedChild = msg.repeatedChild.map( NestedTestAllTypes._writeMessageJSON ); } @@ -61404,19 +62792,19 @@ export const NestedTestAllTypes = { msg: NestedTestAllTypes, json: any ): NestedTestAllTypes { - const child = json[\\"child\\"] ?? json.child; + const child = json.child ?? json.child; if (child) { const m = NestedTestAllTypes.initialize(); NestedTestAllTypes._readMessageJSON(m, child); msg.child = m; } - const payload = json[\\"payload\\"] ?? json.payload; + const payload = json.payload ?? json.payload; if (payload) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, payload); msg.payload = m; } - const repeatedChild = json[\\"repeatedChild\\"] ?? json.repeated_child; + const repeatedChild = json.repeatedChild ?? json.repeated_child; if (repeatedChild) { for (const item of repeatedChild) { const m = NestedTestAllTypes.initialize(); @@ -61505,10 +62893,10 @@ export const TestDeprecatedFields = { ): Record { const json: Record = {}; if (msg.deprecatedInt32) { - json[\\"deprecatedInt32\\"] = msg.deprecatedInt32; + json.deprecatedInt32 = msg.deprecatedInt32; } if (msg.deprecatedInt32InOneof != undefined) { - json[\\"deprecatedInt32InOneof\\"] = msg.deprecatedInt32InOneof; + json.deprecatedInt32InOneof = msg.deprecatedInt32InOneof; } return json; }, @@ -61547,12 +62935,12 @@ export const TestDeprecatedFields = { msg: TestDeprecatedFields, json: any ): TestDeprecatedFields { - const deprecatedInt32 = json[\\"deprecatedInt32\\"] ?? json.deprecated_int32; + const deprecatedInt32 = json.deprecatedInt32 ?? json.deprecated_int32; if (deprecatedInt32) { msg.deprecatedInt32 = deprecatedInt32; } const deprecatedInt32InOneof = - json[\\"deprecatedInt32InOneof\\"] ?? json.deprecated_int32_in_oneof; + json.deprecatedInt32InOneof ?? json.deprecated_int32_in_oneof; if (deprecatedInt32InOneof) { msg.deprecatedInt32InOneof = deprecatedInt32InOneof; } @@ -61687,10 +63075,10 @@ export const ForeignMessage = { ): Record { const json: Record = {}; if (msg.c) { - json[\\"c\\"] = msg.c; + json.c = msg.c; } if (msg.d) { - json[\\"d\\"] = msg.d; + json.d = msg.d; } return json; }, @@ -61726,11 +63114,11 @@ export const ForeignMessage = { * @private */ _readMessageJSON: function (msg: ForeignMessage, json: any): ForeignMessage { - const c = json[\\"c\\"] ?? json.c; + const c = json.c ?? json.c; if (c) { msg.c = c; } - const d = json[\\"d\\"] ?? json.d; + const d = json.d ?? json.d; if (d) { msg.d = d; } @@ -61922,7 +63310,7 @@ export const OptionalGroup_extension = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -61957,7 +63345,7 @@ export const OptionalGroup_extension = { msg: OptionalGroup_extension, json: any ): OptionalGroup_extension { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -62039,7 +63427,7 @@ export const RepeatedGroup_extension = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -62074,7 +63462,7 @@ export const RepeatedGroup_extension = { msg: RepeatedGroup_extension, json: any ): RepeatedGroup_extension { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -62147,7 +63535,7 @@ export const TestGroup = { ): Record { const json: Record = {}; if (msg.optionalForeignEnum) { - json[\\"optionalForeignEnum\\"] = msg.optionalForeignEnum; + json.optionalForeignEnum = msg.optionalForeignEnum; } return json; }, @@ -62177,7 +63565,7 @@ export const TestGroup = { */ _readMessageJSON: function (msg: TestGroup, json: any): TestGroup { const optionalForeignEnum = - json[\\"optionalForeignEnum\\"] ?? json.optional_foreign_enum; + json.optionalForeignEnum ?? json.optional_foreign_enum; if (optionalForeignEnum) { msg.optionalForeignEnum = optionalForeignEnum; } @@ -62258,7 +63646,7 @@ export const TestGroup = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -62293,7 +63681,7 @@ export const TestGroup = { msg: TestGroup.OptionalGroup, json: any ): TestGroup.OptionalGroup { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -62491,7 +63879,7 @@ export const TestNestedExtension = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -62526,7 +63914,7 @@ export const TestNestedExtension = { msg: TestNestedExtension.OptionalGroup_extension, json: any ): TestNestedExtension.OptionalGroup_extension { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -62621,17 +64009,17 @@ export const TestChildExtension = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } if (msg.b) { - json[\\"b\\"] = msg.b; + json.b = msg.b; } if (msg.optionalExtension) { const optionalExtension = TestAllExtensions._writeMessageJSON( msg.optionalExtension ); if (Object.keys(optionalExtension).length > 0) { - json[\\"optionalExtension\\"] = optionalExtension; + json.optionalExtension = optionalExtension; } } return json; @@ -62678,16 +64066,15 @@ export const TestChildExtension = { msg: TestChildExtension, json: any ): TestChildExtension { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } - const b = json[\\"b\\"] ?? json.b; + const b = json.b ?? json.b; if (b) { msg.b = b; } - const optionalExtension = - json[\\"optionalExtension\\"] ?? json.optional_extension; + const optionalExtension = json.optionalExtension ?? json.optional_extension; if (optionalExtension) { const m = TestAllExtensions.initialize(); TestAllExtensions._readMessageJSON(m, optionalExtension); @@ -62893,103 +64280,103 @@ export const TestRequired = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } if (msg.dummy2) { - json[\\"dummy2\\"] = msg.dummy2; + json.dummy2 = msg.dummy2; } if (msg.b) { - json[\\"b\\"] = msg.b; + json.b = msg.b; } if (msg.dummy4) { - json[\\"dummy4\\"] = msg.dummy4; + json.dummy4 = msg.dummy4; } if (msg.dummy5) { - json[\\"dummy5\\"] = msg.dummy5; + json.dummy5 = msg.dummy5; } if (msg.dummy6) { - json[\\"dummy6\\"] = msg.dummy6; + json.dummy6 = msg.dummy6; } if (msg.dummy7) { - json[\\"dummy7\\"] = msg.dummy7; + json.dummy7 = msg.dummy7; } if (msg.dummy8) { - json[\\"dummy8\\"] = msg.dummy8; + json.dummy8 = msg.dummy8; } if (msg.dummy9) { - json[\\"dummy9\\"] = msg.dummy9; + json.dummy9 = msg.dummy9; } if (msg.dummy10) { - json[\\"dummy10\\"] = msg.dummy10; + json.dummy10 = msg.dummy10; } if (msg.dummy11) { - json[\\"dummy11\\"] = msg.dummy11; + json.dummy11 = msg.dummy11; } if (msg.dummy12) { - json[\\"dummy12\\"] = msg.dummy12; + json.dummy12 = msg.dummy12; } if (msg.dummy13) { - json[\\"dummy13\\"] = msg.dummy13; + json.dummy13 = msg.dummy13; } if (msg.dummy14) { - json[\\"dummy14\\"] = msg.dummy14; + json.dummy14 = msg.dummy14; } if (msg.dummy15) { - json[\\"dummy15\\"] = msg.dummy15; + json.dummy15 = msg.dummy15; } if (msg.dummy16) { - json[\\"dummy16\\"] = msg.dummy16; + json.dummy16 = msg.dummy16; } if (msg.dummy17) { - json[\\"dummy17\\"] = msg.dummy17; + json.dummy17 = msg.dummy17; } if (msg.dummy18) { - json[\\"dummy18\\"] = msg.dummy18; + json.dummy18 = msg.dummy18; } if (msg.dummy19) { - json[\\"dummy19\\"] = msg.dummy19; + json.dummy19 = msg.dummy19; } if (msg.dummy20) { - json[\\"dummy20\\"] = msg.dummy20; + json.dummy20 = msg.dummy20; } if (msg.dummy21) { - json[\\"dummy21\\"] = msg.dummy21; + json.dummy21 = msg.dummy21; } if (msg.dummy22) { - json[\\"dummy22\\"] = msg.dummy22; + json.dummy22 = msg.dummy22; } if (msg.dummy23) { - json[\\"dummy23\\"] = msg.dummy23; + json.dummy23 = msg.dummy23; } if (msg.dummy24) { - json[\\"dummy24\\"] = msg.dummy24; + json.dummy24 = msg.dummy24; } if (msg.dummy25) { - json[\\"dummy25\\"] = msg.dummy25; + json.dummy25 = msg.dummy25; } if (msg.dummy26) { - json[\\"dummy26\\"] = msg.dummy26; + json.dummy26 = msg.dummy26; } if (msg.dummy27) { - json[\\"dummy27\\"] = msg.dummy27; + json.dummy27 = msg.dummy27; } if (msg.dummy28) { - json[\\"dummy28\\"] = msg.dummy28; + json.dummy28 = msg.dummy28; } if (msg.dummy29) { - json[\\"dummy29\\"] = msg.dummy29; + json.dummy29 = msg.dummy29; } if (msg.dummy30) { - json[\\"dummy30\\"] = msg.dummy30; + json.dummy30 = msg.dummy30; } if (msg.dummy31) { - json[\\"dummy31\\"] = msg.dummy31; + json.dummy31 = msg.dummy31; } if (msg.dummy32) { - json[\\"dummy32\\"] = msg.dummy32; + json.dummy32 = msg.dummy32; } if (msg.c) { - json[\\"c\\"] = msg.c; + json.c = msg.c; } return json; }, @@ -63149,135 +64536,135 @@ export const TestRequired = { * @private */ _readMessageJSON: function (msg: TestRequired, json: any): TestRequired { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } - const dummy2 = json[\\"dummy2\\"] ?? json.dummy2; + const dummy2 = json.dummy2 ?? json.dummy2; if (dummy2) { msg.dummy2 = dummy2; } - const b = json[\\"b\\"] ?? json.b; + const b = json.b ?? json.b; if (b) { msg.b = b; } - const dummy4 = json[\\"dummy4\\"] ?? json.dummy4; + const dummy4 = json.dummy4 ?? json.dummy4; if (dummy4) { msg.dummy4 = dummy4; } - const dummy5 = json[\\"dummy5\\"] ?? json.dummy5; + const dummy5 = json.dummy5 ?? json.dummy5; if (dummy5) { msg.dummy5 = dummy5; } - const dummy6 = json[\\"dummy6\\"] ?? json.dummy6; + const dummy6 = json.dummy6 ?? json.dummy6; if (dummy6) { msg.dummy6 = dummy6; } - const dummy7 = json[\\"dummy7\\"] ?? json.dummy7; + const dummy7 = json.dummy7 ?? json.dummy7; if (dummy7) { msg.dummy7 = dummy7; } - const dummy8 = json[\\"dummy8\\"] ?? json.dummy8; + const dummy8 = json.dummy8 ?? json.dummy8; if (dummy8) { msg.dummy8 = dummy8; } - const dummy9 = json[\\"dummy9\\"] ?? json.dummy9; + const dummy9 = json.dummy9 ?? json.dummy9; if (dummy9) { msg.dummy9 = dummy9; } - const dummy10 = json[\\"dummy10\\"] ?? json.dummy10; + const dummy10 = json.dummy10 ?? json.dummy10; if (dummy10) { msg.dummy10 = dummy10; } - const dummy11 = json[\\"dummy11\\"] ?? json.dummy11; + const dummy11 = json.dummy11 ?? json.dummy11; if (dummy11) { msg.dummy11 = dummy11; } - const dummy12 = json[\\"dummy12\\"] ?? json.dummy12; + const dummy12 = json.dummy12 ?? json.dummy12; if (dummy12) { msg.dummy12 = dummy12; } - const dummy13 = json[\\"dummy13\\"] ?? json.dummy13; + const dummy13 = json.dummy13 ?? json.dummy13; if (dummy13) { msg.dummy13 = dummy13; } - const dummy14 = json[\\"dummy14\\"] ?? json.dummy14; + const dummy14 = json.dummy14 ?? json.dummy14; if (dummy14) { msg.dummy14 = dummy14; } - const dummy15 = json[\\"dummy15\\"] ?? json.dummy15; + const dummy15 = json.dummy15 ?? json.dummy15; if (dummy15) { msg.dummy15 = dummy15; } - const dummy16 = json[\\"dummy16\\"] ?? json.dummy16; + const dummy16 = json.dummy16 ?? json.dummy16; if (dummy16) { msg.dummy16 = dummy16; } - const dummy17 = json[\\"dummy17\\"] ?? json.dummy17; + const dummy17 = json.dummy17 ?? json.dummy17; if (dummy17) { msg.dummy17 = dummy17; } - const dummy18 = json[\\"dummy18\\"] ?? json.dummy18; + const dummy18 = json.dummy18 ?? json.dummy18; if (dummy18) { msg.dummy18 = dummy18; } - const dummy19 = json[\\"dummy19\\"] ?? json.dummy19; + const dummy19 = json.dummy19 ?? json.dummy19; if (dummy19) { msg.dummy19 = dummy19; } - const dummy20 = json[\\"dummy20\\"] ?? json.dummy20; + const dummy20 = json.dummy20 ?? json.dummy20; if (dummy20) { msg.dummy20 = dummy20; } - const dummy21 = json[\\"dummy21\\"] ?? json.dummy21; + const dummy21 = json.dummy21 ?? json.dummy21; if (dummy21) { msg.dummy21 = dummy21; } - const dummy22 = json[\\"dummy22\\"] ?? json.dummy22; + const dummy22 = json.dummy22 ?? json.dummy22; if (dummy22) { msg.dummy22 = dummy22; } - const dummy23 = json[\\"dummy23\\"] ?? json.dummy23; + const dummy23 = json.dummy23 ?? json.dummy23; if (dummy23) { msg.dummy23 = dummy23; } - const dummy24 = json[\\"dummy24\\"] ?? json.dummy24; + const dummy24 = json.dummy24 ?? json.dummy24; if (dummy24) { msg.dummy24 = dummy24; } - const dummy25 = json[\\"dummy25\\"] ?? json.dummy25; + const dummy25 = json.dummy25 ?? json.dummy25; if (dummy25) { msg.dummy25 = dummy25; } - const dummy26 = json[\\"dummy26\\"] ?? json.dummy26; + const dummy26 = json.dummy26 ?? json.dummy26; if (dummy26) { msg.dummy26 = dummy26; } - const dummy27 = json[\\"dummy27\\"] ?? json.dummy27; + const dummy27 = json.dummy27 ?? json.dummy27; if (dummy27) { msg.dummy27 = dummy27; } - const dummy28 = json[\\"dummy28\\"] ?? json.dummy28; + const dummy28 = json.dummy28 ?? json.dummy28; if (dummy28) { msg.dummy28 = dummy28; } - const dummy29 = json[\\"dummy29\\"] ?? json.dummy29; + const dummy29 = json.dummy29 ?? json.dummy29; if (dummy29) { msg.dummy29 = dummy29; } - const dummy30 = json[\\"dummy30\\"] ?? json.dummy30; + const dummy30 = json.dummy30 ?? json.dummy30; if (dummy30) { msg.dummy30 = dummy30; } - const dummy31 = json[\\"dummy31\\"] ?? json.dummy31; + const dummy31 = json.dummy31 ?? json.dummy31; if (dummy31) { msg.dummy31 = dummy31; } - const dummy32 = json[\\"dummy32\\"] ?? json.dummy32; + const dummy32 = json.dummy32 ?? json.dummy32; if (dummy32) { msg.dummy32 = dummy32; } - const c = json[\\"c\\"] ?? json.c; + const c = json.c ?? json.c; if (c) { msg.c = c; } @@ -63375,16 +64762,16 @@ export const TestRequiredForeign = { msg.optionalMessage ); if (Object.keys(optionalMessage).length > 0) { - json[\\"optionalMessage\\"] = optionalMessage; + json.optionalMessage = optionalMessage; } } if (msg.repeatedMessage?.length) { - json[\\"repeatedMessage\\"] = msg.repeatedMessage.map( + json.repeatedMessage = msg.repeatedMessage.map( TestRequired._writeMessageJSON ); } if (msg.dummy) { - json[\\"dummy\\"] = msg.dummy; + json.dummy = msg.dummy; } return json; }, @@ -63429,13 +64816,13 @@ export const TestRequiredForeign = { msg: TestRequiredForeign, json: any ): TestRequiredForeign { - const optionalMessage = json[\\"optionalMessage\\"] ?? json.optional_message; + const optionalMessage = json.optionalMessage ?? json.optional_message; if (optionalMessage) { const m = TestRequired.initialize(); TestRequired._readMessageJSON(m, optionalMessage); msg.optionalMessage = m; } - const repeatedMessage = json[\\"repeatedMessage\\"] ?? json.repeated_message; + const repeatedMessage = json.repeatedMessage ?? json.repeated_message; if (repeatedMessage) { for (const item of repeatedMessage) { const m = TestRequired.initialize(); @@ -63443,7 +64830,7 @@ export const TestRequiredForeign = { msg.repeatedMessage.push(m); } } - const dummy = json[\\"dummy\\"] ?? json.dummy; + const dummy = json.dummy ?? json.dummy; if (dummy) { msg.dummy = dummy; } @@ -63541,11 +64928,11 @@ export const TestRequiredMessage = { msg.optionalMessage ); if (Object.keys(optionalMessage).length > 0) { - json[\\"optionalMessage\\"] = optionalMessage; + json.optionalMessage = optionalMessage; } } if (msg.repeatedMessage?.length) { - json[\\"repeatedMessage\\"] = msg.repeatedMessage.map( + json.repeatedMessage = msg.repeatedMessage.map( TestRequired._writeMessageJSON ); } @@ -63554,7 +64941,7 @@ export const TestRequiredMessage = { msg.requiredMessage ); if (Object.keys(requiredMessage).length > 0) { - json[\\"requiredMessage\\"] = requiredMessage; + json.requiredMessage = requiredMessage; } } return json; @@ -63600,13 +64987,13 @@ export const TestRequiredMessage = { msg: TestRequiredMessage, json: any ): TestRequiredMessage { - const optionalMessage = json[\\"optionalMessage\\"] ?? json.optional_message; + const optionalMessage = json.optionalMessage ?? json.optional_message; if (optionalMessage) { const m = TestRequired.initialize(); TestRequired._readMessageJSON(m, optionalMessage); msg.optionalMessage = m; } - const repeatedMessage = json[\\"repeatedMessage\\"] ?? json.repeated_message; + const repeatedMessage = json.repeatedMessage ?? json.repeated_message; if (repeatedMessage) { for (const item of repeatedMessage) { const m = TestRequired.initialize(); @@ -63614,7 +65001,7 @@ export const TestRequiredMessage = { msg.repeatedMessage.push(m); } } - const requiredMessage = json[\\"requiredMessage\\"] ?? json.required_message; + const requiredMessage = json.requiredMessage ?? json.required_message; if (requiredMessage) { const m = TestRequired.initialize(); TestRequired._readMessageJSON(m, requiredMessage); @@ -63702,7 +65089,7 @@ export const TestForeignNested = { msg.foreignNested ); if (Object.keys(foreignNested).length > 0) { - json[\\"foreignNested\\"] = foreignNested; + json.foreignNested = foreignNested; } } return json; @@ -63741,7 +65128,7 @@ export const TestForeignNested = { msg: TestForeignNested, json: any ): TestForeignNested { - const foreignNested = json[\\"foreignNested\\"] ?? json.foreign_nested; + const foreignNested = json.foreignNested ?? json.foreign_nested; if (foreignNested) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, foreignNested); @@ -63987,7 +65374,7 @@ export const TestPickleNestedMessage = { ): Record { const json: Record = {}; if (msg.bb) { - json[\\"bb\\"] = msg.bb; + json.bb = msg.bb; } return json; }, @@ -64022,7 +65409,7 @@ export const TestPickleNestedMessage = { msg: TestPickleNestedMessage.NestedMessage, json: any ): TestPickleNestedMessage.NestedMessage { - const bb = json[\\"bb\\"] ?? json.bb; + const bb = json.bb ?? json.bb; if (bb) { msg.bb = bb; } @@ -64110,7 +65497,7 @@ export const TestPickleNestedMessage = { ): Record { const json: Record = {}; if (msg.cc) { - json[\\"cc\\"] = msg.cc; + json.cc = msg.cc; } return json; }, @@ -64145,7 +65532,7 @@ export const TestPickleNestedMessage = { msg: TestPickleNestedMessage.NestedMessage.NestedNestedMessage, json: any ): TestPickleNestedMessage.NestedMessage.NestedNestedMessage { - const cc = json[\\"cc\\"] ?? json.cc; + const cc = json.cc ?? json.cc; if (cc) { msg.cc = cc; } @@ -64288,10 +65675,10 @@ export const TestReallyLargeTagNumber = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } if (msg.bb) { - json[\\"bb\\"] = msg.bb; + json.bb = msg.bb; } return json; }, @@ -64330,11 +65717,11 @@ export const TestReallyLargeTagNumber = { msg: TestReallyLargeTagNumber, json: any ): TestReallyLargeTagNumber { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } - const bb = json[\\"bb\\"] ?? json.bb; + const bb = json.bb ?? json.bb; if (bb) { msg.bb = bb; } @@ -64422,11 +65809,11 @@ export const TestRecursiveMessage = { if (msg.a) { const a = TestRecursiveMessage._writeMessageJSON(msg.a); if (Object.keys(a).length > 0) { - json[\\"a\\"] = a; + json.a = a; } } if (msg.i) { - json[\\"i\\"] = msg.i; + json.i = msg.i; } return json; }, @@ -64465,13 +65852,13 @@ export const TestRecursiveMessage = { msg: TestRecursiveMessage, json: any ): TestRecursiveMessage { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { const m = TestRecursiveMessage.initialize(); TestRecursiveMessage._readMessageJSON(m, a); msg.a = m; } - const i = json[\\"i\\"] ?? json.i; + const i = json.i ?? json.i; if (i) { msg.i = i; } @@ -64555,7 +65942,7 @@ export const TestMutualRecursionA = { if (msg.bb) { const bb = TestMutualRecursionB._writeMessageJSON(msg.bb); if (Object.keys(bb).length > 0) { - json[\\"bb\\"] = bb; + json.bb = bb; } } return json; @@ -64591,7 +65978,7 @@ export const TestMutualRecursionA = { msg: TestMutualRecursionA, json: any ): TestMutualRecursionA { - const bb = json[\\"bb\\"] ?? json.bb; + const bb = json.bb ?? json.bb; if (bb) { const m = TestMutualRecursionB.initialize(); TestMutualRecursionB._readMessageJSON(m, bb); @@ -64676,7 +66063,7 @@ export const TestMutualRecursionA = { if (msg.b) { const b = TestMutualRecursionB._writeMessageJSON(msg.b); if (Object.keys(b).length > 0) { - json[\\"b\\"] = b; + json.b = b; } } return json; @@ -64712,7 +66099,7 @@ export const TestMutualRecursionA = { msg: TestMutualRecursionA.SubMessage, json: any ): TestMutualRecursionA.SubMessage { - const b = json[\\"b\\"] ?? json.b; + const b = json.b ?? json.b; if (b) { const m = TestMutualRecursionB.initialize(); TestMutualRecursionB._readMessageJSON(m, b); @@ -64808,13 +66195,13 @@ export const TestMutualRecursionA = { msg.subMessage ); if (Object.keys(subMessage).length > 0) { - json[\\"subMessage\\"] = subMessage; + json.subMessage = subMessage; } } if (msg.notInThisScc) { const notInThisScc = TestAllTypes._writeMessageJSON(msg.notInThisScc); if (Object.keys(notInThisScc).length > 0) { - json[\\"notInThisScc\\"] = notInThisScc; + json.notInThisScc = notInThisScc; } } return json; @@ -64857,13 +66244,13 @@ export const TestMutualRecursionA = { msg: TestMutualRecursionA.SubGroup, json: any ): TestMutualRecursionA.SubGroup { - const subMessage = json[\\"subMessage\\"] ?? json.sub_message; + const subMessage = json.subMessage ?? json.sub_message; if (subMessage) { const m = TestMutualRecursionA.SubMessage.initialize(); TestMutualRecursionA.SubMessage._readMessageJSON(m, subMessage); msg.subMessage = m; } - const notInThisScc = json[\\"notInThisScc\\"] ?? json.not_in_this_scc; + const notInThisScc = json.notInThisScc ?? json.not_in_this_scc; if (notInThisScc) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, notInThisScc); @@ -64954,11 +66341,11 @@ export const TestMutualRecursionB = { if (msg.a) { const a = TestMutualRecursionA._writeMessageJSON(msg.a); if (Object.keys(a).length > 0) { - json[\\"a\\"] = a; + json.a = a; } } if (msg.optionalInt32) { - json[\\"optionalInt32\\"] = msg.optionalInt32; + json.optionalInt32 = msg.optionalInt32; } return json; }, @@ -64997,13 +66384,13 @@ export const TestMutualRecursionB = { msg: TestMutualRecursionB, json: any ): TestMutualRecursionB { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { const m = TestMutualRecursionA.initialize(); TestMutualRecursionA._readMessageJSON(m, a); msg.a = m; } - const optionalInt32 = json[\\"optionalInt32\\"] ?? json.optional_int32; + const optionalInt32 = json.optionalInt32 ?? json.optional_int32; if (optionalInt32) { msg.optionalInt32 = optionalInt32; } @@ -65089,7 +66476,7 @@ export const TestIsInitialized = { msg.subMessage ); if (Object.keys(subMessage).length > 0) { - json[\\"subMessage\\"] = subMessage; + json.subMessage = subMessage; } } return json; @@ -65128,7 +66515,7 @@ export const TestIsInitialized = { msg: TestIsInitialized, json: any ): TestIsInitialized { - const subMessage = json[\\"subMessage\\"] ?? json.sub_message; + const subMessage = json.subMessage ?? json.sub_message; if (subMessage) { const m = TestIsInitialized.SubMessage.initialize(); TestIsInitialized.SubMessage._readMessageJSON(m, subMessage); @@ -65269,7 +66656,7 @@ export const TestIsInitialized = { ): Record { const json: Record = {}; if (msg.i) { - json[\\"i\\"] = msg.i; + json.i = msg.i; } return json; }, @@ -65304,7 +66691,7 @@ export const TestIsInitialized = { msg: TestIsInitialized.SubMessage.SubGroup, json: any ): TestIsInitialized.SubMessage.SubGroup { - const i = json[\\"i\\"] ?? json.i; + const i = json.i ?? json.i; if (i) { msg.i = i; } @@ -65388,7 +66775,7 @@ export const TestDupFieldNumber = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -65423,7 +66810,7 @@ export const TestDupFieldNumber = { msg: TestDupFieldNumber, json: any ): TestDupFieldNumber { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -65498,7 +66885,7 @@ export const TestDupFieldNumber = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -65533,7 +66920,7 @@ export const TestDupFieldNumber = { msg: TestDupFieldNumber.Foo, json: any ): TestDupFieldNumber.Foo { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -65609,7 +66996,7 @@ export const TestDupFieldNumber = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -65644,7 +67031,7 @@ export const TestDupFieldNumber = { msg: TestDupFieldNumber.Bar, json: any ): TestDupFieldNumber.Bar { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -65723,7 +67110,7 @@ export const TestEagerMessage = { if (msg.subMessage) { const subMessage = TestAllTypes._writeMessageJSON(msg.subMessage); if (Object.keys(subMessage).length > 0) { - json[\\"subMessage\\"] = subMessage; + json.subMessage = subMessage; } } return json; @@ -65759,7 +67146,7 @@ export const TestEagerMessage = { msg: TestEagerMessage, json: any ): TestEagerMessage { - const subMessage = json[\\"subMessage\\"] ?? json.sub_message; + const subMessage = json.subMessage ?? json.sub_message; if (subMessage) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, subMessage); @@ -65839,7 +67226,7 @@ export const TestLazyMessage = { if (msg.subMessage) { const subMessage = TestAllTypes._writeMessageJSON(msg.subMessage); if (Object.keys(subMessage).length > 0) { - json[\\"subMessage\\"] = subMessage; + json.subMessage = subMessage; } } return json; @@ -65875,7 +67262,7 @@ export const TestLazyMessage = { msg: TestLazyMessage, json: any ): TestLazyMessage { - const subMessage = json[\\"subMessage\\"] ?? json.sub_message; + const subMessage = json.subMessage ?? json.sub_message; if (subMessage) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, subMessage); @@ -65969,7 +67356,7 @@ export const TestNestedMessageHasBits = { msg.optionalNestedMessage ); if (Object.keys(optionalNestedMessage).length > 0) { - json[\\"optionalNestedMessage\\"] = optionalNestedMessage; + json.optionalNestedMessage = optionalNestedMessage; } } return json; @@ -66009,7 +67396,7 @@ export const TestNestedMessageHasBits = { json: any ): TestNestedMessageHasBits { const optionalNestedMessage = - json[\\"optionalNestedMessage\\"] ?? json.optional_nested_message; + json.optionalNestedMessage ?? json.optional_nested_message; if (optionalNestedMessage) { const m = TestNestedMessageHasBits.NestedMessage.initialize(); TestNestedMessageHasBits.NestedMessage._readMessageJSON( @@ -66107,10 +67494,10 @@ export const TestNestedMessageHasBits = { ): Record { const json: Record = {}; if (msg.nestedmessageRepeatedInt32?.length) { - json[\\"nestedmessageRepeatedInt32\\"] = msg.nestedmessageRepeatedInt32; + json.nestedmessageRepeatedInt32 = msg.nestedmessageRepeatedInt32; } if (msg.nestedmessageRepeatedForeignmessage?.length) { - json[\\"nestedmessageRepeatedForeignmessage\\"] = + json.nestedmessageRepeatedForeignmessage = msg.nestedmessageRepeatedForeignmessage.map( ForeignMessage._writeMessageJSON ); @@ -66155,12 +67542,12 @@ export const TestNestedMessageHasBits = { json: any ): TestNestedMessageHasBits.NestedMessage { const nestedmessageRepeatedInt32 = - json[\\"nestedmessageRepeatedInt32\\"] ?? json.nestedmessage_repeated_int32; + json.nestedmessageRepeatedInt32 ?? json.nestedmessage_repeated_int32; if (nestedmessageRepeatedInt32) { msg.nestedmessageRepeatedInt32 = nestedmessageRepeatedInt32; } const nestedmessageRepeatedForeignmessage = - json[\\"nestedmessageRepeatedForeignmessage\\"] ?? + json.nestedmessageRepeatedForeignmessage ?? json.nestedmessage_repeated_foreignmessage; if (nestedmessageRepeatedForeignmessage) { for (const item of nestedmessageRepeatedForeignmessage) { @@ -66296,45 +67683,45 @@ export const TestCamelCaseFieldNames = { ): Record { const json: Record = {}; if (msg.PrimitiveField) { - json[\\"PrimitiveField\\"] = msg.PrimitiveField; + json.PrimitiveField = msg.PrimitiveField; } if (msg.StringField) { - json[\\"StringField\\"] = msg.StringField; + json.StringField = msg.StringField; } if (msg.EnumField) { - json[\\"EnumField\\"] = msg.EnumField; + json.EnumField = msg.EnumField; } if (msg.MessageField) { const MessageField = ForeignMessage._writeMessageJSON(msg.MessageField); if (Object.keys(MessageField).length > 0) { - json[\\"MessageField\\"] = MessageField; + json.MessageField = MessageField; } } if (msg.StringPieceField) { - json[\\"StringPieceField\\"] = msg.StringPieceField; + json.StringPieceField = msg.StringPieceField; } if (msg.CordField) { - json[\\"CordField\\"] = msg.CordField; + json.CordField = msg.CordField; } if (msg.RepeatedPrimitiveField?.length) { - json[\\"RepeatedPrimitiveField\\"] = msg.RepeatedPrimitiveField; + json.RepeatedPrimitiveField = msg.RepeatedPrimitiveField; } if (msg.RepeatedStringField?.length) { - json[\\"RepeatedStringField\\"] = msg.RepeatedStringField; + json.RepeatedStringField = msg.RepeatedStringField; } if (msg.RepeatedEnumField?.length) { - json[\\"RepeatedEnumField\\"] = msg.RepeatedEnumField; + json.RepeatedEnumField = msg.RepeatedEnumField; } if (msg.RepeatedMessageField?.length) { - json[\\"RepeatedMessageField\\"] = msg.RepeatedMessageField.map( + json.RepeatedMessageField = msg.RepeatedMessageField.map( ForeignMessage._writeMessageJSON ); } if (msg.RepeatedStringPieceField?.length) { - json[\\"RepeatedStringPieceField\\"] = msg.RepeatedStringPieceField; + json.RepeatedStringPieceField = msg.RepeatedStringPieceField; } if (msg.RepeatedCordField?.length) { - json[\\"RepeatedCordField\\"] = msg.RepeatedCordField; + json.RepeatedCordField = msg.RepeatedCordField; } return json; }, @@ -66415,49 +67802,48 @@ export const TestCamelCaseFieldNames = { msg: TestCamelCaseFieldNames, json: any ): TestCamelCaseFieldNames { - const PrimitiveField = json[\\"PrimitiveField\\"] ?? json.PrimitiveField; + const PrimitiveField = json.PrimitiveField ?? json.PrimitiveField; if (PrimitiveField) { msg.PrimitiveField = PrimitiveField; } - const StringField = json[\\"StringField\\"] ?? json.StringField; + const StringField = json.StringField ?? json.StringField; if (StringField) { msg.StringField = StringField; } - const EnumField = json[\\"EnumField\\"] ?? json.EnumField; + const EnumField = json.EnumField ?? json.EnumField; if (EnumField) { msg.EnumField = EnumField; } - const MessageField = json[\\"MessageField\\"] ?? json.MessageField; + const MessageField = json.MessageField ?? json.MessageField; if (MessageField) { const m = ForeignMessage.initialize(); ForeignMessage._readMessageJSON(m, MessageField); msg.MessageField = m; } - const StringPieceField = json[\\"StringPieceField\\"] ?? json.StringPieceField; + const StringPieceField = json.StringPieceField ?? json.StringPieceField; if (StringPieceField) { msg.StringPieceField = StringPieceField; } - const CordField = json[\\"CordField\\"] ?? json.CordField; + const CordField = json.CordField ?? json.CordField; if (CordField) { msg.CordField = CordField; } const RepeatedPrimitiveField = - json[\\"RepeatedPrimitiveField\\"] ?? json.RepeatedPrimitiveField; + json.RepeatedPrimitiveField ?? json.RepeatedPrimitiveField; if (RepeatedPrimitiveField) { msg.RepeatedPrimitiveField = RepeatedPrimitiveField; } const RepeatedStringField = - json[\\"RepeatedStringField\\"] ?? json.RepeatedStringField; + json.RepeatedStringField ?? json.RepeatedStringField; if (RepeatedStringField) { msg.RepeatedStringField = RepeatedStringField; } - const RepeatedEnumField = - json[\\"RepeatedEnumField\\"] ?? json.RepeatedEnumField; + const RepeatedEnumField = json.RepeatedEnumField ?? json.RepeatedEnumField; if (RepeatedEnumField) { msg.RepeatedEnumField = RepeatedEnumField; } const RepeatedMessageField = - json[\\"RepeatedMessageField\\"] ?? json.RepeatedMessageField; + json.RepeatedMessageField ?? json.RepeatedMessageField; if (RepeatedMessageField) { for (const item of RepeatedMessageField) { const m = ForeignMessage.initialize(); @@ -66466,12 +67852,11 @@ export const TestCamelCaseFieldNames = { } } const RepeatedStringPieceField = - json[\\"RepeatedStringPieceField\\"] ?? json.RepeatedStringPieceField; + json.RepeatedStringPieceField ?? json.RepeatedStringPieceField; if (RepeatedStringPieceField) { msg.RepeatedStringPieceField = RepeatedStringPieceField; } - const RepeatedCordField = - json[\\"RepeatedCordField\\"] ?? json.RepeatedCordField; + const RepeatedCordField = json.RepeatedCordField ?? json.RepeatedCordField; if (RepeatedCordField) { msg.RepeatedCordField = RepeatedCordField; } @@ -66529,7 +67914,7 @@ export const TestFieldOrderings = { initialize: function (): TestFieldOrderings { return { myString: \\"\\", - myInt: \\"\\", + myInt: 0n, myFloat: 0, optionalNestedMessage: TestFieldOrderings.NestedMessage.initialize(), }; @@ -66546,7 +67931,7 @@ export const TestFieldOrderings = { writer.writeString(11, msg.myString); } if (msg.myInt) { - writer.writeInt64String(1, msg.myInt); + writer.writeInt64String(1, msg.myInt.toString()); } if (msg.myFloat) { writer.writeFloat(101, msg.myFloat); @@ -66569,13 +67954,13 @@ export const TestFieldOrderings = { ): Record { const json: Record = {}; if (msg.myString) { - json[\\"myString\\"] = msg.myString; + json.myString = msg.myString; } if (msg.myInt) { - json[\\"myInt\\"] = msg.myInt; + json.myInt = msg.myInt.toString(); } if (msg.myFloat) { - json[\\"myFloat\\"] = msg.myFloat; + json.myFloat = msg.myFloat; } if (msg.optionalNestedMessage) { const optionalNestedMessage = @@ -66583,7 +67968,7 @@ export const TestFieldOrderings = { msg.optionalNestedMessage ); if (Object.keys(optionalNestedMessage).length > 0) { - json[\\"optionalNestedMessage\\"] = optionalNestedMessage; + json.optionalNestedMessage = optionalNestedMessage; } } return json; @@ -66604,7 +67989,7 @@ export const TestFieldOrderings = { break; } case 1: { - msg.myInt = reader.readInt64String(); + msg.myInt = BigInt(reader.readInt64String()); break; } case 101: { @@ -66634,20 +68019,20 @@ export const TestFieldOrderings = { msg: TestFieldOrderings, json: any ): TestFieldOrderings { - const myString = json[\\"myString\\"] ?? json.my_string; + const myString = json.myString ?? json.my_string; if (myString) { msg.myString = myString; } - const myInt = json[\\"myInt\\"] ?? json.my_int; + const myInt = json.myInt ?? json.my_int; if (myInt) { - msg.myInt = myInt; + msg.myInt = BigInt(myInt); } - const myFloat = json[\\"myFloat\\"] ?? json.my_float; + const myFloat = json.myFloat ?? json.my_float; if (myFloat) { msg.myFloat = myFloat; } const optionalNestedMessage = - json[\\"optionalNestedMessage\\"] ?? json.optional_nested_message; + json.optionalNestedMessage ?? json.optional_nested_message; if (optionalNestedMessage) { const m = TestFieldOrderings.NestedMessage.initialize(); TestFieldOrderings.NestedMessage._readMessageJSON( @@ -66708,7 +68093,7 @@ export const TestFieldOrderings = { */ initialize: function (): TestFieldOrderings.NestedMessage { return { - oo: \\"\\", + oo: 0n, bb: 0, }; }, @@ -66721,7 +68106,7 @@ export const TestFieldOrderings = { writer: BinaryWriter ): BinaryWriter { if (msg.oo) { - writer.writeInt64String(2, msg.oo); + writer.writeInt64String(2, msg.oo.toString()); } if (msg.bb) { writer.writeInt32(1, msg.bb); @@ -66737,10 +68122,10 @@ export const TestFieldOrderings = { ): Record { const json: Record = {}; if (msg.oo) { - json[\\"oo\\"] = msg.oo; + json.oo = msg.oo.toString(); } if (msg.bb) { - json[\\"bb\\"] = msg.bb; + json.bb = msg.bb; } return json; }, @@ -66756,7 +68141,7 @@ export const TestFieldOrderings = { const field = reader.getFieldNumber(); switch (field) { case 2: { - msg.oo = reader.readInt64String(); + msg.oo = BigInt(reader.readInt64String()); break; } case 1: { @@ -66779,11 +68164,11 @@ export const TestFieldOrderings = { msg: TestFieldOrderings.NestedMessage, json: any ): TestFieldOrderings.NestedMessage { - const oo = json[\\"oo\\"] ?? json.oo; + const oo = json.oo ?? json.oo; if (oo) { - msg.oo = oo; + msg.oo = BigInt(oo); } - const bb = json[\\"bb\\"] ?? json.bb; + const bb = json.bb ?? json.bb; if (bb) { msg.bb = bb; } @@ -66866,7 +68251,7 @@ export const TestExtensionOrderings1 = { ): Record { const json: Record = {}; if (msg.myString) { - json[\\"myString\\"] = msg.myString; + json.myString = msg.myString; } return json; }, @@ -66901,7 +68286,7 @@ export const TestExtensionOrderings1 = { msg: TestExtensionOrderings1, json: any ): TestExtensionOrderings1 { - const myString = json[\\"myString\\"] ?? json.my_string; + const myString = json.myString ?? json.my_string; if (myString) { msg.myString = myString; } @@ -66983,7 +68368,7 @@ export const TestExtensionOrderings2 = { ): Record { const json: Record = {}; if (msg.myString) { - json[\\"myString\\"] = msg.myString; + json.myString = msg.myString; } return json; }, @@ -67018,7 +68403,7 @@ export const TestExtensionOrderings2 = { msg: TestExtensionOrderings2, json: any ): TestExtensionOrderings2 { - const myString = json[\\"myString\\"] ?? json.my_string; + const myString = json.myString ?? json.my_string; if (myString) { msg.myString = myString; } @@ -67105,7 +68490,7 @@ export const TestExtensionOrderings2 = { ): Record { const json: Record = {}; if (msg.myString) { - json[\\"myString\\"] = msg.myString; + json.myString = msg.myString; } return json; }, @@ -67140,7 +68525,7 @@ export const TestExtensionOrderings2 = { msg: TestExtensionOrderings2.TestExtensionOrderings3, json: any ): TestExtensionOrderings2.TestExtensionOrderings3 { - const myString = json[\\"myString\\"] ?? json.my_string; + const myString = json.myString ?? json.my_string; if (myString) { msg.myString = myString; } @@ -67200,11 +68585,11 @@ export const TestExtremeDefaultValues = { return { escapedBytes: new Uint8Array(), largeUint32: 0, - largeUint64: \\"\\", + largeUint64: 0n, smallInt32: 0, - smallInt64: \\"\\", + smallInt64: 0n, reallySmallInt32: 0, - reallySmallInt64: \\"\\", + reallySmallInt64: 0n, utf8String: \\"\\", zeroFloat: 0, oneFloat: 0, @@ -67242,19 +68627,19 @@ export const TestExtremeDefaultValues = { writer.writeUint32(2, msg.largeUint32); } if (msg.largeUint64) { - writer.writeUint64String(3, msg.largeUint64); + writer.writeUint64String(3, msg.largeUint64.toString()); } if (msg.smallInt32) { writer.writeInt32(4, msg.smallInt32); } if (msg.smallInt64) { - writer.writeInt64String(5, msg.smallInt64); + writer.writeInt64String(5, msg.smallInt64.toString()); } if (msg.reallySmallInt32) { writer.writeInt32(21, msg.reallySmallInt32); } if (msg.reallySmallInt64) { - writer.writeInt64String(22, msg.reallySmallInt64); + writer.writeInt64String(22, msg.reallySmallInt64.toString()); } if (msg.utf8String) { writer.writeString(6, msg.utf8String); @@ -67327,85 +68712,85 @@ export const TestExtremeDefaultValues = { ): Record { const json: Record = {}; if (msg.escapedBytes) { - json[\\"escapedBytes\\"] = msg.escapedBytes; + json.escapedBytes = msg.escapedBytes; } if (msg.largeUint32) { - json[\\"largeUint32\\"] = msg.largeUint32; + json.largeUint32 = msg.largeUint32; } if (msg.largeUint64) { - json[\\"largeUint64\\"] = msg.largeUint64; + json.largeUint64 = msg.largeUint64.toString(); } if (msg.smallInt32) { - json[\\"smallInt32\\"] = msg.smallInt32; + json.smallInt32 = msg.smallInt32; } if (msg.smallInt64) { - json[\\"smallInt64\\"] = msg.smallInt64; + json.smallInt64 = msg.smallInt64.toString(); } if (msg.reallySmallInt32) { - json[\\"reallySmallInt32\\"] = msg.reallySmallInt32; + json.reallySmallInt32 = msg.reallySmallInt32; } if (msg.reallySmallInt64) { - json[\\"reallySmallInt64\\"] = msg.reallySmallInt64; + json.reallySmallInt64 = msg.reallySmallInt64.toString(); } if (msg.utf8String) { - json[\\"utf8String\\"] = msg.utf8String; + json.utf8String = msg.utf8String; } if (msg.zeroFloat) { - json[\\"zeroFloat\\"] = msg.zeroFloat; + json.zeroFloat = msg.zeroFloat; } if (msg.oneFloat) { - json[\\"oneFloat\\"] = msg.oneFloat; + json.oneFloat = msg.oneFloat; } if (msg.smallFloat) { - json[\\"smallFloat\\"] = msg.smallFloat; + json.smallFloat = msg.smallFloat; } if (msg.negativeOneFloat) { - json[\\"negativeOneFloat\\"] = msg.negativeOneFloat; + json.negativeOneFloat = msg.negativeOneFloat; } if (msg.negativeFloat) { - json[\\"negativeFloat\\"] = msg.negativeFloat; + json.negativeFloat = msg.negativeFloat; } if (msg.largeFloat) { - json[\\"largeFloat\\"] = msg.largeFloat; + json.largeFloat = msg.largeFloat; } if (msg.smallNegativeFloat) { - json[\\"smallNegativeFloat\\"] = msg.smallNegativeFloat; + json.smallNegativeFloat = msg.smallNegativeFloat; } if (msg.infDouble) { - json[\\"infDouble\\"] = msg.infDouble; + json.infDouble = msg.infDouble; } if (msg.negInfDouble) { - json[\\"negInfDouble\\"] = msg.negInfDouble; + json.negInfDouble = msg.negInfDouble; } if (msg.nanDouble) { - json[\\"nanDouble\\"] = msg.nanDouble; + json.nanDouble = msg.nanDouble; } if (msg.infFloat) { - json[\\"infFloat\\"] = msg.infFloat; + json.infFloat = msg.infFloat; } if (msg.negInfFloat) { - json[\\"negInfFloat\\"] = msg.negInfFloat; + json.negInfFloat = msg.negInfFloat; } if (msg.nanFloat) { - json[\\"nanFloat\\"] = msg.nanFloat; + json.nanFloat = msg.nanFloat; } if (msg.cppTrigraph) { - json[\\"cppTrigraph\\"] = msg.cppTrigraph; + json.cppTrigraph = msg.cppTrigraph; } if (msg.stringWithZero) { - json[\\"stringWithZero\\"] = msg.stringWithZero; + json.stringWithZero = msg.stringWithZero; } if (msg.bytesWithZero) { - json[\\"bytesWithZero\\"] = msg.bytesWithZero; + json.bytesWithZero = msg.bytesWithZero; } if (msg.stringPieceWithZero) { - json[\\"stringPieceWithZero\\"] = msg.stringPieceWithZero; + json.stringPieceWithZero = msg.stringPieceWithZero; } if (msg.cordWithZero) { - json[\\"cordWithZero\\"] = msg.cordWithZero; + json.cordWithZero = msg.cordWithZero; } if (msg.replacementString) { - json[\\"replacementString\\"] = msg.replacementString; + json.replacementString = msg.replacementString; } return json; }, @@ -67429,7 +68814,7 @@ export const TestExtremeDefaultValues = { break; } case 3: { - msg.largeUint64 = reader.readUint64String(); + msg.largeUint64 = BigInt(reader.readUint64String()); break; } case 4: { @@ -67437,7 +68822,7 @@ export const TestExtremeDefaultValues = { break; } case 5: { - msg.smallInt64 = reader.readInt64String(); + msg.smallInt64 = BigInt(reader.readInt64String()); break; } case 21: { @@ -67445,7 +68830,7 @@ export const TestExtremeDefaultValues = { break; } case 22: { - msg.reallySmallInt64 = reader.readInt64String(); + msg.reallySmallInt64 = BigInt(reader.readInt64String()); break; } case 6: { @@ -67544,117 +68929,113 @@ export const TestExtremeDefaultValues = { msg: TestExtremeDefaultValues, json: any ): TestExtremeDefaultValues { - const escapedBytes = json[\\"escapedBytes\\"] ?? json.escaped_bytes; + const escapedBytes = json.escapedBytes ?? json.escaped_bytes; if (escapedBytes) { msg.escapedBytes = escapedBytes; } - const largeUint32 = json[\\"largeUint32\\"] ?? json.large_uint32; + const largeUint32 = json.largeUint32 ?? json.large_uint32; if (largeUint32) { msg.largeUint32 = largeUint32; } - const largeUint64 = json[\\"largeUint64\\"] ?? json.large_uint64; + const largeUint64 = json.largeUint64 ?? json.large_uint64; if (largeUint64) { - msg.largeUint64 = largeUint64; + msg.largeUint64 = BigInt(largeUint64); } - const smallInt32 = json[\\"smallInt32\\"] ?? json.small_int32; + const smallInt32 = json.smallInt32 ?? json.small_int32; if (smallInt32) { msg.smallInt32 = smallInt32; } - const smallInt64 = json[\\"smallInt64\\"] ?? json.small_int64; + const smallInt64 = json.smallInt64 ?? json.small_int64; if (smallInt64) { - msg.smallInt64 = smallInt64; + msg.smallInt64 = BigInt(smallInt64); } - const reallySmallInt32 = - json[\\"reallySmallInt32\\"] ?? json.really_small_int32; + const reallySmallInt32 = json.reallySmallInt32 ?? json.really_small_int32; if (reallySmallInt32) { msg.reallySmallInt32 = reallySmallInt32; } - const reallySmallInt64 = - json[\\"reallySmallInt64\\"] ?? json.really_small_int64; + const reallySmallInt64 = json.reallySmallInt64 ?? json.really_small_int64; if (reallySmallInt64) { - msg.reallySmallInt64 = reallySmallInt64; + msg.reallySmallInt64 = BigInt(reallySmallInt64); } - const utf8String = json[\\"utf8String\\"] ?? json.utf8_string; + const utf8String = json.utf8String ?? json.utf8_string; if (utf8String) { msg.utf8String = utf8String; } - const zeroFloat = json[\\"zeroFloat\\"] ?? json.zero_float; + const zeroFloat = json.zeroFloat ?? json.zero_float; if (zeroFloat) { msg.zeroFloat = zeroFloat; } - const oneFloat = json[\\"oneFloat\\"] ?? json.one_float; + const oneFloat = json.oneFloat ?? json.one_float; if (oneFloat) { msg.oneFloat = oneFloat; } - const smallFloat = json[\\"smallFloat\\"] ?? json.small_float; + const smallFloat = json.smallFloat ?? json.small_float; if (smallFloat) { msg.smallFloat = smallFloat; } - const negativeOneFloat = - json[\\"negativeOneFloat\\"] ?? json.negative_one_float; + const negativeOneFloat = json.negativeOneFloat ?? json.negative_one_float; if (negativeOneFloat) { msg.negativeOneFloat = negativeOneFloat; } - const negativeFloat = json[\\"negativeFloat\\"] ?? json.negative_float; + const negativeFloat = json.negativeFloat ?? json.negative_float; if (negativeFloat) { msg.negativeFloat = negativeFloat; } - const largeFloat = json[\\"largeFloat\\"] ?? json.large_float; + const largeFloat = json.largeFloat ?? json.large_float; if (largeFloat) { msg.largeFloat = largeFloat; } const smallNegativeFloat = - json[\\"smallNegativeFloat\\"] ?? json.small_negative_float; + json.smallNegativeFloat ?? json.small_negative_float; if (smallNegativeFloat) { msg.smallNegativeFloat = smallNegativeFloat; } - const infDouble = json[\\"infDouble\\"] ?? json.inf_double; + const infDouble = json.infDouble ?? json.inf_double; if (infDouble) { msg.infDouble = infDouble; } - const negInfDouble = json[\\"negInfDouble\\"] ?? json.neg_inf_double; + const negInfDouble = json.negInfDouble ?? json.neg_inf_double; if (negInfDouble) { msg.negInfDouble = negInfDouble; } - const nanDouble = json[\\"nanDouble\\"] ?? json.nan_double; + const nanDouble = json.nanDouble ?? json.nan_double; if (nanDouble) { msg.nanDouble = nanDouble; } - const infFloat = json[\\"infFloat\\"] ?? json.inf_float; + const infFloat = json.infFloat ?? json.inf_float; if (infFloat) { msg.infFloat = infFloat; } - const negInfFloat = json[\\"negInfFloat\\"] ?? json.neg_inf_float; + const negInfFloat = json.negInfFloat ?? json.neg_inf_float; if (negInfFloat) { msg.negInfFloat = negInfFloat; } - const nanFloat = json[\\"nanFloat\\"] ?? json.nan_float; + const nanFloat = json.nanFloat ?? json.nan_float; if (nanFloat) { msg.nanFloat = nanFloat; } - const cppTrigraph = json[\\"cppTrigraph\\"] ?? json.cpp_trigraph; + const cppTrigraph = json.cppTrigraph ?? json.cpp_trigraph; if (cppTrigraph) { msg.cppTrigraph = cppTrigraph; } - const stringWithZero = json[\\"stringWithZero\\"] ?? json.string_with_zero; + const stringWithZero = json.stringWithZero ?? json.string_with_zero; if (stringWithZero) { msg.stringWithZero = stringWithZero; } - const bytesWithZero = json[\\"bytesWithZero\\"] ?? json.bytes_with_zero; + const bytesWithZero = json.bytesWithZero ?? json.bytes_with_zero; if (bytesWithZero) { msg.bytesWithZero = bytesWithZero; } const stringPieceWithZero = - json[\\"stringPieceWithZero\\"] ?? json.string_piece_with_zero; + json.stringPieceWithZero ?? json.string_piece_with_zero; if (stringPieceWithZero) { msg.stringPieceWithZero = stringPieceWithZero; } - const cordWithZero = json[\\"cordWithZero\\"] ?? json.cord_with_zero; + const cordWithZero = json.cordWithZero ?? json.cord_with_zero; if (cordWithZero) { msg.cordWithZero = cordWithZero; } - const replacementString = - json[\\"replacementString\\"] ?? json.replacement_string; + const replacementString = json.replacementString ?? json.replacement_string; if (replacementString) { msg.replacementString = replacementString; } @@ -67732,7 +69113,7 @@ export const SparseEnumMessage = { ): Record { const json: Record = {}; if (msg.sparseEnum) { - json[\\"sparseEnum\\"] = msg.sparseEnum; + json.sparseEnum = msg.sparseEnum; } return json; }, @@ -67767,7 +69148,7 @@ export const SparseEnumMessage = { msg: SparseEnumMessage, json: any ): SparseEnumMessage { - const sparseEnum = json[\\"sparseEnum\\"] ?? json.sparse_enum; + const sparseEnum = json.sparseEnum ?? json.sparse_enum; if (sparseEnum) { msg.sparseEnum = sparseEnum; } @@ -67840,7 +69221,7 @@ export const OneString = { ): Record { const json: Record = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -67869,7 +69250,7 @@ export const OneString = { * @private */ _readMessageJSON: function (msg: OneString, json: any): OneString { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -67945,7 +69326,7 @@ export const MoreString = { ): Record { const json: Record = {}; if (msg.data?.length) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -67974,7 +69355,7 @@ export const MoreString = { * @private */ _readMessageJSON: function (msg: MoreString, json: any): MoreString { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -68047,7 +69428,7 @@ export const OneBytes = { ): Record { const json: Record = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -68076,7 +69457,7 @@ export const OneBytes = { * @private */ _readMessageJSON: function (msg: OneBytes, json: any): OneBytes { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -68149,7 +69530,7 @@ export const MoreBytes = { ): Record { const json: Record = {}; if (msg.data?.length) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -68178,7 +69559,7 @@ export const MoreBytes = { * @private */ _readMessageJSON: function (msg: MoreBytes, json: any): MoreBytes { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -68254,7 +69635,7 @@ export const Int32Message = { ): Record { const json: Record = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -68286,7 +69667,7 @@ export const Int32Message = { * @private */ _readMessageJSON: function (msg: Int32Message, json: any): Int32Message { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -68362,7 +69743,7 @@ export const Uint32Message = { ): Record { const json: Record = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -68394,7 +69775,7 @@ export const Uint32Message = { * @private */ _readMessageJSON: function (msg: Uint32Message, json: any): Uint32Message { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -68445,7 +69826,7 @@ export const Int64Message = { */ initialize: function (): Int64Message { return { - data: \\"\\", + data: 0n, }; }, @@ -68457,7 +69838,7 @@ export const Int64Message = { writer: BinaryWriter ): BinaryWriter { if (msg.data) { - writer.writeInt64String(1, msg.data); + writer.writeInt64String(1, msg.data.toString()); } return writer; }, @@ -68470,7 +69851,7 @@ export const Int64Message = { ): Record { const json: Record = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data.toString(); } return json; }, @@ -68486,7 +69867,7 @@ export const Int64Message = { const field = reader.getFieldNumber(); switch (field) { case 1: { - msg.data = reader.readInt64String(); + msg.data = BigInt(reader.readInt64String()); break; } default: { @@ -68502,9 +69883,9 @@ export const Int64Message = { * @private */ _readMessageJSON: function (msg: Int64Message, json: any): Int64Message { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { - msg.data = data; + msg.data = BigInt(data); } return msg; }, @@ -68553,7 +69934,7 @@ export const Uint64Message = { */ initialize: function (): Uint64Message { return { - data: \\"\\", + data: 0n, }; }, @@ -68565,7 +69946,7 @@ export const Uint64Message = { writer: BinaryWriter ): BinaryWriter { if (msg.data) { - writer.writeUint64String(1, msg.data); + writer.writeUint64String(1, msg.data.toString()); } return writer; }, @@ -68578,7 +69959,7 @@ export const Uint64Message = { ): Record { const json: Record = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data.toString(); } return json; }, @@ -68594,7 +69975,7 @@ export const Uint64Message = { const field = reader.getFieldNumber(); switch (field) { case 1: { - msg.data = reader.readUint64String(); + msg.data = BigInt(reader.readUint64String()); break; } default: { @@ -68610,9 +69991,9 @@ export const Uint64Message = { * @private */ _readMessageJSON: function (msg: Uint64Message, json: any): Uint64Message { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { - msg.data = data; + msg.data = BigInt(data); } return msg; }, @@ -68686,7 +70067,7 @@ export const BoolMessage = { ): Record { const json: Record = {}; if (msg.data) { - json[\\"data\\"] = msg.data; + json.data = msg.data; } return json; }, @@ -68715,7 +70096,7 @@ export const BoolMessage = { * @private */ _readMessageJSON: function (msg: BoolMessage, json: any): BoolMessage { - const data = json[\\"data\\"] ?? json.data; + const data = json.data ?? json.data; if (data) { msg.data = data; } @@ -68794,15 +70175,15 @@ export const TestOneof = { ): Record { const json: Record = {}; if (msg.fooInt != undefined) { - json[\\"fooInt\\"] = msg.fooInt; + json.fooInt = msg.fooInt; } if (msg.fooString != undefined) { - json[\\"fooString\\"] = msg.fooString; + json.fooString = msg.fooString; } if (msg.fooMessage != undefined) { const fooMessage = TestAllTypes._writeMessageJSON(msg.fooMessage); if (Object.keys(fooMessage).length > 0) { - json[\\"fooMessage\\"] = fooMessage; + json.fooMessage = fooMessage; } } return json; @@ -68840,15 +70221,15 @@ export const TestOneof = { * @private */ _readMessageJSON: function (msg: TestOneof, json: any): TestOneof { - const fooInt = json[\\"fooInt\\"] ?? json.foo_int; + const fooInt = json.fooInt ?? json.foo_int; if (fooInt) { msg.fooInt = fooInt; } - const fooString = json[\\"fooString\\"] ?? json.foo_string; + const fooString = json.fooString ?? json.foo_string; if (fooString) { msg.fooString = fooString; } - const fooMessage = json[\\"fooMessage\\"] ?? json.foo_message; + const fooMessage = json.fooMessage ?? json.foo_message; if (fooMessage) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, fooMessage); @@ -68929,10 +70310,10 @@ export const TestOneof = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } if (msg.b) { - json[\\"b\\"] = msg.b; + json.b = msg.b; } return json; }, @@ -68971,11 +70352,11 @@ export const TestOneof = { msg: TestOneof.FooGroup, json: any ): TestOneof.FooGroup { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } - const b = json[\\"b\\"] ?? json.b; + const b = json.b ?? json.b; if (b) { msg.b = b; } @@ -69068,15 +70449,15 @@ export const TestOneofBackwardsCompatible = { ): Record { const json: Record = {}; if (msg.fooInt) { - json[\\"fooInt\\"] = msg.fooInt; + json.fooInt = msg.fooInt; } if (msg.fooString) { - json[\\"fooString\\"] = msg.fooString; + json.fooString = msg.fooString; } if (msg.fooMessage) { const fooMessage = TestAllTypes._writeMessageJSON(msg.fooMessage); if (Object.keys(fooMessage).length > 0) { - json[\\"fooMessage\\"] = fooMessage; + json.fooMessage = fooMessage; } } return json; @@ -69120,15 +70501,15 @@ export const TestOneofBackwardsCompatible = { msg: TestOneofBackwardsCompatible, json: any ): TestOneofBackwardsCompatible { - const fooInt = json[\\"fooInt\\"] ?? json.foo_int; + const fooInt = json.fooInt ?? json.foo_int; if (fooInt) { msg.fooInt = fooInt; } - const fooString = json[\\"fooString\\"] ?? json.foo_string; + const fooString = json.fooString ?? json.foo_string; if (fooString) { msg.fooString = fooString; } - const fooMessage = json[\\"fooMessage\\"] ?? json.foo_message; + const fooMessage = json.fooMessage ?? json.foo_message; if (fooMessage) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, fooMessage); @@ -69217,10 +70598,10 @@ export const TestOneofBackwardsCompatible = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } if (msg.b) { - json[\\"b\\"] = msg.b; + json.b = msg.b; } return json; }, @@ -69259,11 +70640,11 @@ export const TestOneofBackwardsCompatible = { msg: TestOneofBackwardsCompatible.FooGroup, json: any ): TestOneofBackwardsCompatible.FooGroup { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } - const b = json[\\"b\\"] ?? json.b; + const b = json.b ?? json.b; if (b) { msg.b = b; } @@ -69408,29 +70789,29 @@ export const TestOneof2 = { ): Record { const json: Record = {}; if (msg.fooInt != undefined) { - json[\\"fooInt\\"] = msg.fooInt; + json.fooInt = msg.fooInt; } if (msg.fooString != undefined) { - json[\\"fooString\\"] = msg.fooString; + json.fooString = msg.fooString; } if (msg.fooCord != undefined) { - json[\\"fooCord\\"] = msg.fooCord; + json.fooCord = msg.fooCord; } if (msg.fooStringPiece != undefined) { - json[\\"fooStringPiece\\"] = msg.fooStringPiece; + json.fooStringPiece = msg.fooStringPiece; } if (msg.fooBytes != undefined) { - json[\\"fooBytes\\"] = msg.fooBytes; + json.fooBytes = msg.fooBytes; } if (msg.fooEnum != undefined) { - json[\\"fooEnum\\"] = msg.fooEnum; + json.fooEnum = msg.fooEnum; } if (msg.fooMessage != undefined) { const fooMessage = TestOneof2.NestedMessage._writeMessageJSON( msg.fooMessage ); if (Object.keys(fooMessage).length > 0) { - json[\\"fooMessage\\"] = fooMessage; + json.fooMessage = fooMessage; } } if (msg.fooLazyMessage != undefined) { @@ -69438,45 +70819,44 @@ export const TestOneof2 = { msg.fooLazyMessage ); if (Object.keys(fooLazyMessage).length > 0) { - json[\\"fooLazyMessage\\"] = fooLazyMessage; + json.fooLazyMessage = fooLazyMessage; } } if (msg.barInt != undefined) { - json[\\"barInt\\"] = msg.barInt; + json.barInt = msg.barInt; } if (msg.barString != undefined) { - json[\\"barString\\"] = msg.barString; + json.barString = msg.barString; } if (msg.barCord != undefined) { - json[\\"barCord\\"] = msg.barCord; + json.barCord = msg.barCord; } if (msg.barStringPiece != undefined) { - json[\\"barStringPiece\\"] = msg.barStringPiece; + json.barStringPiece = msg.barStringPiece; } if (msg.barBytes != undefined) { - json[\\"barBytes\\"] = msg.barBytes; + json.barBytes = msg.barBytes; } if (msg.barEnum != undefined) { - json[\\"barEnum\\"] = msg.barEnum; + json.barEnum = msg.barEnum; } if (msg.barStringWithEmptyDefault != undefined) { - json[\\"barStringWithEmptyDefault\\"] = msg.barStringWithEmptyDefault; + json.barStringWithEmptyDefault = msg.barStringWithEmptyDefault; } if (msg.barCordWithEmptyDefault != undefined) { - json[\\"barCordWithEmptyDefault\\"] = msg.barCordWithEmptyDefault; + json.barCordWithEmptyDefault = msg.barCordWithEmptyDefault; } if (msg.barStringPieceWithEmptyDefault != undefined) { - json[\\"barStringPieceWithEmptyDefault\\"] = - msg.barStringPieceWithEmptyDefault; + json.barStringPieceWithEmptyDefault = msg.barStringPieceWithEmptyDefault; } if (msg.barBytesWithEmptyDefault != undefined) { - json[\\"barBytesWithEmptyDefault\\"] = msg.barBytesWithEmptyDefault; + json.barBytesWithEmptyDefault = msg.barBytesWithEmptyDefault; } if (msg.bazInt) { - json[\\"bazInt\\"] = msg.bazInt; + json.bazInt = msg.bazInt; } if (msg.bazString) { - json[\\"bazString\\"] = msg.bazString; + json.bazString = msg.bazString; } return json; }, @@ -69587,92 +70967,92 @@ export const TestOneof2 = { * @private */ _readMessageJSON: function (msg: TestOneof2, json: any): TestOneof2 { - const fooInt = json[\\"fooInt\\"] ?? json.foo_int; + const fooInt = json.fooInt ?? json.foo_int; if (fooInt) { msg.fooInt = fooInt; } - const fooString = json[\\"fooString\\"] ?? json.foo_string; + const fooString = json.fooString ?? json.foo_string; if (fooString) { msg.fooString = fooString; } - const fooCord = json[\\"fooCord\\"] ?? json.foo_cord; + const fooCord = json.fooCord ?? json.foo_cord; if (fooCord) { msg.fooCord = fooCord; } - const fooStringPiece = json[\\"fooStringPiece\\"] ?? json.foo_string_piece; + const fooStringPiece = json.fooStringPiece ?? json.foo_string_piece; if (fooStringPiece) { msg.fooStringPiece = fooStringPiece; } - const fooBytes = json[\\"fooBytes\\"] ?? json.foo_bytes; + const fooBytes = json.fooBytes ?? json.foo_bytes; if (fooBytes) { msg.fooBytes = fooBytes; } - const fooEnum = json[\\"fooEnum\\"] ?? json.foo_enum; + const fooEnum = json.fooEnum ?? json.foo_enum; if (fooEnum) { msg.fooEnum = fooEnum; } - const fooMessage = json[\\"fooMessage\\"] ?? json.foo_message; + const fooMessage = json.fooMessage ?? json.foo_message; if (fooMessage) { const m = TestOneof2.NestedMessage.initialize(); TestOneof2.NestedMessage._readMessageJSON(m, fooMessage); msg.fooMessage = m; } - const fooLazyMessage = json[\\"fooLazyMessage\\"] ?? json.foo_lazy_message; + const fooLazyMessage = json.fooLazyMessage ?? json.foo_lazy_message; if (fooLazyMessage) { const m = TestOneof2.NestedMessage.initialize(); TestOneof2.NestedMessage._readMessageJSON(m, fooLazyMessage); msg.fooLazyMessage = m; } - const barInt = json[\\"barInt\\"] ?? json.bar_int; + const barInt = json.barInt ?? json.bar_int; if (barInt) { msg.barInt = barInt; } - const barString = json[\\"barString\\"] ?? json.bar_string; + const barString = json.barString ?? json.bar_string; if (barString) { msg.barString = barString; } - const barCord = json[\\"barCord\\"] ?? json.bar_cord; + const barCord = json.barCord ?? json.bar_cord; if (barCord) { msg.barCord = barCord; } - const barStringPiece = json[\\"barStringPiece\\"] ?? json.bar_string_piece; + const barStringPiece = json.barStringPiece ?? json.bar_string_piece; if (barStringPiece) { msg.barStringPiece = barStringPiece; } - const barBytes = json[\\"barBytes\\"] ?? json.bar_bytes; + const barBytes = json.barBytes ?? json.bar_bytes; if (barBytes) { msg.barBytes = barBytes; } - const barEnum = json[\\"barEnum\\"] ?? json.bar_enum; + const barEnum = json.barEnum ?? json.bar_enum; if (barEnum) { msg.barEnum = barEnum; } const barStringWithEmptyDefault = - json[\\"barStringWithEmptyDefault\\"] ?? json.bar_string_with_empty_default; + json.barStringWithEmptyDefault ?? json.bar_string_with_empty_default; if (barStringWithEmptyDefault) { msg.barStringWithEmptyDefault = barStringWithEmptyDefault; } const barCordWithEmptyDefault = - json[\\"barCordWithEmptyDefault\\"] ?? json.bar_cord_with_empty_default; + json.barCordWithEmptyDefault ?? json.bar_cord_with_empty_default; if (barCordWithEmptyDefault) { msg.barCordWithEmptyDefault = barCordWithEmptyDefault; } const barStringPieceWithEmptyDefault = - json[\\"barStringPieceWithEmptyDefault\\"] ?? + json.barStringPieceWithEmptyDefault ?? json.bar_string_piece_with_empty_default; if (barStringPieceWithEmptyDefault) { msg.barStringPieceWithEmptyDefault = barStringPieceWithEmptyDefault; } const barBytesWithEmptyDefault = - json[\\"barBytesWithEmptyDefault\\"] ?? json.bar_bytes_with_empty_default; + json.barBytesWithEmptyDefault ?? json.bar_bytes_with_empty_default; if (barBytesWithEmptyDefault) { msg.barBytesWithEmptyDefault = barBytesWithEmptyDefault; } - const bazInt = json[\\"bazInt\\"] ?? json.baz_int; + const bazInt = json.bazInt ?? json.baz_int; if (bazInt) { msg.bazInt = bazInt; } - const bazString = json[\\"bazString\\"] ?? json.baz_string; + const bazString = json.bazString ?? json.baz_string; if (bazString) { msg.bazString = bazString; } @@ -69753,10 +71133,10 @@ export const TestOneof2 = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } if (msg.b) { - json[\\"b\\"] = msg.b; + json.b = msg.b; } return json; }, @@ -69795,11 +71175,11 @@ export const TestOneof2 = { msg: TestOneof2.FooGroup, json: any ): TestOneof2.FooGroup { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } - const b = json[\\"b\\"] ?? json.b; + const b = json.b ?? json.b; if (b) { msg.b = b; } @@ -69856,7 +71236,7 @@ export const TestOneof2 = { */ initialize: function (): TestOneof2.NestedMessage { return { - quxInt: \\"\\", + quxInt: 0n, corgeInt: [], }; }, @@ -69869,7 +71249,7 @@ export const TestOneof2 = { writer: BinaryWriter ): BinaryWriter { if (msg.quxInt) { - writer.writeInt64String(1, msg.quxInt); + writer.writeInt64String(1, msg.quxInt.toString()); } if (msg.corgeInt?.length) { writer.writeRepeatedInt32(2, msg.corgeInt); @@ -69885,10 +71265,10 @@ export const TestOneof2 = { ): Record { const json: Record = {}; if (msg.quxInt) { - json[\\"quxInt\\"] = msg.quxInt; + json.quxInt = msg.quxInt.toString(); } if (msg.corgeInt?.length) { - json[\\"corgeInt\\"] = msg.corgeInt; + json.corgeInt = msg.corgeInt; } return json; }, @@ -69904,7 +71284,7 @@ export const TestOneof2 = { const field = reader.getFieldNumber(); switch (field) { case 1: { - msg.quxInt = reader.readInt64String(); + msg.quxInt = BigInt(reader.readInt64String()); break; } case 2: { @@ -69927,11 +71307,11 @@ export const TestOneof2 = { msg: TestOneof2.NestedMessage, json: any ): TestOneof2.NestedMessage { - const quxInt = json[\\"quxInt\\"] ?? json.qux_int; + const quxInt = json.quxInt ?? json.qux_int; if (quxInt) { - msg.quxInt = quxInt; + msg.quxInt = BigInt(quxInt); } - const corgeInt = json[\\"corgeInt\\"] ?? json.corge_int; + const corgeInt = json.corgeInt ?? json.corge_int; if (corgeInt) { msg.corgeInt = corgeInt; } @@ -70020,17 +71400,17 @@ export const TestRequiredOneof = { ): Record { const json: Record = {}; if (msg.fooInt != undefined) { - json[\\"fooInt\\"] = msg.fooInt; + json.fooInt = msg.fooInt; } if (msg.fooString != undefined) { - json[\\"fooString\\"] = msg.fooString; + json.fooString = msg.fooString; } if (msg.fooMessage != undefined) { const fooMessage = TestRequiredOneof.NestedMessage._writeMessageJSON( msg.fooMessage ); if (Object.keys(fooMessage).length > 0) { - json[\\"fooMessage\\"] = fooMessage; + json.fooMessage = fooMessage; } } return json; @@ -70077,15 +71457,15 @@ export const TestRequiredOneof = { msg: TestRequiredOneof, json: any ): TestRequiredOneof { - const fooInt = json[\\"fooInt\\"] ?? json.foo_int; + const fooInt = json.fooInt ?? json.foo_int; if (fooInt) { msg.fooInt = fooInt; } - const fooString = json[\\"fooString\\"] ?? json.foo_string; + const fooString = json.fooString ?? json.foo_string; if (fooString) { msg.fooString = fooString; } - const fooMessage = json[\\"fooMessage\\"] ?? json.foo_message; + const fooMessage = json.fooMessage ?? json.foo_message; if (fooMessage) { const m = TestRequiredOneof.NestedMessage.initialize(); TestRequiredOneof.NestedMessage._readMessageJSON(m, fooMessage); @@ -70168,7 +71548,7 @@ export const TestRequiredOneof = { ): Record { const json: Record = {}; if (msg.requiredDouble) { - json[\\"requiredDouble\\"] = msg.requiredDouble; + json.requiredDouble = msg.requiredDouble; } return json; }, @@ -70203,7 +71583,7 @@ export const TestRequiredOneof = { msg: TestRequiredOneof.NestedMessage, json: any ): TestRequiredOneof.NestedMessage { - const requiredDouble = json[\\"requiredDouble\\"] ?? json.required_double; + const requiredDouble = json.requiredDouble ?? json.required_double; if (requiredDouble) { msg.requiredDouble = requiredDouble; } @@ -70283,31 +71663,31 @@ export const TestPackedTypes = { writer.writeRepeatedInt32(90, msg.packedInt32); } if (msg.packedInt64?.length) { - writer.writeRepeatedInt64String(91, msg.packedInt64); + writer.writeRepeatedInt64String(91, msg.packedInt64.toString()); } if (msg.packedUint32?.length) { writer.writeRepeatedUint32(92, msg.packedUint32); } if (msg.packedUint64?.length) { - writer.writeRepeatedUint64String(93, msg.packedUint64); + writer.writeRepeatedUint64String(93, msg.packedUint64.toString()); } if (msg.packedSint32?.length) { writer.writeRepeatedSint32(94, msg.packedSint32); } if (msg.packedSint64?.length) { - writer.writeRepeatedSint64String(95, msg.packedSint64); + writer.writeRepeatedSint64String(95, msg.packedSint64.toString()); } if (msg.packedFixed32?.length) { writer.writeRepeatedFixed32(96, msg.packedFixed32); } if (msg.packedFixed64?.length) { - writer.writeRepeatedFixed64String(97, msg.packedFixed64); + writer.writeRepeatedFixed64String(97, msg.packedFixed64.toString()); } if (msg.packedSfixed32?.length) { writer.writeRepeatedSfixed32(98, msg.packedSfixed32); } if (msg.packedSfixed64?.length) { - writer.writeRepeatedSfixed64(99, msg.packedSfixed64); + writer.writeRepeatedSfixed64(99, msg.packedSfixed64.toString()); } if (msg.packedFloat?.length) { writer.writeRepeatedFloat(100, msg.packedFloat); @@ -70332,46 +71712,46 @@ export const TestPackedTypes = { ): Record { const json: Record = {}; if (msg.packedInt32?.length) { - json[\\"packedInt32\\"] = msg.packedInt32; + json.packedInt32 = msg.packedInt32; } if (msg.packedInt64?.length) { - json[\\"packedInt64\\"] = msg.packedInt64; + json.packedInt64 = msg.packedInt64.map((x) => x.toString()); } if (msg.packedUint32?.length) { - json[\\"packedUint32\\"] = msg.packedUint32; + json.packedUint32 = msg.packedUint32; } if (msg.packedUint64?.length) { - json[\\"packedUint64\\"] = msg.packedUint64; + json.packedUint64 = msg.packedUint64.map((x) => x.toString()); } if (msg.packedSint32?.length) { - json[\\"packedSint32\\"] = msg.packedSint32; + json.packedSint32 = msg.packedSint32; } if (msg.packedSint64?.length) { - json[\\"packedSint64\\"] = msg.packedSint64; + json.packedSint64 = msg.packedSint64.map((x) => x.toString()); } if (msg.packedFixed32?.length) { - json[\\"packedFixed32\\"] = msg.packedFixed32; + json.packedFixed32 = msg.packedFixed32; } if (msg.packedFixed64?.length) { - json[\\"packedFixed64\\"] = msg.packedFixed64; + json.packedFixed64 = msg.packedFixed64.map((x) => x.toString()); } if (msg.packedSfixed32?.length) { - json[\\"packedSfixed32\\"] = msg.packedSfixed32; + json.packedSfixed32 = msg.packedSfixed32; } if (msg.packedSfixed64?.length) { - json[\\"packedSfixed64\\"] = msg.packedSfixed64; + json.packedSfixed64 = msg.packedSfixed64.map((x) => x.toString()); } if (msg.packedFloat?.length) { - json[\\"packedFloat\\"] = msg.packedFloat; + json.packedFloat = msg.packedFloat; } if (msg.packedDouble?.length) { - json[\\"packedDouble\\"] = msg.packedDouble; + json.packedDouble = msg.packedDouble; } if (msg.packedBool?.length) { - json[\\"packedBool\\"] = msg.packedBool; + json.packedBool = msg.packedBool; } if (msg.packedEnum?.length) { - json[\\"packedEnum\\"] = msg.packedEnum; + json.packedEnum = msg.packedEnum; } return json; }, @@ -70391,7 +71771,7 @@ export const TestPackedTypes = { break; } case 91: { - msg.packedInt64.push(reader.readInt64String()); + msg.packedInt64 = reader.readInt64String().map(BigInt); break; } case 92: { @@ -70399,7 +71779,7 @@ export const TestPackedTypes = { break; } case 93: { - msg.packedUint64.push(reader.readUint64String()); + msg.packedUint64 = reader.readUint64String().map(BigInt); break; } case 94: { @@ -70407,7 +71787,7 @@ export const TestPackedTypes = { break; } case 95: { - msg.packedSint64.push(reader.readSint64()); + msg.packedSint64 = reader.readSint64().map(BigInt); break; } case 96: { @@ -70415,7 +71795,7 @@ export const TestPackedTypes = { break; } case 97: { - msg.packedFixed64.push(reader.readFixed64String()); + msg.packedFixed64 = reader.readFixed64String().map(BigInt); break; } case 98: { @@ -70423,7 +71803,7 @@ export const TestPackedTypes = { break; } case 99: { - msg.packedSfixed64.push(reader.readSfixed64()); + msg.packedSfixed64 = reader.readSfixed64().map(BigInt); break; } case 100: { @@ -70458,59 +71838,59 @@ export const TestPackedTypes = { msg: TestPackedTypes, json: any ): TestPackedTypes { - const packedInt32 = json[\\"packedInt32\\"] ?? json.packed_int32; + const packedInt32 = json.packedInt32 ?? json.packed_int32; if (packedInt32) { msg.packedInt32 = packedInt32; } - const packedInt64 = json[\\"packedInt64\\"] ?? json.packed_int64; + const packedInt64 = json.packedInt64 ?? json.packed_int64; if (packedInt64) { - msg.packedInt64 = packedInt64; + msg.packedInt64 = packedInt64.map(BigInt); } - const packedUint32 = json[\\"packedUint32\\"] ?? json.packed_uint32; + const packedUint32 = json.packedUint32 ?? json.packed_uint32; if (packedUint32) { msg.packedUint32 = packedUint32; } - const packedUint64 = json[\\"packedUint64\\"] ?? json.packed_uint64; + const packedUint64 = json.packedUint64 ?? json.packed_uint64; if (packedUint64) { - msg.packedUint64 = packedUint64; + msg.packedUint64 = packedUint64.map(BigInt); } - const packedSint32 = json[\\"packedSint32\\"] ?? json.packed_sint32; + const packedSint32 = json.packedSint32 ?? json.packed_sint32; if (packedSint32) { msg.packedSint32 = packedSint32; } - const packedSint64 = json[\\"packedSint64\\"] ?? json.packed_sint64; + const packedSint64 = json.packedSint64 ?? json.packed_sint64; if (packedSint64) { - msg.packedSint64 = packedSint64; + msg.packedSint64 = packedSint64.map(BigInt); } - const packedFixed32 = json[\\"packedFixed32\\"] ?? json.packed_fixed32; + const packedFixed32 = json.packedFixed32 ?? json.packed_fixed32; if (packedFixed32) { msg.packedFixed32 = packedFixed32; } - const packedFixed64 = json[\\"packedFixed64\\"] ?? json.packed_fixed64; + const packedFixed64 = json.packedFixed64 ?? json.packed_fixed64; if (packedFixed64) { - msg.packedFixed64 = packedFixed64; + msg.packedFixed64 = packedFixed64.map(BigInt); } - const packedSfixed32 = json[\\"packedSfixed32\\"] ?? json.packed_sfixed32; + const packedSfixed32 = json.packedSfixed32 ?? json.packed_sfixed32; if (packedSfixed32) { msg.packedSfixed32 = packedSfixed32; } - const packedSfixed64 = json[\\"packedSfixed64\\"] ?? json.packed_sfixed64; + const packedSfixed64 = json.packedSfixed64 ?? json.packed_sfixed64; if (packedSfixed64) { - msg.packedSfixed64 = packedSfixed64; + msg.packedSfixed64 = packedSfixed64.map(BigInt); } - const packedFloat = json[\\"packedFloat\\"] ?? json.packed_float; + const packedFloat = json.packedFloat ?? json.packed_float; if (packedFloat) { msg.packedFloat = packedFloat; } - const packedDouble = json[\\"packedDouble\\"] ?? json.packed_double; + const packedDouble = json.packedDouble ?? json.packed_double; if (packedDouble) { msg.packedDouble = packedDouble; } - const packedBool = json[\\"packedBool\\"] ?? json.packed_bool; + const packedBool = json.packedBool ?? json.packed_bool; if (packedBool) { msg.packedBool = packedBool; } - const packedEnum = json[\\"packedEnum\\"] ?? json.packed_enum; + const packedEnum = json.packedEnum ?? json.packed_enum; if (packedEnum) { msg.packedEnum = packedEnum; } @@ -70591,31 +71971,31 @@ export const TestUnpackedTypes = { writer.writeRepeatedInt32(90, msg.unpackedInt32); } if (msg.unpackedInt64?.length) { - writer.writeRepeatedInt64String(91, msg.unpackedInt64); + writer.writeRepeatedInt64String(91, msg.unpackedInt64.toString()); } if (msg.unpackedUint32?.length) { writer.writeRepeatedUint32(92, msg.unpackedUint32); } if (msg.unpackedUint64?.length) { - writer.writeRepeatedUint64String(93, msg.unpackedUint64); + writer.writeRepeatedUint64String(93, msg.unpackedUint64.toString()); } if (msg.unpackedSint32?.length) { writer.writeRepeatedSint32(94, msg.unpackedSint32); } if (msg.unpackedSint64?.length) { - writer.writeRepeatedSint64String(95, msg.unpackedSint64); + writer.writeRepeatedSint64String(95, msg.unpackedSint64.toString()); } if (msg.unpackedFixed32?.length) { writer.writeRepeatedFixed32(96, msg.unpackedFixed32); } if (msg.unpackedFixed64?.length) { - writer.writeRepeatedFixed64String(97, msg.unpackedFixed64); + writer.writeRepeatedFixed64String(97, msg.unpackedFixed64.toString()); } if (msg.unpackedSfixed32?.length) { writer.writeRepeatedSfixed32(98, msg.unpackedSfixed32); } if (msg.unpackedSfixed64?.length) { - writer.writeRepeatedSfixed64(99, msg.unpackedSfixed64); + writer.writeRepeatedSfixed64(99, msg.unpackedSfixed64.toString()); } if (msg.unpackedFloat?.length) { writer.writeRepeatedFloat(100, msg.unpackedFloat); @@ -70640,46 +72020,46 @@ export const TestUnpackedTypes = { ): Record { const json: Record = {}; if (msg.unpackedInt32?.length) { - json[\\"unpackedInt32\\"] = msg.unpackedInt32; + json.unpackedInt32 = msg.unpackedInt32; } if (msg.unpackedInt64?.length) { - json[\\"unpackedInt64\\"] = msg.unpackedInt64; + json.unpackedInt64 = msg.unpackedInt64.map((x) => x.toString()); } if (msg.unpackedUint32?.length) { - json[\\"unpackedUint32\\"] = msg.unpackedUint32; + json.unpackedUint32 = msg.unpackedUint32; } if (msg.unpackedUint64?.length) { - json[\\"unpackedUint64\\"] = msg.unpackedUint64; + json.unpackedUint64 = msg.unpackedUint64.map((x) => x.toString()); } if (msg.unpackedSint32?.length) { - json[\\"unpackedSint32\\"] = msg.unpackedSint32; + json.unpackedSint32 = msg.unpackedSint32; } if (msg.unpackedSint64?.length) { - json[\\"unpackedSint64\\"] = msg.unpackedSint64; + json.unpackedSint64 = msg.unpackedSint64.map((x) => x.toString()); } if (msg.unpackedFixed32?.length) { - json[\\"unpackedFixed32\\"] = msg.unpackedFixed32; + json.unpackedFixed32 = msg.unpackedFixed32; } if (msg.unpackedFixed64?.length) { - json[\\"unpackedFixed64\\"] = msg.unpackedFixed64; + json.unpackedFixed64 = msg.unpackedFixed64.map((x) => x.toString()); } if (msg.unpackedSfixed32?.length) { - json[\\"unpackedSfixed32\\"] = msg.unpackedSfixed32; + json.unpackedSfixed32 = msg.unpackedSfixed32; } if (msg.unpackedSfixed64?.length) { - json[\\"unpackedSfixed64\\"] = msg.unpackedSfixed64; + json.unpackedSfixed64 = msg.unpackedSfixed64.map((x) => x.toString()); } if (msg.unpackedFloat?.length) { - json[\\"unpackedFloat\\"] = msg.unpackedFloat; + json.unpackedFloat = msg.unpackedFloat; } if (msg.unpackedDouble?.length) { - json[\\"unpackedDouble\\"] = msg.unpackedDouble; + json.unpackedDouble = msg.unpackedDouble; } if (msg.unpackedBool?.length) { - json[\\"unpackedBool\\"] = msg.unpackedBool; + json.unpackedBool = msg.unpackedBool; } if (msg.unpackedEnum?.length) { - json[\\"unpackedEnum\\"] = msg.unpackedEnum; + json.unpackedEnum = msg.unpackedEnum; } return json; }, @@ -70699,7 +72079,7 @@ export const TestUnpackedTypes = { break; } case 91: { - msg.unpackedInt64.push(reader.readInt64String()); + msg.unpackedInt64 = reader.readInt64String().map(BigInt); break; } case 92: { @@ -70707,7 +72087,7 @@ export const TestUnpackedTypes = { break; } case 93: { - msg.unpackedUint64.push(reader.readUint64String()); + msg.unpackedUint64 = reader.readUint64String().map(BigInt); break; } case 94: { @@ -70715,7 +72095,7 @@ export const TestUnpackedTypes = { break; } case 95: { - msg.unpackedSint64.push(reader.readSint64()); + msg.unpackedSint64 = reader.readSint64().map(BigInt); break; } case 96: { @@ -70723,7 +72103,7 @@ export const TestUnpackedTypes = { break; } case 97: { - msg.unpackedFixed64.push(reader.readFixed64String()); + msg.unpackedFixed64 = reader.readFixed64String().map(BigInt); break; } case 98: { @@ -70731,7 +72111,7 @@ export const TestUnpackedTypes = { break; } case 99: { - msg.unpackedSfixed64.push(reader.readSfixed64()); + msg.unpackedSfixed64 = reader.readSfixed64().map(BigInt); break; } case 100: { @@ -70766,59 +72146,59 @@ export const TestUnpackedTypes = { msg: TestUnpackedTypes, json: any ): TestUnpackedTypes { - const unpackedInt32 = json[\\"unpackedInt32\\"] ?? json.unpacked_int32; + const unpackedInt32 = json.unpackedInt32 ?? json.unpacked_int32; if (unpackedInt32) { msg.unpackedInt32 = unpackedInt32; } - const unpackedInt64 = json[\\"unpackedInt64\\"] ?? json.unpacked_int64; + const unpackedInt64 = json.unpackedInt64 ?? json.unpacked_int64; if (unpackedInt64) { - msg.unpackedInt64 = unpackedInt64; + msg.unpackedInt64 = unpackedInt64.map(BigInt); } - const unpackedUint32 = json[\\"unpackedUint32\\"] ?? json.unpacked_uint32; + const unpackedUint32 = json.unpackedUint32 ?? json.unpacked_uint32; if (unpackedUint32) { msg.unpackedUint32 = unpackedUint32; } - const unpackedUint64 = json[\\"unpackedUint64\\"] ?? json.unpacked_uint64; + const unpackedUint64 = json.unpackedUint64 ?? json.unpacked_uint64; if (unpackedUint64) { - msg.unpackedUint64 = unpackedUint64; + msg.unpackedUint64 = unpackedUint64.map(BigInt); } - const unpackedSint32 = json[\\"unpackedSint32\\"] ?? json.unpacked_sint32; + const unpackedSint32 = json.unpackedSint32 ?? json.unpacked_sint32; if (unpackedSint32) { msg.unpackedSint32 = unpackedSint32; } - const unpackedSint64 = json[\\"unpackedSint64\\"] ?? json.unpacked_sint64; + const unpackedSint64 = json.unpackedSint64 ?? json.unpacked_sint64; if (unpackedSint64) { - msg.unpackedSint64 = unpackedSint64; + msg.unpackedSint64 = unpackedSint64.map(BigInt); } - const unpackedFixed32 = json[\\"unpackedFixed32\\"] ?? json.unpacked_fixed32; + const unpackedFixed32 = json.unpackedFixed32 ?? json.unpacked_fixed32; if (unpackedFixed32) { msg.unpackedFixed32 = unpackedFixed32; } - const unpackedFixed64 = json[\\"unpackedFixed64\\"] ?? json.unpacked_fixed64; + const unpackedFixed64 = json.unpackedFixed64 ?? json.unpacked_fixed64; if (unpackedFixed64) { - msg.unpackedFixed64 = unpackedFixed64; + msg.unpackedFixed64 = unpackedFixed64.map(BigInt); } - const unpackedSfixed32 = json[\\"unpackedSfixed32\\"] ?? json.unpacked_sfixed32; + const unpackedSfixed32 = json.unpackedSfixed32 ?? json.unpacked_sfixed32; if (unpackedSfixed32) { msg.unpackedSfixed32 = unpackedSfixed32; } - const unpackedSfixed64 = json[\\"unpackedSfixed64\\"] ?? json.unpacked_sfixed64; + const unpackedSfixed64 = json.unpackedSfixed64 ?? json.unpacked_sfixed64; if (unpackedSfixed64) { - msg.unpackedSfixed64 = unpackedSfixed64; + msg.unpackedSfixed64 = unpackedSfixed64.map(BigInt); } - const unpackedFloat = json[\\"unpackedFloat\\"] ?? json.unpacked_float; + const unpackedFloat = json.unpackedFloat ?? json.unpacked_float; if (unpackedFloat) { msg.unpackedFloat = unpackedFloat; } - const unpackedDouble = json[\\"unpackedDouble\\"] ?? json.unpacked_double; + const unpackedDouble = json.unpackedDouble ?? json.unpacked_double; if (unpackedDouble) { msg.unpackedDouble = unpackedDouble; } - const unpackedBool = json[\\"unpackedBool\\"] ?? json.unpacked_bool; + const unpackedBool = json.unpackedBool ?? json.unpacked_bool; if (unpackedBool) { msg.unpackedBool = unpackedBool; } - const unpackedEnum = json[\\"unpackedEnum\\"] ?? json.unpacked_enum; + const unpackedEnum = json.unpackedEnum ?? json.unpacked_enum; if (unpackedEnum) { msg.unpackedEnum = unpackedEnum; } @@ -71043,20 +72423,20 @@ export const TestDynamicExtensions = { ): Record { const json: Record = {}; if (msg.scalarExtension) { - json[\\"scalarExtension\\"] = msg.scalarExtension; + json.scalarExtension = msg.scalarExtension; } if (msg.enumExtension) { - json[\\"enumExtension\\"] = msg.enumExtension; + json.enumExtension = msg.enumExtension; } if (msg.dynamicEnumExtension) { - json[\\"dynamicEnumExtension\\"] = msg.dynamicEnumExtension; + json.dynamicEnumExtension = msg.dynamicEnumExtension; } if (msg.messageExtension) { const messageExtension = ForeignMessage._writeMessageJSON( msg.messageExtension ); if (Object.keys(messageExtension).length > 0) { - json[\\"messageExtension\\"] = messageExtension; + json.messageExtension = messageExtension; } } if (msg.dynamicMessageExtension) { @@ -71065,14 +72445,14 @@ export const TestDynamicExtensions = { msg.dynamicMessageExtension ); if (Object.keys(dynamicMessageExtension).length > 0) { - json[\\"dynamicMessageExtension\\"] = dynamicMessageExtension; + json.dynamicMessageExtension = dynamicMessageExtension; } } if (msg.repeatedExtension?.length) { - json[\\"repeatedExtension\\"] = msg.repeatedExtension; + json.repeatedExtension = msg.repeatedExtension; } if (msg.packedExtension?.length) { - json[\\"packedExtension\\"] = msg.packedExtension; + json.packedExtension = msg.packedExtension; } return json; }, @@ -71135,27 +72515,27 @@ export const TestDynamicExtensions = { msg: TestDynamicExtensions, json: any ): TestDynamicExtensions { - const scalarExtension = json[\\"scalarExtension\\"] ?? json.scalar_extension; + const scalarExtension = json.scalarExtension ?? json.scalar_extension; if (scalarExtension) { msg.scalarExtension = scalarExtension; } - const enumExtension = json[\\"enumExtension\\"] ?? json.enum_extension; + const enumExtension = json.enumExtension ?? json.enum_extension; if (enumExtension) { msg.enumExtension = enumExtension; } const dynamicEnumExtension = - json[\\"dynamicEnumExtension\\"] ?? json.dynamic_enum_extension; + json.dynamicEnumExtension ?? json.dynamic_enum_extension; if (dynamicEnumExtension) { msg.dynamicEnumExtension = dynamicEnumExtension; } - const messageExtension = json[\\"messageExtension\\"] ?? json.message_extension; + const messageExtension = json.messageExtension ?? json.message_extension; if (messageExtension) { const m = ForeignMessage.initialize(); ForeignMessage._readMessageJSON(m, messageExtension); msg.messageExtension = m; } const dynamicMessageExtension = - json[\\"dynamicMessageExtension\\"] ?? json.dynamic_message_extension; + json.dynamicMessageExtension ?? json.dynamic_message_extension; if (dynamicMessageExtension) { const m = TestDynamicExtensions.DynamicMessageType.initialize(); TestDynamicExtensions.DynamicMessageType._readMessageJSON( @@ -71164,12 +72544,11 @@ export const TestDynamicExtensions = { ); msg.dynamicMessageExtension = m; } - const repeatedExtension = - json[\\"repeatedExtension\\"] ?? json.repeated_extension; + const repeatedExtension = json.repeatedExtension ?? json.repeated_extension; if (repeatedExtension) { msg.repeatedExtension = repeatedExtension; } - const packedExtension = json[\\"packedExtension\\"] ?? json.packed_extension; + const packedExtension = json.packedExtension ?? json.packed_extension; if (packedExtension) { msg.packedExtension = packedExtension; } @@ -71262,7 +72641,7 @@ export const TestDynamicExtensions = { ): Record { const json: Record = {}; if (msg.dynamicField) { - json[\\"dynamicField\\"] = msg.dynamicField; + json.dynamicField = msg.dynamicField; } return json; }, @@ -71297,7 +72676,7 @@ export const TestDynamicExtensions = { msg: TestDynamicExtensions.DynamicMessageType, json: any ): TestDynamicExtensions.DynamicMessageType { - const dynamicField = json[\\"dynamicField\\"] ?? json.dynamic_field; + const dynamicField = json.dynamicField ?? json.dynamic_field; if (dynamicField) { msg.dynamicField = dynamicField; } @@ -71380,16 +72759,16 @@ export const TestRepeatedScalarDifferentTagSizes = { writer.writeRepeatedInt32(13, msg.repeatedInt32); } if (msg.repeatedFixed64?.length) { - writer.writeRepeatedFixed64String(2046, msg.repeatedFixed64); + writer.writeRepeatedFixed64String(2046, msg.repeatedFixed64.toString()); } if (msg.repeatedInt64?.length) { - writer.writeRepeatedInt64String(2047, msg.repeatedInt64); + writer.writeRepeatedInt64String(2047, msg.repeatedInt64.toString()); } if (msg.repeatedFloat?.length) { writer.writeRepeatedFloat(262142, msg.repeatedFloat); } if (msg.repeatedUint64?.length) { - writer.writeRepeatedUint64String(262143, msg.repeatedUint64); + writer.writeRepeatedUint64String(262143, msg.repeatedUint64.toString()); } return writer; }, @@ -71402,22 +72781,22 @@ export const TestRepeatedScalarDifferentTagSizes = { ): Record { const json: Record = {}; if (msg.repeatedFixed32?.length) { - json[\\"repeatedFixed32\\"] = msg.repeatedFixed32; + json.repeatedFixed32 = msg.repeatedFixed32; } if (msg.repeatedInt32?.length) { - json[\\"repeatedInt32\\"] = msg.repeatedInt32; + json.repeatedInt32 = msg.repeatedInt32; } if (msg.repeatedFixed64?.length) { - json[\\"repeatedFixed64\\"] = msg.repeatedFixed64; + json.repeatedFixed64 = msg.repeatedFixed64.map((x) => x.toString()); } if (msg.repeatedInt64?.length) { - json[\\"repeatedInt64\\"] = msg.repeatedInt64; + json.repeatedInt64 = msg.repeatedInt64.map((x) => x.toString()); } if (msg.repeatedFloat?.length) { - json[\\"repeatedFloat\\"] = msg.repeatedFloat; + json.repeatedFloat = msg.repeatedFloat; } if (msg.repeatedUint64?.length) { - json[\\"repeatedUint64\\"] = msg.repeatedUint64; + json.repeatedUint64 = msg.repeatedUint64.map((x) => x.toString()); } return json; }, @@ -71441,11 +72820,11 @@ export const TestRepeatedScalarDifferentTagSizes = { break; } case 2046: { - msg.repeatedFixed64.push(reader.readFixed64String()); + msg.repeatedFixed64 = reader.readFixed64String().map(BigInt); break; } case 2047: { - msg.repeatedInt64.push(reader.readInt64String()); + msg.repeatedInt64 = reader.readInt64String().map(BigInt); break; } case 262142: { @@ -71453,7 +72832,7 @@ export const TestRepeatedScalarDifferentTagSizes = { break; } case 262143: { - msg.repeatedUint64.push(reader.readUint64String()); + msg.repeatedUint64 = reader.readUint64String().map(BigInt); break; } default: { @@ -71472,29 +72851,29 @@ export const TestRepeatedScalarDifferentTagSizes = { msg: TestRepeatedScalarDifferentTagSizes, json: any ): TestRepeatedScalarDifferentTagSizes { - const repeatedFixed32 = json[\\"repeatedFixed32\\"] ?? json.repeated_fixed32; + const repeatedFixed32 = json.repeatedFixed32 ?? json.repeated_fixed32; if (repeatedFixed32) { msg.repeatedFixed32 = repeatedFixed32; } - const repeatedInt32 = json[\\"repeatedInt32\\"] ?? json.repeated_int32; + const repeatedInt32 = json.repeatedInt32 ?? json.repeated_int32; if (repeatedInt32) { msg.repeatedInt32 = repeatedInt32; } - const repeatedFixed64 = json[\\"repeatedFixed64\\"] ?? json.repeated_fixed64; + const repeatedFixed64 = json.repeatedFixed64 ?? json.repeated_fixed64; if (repeatedFixed64) { - msg.repeatedFixed64 = repeatedFixed64; + msg.repeatedFixed64 = repeatedFixed64.map(BigInt); } - const repeatedInt64 = json[\\"repeatedInt64\\"] ?? json.repeated_int64; + const repeatedInt64 = json.repeatedInt64 ?? json.repeated_int64; if (repeatedInt64) { - msg.repeatedInt64 = repeatedInt64; + msg.repeatedInt64 = repeatedInt64.map(BigInt); } - const repeatedFloat = json[\\"repeatedFloat\\"] ?? json.repeated_float; + const repeatedFloat = json.repeatedFloat ?? json.repeated_float; if (repeatedFloat) { msg.repeatedFloat = repeatedFloat; } - const repeatedUint64 = json[\\"repeatedUint64\\"] ?? json.repeated_uint64; + const repeatedUint64 = json.repeatedUint64 ?? json.repeated_uint64; if (repeatedUint64) { - msg.repeatedUint64 = repeatedUint64; + msg.repeatedUint64 = repeatedUint64.map(BigInt); } return msg; }, @@ -71584,7 +72963,7 @@ export const TestParsingMerge = { msg.requiredAllTypes ); if (Object.keys(requiredAllTypes).length > 0) { - json[\\"requiredAllTypes\\"] = requiredAllTypes; + json.requiredAllTypes = requiredAllTypes; } } if (msg.optionalAllTypes) { @@ -71592,11 +72971,11 @@ export const TestParsingMerge = { msg.optionalAllTypes ); if (Object.keys(optionalAllTypes).length > 0) { - json[\\"optionalAllTypes\\"] = optionalAllTypes; + json.optionalAllTypes = optionalAllTypes; } } if (msg.repeatedAllTypes?.length) { - json[\\"repeatedAllTypes\\"] = msg.repeatedAllTypes.map( + json.repeatedAllTypes = msg.repeatedAllTypes.map( TestAllTypes._writeMessageJSON ); } @@ -71643,22 +73022,19 @@ export const TestParsingMerge = { msg: TestParsingMerge, json: any ): TestParsingMerge { - const requiredAllTypes = - json[\\"requiredAllTypes\\"] ?? json.required_all_types; + const requiredAllTypes = json.requiredAllTypes ?? json.required_all_types; if (requiredAllTypes) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, requiredAllTypes); msg.requiredAllTypes = m; } - const optionalAllTypes = - json[\\"optionalAllTypes\\"] ?? json.optional_all_types; + const optionalAllTypes = json.optionalAllTypes ?? json.optional_all_types; if (optionalAllTypes) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, optionalAllTypes); msg.optionalAllTypes = m; } - const repeatedAllTypes = - json[\\"repeatedAllTypes\\"] ?? json.repeated_all_types; + const repeatedAllTypes = json.repeatedAllTypes ?? json.repeated_all_types; if (repeatedAllTypes) { for (const item of repeatedAllTypes) { const m = TestAllTypes.initialize(); @@ -71785,19 +73161,19 @@ export const TestParsingMerge = { ): Record { const json: Record = {}; if (msg.field1?.length) { - json[\\"field1\\"] = msg.field1.map(TestAllTypes._writeMessageJSON); + json.field1 = msg.field1.map(TestAllTypes._writeMessageJSON); } if (msg.field2?.length) { - json[\\"field2\\"] = msg.field2.map(TestAllTypes._writeMessageJSON); + json.field2 = msg.field2.map(TestAllTypes._writeMessageJSON); } if (msg.field3?.length) { - json[\\"field3\\"] = msg.field3.map(TestAllTypes._writeMessageJSON); + json.field3 = msg.field3.map(TestAllTypes._writeMessageJSON); } if (msg.ext1?.length) { - json[\\"ext1\\"] = msg.ext1.map(TestAllTypes._writeMessageJSON); + json.ext1 = msg.ext1.map(TestAllTypes._writeMessageJSON); } if (msg.ext2?.length) { - json[\\"ext2\\"] = msg.ext2.map(TestAllTypes._writeMessageJSON); + json.ext2 = msg.ext2.map(TestAllTypes._writeMessageJSON); } return json; }, @@ -71858,7 +73234,7 @@ export const TestParsingMerge = { msg: TestParsingMerge.RepeatedFieldsGenerator, json: any ): TestParsingMerge.RepeatedFieldsGenerator { - const field1 = json[\\"field1\\"] ?? json.field1; + const field1 = json.field1 ?? json.field1; if (field1) { for (const item of field1) { const m = TestAllTypes.initialize(); @@ -71866,7 +73242,7 @@ export const TestParsingMerge = { msg.field1.push(m); } } - const field2 = json[\\"field2\\"] ?? json.field2; + const field2 = json.field2 ?? json.field2; if (field2) { for (const item of field2) { const m = TestAllTypes.initialize(); @@ -71874,7 +73250,7 @@ export const TestParsingMerge = { msg.field2.push(m); } } - const field3 = json[\\"field3\\"] ?? json.field3; + const field3 = json.field3 ?? json.field3; if (field3) { for (const item of field3) { const m = TestAllTypes.initialize(); @@ -71882,7 +73258,7 @@ export const TestParsingMerge = { msg.field3.push(m); } } - const ext1 = json[\\"ext1\\"] ?? json.ext1; + const ext1 = json.ext1 ?? json.ext1; if (ext1) { for (const item of ext1) { const m = TestAllTypes.initialize(); @@ -71890,7 +73266,7 @@ export const TestParsingMerge = { msg.ext1.push(m); } } - const ext2 = json[\\"ext2\\"] ?? json.ext2; + const ext2 = json.ext2 ?? json.ext2; if (ext2) { for (const item of ext2) { const m = TestAllTypes.initialize(); @@ -71983,7 +73359,7 @@ export const TestParsingMerge = { if (msg.field1) { const field1 = TestAllTypes._writeMessageJSON(msg.field1); if (Object.keys(field1).length > 0) { - json[\\"field1\\"] = field1; + json.field1 = field1; } } return json; @@ -72019,7 +73395,7 @@ export const TestParsingMerge = { msg: TestParsingMerge.RepeatedFieldsGenerator.Group1, json: any ): TestParsingMerge.RepeatedFieldsGenerator.Group1 { - const field1 = json[\\"field1\\"] ?? json.field1; + const field1 = json.field1 ?? json.field1; if (field1) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, field1); @@ -72111,7 +73487,7 @@ export const TestParsingMerge = { if (msg.field1) { const field1 = TestAllTypes._writeMessageJSON(msg.field1); if (Object.keys(field1).length > 0) { - json[\\"field1\\"] = field1; + json.field1 = field1; } } return json; @@ -72147,7 +73523,7 @@ export const TestParsingMerge = { msg: TestParsingMerge.RepeatedFieldsGenerator.Group2, json: any ): TestParsingMerge.RepeatedFieldsGenerator.Group2 { - const field1 = json[\\"field1\\"] ?? json.field1; + const field1 = json.field1 ?? json.field1; if (field1) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, field1); @@ -72240,7 +73616,7 @@ export const TestParsingMerge = { msg.optionalGroupAllTypes ); if (Object.keys(optionalGroupAllTypes).length > 0) { - json[\\"optionalGroupAllTypes\\"] = optionalGroupAllTypes; + json.optionalGroupAllTypes = optionalGroupAllTypes; } } return json; @@ -72280,7 +73656,7 @@ export const TestParsingMerge = { json: any ): TestParsingMerge.OptionalGroup { const optionalGroupAllTypes = - json[\\"optionalGroupAllTypes\\"] ?? json.optional_group_all_types; + json.optionalGroupAllTypes ?? json.optional_group_all_types; if (optionalGroupAllTypes) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, optionalGroupAllTypes); @@ -72372,7 +73748,7 @@ export const TestParsingMerge = { msg.repeatedGroupAllTypes ); if (Object.keys(repeatedGroupAllTypes).length > 0) { - json[\\"repeatedGroupAllTypes\\"] = repeatedGroupAllTypes; + json.repeatedGroupAllTypes = repeatedGroupAllTypes; } } return json; @@ -72412,7 +73788,7 @@ export const TestParsingMerge = { json: any ): TestParsingMerge.RepeatedGroup { const repeatedGroupAllTypes = - json[\\"repeatedGroupAllTypes\\"] ?? json.repeated_group_all_types; + json.repeatedGroupAllTypes ?? json.repeated_group_all_types; if (repeatedGroupAllTypes) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, repeatedGroupAllTypes); @@ -72497,7 +73873,7 @@ export const TestCommentInjectionMessage = { ): Record { const json: Record = {}; if (msg.a) { - json[\\"a\\"] = msg.a; + json.a = msg.a; } return json; }, @@ -72532,7 +73908,7 @@ export const TestCommentInjectionMessage = { msg: TestCommentInjectionMessage, json: any ): TestCommentInjectionMessage { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { msg.a = a; } @@ -72926,25 +74302,25 @@ export const TestJsonName = { ): Record { const json: Record = {}; if (msg.fieldName1) { - json[\\"fieldName1\\"] = msg.fieldName1; + json.fieldName1 = msg.fieldName1; } if (msg.fieldName2) { - json[\\"fieldName2\\"] = msg.fieldName2; + json.fieldName2 = msg.fieldName2; } if (msg.FieldName3) { - json[\\"FieldName3\\"] = msg.FieldName3; + json.FieldName3 = msg.FieldName3; } if (msg.FieldName4) { - json[\\"FieldName4\\"] = msg.FieldName4; + json.FieldName4 = msg.FieldName4; } if (msg.FIELDNAME5) { - json[\\"FIELDNAME5\\"] = msg.FIELDNAME5; + json.FIELDNAME5 = msg.FIELDNAME5; } if (msg.fieldName6) { json[\\"@type\\"] = msg.fieldName6; } if (msg.fieldname7) { - json[\\"fieldname7\\"] = msg.fieldname7; + json.fieldname7 = msg.fieldname7; } return json; }, @@ -73000,23 +74376,23 @@ export const TestJsonName = { * @private */ _readMessageJSON: function (msg: TestJsonName, json: any): TestJsonName { - const fieldName1 = json[\\"fieldName1\\"] ?? json.field_name1; + const fieldName1 = json.fieldName1 ?? json.field_name1; if (fieldName1) { msg.fieldName1 = fieldName1; } - const fieldName2 = json[\\"fieldName2\\"] ?? json.fieldName2; + const fieldName2 = json.fieldName2 ?? json.fieldName2; if (fieldName2) { msg.fieldName2 = fieldName2; } - const FieldName3 = json[\\"FieldName3\\"] ?? json.FieldName3; + const FieldName3 = json.FieldName3 ?? json.FieldName3; if (FieldName3) { msg.FieldName3 = FieldName3; } - const FieldName4 = json[\\"FieldName4\\"] ?? json._field_name4; + const FieldName4 = json.FieldName4 ?? json._field_name4; if (FieldName4) { msg.FieldName4 = FieldName4; } - const FIELDNAME5 = json[\\"FIELDNAME5\\"] ?? json.FIELD_NAME5; + const FIELDNAME5 = json.FIELDNAME5 ?? json.FIELD_NAME5; if (FIELDNAME5) { msg.FIELDNAME5 = FIELDNAME5; } @@ -73024,7 +74400,7 @@ export const TestJsonName = { if (fieldName6) { msg.fieldName6 = fieldName6; } - const fieldname7 = json[\\"fieldname7\\"] ?? json.fieldname7; + const fieldname7 = json.fieldname7 ?? json.fieldname7; if (fieldname7) { msg.fieldname7 = fieldname7; } @@ -73130,11 +74506,13 @@ export const TestHugeFieldNumbers = { ); } if (msg.stringStringMap) { - for (const key in msg.stringStringMap) { - writer.writeMessage(536870010, {}, (_, mapWriter) => { - mapWriter.writeString(1, key as unknown as string); - mapWriter.writeString(2, msg.stringStringMap![key]); - }); + for (const [key, value] of Object.entries(msg.stringStringMap)) { + if (key && value) { + writer.writeMessage(536870010, {}, (_, mapWriter) => { + mapWriter.writeString(1, key as any); + mapWriter.writeString(2, value); + }); + } } } if (msg.oneofUint32 != undefined) { @@ -73164,55 +74542,61 @@ export const TestHugeFieldNumbers = { ): Record { const json: Record = {}; if (msg.optionalInt32) { - json[\\"optionalInt32\\"] = msg.optionalInt32; + json.optionalInt32 = msg.optionalInt32; } if (msg.fixed32) { - json[\\"fixed32\\"] = msg.fixed32; + json.fixed32 = msg.fixed32; } if (msg.repeatedInt32?.length) { - json[\\"repeatedInt32\\"] = msg.repeatedInt32; + json.repeatedInt32 = msg.repeatedInt32; } if (msg.packedInt32?.length) { - json[\\"packedInt32\\"] = msg.packedInt32; + json.packedInt32 = msg.packedInt32; } if (msg.optionalEnum) { - json[\\"optionalEnum\\"] = msg.optionalEnum; + json.optionalEnum = msg.optionalEnum; } if (msg.optionalString) { - json[\\"optionalString\\"] = msg.optionalString; + json.optionalString = msg.optionalString; } if (msg.optionalBytes) { - json[\\"optionalBytes\\"] = msg.optionalBytes; + json.optionalBytes = msg.optionalBytes; } if (msg.optionalMessage) { const optionalMessage = ForeignMessage._writeMessageJSON( msg.optionalMessage ); if (Object.keys(optionalMessage).length > 0) { - json[\\"optionalMessage\\"] = optionalMessage; + json.optionalMessage = optionalMessage; } } if (msg.stringStringMap) { - if (Object.keys(msg.stringStringMap).length > 0) { - json[\\"stringStringMap\\"] = msg.stringStringMap; + if (msg.stringStringMap) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.stringStringMap)) { + if (key && value) { + map[key] = value; + json.stringStringMap = map; + } + } } } if (msg.oneofUint32 != undefined) { - json[\\"oneofUint32\\"] = msg.oneofUint32; + json.oneofUint32 = msg.oneofUint32; } if (msg.oneofTestAllTypes != undefined) { const oneofTestAllTypes = TestAllTypes._writeMessageJSON( msg.oneofTestAllTypes ); if (Object.keys(oneofTestAllTypes).length > 0) { - json[\\"oneofTestAllTypes\\"] = oneofTestAllTypes; + json.oneofTestAllTypes = oneofTestAllTypes; } } if (msg.oneofString != undefined) { - json[\\"oneofString\\"] = msg.oneofString; + json.oneofString = msg.oneofString; } if (msg.oneofBytes != undefined) { - json[\\"oneofBytes\\"] = msg.oneofBytes; + json.oneofBytes = msg.oneofBytes; } return json; }, @@ -73314,60 +74698,62 @@ export const TestHugeFieldNumbers = { msg: TestHugeFieldNumbers, json: any ): TestHugeFieldNumbers { - const optionalInt32 = json[\\"optionalInt32\\"] ?? json.optional_int32; + const optionalInt32 = json.optionalInt32 ?? json.optional_int32; if (optionalInt32) { msg.optionalInt32 = optionalInt32; } - const fixed32 = json[\\"fixed32\\"] ?? json.fixed_32; + const fixed32 = json.fixed32 ?? json.fixed_32; if (fixed32) { msg.fixed32 = fixed32; } - const repeatedInt32 = json[\\"repeatedInt32\\"] ?? json.repeated_int32; + const repeatedInt32 = json.repeatedInt32 ?? json.repeated_int32; if (repeatedInt32) { msg.repeatedInt32 = repeatedInt32; } - const packedInt32 = json[\\"packedInt32\\"] ?? json.packed_int32; + const packedInt32 = json.packedInt32 ?? json.packed_int32; if (packedInt32) { msg.packedInt32 = packedInt32; } - const optionalEnum = json[\\"optionalEnum\\"] ?? json.optional_enum; + const optionalEnum = json.optionalEnum ?? json.optional_enum; if (optionalEnum) { msg.optionalEnum = optionalEnum; } - const optionalString = json[\\"optionalString\\"] ?? json.optional_string; + const optionalString = json.optionalString ?? json.optional_string; if (optionalString) { msg.optionalString = optionalString; } - const optionalBytes = json[\\"optionalBytes\\"] ?? json.optional_bytes; + const optionalBytes = json.optionalBytes ?? json.optional_bytes; if (optionalBytes) { msg.optionalBytes = optionalBytes; } - const optionalMessage = json[\\"optionalMessage\\"] ?? json.optional_message; + const optionalMessage = json.optionalMessage ?? json.optional_message; if (optionalMessage) { const m = ForeignMessage.initialize(); ForeignMessage._readMessageJSON(m, optionalMessage); msg.optionalMessage = m; } - const stringStringMap = json[\\"stringStringMap\\"] ?? json.string_string_map; + const stringStringMap = json.stringStringMap ?? json.string_string_map; if (stringStringMap) { - msg.stringStringMap = stringStringMap; + for (const [key, value] of Object.entries(stringStringMap)) { + msg.stringStringMap[key] = value; + } } - const oneofUint32 = json[\\"oneofUint32\\"] ?? json.oneof_uint32; + const oneofUint32 = json.oneofUint32 ?? json.oneof_uint32; if (oneofUint32) { msg.oneofUint32 = oneofUint32; } const oneofTestAllTypes = - json[\\"oneofTestAllTypes\\"] ?? json.oneof_test_all_types; + json.oneofTestAllTypes ?? json.oneof_test_all_types; if (oneofTestAllTypes) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, oneofTestAllTypes); msg.oneofTestAllTypes = m; } - const oneofString = json[\\"oneofString\\"] ?? json.oneof_string; + const oneofString = json.oneofString ?? json.oneof_string; if (oneofString) { msg.oneofString = oneofString; } - const oneofBytes = json[\\"oneofBytes\\"] ?? json.oneof_bytes; + const oneofBytes = json.oneofBytes ?? json.oneof_bytes; if (oneofBytes) { msg.oneofBytes = oneofBytes; } @@ -73448,7 +74834,7 @@ export const TestHugeFieldNumbers = { ): Record { const json: Record = {}; if (msg.groupA) { - json[\\"groupA\\"] = msg.groupA; + json.groupA = msg.groupA; } return json; }, @@ -73483,7 +74869,7 @@ export const TestHugeFieldNumbers = { msg: TestHugeFieldNumbers.OptionalGroup, json: any ): TestHugeFieldNumbers.OptionalGroup { - const groupA = json[\\"groupA\\"] ?? json.group_a; + const groupA = json.groupA ?? json.group_a; if (groupA) { msg.groupA = groupA; } @@ -73598,31 +74984,31 @@ export const TestExtensionInsideTable = { ): Record { const json: Record = {}; if (msg.field1) { - json[\\"field1\\"] = msg.field1; + json.field1 = msg.field1; } if (msg.field2) { - json[\\"field2\\"] = msg.field2; + json.field2 = msg.field2; } if (msg.field3) { - json[\\"field3\\"] = msg.field3; + json.field3 = msg.field3; } if (msg.field4) { - json[\\"field4\\"] = msg.field4; + json.field4 = msg.field4; } if (msg.field6) { - json[\\"field6\\"] = msg.field6; + json.field6 = msg.field6; } if (msg.field7) { - json[\\"field7\\"] = msg.field7; + json.field7 = msg.field7; } if (msg.field8) { - json[\\"field8\\"] = msg.field8; + json.field8 = msg.field8; } if (msg.field9) { - json[\\"field9\\"] = msg.field9; + json.field9 = msg.field9; } if (msg.field10) { - json[\\"field10\\"] = msg.field10; + json.field10 = msg.field10; } return json; }, @@ -73689,39 +75075,39 @@ export const TestExtensionInsideTable = { msg: TestExtensionInsideTable, json: any ): TestExtensionInsideTable { - const field1 = json[\\"field1\\"] ?? json.field1; + const field1 = json.field1 ?? json.field1; if (field1) { msg.field1 = field1; } - const field2 = json[\\"field2\\"] ?? json.field2; + const field2 = json.field2 ?? json.field2; if (field2) { msg.field2 = field2; } - const field3 = json[\\"field3\\"] ?? json.field3; + const field3 = json.field3 ?? json.field3; if (field3) { msg.field3 = field3; } - const field4 = json[\\"field4\\"] ?? json.field4; + const field4 = json.field4 ?? json.field4; if (field4) { msg.field4 = field4; } - const field6 = json[\\"field6\\"] ?? json.field6; + const field6 = json.field6 ?? json.field6; if (field6) { msg.field6 = field6; } - const field7 = json[\\"field7\\"] ?? json.field7; + const field7 = json.field7 ?? json.field7; if (field7) { msg.field7 = field7; } - const field8 = json[\\"field8\\"] ?? json.field8; + const field8 = json.field8 ?? json.field8; if (field8) { msg.field8 = field8; } - const field9 = json[\\"field9\\"] ?? json.field9; + const field9 = json.field9 ?? json.field9; if (field9) { msg.field9 = field9; } - const field10 = json[\\"field10\\"] ?? json.field10; + const field10 = json.field10 ?? json.field10; if (field10) { msg.field10 = field10; } @@ -73815,16 +75201,16 @@ export const TestExtensionRangeSerialize = { ): Record { const json: Record = {}; if (msg.fooOne) { - json[\\"fooOne\\"] = msg.fooOne; + json.fooOne = msg.fooOne; } if (msg.fooTwo) { - json[\\"fooTwo\\"] = msg.fooTwo; + json.fooTwo = msg.fooTwo; } if (msg.fooThree) { - json[\\"fooThree\\"] = msg.fooThree; + json.fooThree = msg.fooThree; } if (msg.fooFour) { - json[\\"fooFour\\"] = msg.fooFour; + json.fooFour = msg.fooFour; } return json; }, @@ -73871,19 +75257,19 @@ export const TestExtensionRangeSerialize = { msg: TestExtensionRangeSerialize, json: any ): TestExtensionRangeSerialize { - const fooOne = json[\\"fooOne\\"] ?? json.foo_one; + const fooOne = json.fooOne ?? json.foo_one; if (fooOne) { msg.fooOne = fooOne; } - const fooTwo = json[\\"fooTwo\\"] ?? json.foo_two; + const fooTwo = json.fooTwo ?? json.foo_two; if (fooTwo) { msg.fooTwo = fooTwo; } - const fooThree = json[\\"fooThree\\"] ?? json.foo_three; + const fooThree = json.fooThree ?? json.foo_three; if (fooThree) { msg.fooThree = fooThree; } - const fooFour = json[\\"fooFour\\"] ?? json.foo_four; + const fooFour = json.fooFour ?? json.foo_four; if (fooFour) { msg.fooFour = fooFour; } @@ -73933,15 +75319,15 @@ export type MapEnum = typeof MapEnum[keyof typeof MapEnum]; */ export interface TestMap { mapInt32Int32: Record; - mapInt64Int64: Record; + mapInt64Int64: Record; mapUint32Uint32: Record; - mapUint64Uint64: Record; + mapUint64Uint64: Record; mapSint32Sint32: Record; - mapSint64Sint64: Record; + mapSint64Sint64: Record; mapFixed32Fixed32: Record; - mapFixed64Fixed64: Record; + mapFixed64Fixed64: Record; mapSfixed32Sfixed32: Record; - mapSfixed64Sfixed64: Record; + mapSfixed64Sfixed64: Record; mapInt32Float: Record; mapInt32Double: Record; mapBoolBool: Record; @@ -73978,15 +75364,15 @@ export interface TestRequiredMessageMap { export interface TestArenaMap { mapInt32Int32: Record; - mapInt64Int64: Record; + mapInt64Int64: Record; mapUint32Uint32: Record; - mapUint64Uint64: Record; + mapUint64Uint64: Record; mapSint32Sint32: Record; - mapSint64Sint64: Record; + mapSint64Sint64: Record; mapFixed32Fixed32: Record; - mapFixed64Fixed64: Record; + mapFixed64Fixed64: Record; mapSfixed32Sfixed32: Record; - mapSfixed64Sfixed64: Record; + mapSfixed64Sfixed64: Record; mapInt32Float: Record; mapInt32Double: Record; mapBoolBool: Record; @@ -74081,155 +75467,193 @@ export const TestMap = { writer: BinaryWriter ): BinaryWriter { if (msg.mapInt32Int32) { - for (const key in msg.mapInt32Int32) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeInt32(2, msg.mapInt32Int32![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Int32)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeInt32(2, value); + }); + } } } if (msg.mapInt64Int64) { - for (const key in msg.mapInt64Int64) { - writer.writeMessage(2, {}, (_, mapWriter) => { - mapWriter.writeInt64String(1, key as unknown as string); - mapWriter.writeInt64String(2, msg.mapInt64Int64![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt64Int64)) { + if (key && value) { + writer.writeMessage(2, {}, (_, mapWriter) => { + mapWriter.writeInt64String(1, key as any); + mapWriter.writeInt64String(2, value.toString()); + }); + } } } if (msg.mapUint32Uint32) { - for (const key in msg.mapUint32Uint32) { - writer.writeMessage(3, {}, (_, mapWriter) => { - mapWriter.writeUint32(1, key as unknown as number); - mapWriter.writeUint32(2, msg.mapUint32Uint32![key]); - }); + for (const [key, value] of Object.entries(msg.mapUint32Uint32)) { + if (key && value) { + writer.writeMessage(3, {}, (_, mapWriter) => { + mapWriter.writeUint32(1, key as any); + mapWriter.writeUint32(2, value); + }); + } } } if (msg.mapUint64Uint64) { - for (const key in msg.mapUint64Uint64) { - writer.writeMessage(4, {}, (_, mapWriter) => { - mapWriter.writeUint64String(1, key as unknown as string); - mapWriter.writeUint64String(2, msg.mapUint64Uint64![key]); - }); + for (const [key, value] of Object.entries(msg.mapUint64Uint64)) { + if (key && value) { + writer.writeMessage(4, {}, (_, mapWriter) => { + mapWriter.writeUint64String(1, key as any); + mapWriter.writeUint64String(2, value.toString()); + }); + } } } if (msg.mapSint32Sint32) { - for (const key in msg.mapSint32Sint32) { - writer.writeMessage(5, {}, (_, mapWriter) => { - mapWriter.writeSint32(1, key as unknown as number); - mapWriter.writeSint32(2, msg.mapSint32Sint32![key]); - }); + for (const [key, value] of Object.entries(msg.mapSint32Sint32)) { + if (key && value) { + writer.writeMessage(5, {}, (_, mapWriter) => { + mapWriter.writeSint32(1, key as any); + mapWriter.writeSint32(2, value); + }); + } } } if (msg.mapSint64Sint64) { - for (const key in msg.mapSint64Sint64) { - writer.writeMessage(6, {}, (_, mapWriter) => { - mapWriter.writeSint64String(1, key as unknown as string); - mapWriter.writeSint64String(2, msg.mapSint64Sint64![key]); - }); + for (const [key, value] of Object.entries(msg.mapSint64Sint64)) { + if (key && value) { + writer.writeMessage(6, {}, (_, mapWriter) => { + mapWriter.writeSint64String(1, key as any); + mapWriter.writeSint64String(2, value.toString()); + }); + } } } if (msg.mapFixed32Fixed32) { - for (const key in msg.mapFixed32Fixed32) { - writer.writeMessage(7, {}, (_, mapWriter) => { - mapWriter.writeFixed32(1, key as unknown as number); - mapWriter.writeFixed32(2, msg.mapFixed32Fixed32![key]); - }); + for (const [key, value] of Object.entries(msg.mapFixed32Fixed32)) { + if (key && value) { + writer.writeMessage(7, {}, (_, mapWriter) => { + mapWriter.writeFixed32(1, key as any); + mapWriter.writeFixed32(2, value); + }); + } } } if (msg.mapFixed64Fixed64) { - for (const key in msg.mapFixed64Fixed64) { - writer.writeMessage(8, {}, (_, mapWriter) => { - mapWriter.writeFixed64String(1, key as unknown as string); - mapWriter.writeFixed64String(2, msg.mapFixed64Fixed64![key]); - }); + for (const [key, value] of Object.entries(msg.mapFixed64Fixed64)) { + if (key && value) { + writer.writeMessage(8, {}, (_, mapWriter) => { + mapWriter.writeFixed64String(1, key as any); + mapWriter.writeFixed64String(2, value.toString()); + }); + } } } if (msg.mapSfixed32Sfixed32) { - for (const key in msg.mapSfixed32Sfixed32) { - writer.writeMessage(9, {}, (_, mapWriter) => { - mapWriter.writeSfixed32(1, key as unknown as number); - mapWriter.writeSfixed32(2, msg.mapSfixed32Sfixed32![key]); - }); + for (const [key, value] of Object.entries(msg.mapSfixed32Sfixed32)) { + if (key && value) { + writer.writeMessage(9, {}, (_, mapWriter) => { + mapWriter.writeSfixed32(1, key as any); + mapWriter.writeSfixed32(2, value); + }); + } } } if (msg.mapSfixed64Sfixed64) { - for (const key in msg.mapSfixed64Sfixed64) { - writer.writeMessage(10, {}, (_, mapWriter) => { - mapWriter.writeSfixed64(1, key as unknown as string); - mapWriter.writeSfixed64(2, msg.mapSfixed64Sfixed64![key]); - }); + for (const [key, value] of Object.entries(msg.mapSfixed64Sfixed64)) { + if (key && value) { + writer.writeMessage(10, {}, (_, mapWriter) => { + mapWriter.writeSfixed64(1, key as any); + mapWriter.writeSfixed64(2, value.toString()); + }); + } } } if (msg.mapInt32Float) { - for (const key in msg.mapInt32Float) { - writer.writeMessage(11, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeFloat(2, msg.mapInt32Float![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Float)) { + if (key && value) { + writer.writeMessage(11, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeFloat(2, value); + }); + } } } if (msg.mapInt32Double) { - for (const key in msg.mapInt32Double) { - writer.writeMessage(12, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeDouble(2, msg.mapInt32Double![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Double)) { + if (key && value) { + writer.writeMessage(12, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeDouble(2, value); + }); + } } } if (msg.mapBoolBool) { - for (const key in msg.mapBoolBool) { - writer.writeMessage(13, {}, (_, mapWriter) => { - mapWriter.writeBool(1, key as unknown as boolean); - mapWriter.writeBool(2, msg.mapBoolBool![key]); - }); + for (const [key, value] of Object.entries(msg.mapBoolBool)) { + if (key && value) { + writer.writeMessage(13, {}, (_, mapWriter) => { + mapWriter.writeBool(1, key as any); + mapWriter.writeBool(2, value); + }); + } } } if (msg.mapStringString) { - for (const key in msg.mapStringString) { - writer.writeMessage(14, {}, (_, mapWriter) => { - mapWriter.writeString(1, key as unknown as string); - mapWriter.writeString(2, msg.mapStringString![key]); - }); + for (const [key, value] of Object.entries(msg.mapStringString)) { + if (key && value) { + writer.writeMessage(14, {}, (_, mapWriter) => { + mapWriter.writeString(1, key as any); + mapWriter.writeString(2, value); + }); + } } } if (msg.mapInt32Bytes) { - for (const key in msg.mapInt32Bytes) { - writer.writeMessage(15, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeBytes(2, msg.mapInt32Bytes![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Bytes)) { + if (key && value) { + writer.writeMessage(15, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeBytes(2, value); + }); + } } } if (msg.mapInt32Enum) { - for (const key in msg.mapInt32Enum) { - writer.writeMessage(16, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeEnum(2, msg.mapInt32Enum![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Enum)) { + if (key && value) { + writer.writeMessage(16, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeEnum(2, value as MapEnum); + }); + } } } if (msg.mapInt32ForeignMessage) { - for (const key in msg.mapInt32ForeignMessage) { - writer.writeMessage(17, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeMessage(2, msg.mapInt32ForeignMessage![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32ForeignMessage)) { + if (key && value) { + writer.writeMessage(17, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeMessage(2, value, ForeignMessage._writeMessage); + }); + } } } if (msg.mapStringForeignMessage) { - for (const key in msg.mapStringForeignMessage) { - writer.writeMessage(18, {}, (_, mapWriter) => { - mapWriter.writeString(1, key as unknown as string); - mapWriter.writeMessage(2, msg.mapStringForeignMessage![key]); - }); + for (const [key, value] of Object.entries(msg.mapStringForeignMessage)) { + if (key && value) { + writer.writeMessage(18, {}, (_, mapWriter) => { + mapWriter.writeString(1, key as any); + mapWriter.writeMessage(2, value, ForeignMessage._writeMessage); + }); + } } } if (msg.mapInt32AllTypes) { - for (const key in msg.mapInt32AllTypes) { - writer.writeMessage(19, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeMessage(2, msg.mapInt32AllTypes![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32AllTypes)) { + if (key && value) { + writer.writeMessage(19, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeMessage(2, value, TestAllTypes._writeMessage); + }); + } } } return writer; @@ -74241,98 +75665,214 @@ export const TestMap = { _writeMessageJSON: function (msg: Partial): Record { const json: Record = {}; if (msg.mapInt32Int32) { - if (Object.keys(msg.mapInt32Int32).length > 0) { - json[\\"mapInt32Int32\\"] = msg.mapInt32Int32; + if (msg.mapInt32Int32) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32Int32)) { + if (key && value) { + map[key] = value; + json.mapInt32Int32 = map; + } + } } } if (msg.mapInt64Int64) { - if (Object.keys(msg.mapInt64Int64).length > 0) { - json[\\"mapInt64Int64\\"] = msg.mapInt64Int64; + if (msg.mapInt64Int64) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt64Int64)) { + if (key && value) { + map[key] = value.toString(); + json.mapInt64Int64 = map; + } + } } } if (msg.mapUint32Uint32) { - if (Object.keys(msg.mapUint32Uint32).length > 0) { - json[\\"mapUint32Uint32\\"] = msg.mapUint32Uint32; + if (msg.mapUint32Uint32) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapUint32Uint32)) { + if (key && value) { + map[key] = value; + json.mapUint32Uint32 = map; + } + } } } if (msg.mapUint64Uint64) { - if (Object.keys(msg.mapUint64Uint64).length > 0) { - json[\\"mapUint64Uint64\\"] = msg.mapUint64Uint64; + if (msg.mapUint64Uint64) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapUint64Uint64)) { + if (key && value) { + map[key] = value.toString(); + json.mapUint64Uint64 = map; + } + } } } if (msg.mapSint32Sint32) { - if (Object.keys(msg.mapSint32Sint32).length > 0) { - json[\\"mapSint32Sint32\\"] = msg.mapSint32Sint32; + if (msg.mapSint32Sint32) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapSint32Sint32)) { + if (key && value) { + map[key] = value; + json.mapSint32Sint32 = map; + } + } } } if (msg.mapSint64Sint64) { - if (Object.keys(msg.mapSint64Sint64).length > 0) { - json[\\"mapSint64Sint64\\"] = msg.mapSint64Sint64; + if (msg.mapSint64Sint64) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapSint64Sint64)) { + if (key && value) { + map[key] = value.toString(); + json.mapSint64Sint64 = map; + } + } } } if (msg.mapFixed32Fixed32) { - if (Object.keys(msg.mapFixed32Fixed32).length > 0) { - json[\\"mapFixed32Fixed32\\"] = msg.mapFixed32Fixed32; + if (msg.mapFixed32Fixed32) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapFixed32Fixed32)) { + if (key && value) { + map[key] = value; + json.mapFixed32Fixed32 = map; + } + } } } if (msg.mapFixed64Fixed64) { - if (Object.keys(msg.mapFixed64Fixed64).length > 0) { - json[\\"mapFixed64Fixed64\\"] = msg.mapFixed64Fixed64; + if (msg.mapFixed64Fixed64) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapFixed64Fixed64)) { + if (key && value) { + map[key] = value.toString(); + json.mapFixed64Fixed64 = map; + } + } } } if (msg.mapSfixed32Sfixed32) { - if (Object.keys(msg.mapSfixed32Sfixed32).length > 0) { - json[\\"mapSfixed32Sfixed32\\"] = msg.mapSfixed32Sfixed32; + if (msg.mapSfixed32Sfixed32) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapSfixed32Sfixed32)) { + if (key && value) { + map[key] = value; + json.mapSfixed32Sfixed32 = map; + } + } } } if (msg.mapSfixed64Sfixed64) { - if (Object.keys(msg.mapSfixed64Sfixed64).length > 0) { - json[\\"mapSfixed64Sfixed64\\"] = msg.mapSfixed64Sfixed64; + if (msg.mapSfixed64Sfixed64) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapSfixed64Sfixed64)) { + if (key && value) { + map[key] = value.toString(); + json.mapSfixed64Sfixed64 = map; + } + } } } if (msg.mapInt32Float) { - if (Object.keys(msg.mapInt32Float).length > 0) { - json[\\"mapInt32Float\\"] = msg.mapInt32Float; + if (msg.mapInt32Float) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32Float)) { + if (key && value) { + map[key] = value; + json.mapInt32Float = map; + } + } } } if (msg.mapInt32Double) { - if (Object.keys(msg.mapInt32Double).length > 0) { - json[\\"mapInt32Double\\"] = msg.mapInt32Double; + if (msg.mapInt32Double) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32Double)) { + if (key && value) { + map[key] = value; + json.mapInt32Double = map; + } + } } } if (msg.mapBoolBool) { - if (Object.keys(msg.mapBoolBool).length > 0) { - json[\\"mapBoolBool\\"] = msg.mapBoolBool; + if (msg.mapBoolBool) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapBoolBool)) { + if (key && value) { + map[key] = value; + json.mapBoolBool = map; + } + } } } if (msg.mapStringString) { - if (Object.keys(msg.mapStringString).length > 0) { - json[\\"mapStringString\\"] = msg.mapStringString; + if (msg.mapStringString) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapStringString)) { + if (key && value) { + map[key] = value; + json.mapStringString = map; + } + } } } if (msg.mapInt32Bytes) { - if (Object.keys(msg.mapInt32Bytes).length > 0) { - json[\\"mapInt32Bytes\\"] = msg.mapInt32Bytes; + if (msg.mapInt32Bytes) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32Bytes)) { + if (key && value) { + map[key] = value; + json.mapInt32Bytes = map; + } + } } } if (msg.mapInt32Enum) { - if (Object.keys(msg.mapInt32Enum).length > 0) { - json[\\"mapInt32Enum\\"] = msg.mapInt32Enum; + if (msg.mapInt32Enum) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32Enum)) { + if (key && value) { + map[key] = value; + json.mapInt32Enum = map; + } + } } } if (msg.mapInt32ForeignMessage) { - if (Object.keys(msg.mapInt32ForeignMessage).length > 0) { - json[\\"mapInt32ForeignMessage\\"] = msg.mapInt32ForeignMessage; + if (msg.mapInt32ForeignMessage) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32ForeignMessage)) { + if (key && value) { + map[key] = ForeignMessage._writeMessageJSON(value); + json.mapInt32ForeignMessage = map; + } + } } } if (msg.mapStringForeignMessage) { - if (Object.keys(msg.mapStringForeignMessage).length > 0) { - json[\\"mapStringForeignMessage\\"] = msg.mapStringForeignMessage; + if (msg.mapStringForeignMessage) { + const map: Record = {}; + for (const [key, value] of Object.entries( + msg.mapStringForeignMessage + )) { + if (key && value) { + map[key] = ForeignMessage._writeMessageJSON(value); + json.mapStringForeignMessage = map; + } + } } } if (msg.mapInt32AllTypes) { - if (Object.keys(msg.mapInt32AllTypes).length > 0) { - json[\\"mapInt32AllTypes\\"] = msg.mapInt32AllTypes; + if (msg.mapInt32AllTypes) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32AllTypes)) { + if (key && value) { + map[key] = TestAllTypes._writeMessageJSON(value); + json.mapInt32AllTypes = map; + } + } } } return json; @@ -74370,8 +75910,8 @@ export const TestMap = { } case 2: { reader.readMessage(undefined, () => { - let key: string | undefined; - let value = \\"\\"; + let key: bigint | undefined; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -74380,7 +75920,7 @@ export const TestMap = { break; } case 2: { - value = reader.readInt64String(); + value = BigInt(reader.readInt64String()); break; } } @@ -74416,8 +75956,8 @@ export const TestMap = { } case 4: { reader.readMessage(undefined, () => { - let key: string | undefined; - let value = \\"\\"; + let key: bigint | undefined; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -74426,7 +75966,7 @@ export const TestMap = { break; } case 2: { - value = reader.readUint64String(); + value = BigInt(reader.readUint64String()); break; } } @@ -74462,8 +76002,8 @@ export const TestMap = { } case 6: { reader.readMessage(undefined, () => { - let key: string | undefined; - let value = \\"\\"; + let key: bigint | undefined; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -74472,7 +76012,7 @@ export const TestMap = { break; } case 2: { - value = reader.readSint64(); + value = BigInt(reader.readSint64()); break; } } @@ -74508,8 +76048,8 @@ export const TestMap = { } case 8: { reader.readMessage(undefined, () => { - let key: string | undefined; - let value = \\"\\"; + let key: bigint | undefined; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -74518,7 +76058,7 @@ export const TestMap = { break; } case 2: { - value = reader.readFixed64String(); + value = BigInt(reader.readFixed64String()); break; } } @@ -74554,8 +76094,8 @@ export const TestMap = { } case 10: { reader.readMessage(undefined, () => { - let key: string | undefined; - let value = \\"\\"; + let key: bigint | undefined; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -74564,7 +76104,7 @@ export const TestMap = { break; } case 2: { - value = reader.readSfixed64(); + value = BigInt(reader.readSfixed64()); break; } } @@ -74702,7 +76242,7 @@ export const TestMap = { break; } case 2: { - value = reader.readEnum(); + value = reader.readEnum() as MapEnum; break; } } @@ -74725,7 +76265,10 @@ export const TestMap = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + ForeignMessage.initialize(), + ForeignMessage._readMessage + ); break; } } @@ -74748,7 +76291,10 @@ export const TestMap = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + ForeignMessage.initialize(), + ForeignMessage._readMessage + ); break; } } @@ -74771,7 +76317,10 @@ export const TestMap = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + TestAllTypes.initialize(), + TestAllTypes._readMessage + ); break; } } @@ -74795,88 +76344,134 @@ export const TestMap = { * @private */ _readMessageJSON: function (msg: TestMap, json: any): TestMap { - const mapInt32Int32 = json[\\"mapInt32Int32\\"] ?? json.map_int32_int32; + const mapInt32Int32 = json.mapInt32Int32 ?? json.map_int32_int32; if (mapInt32Int32) { - msg.mapInt32Int32 = mapInt32Int32; + for (const [key, value] of Object.entries(mapInt32Int32)) { + msg.mapInt32Int32[key] = value; + } } - const mapInt64Int64 = json[\\"mapInt64Int64\\"] ?? json.map_int64_int64; + const mapInt64Int64 = json.mapInt64Int64 ?? json.map_int64_int64; if (mapInt64Int64) { - msg.mapInt64Int64 = mapInt64Int64; + for (const [key, value] of Object.entries(mapInt64Int64)) { + msg.mapInt64Int64[key] = BigInt(value as string); + } } - const mapUint32Uint32 = json[\\"mapUint32Uint32\\"] ?? json.map_uint32_uint32; + const mapUint32Uint32 = json.mapUint32Uint32 ?? json.map_uint32_uint32; if (mapUint32Uint32) { - msg.mapUint32Uint32 = mapUint32Uint32; + for (const [key, value] of Object.entries(mapUint32Uint32)) { + msg.mapUint32Uint32[key] = value; + } } - const mapUint64Uint64 = json[\\"mapUint64Uint64\\"] ?? json.map_uint64_uint64; + const mapUint64Uint64 = json.mapUint64Uint64 ?? json.map_uint64_uint64; if (mapUint64Uint64) { - msg.mapUint64Uint64 = mapUint64Uint64; + for (const [key, value] of Object.entries(mapUint64Uint64)) { + msg.mapUint64Uint64[key] = BigInt(value as string); + } } - const mapSint32Sint32 = json[\\"mapSint32Sint32\\"] ?? json.map_sint32_sint32; + const mapSint32Sint32 = json.mapSint32Sint32 ?? json.map_sint32_sint32; if (mapSint32Sint32) { - msg.mapSint32Sint32 = mapSint32Sint32; + for (const [key, value] of Object.entries(mapSint32Sint32)) { + msg.mapSint32Sint32[key] = value; + } } - const mapSint64Sint64 = json[\\"mapSint64Sint64\\"] ?? json.map_sint64_sint64; + const mapSint64Sint64 = json.mapSint64Sint64 ?? json.map_sint64_sint64; if (mapSint64Sint64) { - msg.mapSint64Sint64 = mapSint64Sint64; + for (const [key, value] of Object.entries(mapSint64Sint64)) { + msg.mapSint64Sint64[key] = BigInt(value as string); + } } const mapFixed32Fixed32 = - json[\\"mapFixed32Fixed32\\"] ?? json.map_fixed32_fixed32; + json.mapFixed32Fixed32 ?? json.map_fixed32_fixed32; if (mapFixed32Fixed32) { - msg.mapFixed32Fixed32 = mapFixed32Fixed32; + for (const [key, value] of Object.entries(mapFixed32Fixed32)) { + msg.mapFixed32Fixed32[key] = value; + } } const mapFixed64Fixed64 = - json[\\"mapFixed64Fixed64\\"] ?? json.map_fixed64_fixed64; + json.mapFixed64Fixed64 ?? json.map_fixed64_fixed64; if (mapFixed64Fixed64) { - msg.mapFixed64Fixed64 = mapFixed64Fixed64; + for (const [key, value] of Object.entries(mapFixed64Fixed64)) { + msg.mapFixed64Fixed64[key] = BigInt(value as string); + } } const mapSfixed32Sfixed32 = - json[\\"mapSfixed32Sfixed32\\"] ?? json.map_sfixed32_sfixed32; + json.mapSfixed32Sfixed32 ?? json.map_sfixed32_sfixed32; if (mapSfixed32Sfixed32) { - msg.mapSfixed32Sfixed32 = mapSfixed32Sfixed32; + for (const [key, value] of Object.entries(mapSfixed32Sfixed32)) { + msg.mapSfixed32Sfixed32[key] = value; + } } const mapSfixed64Sfixed64 = - json[\\"mapSfixed64Sfixed64\\"] ?? json.map_sfixed64_sfixed64; + json.mapSfixed64Sfixed64 ?? json.map_sfixed64_sfixed64; if (mapSfixed64Sfixed64) { - msg.mapSfixed64Sfixed64 = mapSfixed64Sfixed64; + for (const [key, value] of Object.entries(mapSfixed64Sfixed64)) { + msg.mapSfixed64Sfixed64[key] = BigInt(value as string); + } } - const mapInt32Float = json[\\"mapInt32Float\\"] ?? json.map_int32_float; + const mapInt32Float = json.mapInt32Float ?? json.map_int32_float; if (mapInt32Float) { - msg.mapInt32Float = mapInt32Float; + for (const [key, value] of Object.entries(mapInt32Float)) { + msg.mapInt32Float[key] = value; + } } - const mapInt32Double = json[\\"mapInt32Double\\"] ?? json.map_int32_double; + const mapInt32Double = json.mapInt32Double ?? json.map_int32_double; if (mapInt32Double) { - msg.mapInt32Double = mapInt32Double; + for (const [key, value] of Object.entries(mapInt32Double)) { + msg.mapInt32Double[key] = value; + } } - const mapBoolBool = json[\\"mapBoolBool\\"] ?? json.map_bool_bool; + const mapBoolBool = json.mapBoolBool ?? json.map_bool_bool; if (mapBoolBool) { - msg.mapBoolBool = mapBoolBool; + for (const [key, value] of Object.entries(mapBoolBool)) { + msg.mapBoolBool[key] = value; + } } - const mapStringString = json[\\"mapStringString\\"] ?? json.map_string_string; + const mapStringString = json.mapStringString ?? json.map_string_string; if (mapStringString) { - msg.mapStringString = mapStringString; + for (const [key, value] of Object.entries(mapStringString)) { + msg.mapStringString[key] = value; + } } - const mapInt32Bytes = json[\\"mapInt32Bytes\\"] ?? json.map_int32_bytes; + const mapInt32Bytes = json.mapInt32Bytes ?? json.map_int32_bytes; if (mapInt32Bytes) { - msg.mapInt32Bytes = mapInt32Bytes; + for (const [key, value] of Object.entries(mapInt32Bytes)) { + msg.mapInt32Bytes[key] = value; + } } - const mapInt32Enum = json[\\"mapInt32Enum\\"] ?? json.map_int32_enum; + const mapInt32Enum = json.mapInt32Enum ?? json.map_int32_enum; if (mapInt32Enum) { - msg.mapInt32Enum = mapInt32Enum; + for (const [key, value] of Object.entries(mapInt32Enum)) { + msg.mapInt32Enum[key] = value as MapEnum; + } } const mapInt32ForeignMessage = - json[\\"mapInt32ForeignMessage\\"] ?? json.map_int32_foreign_message; + json.mapInt32ForeignMessage ?? json.map_int32_foreign_message; if (mapInt32ForeignMessage) { - msg.mapInt32ForeignMessage = mapInt32ForeignMessage; + for (const [key, value] of Object.entries(mapInt32ForeignMessage)) { + msg.mapInt32ForeignMessage[key] = ForeignMessage._readMessageJSON( + ForeignMessage.initialize(), + value + ); + } } const mapStringForeignMessage = - json[\\"mapStringForeignMessage\\"] ?? json.map_string_foreign_message; + json.mapStringForeignMessage ?? json.map_string_foreign_message; if (mapStringForeignMessage) { - msg.mapStringForeignMessage = mapStringForeignMessage; + for (const [key, value] of Object.entries(mapStringForeignMessage)) { + msg.mapStringForeignMessage[key] = ForeignMessage._readMessageJSON( + ForeignMessage.initialize(), + value + ); + } } - const mapInt32AllTypes = - json[\\"mapInt32AllTypes\\"] ?? json.map_int32_all_types; + const mapInt32AllTypes = json.mapInt32AllTypes ?? json.map_int32_all_types; if (mapInt32AllTypes) { - msg.mapInt32AllTypes = mapInt32AllTypes; + for (const [key, value] of Object.entries(mapInt32AllTypes)) { + msg.mapInt32AllTypes[key] = TestAllTypes._readMessageJSON( + TestAllTypes.initialize(), + value + ); + } } return msg; }, @@ -74954,7 +76549,7 @@ export const TestMapSubmessage = { if (msg.testMap) { const testMap = TestMap._writeMessageJSON(msg.testMap); if (Object.keys(testMap).length > 0) { - json[\\"testMap\\"] = testMap; + json.testMap = testMap; } } return json; @@ -74990,7 +76585,7 @@ export const TestMapSubmessage = { msg: TestMapSubmessage, json: any ): TestMapSubmessage { - const testMap = json[\\"testMap\\"] ?? json.test_map; + const testMap = json.testMap ?? json.test_map; if (testMap) { const m = TestMap.initialize(); TestMap._readMessageJSON(m, testMap); @@ -75055,11 +76650,13 @@ export const TestMessageMap = { writer: BinaryWriter ): BinaryWriter { if (msg.mapInt32Message) { - for (const key in msg.mapInt32Message) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeMessage(2, msg.mapInt32Message![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Message)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeMessage(2, value, TestAllTypes._writeMessage); + }); + } } } return writer; @@ -75073,8 +76670,14 @@ export const TestMessageMap = { ): Record { const json: Record = {}; if (msg.mapInt32Message) { - if (Object.keys(msg.mapInt32Message).length > 0) { - json[\\"mapInt32Message\\"] = msg.mapInt32Message; + if (msg.mapInt32Message) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32Message)) { + if (key && value) { + map[key] = TestAllTypes._writeMessageJSON(value); + json.mapInt32Message = map; + } + } } } return json; @@ -75102,7 +76705,10 @@ export const TestMessageMap = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + TestAllTypes.initialize(), + TestAllTypes._readMessage + ); break; } } @@ -75126,9 +76732,14 @@ export const TestMessageMap = { * @private */ _readMessageJSON: function (msg: TestMessageMap, json: any): TestMessageMap { - const mapInt32Message = json[\\"mapInt32Message\\"] ?? json.map_int32_message; + const mapInt32Message = json.mapInt32Message ?? json.map_int32_message; if (mapInt32Message) { - msg.mapInt32Message = mapInt32Message; + for (const [key, value] of Object.entries(mapInt32Message)) { + msg.mapInt32Message[key] = TestAllTypes._readMessageJSON( + TestAllTypes.initialize(), + value + ); + } } return msg; }, @@ -75190,19 +76801,23 @@ export const TestSameTypeMap = { writer: BinaryWriter ): BinaryWriter { if (msg.map1) { - for (const key in msg.map1) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeInt32(2, msg.map1![key]); - }); + for (const [key, value] of Object.entries(msg.map1)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeInt32(2, value); + }); + } } } if (msg.map2) { - for (const key in msg.map2) { - writer.writeMessage(2, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeInt32(2, msg.map2![key]); - }); + for (const [key, value] of Object.entries(msg.map2)) { + if (key && value) { + writer.writeMessage(2, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeInt32(2, value); + }); + } } } return writer; @@ -75216,13 +76831,25 @@ export const TestSameTypeMap = { ): Record { const json: Record = {}; if (msg.map1) { - if (Object.keys(msg.map1).length > 0) { - json[\\"map1\\"] = msg.map1; + if (msg.map1) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.map1)) { + if (key && value) { + map[key] = value; + json.map1 = map; + } + } } } if (msg.map2) { - if (Object.keys(msg.map2).length > 0) { - json[\\"map2\\"] = msg.map2; + if (msg.map2) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.map2)) { + if (key && value) { + map[key] = value; + json.map2 = map; + } + } } } return json; @@ -75300,13 +76927,17 @@ export const TestSameTypeMap = { msg: TestSameTypeMap, json: any ): TestSameTypeMap { - const map1 = json[\\"map1\\"] ?? json.map1; + const map1 = json.map1 ?? json.map1; if (map1) { - msg.map1 = map1; + for (const [key, value] of Object.entries(map1)) { + msg.map1[key] = value; + } } - const map2 = json[\\"map2\\"] ?? json.map2; + const map2 = json.map2 ?? json.map2; if (map2) { - msg.map2 = map2; + for (const [key, value] of Object.entries(map2)) { + msg.map2[key] = value; + } } return msg; }, @@ -75373,11 +77004,13 @@ export const TestRequiredMessageMap = { writer: BinaryWriter ): BinaryWriter { if (msg.mapField) { - for (const key in msg.mapField) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeMessage(2, msg.mapField![key]); - }); + for (const [key, value] of Object.entries(msg.mapField)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeMessage(2, value, TestRequired._writeMessage); + }); + } } } return writer; @@ -75391,8 +77024,14 @@ export const TestRequiredMessageMap = { ): Record { const json: Record = {}; if (msg.mapField) { - if (Object.keys(msg.mapField).length > 0) { - json[\\"mapField\\"] = msg.mapField; + if (msg.mapField) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapField)) { + if (key && value) { + map[key] = TestRequired._writeMessageJSON(value); + json.mapField = map; + } + } } } return json; @@ -75420,7 +77059,10 @@ export const TestRequiredMessageMap = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + TestRequired.initialize(), + TestRequired._readMessage + ); break; } } @@ -75447,9 +77089,14 @@ export const TestRequiredMessageMap = { msg: TestRequiredMessageMap, json: any ): TestRequiredMessageMap { - const mapField = json[\\"mapField\\"] ?? json.map_field; + const mapField = json.mapField ?? json.map_field; if (mapField) { - msg.mapField = mapField; + for (const [key, value] of Object.entries(mapField)) { + msg.mapField[key] = TestRequired._readMessageJSON( + TestRequired.initialize(), + value + ); + } } return msg; }, @@ -75526,139 +77173,173 @@ export const TestArenaMap = { writer: BinaryWriter ): BinaryWriter { if (msg.mapInt32Int32) { - for (const key in msg.mapInt32Int32) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeInt32(2, msg.mapInt32Int32![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Int32)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeInt32(2, value); + }); + } } } if (msg.mapInt64Int64) { - for (const key in msg.mapInt64Int64) { - writer.writeMessage(2, {}, (_, mapWriter) => { - mapWriter.writeInt64String(1, key as unknown as string); - mapWriter.writeInt64String(2, msg.mapInt64Int64![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt64Int64)) { + if (key && value) { + writer.writeMessage(2, {}, (_, mapWriter) => { + mapWriter.writeInt64String(1, key as any); + mapWriter.writeInt64String(2, value.toString()); + }); + } } } if (msg.mapUint32Uint32) { - for (const key in msg.mapUint32Uint32) { - writer.writeMessage(3, {}, (_, mapWriter) => { - mapWriter.writeUint32(1, key as unknown as number); - mapWriter.writeUint32(2, msg.mapUint32Uint32![key]); - }); + for (const [key, value] of Object.entries(msg.mapUint32Uint32)) { + if (key && value) { + writer.writeMessage(3, {}, (_, mapWriter) => { + mapWriter.writeUint32(1, key as any); + mapWriter.writeUint32(2, value); + }); + } } } if (msg.mapUint64Uint64) { - for (const key in msg.mapUint64Uint64) { - writer.writeMessage(4, {}, (_, mapWriter) => { - mapWriter.writeUint64String(1, key as unknown as string); - mapWriter.writeUint64String(2, msg.mapUint64Uint64![key]); - }); + for (const [key, value] of Object.entries(msg.mapUint64Uint64)) { + if (key && value) { + writer.writeMessage(4, {}, (_, mapWriter) => { + mapWriter.writeUint64String(1, key as any); + mapWriter.writeUint64String(2, value.toString()); + }); + } } } if (msg.mapSint32Sint32) { - for (const key in msg.mapSint32Sint32) { - writer.writeMessage(5, {}, (_, mapWriter) => { - mapWriter.writeSint32(1, key as unknown as number); - mapWriter.writeSint32(2, msg.mapSint32Sint32![key]); - }); + for (const [key, value] of Object.entries(msg.mapSint32Sint32)) { + if (key && value) { + writer.writeMessage(5, {}, (_, mapWriter) => { + mapWriter.writeSint32(1, key as any); + mapWriter.writeSint32(2, value); + }); + } } } if (msg.mapSint64Sint64) { - for (const key in msg.mapSint64Sint64) { - writer.writeMessage(6, {}, (_, mapWriter) => { - mapWriter.writeSint64String(1, key as unknown as string); - mapWriter.writeSint64String(2, msg.mapSint64Sint64![key]); - }); + for (const [key, value] of Object.entries(msg.mapSint64Sint64)) { + if (key && value) { + writer.writeMessage(6, {}, (_, mapWriter) => { + mapWriter.writeSint64String(1, key as any); + mapWriter.writeSint64String(2, value.toString()); + }); + } } } if (msg.mapFixed32Fixed32) { - for (const key in msg.mapFixed32Fixed32) { - writer.writeMessage(7, {}, (_, mapWriter) => { - mapWriter.writeFixed32(1, key as unknown as number); - mapWriter.writeFixed32(2, msg.mapFixed32Fixed32![key]); - }); + for (const [key, value] of Object.entries(msg.mapFixed32Fixed32)) { + if (key && value) { + writer.writeMessage(7, {}, (_, mapWriter) => { + mapWriter.writeFixed32(1, key as any); + mapWriter.writeFixed32(2, value); + }); + } } } if (msg.mapFixed64Fixed64) { - for (const key in msg.mapFixed64Fixed64) { - writer.writeMessage(8, {}, (_, mapWriter) => { - mapWriter.writeFixed64String(1, key as unknown as string); - mapWriter.writeFixed64String(2, msg.mapFixed64Fixed64![key]); - }); + for (const [key, value] of Object.entries(msg.mapFixed64Fixed64)) { + if (key && value) { + writer.writeMessage(8, {}, (_, mapWriter) => { + mapWriter.writeFixed64String(1, key as any); + mapWriter.writeFixed64String(2, value.toString()); + }); + } } } if (msg.mapSfixed32Sfixed32) { - for (const key in msg.mapSfixed32Sfixed32) { - writer.writeMessage(9, {}, (_, mapWriter) => { - mapWriter.writeSfixed32(1, key as unknown as number); - mapWriter.writeSfixed32(2, msg.mapSfixed32Sfixed32![key]); - }); + for (const [key, value] of Object.entries(msg.mapSfixed32Sfixed32)) { + if (key && value) { + writer.writeMessage(9, {}, (_, mapWriter) => { + mapWriter.writeSfixed32(1, key as any); + mapWriter.writeSfixed32(2, value); + }); + } } } if (msg.mapSfixed64Sfixed64) { - for (const key in msg.mapSfixed64Sfixed64) { - writer.writeMessage(10, {}, (_, mapWriter) => { - mapWriter.writeSfixed64(1, key as unknown as string); - mapWriter.writeSfixed64(2, msg.mapSfixed64Sfixed64![key]); - }); + for (const [key, value] of Object.entries(msg.mapSfixed64Sfixed64)) { + if (key && value) { + writer.writeMessage(10, {}, (_, mapWriter) => { + mapWriter.writeSfixed64(1, key as any); + mapWriter.writeSfixed64(2, value.toString()); + }); + } } } if (msg.mapInt32Float) { - for (const key in msg.mapInt32Float) { - writer.writeMessage(11, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeFloat(2, msg.mapInt32Float![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Float)) { + if (key && value) { + writer.writeMessage(11, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeFloat(2, value); + }); + } } } if (msg.mapInt32Double) { - for (const key in msg.mapInt32Double) { - writer.writeMessage(12, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeDouble(2, msg.mapInt32Double![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Double)) { + if (key && value) { + writer.writeMessage(12, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeDouble(2, value); + }); + } } } if (msg.mapBoolBool) { - for (const key in msg.mapBoolBool) { - writer.writeMessage(13, {}, (_, mapWriter) => { - mapWriter.writeBool(1, key as unknown as boolean); - mapWriter.writeBool(2, msg.mapBoolBool![key]); - }); + for (const [key, value] of Object.entries(msg.mapBoolBool)) { + if (key && value) { + writer.writeMessage(13, {}, (_, mapWriter) => { + mapWriter.writeBool(1, key as any); + mapWriter.writeBool(2, value); + }); + } } } if (msg.mapStringString) { - for (const key in msg.mapStringString) { - writer.writeMessage(14, {}, (_, mapWriter) => { - mapWriter.writeString(1, key as unknown as string); - mapWriter.writeString(2, msg.mapStringString![key]); - }); + for (const [key, value] of Object.entries(msg.mapStringString)) { + if (key && value) { + writer.writeMessage(14, {}, (_, mapWriter) => { + mapWriter.writeString(1, key as any); + mapWriter.writeString(2, value); + }); + } } } if (msg.mapInt32Bytes) { - for (const key in msg.mapInt32Bytes) { - writer.writeMessage(15, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeBytes(2, msg.mapInt32Bytes![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Bytes)) { + if (key && value) { + writer.writeMessage(15, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeBytes(2, value); + }); + } } } if (msg.mapInt32Enum) { - for (const key in msg.mapInt32Enum) { - writer.writeMessage(16, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeEnum(2, msg.mapInt32Enum![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32Enum)) { + if (key && value) { + writer.writeMessage(16, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeEnum(2, value as MapEnum); + }); + } } } if (msg.mapInt32ForeignMessage) { - for (const key in msg.mapInt32ForeignMessage) { - writer.writeMessage(17, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeMessage(2, msg.mapInt32ForeignMessage![key]); - }); + for (const [key, value] of Object.entries(msg.mapInt32ForeignMessage)) { + if (key && value) { + writer.writeMessage(17, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeMessage(2, value, ForeignMessage._writeMessage); + }); + } } } return writer; @@ -75672,88 +77353,190 @@ export const TestArenaMap = { ): Record { const json: Record = {}; if (msg.mapInt32Int32) { - if (Object.keys(msg.mapInt32Int32).length > 0) { - json[\\"mapInt32Int32\\"] = msg.mapInt32Int32; + if (msg.mapInt32Int32) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32Int32)) { + if (key && value) { + map[key] = value; + json.mapInt32Int32 = map; + } + } } } if (msg.mapInt64Int64) { - if (Object.keys(msg.mapInt64Int64).length > 0) { - json[\\"mapInt64Int64\\"] = msg.mapInt64Int64; + if (msg.mapInt64Int64) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt64Int64)) { + if (key && value) { + map[key] = value.toString(); + json.mapInt64Int64 = map; + } + } } } if (msg.mapUint32Uint32) { - if (Object.keys(msg.mapUint32Uint32).length > 0) { - json[\\"mapUint32Uint32\\"] = msg.mapUint32Uint32; + if (msg.mapUint32Uint32) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapUint32Uint32)) { + if (key && value) { + map[key] = value; + json.mapUint32Uint32 = map; + } + } } } if (msg.mapUint64Uint64) { - if (Object.keys(msg.mapUint64Uint64).length > 0) { - json[\\"mapUint64Uint64\\"] = msg.mapUint64Uint64; + if (msg.mapUint64Uint64) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapUint64Uint64)) { + if (key && value) { + map[key] = value.toString(); + json.mapUint64Uint64 = map; + } + } } } if (msg.mapSint32Sint32) { - if (Object.keys(msg.mapSint32Sint32).length > 0) { - json[\\"mapSint32Sint32\\"] = msg.mapSint32Sint32; + if (msg.mapSint32Sint32) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapSint32Sint32)) { + if (key && value) { + map[key] = value; + json.mapSint32Sint32 = map; + } + } } } if (msg.mapSint64Sint64) { - if (Object.keys(msg.mapSint64Sint64).length > 0) { - json[\\"mapSint64Sint64\\"] = msg.mapSint64Sint64; + if (msg.mapSint64Sint64) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapSint64Sint64)) { + if (key && value) { + map[key] = value.toString(); + json.mapSint64Sint64 = map; + } + } } } if (msg.mapFixed32Fixed32) { - if (Object.keys(msg.mapFixed32Fixed32).length > 0) { - json[\\"mapFixed32Fixed32\\"] = msg.mapFixed32Fixed32; + if (msg.mapFixed32Fixed32) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapFixed32Fixed32)) { + if (key && value) { + map[key] = value; + json.mapFixed32Fixed32 = map; + } + } } } if (msg.mapFixed64Fixed64) { - if (Object.keys(msg.mapFixed64Fixed64).length > 0) { - json[\\"mapFixed64Fixed64\\"] = msg.mapFixed64Fixed64; + if (msg.mapFixed64Fixed64) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapFixed64Fixed64)) { + if (key && value) { + map[key] = value.toString(); + json.mapFixed64Fixed64 = map; + } + } } } if (msg.mapSfixed32Sfixed32) { - if (Object.keys(msg.mapSfixed32Sfixed32).length > 0) { - json[\\"mapSfixed32Sfixed32\\"] = msg.mapSfixed32Sfixed32; + if (msg.mapSfixed32Sfixed32) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapSfixed32Sfixed32)) { + if (key && value) { + map[key] = value; + json.mapSfixed32Sfixed32 = map; + } + } } } if (msg.mapSfixed64Sfixed64) { - if (Object.keys(msg.mapSfixed64Sfixed64).length > 0) { - json[\\"mapSfixed64Sfixed64\\"] = msg.mapSfixed64Sfixed64; + if (msg.mapSfixed64Sfixed64) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapSfixed64Sfixed64)) { + if (key && value) { + map[key] = value.toString(); + json.mapSfixed64Sfixed64 = map; + } + } } } if (msg.mapInt32Float) { - if (Object.keys(msg.mapInt32Float).length > 0) { - json[\\"mapInt32Float\\"] = msg.mapInt32Float; + if (msg.mapInt32Float) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32Float)) { + if (key && value) { + map[key] = value; + json.mapInt32Float = map; + } + } } } if (msg.mapInt32Double) { - if (Object.keys(msg.mapInt32Double).length > 0) { - json[\\"mapInt32Double\\"] = msg.mapInt32Double; + if (msg.mapInt32Double) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32Double)) { + if (key && value) { + map[key] = value; + json.mapInt32Double = map; + } + } } } if (msg.mapBoolBool) { - if (Object.keys(msg.mapBoolBool).length > 0) { - json[\\"mapBoolBool\\"] = msg.mapBoolBool; + if (msg.mapBoolBool) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapBoolBool)) { + if (key && value) { + map[key] = value; + json.mapBoolBool = map; + } + } } } if (msg.mapStringString) { - if (Object.keys(msg.mapStringString).length > 0) { - json[\\"mapStringString\\"] = msg.mapStringString; + if (msg.mapStringString) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapStringString)) { + if (key && value) { + map[key] = value; + json.mapStringString = map; + } + } } } if (msg.mapInt32Bytes) { - if (Object.keys(msg.mapInt32Bytes).length > 0) { - json[\\"mapInt32Bytes\\"] = msg.mapInt32Bytes; + if (msg.mapInt32Bytes) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32Bytes)) { + if (key && value) { + map[key] = value; + json.mapInt32Bytes = map; + } + } } } if (msg.mapInt32Enum) { - if (Object.keys(msg.mapInt32Enum).length > 0) { - json[\\"mapInt32Enum\\"] = msg.mapInt32Enum; + if (msg.mapInt32Enum) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32Enum)) { + if (key && value) { + map[key] = value; + json.mapInt32Enum = map; + } + } } } if (msg.mapInt32ForeignMessage) { - if (Object.keys(msg.mapInt32ForeignMessage).length > 0) { - json[\\"mapInt32ForeignMessage\\"] = msg.mapInt32ForeignMessage; + if (msg.mapInt32ForeignMessage) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.mapInt32ForeignMessage)) { + if (key && value) { + map[key] = ForeignMessage._writeMessageJSON(value); + json.mapInt32ForeignMessage = map; + } + } } } return json; @@ -75794,8 +77577,8 @@ export const TestArenaMap = { } case 2: { reader.readMessage(undefined, () => { - let key: string | undefined; - let value = \\"\\"; + let key: bigint | undefined; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -75804,7 +77587,7 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readInt64String(); + value = BigInt(reader.readInt64String()); break; } } @@ -75840,8 +77623,8 @@ export const TestArenaMap = { } case 4: { reader.readMessage(undefined, () => { - let key: string | undefined; - let value = \\"\\"; + let key: bigint | undefined; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -75850,7 +77633,7 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readUint64String(); + value = BigInt(reader.readUint64String()); break; } } @@ -75886,8 +77669,8 @@ export const TestArenaMap = { } case 6: { reader.readMessage(undefined, () => { - let key: string | undefined; - let value = \\"\\"; + let key: bigint | undefined; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -75896,7 +77679,7 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readSint64(); + value = BigInt(reader.readSint64()); break; } } @@ -75932,8 +77715,8 @@ export const TestArenaMap = { } case 8: { reader.readMessage(undefined, () => { - let key: string | undefined; - let value = \\"\\"; + let key: bigint | undefined; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -75942,7 +77725,7 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readFixed64String(); + value = BigInt(reader.readFixed64String()); break; } } @@ -75978,8 +77761,8 @@ export const TestArenaMap = { } case 10: { reader.readMessage(undefined, () => { - let key: string | undefined; - let value = \\"\\"; + let key: bigint | undefined; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -75988,7 +77771,7 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readSfixed64(); + value = BigInt(reader.readSfixed64()); break; } } @@ -76126,7 +77909,7 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readEnum(); + value = reader.readEnum() as MapEnum; break; } } @@ -76149,7 +77932,10 @@ export const TestArenaMap = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + ForeignMessage.initialize(), + ForeignMessage._readMessage + ); break; } } @@ -76173,78 +77959,115 @@ export const TestArenaMap = { * @private */ _readMessageJSON: function (msg: TestArenaMap, json: any): TestArenaMap { - const mapInt32Int32 = json[\\"mapInt32Int32\\"] ?? json.map_int32_int32; + const mapInt32Int32 = json.mapInt32Int32 ?? json.map_int32_int32; if (mapInt32Int32) { - msg.mapInt32Int32 = mapInt32Int32; + for (const [key, value] of Object.entries(mapInt32Int32)) { + msg.mapInt32Int32[key] = value; + } } - const mapInt64Int64 = json[\\"mapInt64Int64\\"] ?? json.map_int64_int64; + const mapInt64Int64 = json.mapInt64Int64 ?? json.map_int64_int64; if (mapInt64Int64) { - msg.mapInt64Int64 = mapInt64Int64; + for (const [key, value] of Object.entries(mapInt64Int64)) { + msg.mapInt64Int64[key] = BigInt(value as string); + } } - const mapUint32Uint32 = json[\\"mapUint32Uint32\\"] ?? json.map_uint32_uint32; + const mapUint32Uint32 = json.mapUint32Uint32 ?? json.map_uint32_uint32; if (mapUint32Uint32) { - msg.mapUint32Uint32 = mapUint32Uint32; + for (const [key, value] of Object.entries(mapUint32Uint32)) { + msg.mapUint32Uint32[key] = value; + } } - const mapUint64Uint64 = json[\\"mapUint64Uint64\\"] ?? json.map_uint64_uint64; + const mapUint64Uint64 = json.mapUint64Uint64 ?? json.map_uint64_uint64; if (mapUint64Uint64) { - msg.mapUint64Uint64 = mapUint64Uint64; + for (const [key, value] of Object.entries(mapUint64Uint64)) { + msg.mapUint64Uint64[key] = BigInt(value as string); + } } - const mapSint32Sint32 = json[\\"mapSint32Sint32\\"] ?? json.map_sint32_sint32; + const mapSint32Sint32 = json.mapSint32Sint32 ?? json.map_sint32_sint32; if (mapSint32Sint32) { - msg.mapSint32Sint32 = mapSint32Sint32; + for (const [key, value] of Object.entries(mapSint32Sint32)) { + msg.mapSint32Sint32[key] = value; + } } - const mapSint64Sint64 = json[\\"mapSint64Sint64\\"] ?? json.map_sint64_sint64; + const mapSint64Sint64 = json.mapSint64Sint64 ?? json.map_sint64_sint64; if (mapSint64Sint64) { - msg.mapSint64Sint64 = mapSint64Sint64; + for (const [key, value] of Object.entries(mapSint64Sint64)) { + msg.mapSint64Sint64[key] = BigInt(value as string); + } } const mapFixed32Fixed32 = - json[\\"mapFixed32Fixed32\\"] ?? json.map_fixed32_fixed32; + json.mapFixed32Fixed32 ?? json.map_fixed32_fixed32; if (mapFixed32Fixed32) { - msg.mapFixed32Fixed32 = mapFixed32Fixed32; + for (const [key, value] of Object.entries(mapFixed32Fixed32)) { + msg.mapFixed32Fixed32[key] = value; + } } const mapFixed64Fixed64 = - json[\\"mapFixed64Fixed64\\"] ?? json.map_fixed64_fixed64; + json.mapFixed64Fixed64 ?? json.map_fixed64_fixed64; if (mapFixed64Fixed64) { - msg.mapFixed64Fixed64 = mapFixed64Fixed64; + for (const [key, value] of Object.entries(mapFixed64Fixed64)) { + msg.mapFixed64Fixed64[key] = BigInt(value as string); + } } const mapSfixed32Sfixed32 = - json[\\"mapSfixed32Sfixed32\\"] ?? json.map_sfixed32_sfixed32; + json.mapSfixed32Sfixed32 ?? json.map_sfixed32_sfixed32; if (mapSfixed32Sfixed32) { - msg.mapSfixed32Sfixed32 = mapSfixed32Sfixed32; + for (const [key, value] of Object.entries(mapSfixed32Sfixed32)) { + msg.mapSfixed32Sfixed32[key] = value; + } } const mapSfixed64Sfixed64 = - json[\\"mapSfixed64Sfixed64\\"] ?? json.map_sfixed64_sfixed64; + json.mapSfixed64Sfixed64 ?? json.map_sfixed64_sfixed64; if (mapSfixed64Sfixed64) { - msg.mapSfixed64Sfixed64 = mapSfixed64Sfixed64; + for (const [key, value] of Object.entries(mapSfixed64Sfixed64)) { + msg.mapSfixed64Sfixed64[key] = BigInt(value as string); + } } - const mapInt32Float = json[\\"mapInt32Float\\"] ?? json.map_int32_float; + const mapInt32Float = json.mapInt32Float ?? json.map_int32_float; if (mapInt32Float) { - msg.mapInt32Float = mapInt32Float; + for (const [key, value] of Object.entries(mapInt32Float)) { + msg.mapInt32Float[key] = value; + } } - const mapInt32Double = json[\\"mapInt32Double\\"] ?? json.map_int32_double; + const mapInt32Double = json.mapInt32Double ?? json.map_int32_double; if (mapInt32Double) { - msg.mapInt32Double = mapInt32Double; + for (const [key, value] of Object.entries(mapInt32Double)) { + msg.mapInt32Double[key] = value; + } } - const mapBoolBool = json[\\"mapBoolBool\\"] ?? json.map_bool_bool; + const mapBoolBool = json.mapBoolBool ?? json.map_bool_bool; if (mapBoolBool) { - msg.mapBoolBool = mapBoolBool; + for (const [key, value] of Object.entries(mapBoolBool)) { + msg.mapBoolBool[key] = value; + } } - const mapStringString = json[\\"mapStringString\\"] ?? json.map_string_string; + const mapStringString = json.mapStringString ?? json.map_string_string; if (mapStringString) { - msg.mapStringString = mapStringString; + for (const [key, value] of Object.entries(mapStringString)) { + msg.mapStringString[key] = value; + } } - const mapInt32Bytes = json[\\"mapInt32Bytes\\"] ?? json.map_int32_bytes; + const mapInt32Bytes = json.mapInt32Bytes ?? json.map_int32_bytes; if (mapInt32Bytes) { - msg.mapInt32Bytes = mapInt32Bytes; + for (const [key, value] of Object.entries(mapInt32Bytes)) { + msg.mapInt32Bytes[key] = value; + } } - const mapInt32Enum = json[\\"mapInt32Enum\\"] ?? json.map_int32_enum; + const mapInt32Enum = json.mapInt32Enum ?? json.map_int32_enum; if (mapInt32Enum) { - msg.mapInt32Enum = mapInt32Enum; + for (const [key, value] of Object.entries(mapInt32Enum)) { + msg.mapInt32Enum[key] = value as MapEnum; + } } const mapInt32ForeignMessage = - json[\\"mapInt32ForeignMessage\\"] ?? json.map_int32_foreign_message; + json.mapInt32ForeignMessage ?? json.map_int32_foreign_message; if (mapInt32ForeignMessage) { - msg.mapInt32ForeignMessage = mapInt32ForeignMessage; + for (const [key, value] of Object.entries(mapInt32ForeignMessage)) { + msg.mapInt32ForeignMessage[key] = ForeignMessage._readMessageJSON( + ForeignMessage.initialize(), + value + ); + } } return msg; }, @@ -76313,11 +78136,13 @@ export const MessageContainingMapCalledEntry = { writer: BinaryWriter ): BinaryWriter { if (msg.entry) { - for (const key in msg.entry) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeInt32(1, key as unknown as number); - mapWriter.writeInt32(2, msg.entry![key]); - }); + for (const [key, value] of Object.entries(msg.entry)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeInt32(1, key as any); + mapWriter.writeInt32(2, value); + }); + } } } return writer; @@ -76331,8 +78156,14 @@ export const MessageContainingMapCalledEntry = { ): Record { const json: Record = {}; if (msg.entry) { - if (Object.keys(msg.entry).length > 0) { - json[\\"entry\\"] = msg.entry; + if (msg.entry) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.entry)) { + if (key && value) { + map[key] = value; + json.entry = map; + } + } } } return json; @@ -76387,9 +78218,11 @@ export const MessageContainingMapCalledEntry = { msg: MessageContainingMapCalledEntry, json: any ): MessageContainingMapCalledEntry { - const entry = json[\\"entry\\"] ?? json.entry; + const entry = json.entry ?? json.entry; if (entry) { - msg.entry = entry; + for (const [key, value] of Object.entries(entry)) { + msg.entry[key] = value; + } } return msg; }, @@ -76456,11 +78289,17 @@ export const TestRecursiveMapMessage = { writer: BinaryWriter ): BinaryWriter { if (msg.a) { - for (const key in msg.a) { - writer.writeMessage(1, {}, (_, mapWriter) => { - mapWriter.writeString(1, key as unknown as string); - mapWriter.writeMessage(2, msg.a![key]); - }); + for (const [key, value] of Object.entries(msg.a)) { + if (key && value) { + writer.writeMessage(1, {}, (_, mapWriter) => { + mapWriter.writeString(1, key as any); + mapWriter.writeMessage( + 2, + value, + TestRecursiveMapMessage._writeMessage + ); + }); + } } } return writer; @@ -76474,8 +78313,14 @@ export const TestRecursiveMapMessage = { ): Record { const json: Record = {}; if (msg.a) { - if (Object.keys(msg.a).length > 0) { - json[\\"a\\"] = msg.a; + if (msg.a) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.a)) { + if (key && value) { + map[key] = TestRecursiveMapMessage._writeMessageJSON(value); + json.a = map; + } + } } } return json; @@ -76503,7 +78348,10 @@ export const TestRecursiveMapMessage = { break; } case 2: { - value = reader.readMessage(); + reader.readMessage( + TestRecursiveMapMessage.initialize(), + TestRecursiveMapMessage._readMessage + ); break; } } @@ -76530,9 +78378,14 @@ export const TestRecursiveMapMessage = { msg: TestRecursiveMapMessage, json: any ): TestRecursiveMapMessage { - const a = json[\\"a\\"] ?? json.a; + const a = json.a ?? json.a; if (a) { - msg.a = a; + for (const [key, value] of Object.entries(a)) { + msg.a[key] = TestRecursiveMapMessage._readMessageJSON( + TestRecursiveMapMessage.initialize(), + value + ); + } } return msg; }, @@ -76585,15 +78438,15 @@ export interface TestAllTypes { * Singular */ optionalInt32: number; - optionalInt64: string; + optionalInt64: bigint; optionalUint32: number; - optionalUint64: string; + optionalUint64: bigint; optionalSint32: number; - optionalSint64: string; + optionalSint64: bigint; optionalFixed32: number; - optionalFixed64: string; + optionalFixed64: bigint; optionalSfixed32: number; - optionalSfixed64: string; + optionalSfixed64: bigint; optionalFloat: number; optionalDouble: number; optionalBool: boolean; @@ -76616,15 +78469,15 @@ export interface TestAllTypes { * Repeated */ repeatedInt32: number[]; - repeatedInt64: string[]; + repeatedInt64: bigint[]; repeatedUint32: number[]; - repeatedUint64: string[]; + repeatedUint64: bigint[]; repeatedSint32: number[]; - repeatedSint64: string[]; + repeatedSint64: bigint[]; repeatedFixed32: number[]; - repeatedFixed64: string[]; + repeatedFixed64: bigint[]; repeatedSfixed32: number[]; - repeatedSfixed64: string[]; + repeatedSfixed64: bigint[]; repeatedFloat: number[]; repeatedDouble: number[]; repeatedBool: boolean[]; @@ -76660,15 +78513,15 @@ export namespace TestAllTypes { export interface TestPackedTypes { packedInt32: number[]; - packedInt64: string[]; + packedInt64: bigint[]; packedUint32: number[]; - packedUint64: string[]; + packedUint64: bigint[]; packedSint32: number[]; - packedSint64: string[]; + packedSint64: bigint[]; packedFixed32: number[]; - packedFixed64: string[]; + packedFixed64: bigint[]; packedSfixed32: number[]; - packedSfixed64: string[]; + packedSfixed64: bigint[]; packedFloat: number[]; packedDouble: number[]; packedBool: boolean[]; @@ -76680,15 +78533,15 @@ export interface TestPackedTypes { */ export interface TestUnpackedTypes { repeatedInt32: number[]; - repeatedInt64: string[]; + repeatedInt64: bigint[]; repeatedUint32: number[]; - repeatedUint64: string[]; + repeatedUint64: bigint[]; repeatedSint32: number[]; - repeatedSint64: string[]; + repeatedSint64: bigint[]; repeatedFixed32: number[]; - repeatedFixed64: string[]; + repeatedFixed64: bigint[]; repeatedSfixed32: number[]; - repeatedSfixed64: string[]; + repeatedSfixed64: bigint[]; repeatedFloat: number[]; repeatedDouble: number[]; repeatedBool: boolean[]; @@ -76795,15 +78648,15 @@ export const TestAllTypes = { initialize: function (): TestAllTypes { return { optionalInt32: 0, - optionalInt64: \\"\\", + optionalInt64: 0n, optionalUint32: 0, - optionalUint64: \\"\\", + optionalUint64: 0n, optionalSint32: 0, - optionalSint64: \\"\\", + optionalSint64: 0n, optionalFixed32: 0, - optionalFixed64: \\"\\", + optionalFixed64: 0n, optionalSfixed32: 0, - optionalSfixed64: \\"\\", + optionalSfixed64: 0n, optionalFloat: 0, optionalDouble: 0, optionalBool: false, @@ -76857,31 +78710,31 @@ export const TestAllTypes = { writer.writeInt32(1, msg.optionalInt32); } if (msg.optionalInt64) { - writer.writeInt64String(2, msg.optionalInt64); + writer.writeInt64String(2, msg.optionalInt64.toString()); } if (msg.optionalUint32) { writer.writeUint32(3, msg.optionalUint32); } if (msg.optionalUint64) { - writer.writeUint64String(4, msg.optionalUint64); + writer.writeUint64String(4, msg.optionalUint64.toString()); } if (msg.optionalSint32) { writer.writeSint32(5, msg.optionalSint32); } if (msg.optionalSint64) { - writer.writeSint64String(6, msg.optionalSint64); + writer.writeSint64String(6, msg.optionalSint64.toString()); } if (msg.optionalFixed32) { writer.writeFixed32(7, msg.optionalFixed32); } if (msg.optionalFixed64) { - writer.writeFixed64String(8, msg.optionalFixed64); + writer.writeFixed64String(8, msg.optionalFixed64.toString()); } if (msg.optionalSfixed32) { writer.writeSfixed32(9, msg.optionalSfixed32); } if (msg.optionalSfixed64) { - writer.writeSfixed64(10, msg.optionalSfixed64); + writer.writeSfixed64(10, msg.optionalSfixed64.toString()); } if (msg.optionalFloat) { writer.writeFloat(11, msg.optionalFloat); @@ -76956,31 +78809,31 @@ export const TestAllTypes = { writer.writeRepeatedInt32(31, msg.repeatedInt32); } if (msg.repeatedInt64?.length) { - writer.writeRepeatedInt64String(32, msg.repeatedInt64); + writer.writeRepeatedInt64String(32, msg.repeatedInt64.toString()); } if (msg.repeatedUint32?.length) { writer.writeRepeatedUint32(33, msg.repeatedUint32); } if (msg.repeatedUint64?.length) { - writer.writeRepeatedUint64String(34, msg.repeatedUint64); + writer.writeRepeatedUint64String(34, msg.repeatedUint64.toString()); } if (msg.repeatedSint32?.length) { writer.writeRepeatedSint32(35, msg.repeatedSint32); } if (msg.repeatedSint64?.length) { - writer.writeRepeatedSint64String(36, msg.repeatedSint64); + writer.writeRepeatedSint64String(36, msg.repeatedSint64.toString()); } if (msg.repeatedFixed32?.length) { writer.writeRepeatedFixed32(37, msg.repeatedFixed32); } if (msg.repeatedFixed64?.length) { - writer.writeRepeatedFixed64String(38, msg.repeatedFixed64); + writer.writeRepeatedFixed64String(38, msg.repeatedFixed64.toString()); } if (msg.repeatedSfixed32?.length) { writer.writeRepeatedSfixed32(39, msg.repeatedSfixed32); } if (msg.repeatedSfixed64?.length) { - writer.writeRepeatedSfixed64(40, msg.repeatedSfixed64); + writer.writeRepeatedSfixed64(40, msg.repeatedSfixed64.toString()); } if (msg.repeatedFloat?.length) { writer.writeRepeatedFloat(41, msg.repeatedFloat); @@ -77064,55 +78917,55 @@ export const TestAllTypes = { ): Record { const json: Record = {}; if (msg.optionalInt32) { - json[\\"optionalInt32\\"] = msg.optionalInt32; + json.optionalInt32 = msg.optionalInt32; } if (msg.optionalInt64) { - json[\\"optionalInt64\\"] = msg.optionalInt64; + json.optionalInt64 = msg.optionalInt64.toString(); } if (msg.optionalUint32) { - json[\\"optionalUint32\\"] = msg.optionalUint32; + json.optionalUint32 = msg.optionalUint32; } if (msg.optionalUint64) { - json[\\"optionalUint64\\"] = msg.optionalUint64; + json.optionalUint64 = msg.optionalUint64.toString(); } if (msg.optionalSint32) { - json[\\"optionalSint32\\"] = msg.optionalSint32; + json.optionalSint32 = msg.optionalSint32; } if (msg.optionalSint64) { - json[\\"optionalSint64\\"] = msg.optionalSint64; + json.optionalSint64 = msg.optionalSint64.toString(); } if (msg.optionalFixed32) { - json[\\"optionalFixed32\\"] = msg.optionalFixed32; + json.optionalFixed32 = msg.optionalFixed32; } if (msg.optionalFixed64) { - json[\\"optionalFixed64\\"] = msg.optionalFixed64; + json.optionalFixed64 = msg.optionalFixed64.toString(); } if (msg.optionalSfixed32) { - json[\\"optionalSfixed32\\"] = msg.optionalSfixed32; + json.optionalSfixed32 = msg.optionalSfixed32; } if (msg.optionalSfixed64) { - json[\\"optionalSfixed64\\"] = msg.optionalSfixed64; + json.optionalSfixed64 = msg.optionalSfixed64.toString(); } if (msg.optionalFloat) { - json[\\"optionalFloat\\"] = msg.optionalFloat; + json.optionalFloat = msg.optionalFloat; } if (msg.optionalDouble) { - json[\\"optionalDouble\\"] = msg.optionalDouble; + json.optionalDouble = msg.optionalDouble; } if (msg.optionalBool) { - json[\\"optionalBool\\"] = msg.optionalBool; + json.optionalBool = msg.optionalBool; } if (msg.optionalString) { - json[\\"optionalString\\"] = msg.optionalString; + json.optionalString = msg.optionalString; } if (msg.optionalBytes) { - json[\\"optionalBytes\\"] = msg.optionalBytes; + json.optionalBytes = msg.optionalBytes; } if (msg.optionalNestedMessage) { const optionalNestedMessage = TestAllTypes.NestedMessage._writeMessageJSON(msg.optionalNestedMessage); if (Object.keys(optionalNestedMessage).length > 0) { - json[\\"optionalNestedMessage\\"] = optionalNestedMessage; + json.optionalNestedMessage = optionalNestedMessage; } } if (msg.optionalForeignMessage) { @@ -77120,7 +78973,7 @@ export const TestAllTypes = { msg.optionalForeignMessage ); if (Object.keys(optionalForeignMessage).length > 0) { - json[\\"optionalForeignMessage\\"] = optionalForeignMessage; + json.optionalForeignMessage = optionalForeignMessage; } } if (msg.optionalImportMessage) { @@ -77128,27 +78981,27 @@ export const TestAllTypes = { msg.optionalImportMessage ); if (Object.keys(optionalImportMessage).length > 0) { - json[\\"optionalImportMessage\\"] = optionalImportMessage; + json.optionalImportMessage = optionalImportMessage; } } if (msg.optionalNestedEnum) { - json[\\"optionalNestedEnum\\"] = msg.optionalNestedEnum; + json.optionalNestedEnum = msg.optionalNestedEnum; } if (msg.optionalForeignEnum) { - json[\\"optionalForeignEnum\\"] = msg.optionalForeignEnum; + json.optionalForeignEnum = msg.optionalForeignEnum; } if (msg.optionalStringPiece) { - json[\\"optionalStringPiece\\"] = msg.optionalStringPiece; + json.optionalStringPiece = msg.optionalStringPiece; } if (msg.optionalCord) { - json[\\"optionalCord\\"] = msg.optionalCord; + json.optionalCord = msg.optionalCord; } if (msg.optionalPublicImportMessage) { const optionalPublicImportMessage = PublicImportMessage._writeMessageJSON( msg.optionalPublicImportMessage ); if (Object.keys(optionalPublicImportMessage).length > 0) { - json[\\"optionalPublicImportMessage\\"] = optionalPublicImportMessage; + json.optionalPublicImportMessage = optionalPublicImportMessage; } } if (msg.optionalLazyMessage) { @@ -77156,7 +79009,7 @@ export const TestAllTypes = { msg.optionalLazyMessage ); if (Object.keys(optionalLazyMessage).length > 0) { - json[\\"optionalLazyMessage\\"] = optionalLazyMessage; + json.optionalLazyMessage = optionalLazyMessage; } } if (msg.optionalLazyImportMessage) { @@ -77164,102 +79017,102 @@ export const TestAllTypes = { msg.optionalLazyImportMessage ); if (Object.keys(optionalLazyImportMessage).length > 0) { - json[\\"optionalLazyImportMessage\\"] = optionalLazyImportMessage; + json.optionalLazyImportMessage = optionalLazyImportMessage; } } if (msg.repeatedInt32?.length) { - json[\\"repeatedInt32\\"] = msg.repeatedInt32; + json.repeatedInt32 = msg.repeatedInt32; } if (msg.repeatedInt64?.length) { - json[\\"repeatedInt64\\"] = msg.repeatedInt64; + json.repeatedInt64 = msg.repeatedInt64.map((x) => x.toString()); } if (msg.repeatedUint32?.length) { - json[\\"repeatedUint32\\"] = msg.repeatedUint32; + json.repeatedUint32 = msg.repeatedUint32; } if (msg.repeatedUint64?.length) { - json[\\"repeatedUint64\\"] = msg.repeatedUint64; + json.repeatedUint64 = msg.repeatedUint64.map((x) => x.toString()); } if (msg.repeatedSint32?.length) { - json[\\"repeatedSint32\\"] = msg.repeatedSint32; + json.repeatedSint32 = msg.repeatedSint32; } if (msg.repeatedSint64?.length) { - json[\\"repeatedSint64\\"] = msg.repeatedSint64; + json.repeatedSint64 = msg.repeatedSint64.map((x) => x.toString()); } if (msg.repeatedFixed32?.length) { - json[\\"repeatedFixed32\\"] = msg.repeatedFixed32; + json.repeatedFixed32 = msg.repeatedFixed32; } if (msg.repeatedFixed64?.length) { - json[\\"repeatedFixed64\\"] = msg.repeatedFixed64; + json.repeatedFixed64 = msg.repeatedFixed64.map((x) => x.toString()); } if (msg.repeatedSfixed32?.length) { - json[\\"repeatedSfixed32\\"] = msg.repeatedSfixed32; + json.repeatedSfixed32 = msg.repeatedSfixed32; } if (msg.repeatedSfixed64?.length) { - json[\\"repeatedSfixed64\\"] = msg.repeatedSfixed64; + json.repeatedSfixed64 = msg.repeatedSfixed64.map((x) => x.toString()); } if (msg.repeatedFloat?.length) { - json[\\"repeatedFloat\\"] = msg.repeatedFloat; + json.repeatedFloat = msg.repeatedFloat; } if (msg.repeatedDouble?.length) { - json[\\"repeatedDouble\\"] = msg.repeatedDouble; + json.repeatedDouble = msg.repeatedDouble; } if (msg.repeatedBool?.length) { - json[\\"repeatedBool\\"] = msg.repeatedBool; + json.repeatedBool = msg.repeatedBool; } if (msg.repeatedString?.length) { - json[\\"repeatedString\\"] = msg.repeatedString; + json.repeatedString = msg.repeatedString; } if (msg.repeatedBytes?.length) { - json[\\"repeatedBytes\\"] = msg.repeatedBytes; + json.repeatedBytes = msg.repeatedBytes; } if (msg.repeatedNestedMessage?.length) { - json[\\"repeatedNestedMessage\\"] = msg.repeatedNestedMessage.map( + json.repeatedNestedMessage = msg.repeatedNestedMessage.map( TestAllTypes.NestedMessage._writeMessageJSON ); } if (msg.repeatedForeignMessage?.length) { - json[\\"repeatedForeignMessage\\"] = msg.repeatedForeignMessage.map( + json.repeatedForeignMessage = msg.repeatedForeignMessage.map( ForeignMessage._writeMessageJSON ); } if (msg.repeatedImportMessage?.length) { - json[\\"repeatedImportMessage\\"] = msg.repeatedImportMessage.map( + json.repeatedImportMessage = msg.repeatedImportMessage.map( ImportMessage._writeMessageJSON ); } if (msg.repeatedNestedEnum?.length) { - json[\\"repeatedNestedEnum\\"] = msg.repeatedNestedEnum; + json.repeatedNestedEnum = msg.repeatedNestedEnum; } if (msg.repeatedForeignEnum?.length) { - json[\\"repeatedForeignEnum\\"] = msg.repeatedForeignEnum; + json.repeatedForeignEnum = msg.repeatedForeignEnum; } if (msg.repeatedStringPiece?.length) { - json[\\"repeatedStringPiece\\"] = msg.repeatedStringPiece; + json.repeatedStringPiece = msg.repeatedStringPiece; } if (msg.repeatedCord?.length) { - json[\\"repeatedCord\\"] = msg.repeatedCord; + json.repeatedCord = msg.repeatedCord; } if (msg.repeatedLazyMessage?.length) { - json[\\"repeatedLazyMessage\\"] = msg.repeatedLazyMessage.map( + json.repeatedLazyMessage = msg.repeatedLazyMessage.map( TestAllTypes.NestedMessage._writeMessageJSON ); } if (msg.oneofUint32 != undefined) { - json[\\"oneofUint32\\"] = msg.oneofUint32; + json.oneofUint32 = msg.oneofUint32; } if (msg.oneofNestedMessage != undefined) { const oneofNestedMessage = TestAllTypes.NestedMessage._writeMessageJSON( msg.oneofNestedMessage ); if (Object.keys(oneofNestedMessage).length > 0) { - json[\\"oneofNestedMessage\\"] = oneofNestedMessage; + json.oneofNestedMessage = oneofNestedMessage; } } if (msg.oneofString != undefined) { - json[\\"oneofString\\"] = msg.oneofString; + json.oneofString = msg.oneofString; } if (msg.oneofBytes != undefined) { - json[\\"oneofBytes\\"] = msg.oneofBytes; + json.oneofBytes = msg.oneofBytes; } return json; }, @@ -77279,7 +79132,7 @@ export const TestAllTypes = { break; } case 2: { - msg.optionalInt64 = reader.readInt64String(); + msg.optionalInt64 = BigInt(reader.readInt64String()); break; } case 3: { @@ -77287,7 +79140,7 @@ export const TestAllTypes = { break; } case 4: { - msg.optionalUint64 = reader.readUint64String(); + msg.optionalUint64 = BigInt(reader.readUint64String()); break; } case 5: { @@ -77295,7 +79148,7 @@ export const TestAllTypes = { break; } case 6: { - msg.optionalSint64 = reader.readSint64(); + msg.optionalSint64 = BigInt(reader.readSint64()); break; } case 7: { @@ -77303,7 +79156,7 @@ export const TestAllTypes = { break; } case 8: { - msg.optionalFixed64 = reader.readFixed64String(); + msg.optionalFixed64 = BigInt(reader.readFixed64String()); break; } case 9: { @@ -77311,7 +79164,7 @@ export const TestAllTypes = { break; } case 10: { - msg.optionalSfixed64 = reader.readSfixed64(); + msg.optionalSfixed64 = BigInt(reader.readSfixed64()); break; } case 11: { @@ -77397,7 +79250,7 @@ export const TestAllTypes = { break; } case 32: { - msg.repeatedInt64.push(reader.readInt64String()); + msg.repeatedInt64 = reader.readInt64String().map(BigInt); break; } case 33: { @@ -77405,7 +79258,7 @@ export const TestAllTypes = { break; } case 34: { - msg.repeatedUint64.push(reader.readUint64String()); + msg.repeatedUint64 = reader.readUint64String().map(BigInt); break; } case 35: { @@ -77413,7 +79266,7 @@ export const TestAllTypes = { break; } case 36: { - msg.repeatedSint64.push(reader.readSint64()); + msg.repeatedSint64 = reader.readSint64().map(BigInt); break; } case 37: { @@ -77421,7 +79274,7 @@ export const TestAllTypes = { break; } case 38: { - msg.repeatedFixed64.push(reader.readFixed64String()); + msg.repeatedFixed64 = reader.readFixed64String().map(BigInt); break; } case 39: { @@ -77429,7 +79282,7 @@ export const TestAllTypes = { break; } case 40: { - msg.repeatedSfixed64.push(reader.readSfixed64()); + msg.repeatedSfixed64 = reader.readSfixed64().map(BigInt); break; } case 41: { @@ -77526,190 +79379,189 @@ export const TestAllTypes = { * @private */ _readMessageJSON: function (msg: TestAllTypes, json: any): TestAllTypes { - const optionalInt32 = json[\\"optionalInt32\\"] ?? json.optional_int32; + const optionalInt32 = json.optionalInt32 ?? json.optional_int32; if (optionalInt32) { msg.optionalInt32 = optionalInt32; } - const optionalInt64 = json[\\"optionalInt64\\"] ?? json.optional_int64; + const optionalInt64 = json.optionalInt64 ?? json.optional_int64; if (optionalInt64) { - msg.optionalInt64 = optionalInt64; + msg.optionalInt64 = BigInt(optionalInt64); } - const optionalUint32 = json[\\"optionalUint32\\"] ?? json.optional_uint32; + const optionalUint32 = json.optionalUint32 ?? json.optional_uint32; if (optionalUint32) { msg.optionalUint32 = optionalUint32; } - const optionalUint64 = json[\\"optionalUint64\\"] ?? json.optional_uint64; + const optionalUint64 = json.optionalUint64 ?? json.optional_uint64; if (optionalUint64) { - msg.optionalUint64 = optionalUint64; + msg.optionalUint64 = BigInt(optionalUint64); } - const optionalSint32 = json[\\"optionalSint32\\"] ?? json.optional_sint32; + const optionalSint32 = json.optionalSint32 ?? json.optional_sint32; if (optionalSint32) { msg.optionalSint32 = optionalSint32; } - const optionalSint64 = json[\\"optionalSint64\\"] ?? json.optional_sint64; + const optionalSint64 = json.optionalSint64 ?? json.optional_sint64; if (optionalSint64) { - msg.optionalSint64 = optionalSint64; + msg.optionalSint64 = BigInt(optionalSint64); } - const optionalFixed32 = json[\\"optionalFixed32\\"] ?? json.optional_fixed32; + const optionalFixed32 = json.optionalFixed32 ?? json.optional_fixed32; if (optionalFixed32) { msg.optionalFixed32 = optionalFixed32; } - const optionalFixed64 = json[\\"optionalFixed64\\"] ?? json.optional_fixed64; + const optionalFixed64 = json.optionalFixed64 ?? json.optional_fixed64; if (optionalFixed64) { - msg.optionalFixed64 = optionalFixed64; + msg.optionalFixed64 = BigInt(optionalFixed64); } - const optionalSfixed32 = json[\\"optionalSfixed32\\"] ?? json.optional_sfixed32; + const optionalSfixed32 = json.optionalSfixed32 ?? json.optional_sfixed32; if (optionalSfixed32) { msg.optionalSfixed32 = optionalSfixed32; } - const optionalSfixed64 = json[\\"optionalSfixed64\\"] ?? json.optional_sfixed64; + const optionalSfixed64 = json.optionalSfixed64 ?? json.optional_sfixed64; if (optionalSfixed64) { - msg.optionalSfixed64 = optionalSfixed64; + msg.optionalSfixed64 = BigInt(optionalSfixed64); } - const optionalFloat = json[\\"optionalFloat\\"] ?? json.optional_float; + const optionalFloat = json.optionalFloat ?? json.optional_float; if (optionalFloat) { msg.optionalFloat = optionalFloat; } - const optionalDouble = json[\\"optionalDouble\\"] ?? json.optional_double; + const optionalDouble = json.optionalDouble ?? json.optional_double; if (optionalDouble) { msg.optionalDouble = optionalDouble; } - const optionalBool = json[\\"optionalBool\\"] ?? json.optional_bool; + const optionalBool = json.optionalBool ?? json.optional_bool; if (optionalBool) { msg.optionalBool = optionalBool; } - const optionalString = json[\\"optionalString\\"] ?? json.optional_string; + const optionalString = json.optionalString ?? json.optional_string; if (optionalString) { msg.optionalString = optionalString; } - const optionalBytes = json[\\"optionalBytes\\"] ?? json.optional_bytes; + const optionalBytes = json.optionalBytes ?? json.optional_bytes; if (optionalBytes) { msg.optionalBytes = optionalBytes; } const optionalNestedMessage = - json[\\"optionalNestedMessage\\"] ?? json.optional_nested_message; + json.optionalNestedMessage ?? json.optional_nested_message; if (optionalNestedMessage) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, optionalNestedMessage); msg.optionalNestedMessage = m; } const optionalForeignMessage = - json[\\"optionalForeignMessage\\"] ?? json.optional_foreign_message; + json.optionalForeignMessage ?? json.optional_foreign_message; if (optionalForeignMessage) { const m = ForeignMessage.initialize(); ForeignMessage._readMessageJSON(m, optionalForeignMessage); msg.optionalForeignMessage = m; } const optionalImportMessage = - json[\\"optionalImportMessage\\"] ?? json.optional_import_message; + json.optionalImportMessage ?? json.optional_import_message; if (optionalImportMessage) { const m = ImportMessage.initialize(); ImportMessage._readMessageJSON(m, optionalImportMessage); msg.optionalImportMessage = m; } const optionalNestedEnum = - json[\\"optionalNestedEnum\\"] ?? json.optional_nested_enum; + json.optionalNestedEnum ?? json.optional_nested_enum; if (optionalNestedEnum) { msg.optionalNestedEnum = optionalNestedEnum; } const optionalForeignEnum = - json[\\"optionalForeignEnum\\"] ?? json.optional_foreign_enum; + json.optionalForeignEnum ?? json.optional_foreign_enum; if (optionalForeignEnum) { msg.optionalForeignEnum = optionalForeignEnum; } const optionalStringPiece = - json[\\"optionalStringPiece\\"] ?? json.optional_string_piece; + json.optionalStringPiece ?? json.optional_string_piece; if (optionalStringPiece) { msg.optionalStringPiece = optionalStringPiece; } - const optionalCord = json[\\"optionalCord\\"] ?? json.optional_cord; + const optionalCord = json.optionalCord ?? json.optional_cord; if (optionalCord) { msg.optionalCord = optionalCord; } const optionalPublicImportMessage = - json[\\"optionalPublicImportMessage\\"] ?? - json.optional_public_import_message; + json.optionalPublicImportMessage ?? json.optional_public_import_message; if (optionalPublicImportMessage) { const m = PublicImportMessage.initialize(); PublicImportMessage._readMessageJSON(m, optionalPublicImportMessage); msg.optionalPublicImportMessage = m; } const optionalLazyMessage = - json[\\"optionalLazyMessage\\"] ?? json.optional_lazy_message; + json.optionalLazyMessage ?? json.optional_lazy_message; if (optionalLazyMessage) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, optionalLazyMessage); msg.optionalLazyMessage = m; } const optionalLazyImportMessage = - json[\\"optionalLazyImportMessage\\"] ?? json.optional_lazy_import_message; + json.optionalLazyImportMessage ?? json.optional_lazy_import_message; if (optionalLazyImportMessage) { const m = ImportMessage.initialize(); ImportMessage._readMessageJSON(m, optionalLazyImportMessage); msg.optionalLazyImportMessage = m; } - const repeatedInt32 = json[\\"repeatedInt32\\"] ?? json.repeated_int32; + const repeatedInt32 = json.repeatedInt32 ?? json.repeated_int32; if (repeatedInt32) { msg.repeatedInt32 = repeatedInt32; } - const repeatedInt64 = json[\\"repeatedInt64\\"] ?? json.repeated_int64; + const repeatedInt64 = json.repeatedInt64 ?? json.repeated_int64; if (repeatedInt64) { - msg.repeatedInt64 = repeatedInt64; + msg.repeatedInt64 = repeatedInt64.map(BigInt); } - const repeatedUint32 = json[\\"repeatedUint32\\"] ?? json.repeated_uint32; + const repeatedUint32 = json.repeatedUint32 ?? json.repeated_uint32; if (repeatedUint32) { msg.repeatedUint32 = repeatedUint32; } - const repeatedUint64 = json[\\"repeatedUint64\\"] ?? json.repeated_uint64; + const repeatedUint64 = json.repeatedUint64 ?? json.repeated_uint64; if (repeatedUint64) { - msg.repeatedUint64 = repeatedUint64; + msg.repeatedUint64 = repeatedUint64.map(BigInt); } - const repeatedSint32 = json[\\"repeatedSint32\\"] ?? json.repeated_sint32; + const repeatedSint32 = json.repeatedSint32 ?? json.repeated_sint32; if (repeatedSint32) { msg.repeatedSint32 = repeatedSint32; } - const repeatedSint64 = json[\\"repeatedSint64\\"] ?? json.repeated_sint64; + const repeatedSint64 = json.repeatedSint64 ?? json.repeated_sint64; if (repeatedSint64) { - msg.repeatedSint64 = repeatedSint64; + msg.repeatedSint64 = repeatedSint64.map(BigInt); } - const repeatedFixed32 = json[\\"repeatedFixed32\\"] ?? json.repeated_fixed32; + const repeatedFixed32 = json.repeatedFixed32 ?? json.repeated_fixed32; if (repeatedFixed32) { msg.repeatedFixed32 = repeatedFixed32; } - const repeatedFixed64 = json[\\"repeatedFixed64\\"] ?? json.repeated_fixed64; + const repeatedFixed64 = json.repeatedFixed64 ?? json.repeated_fixed64; if (repeatedFixed64) { - msg.repeatedFixed64 = repeatedFixed64; + msg.repeatedFixed64 = repeatedFixed64.map(BigInt); } - const repeatedSfixed32 = json[\\"repeatedSfixed32\\"] ?? json.repeated_sfixed32; + const repeatedSfixed32 = json.repeatedSfixed32 ?? json.repeated_sfixed32; if (repeatedSfixed32) { msg.repeatedSfixed32 = repeatedSfixed32; } - const repeatedSfixed64 = json[\\"repeatedSfixed64\\"] ?? json.repeated_sfixed64; + const repeatedSfixed64 = json.repeatedSfixed64 ?? json.repeated_sfixed64; if (repeatedSfixed64) { - msg.repeatedSfixed64 = repeatedSfixed64; + msg.repeatedSfixed64 = repeatedSfixed64.map(BigInt); } - const repeatedFloat = json[\\"repeatedFloat\\"] ?? json.repeated_float; + const repeatedFloat = json.repeatedFloat ?? json.repeated_float; if (repeatedFloat) { msg.repeatedFloat = repeatedFloat; } - const repeatedDouble = json[\\"repeatedDouble\\"] ?? json.repeated_double; + const repeatedDouble = json.repeatedDouble ?? json.repeated_double; if (repeatedDouble) { msg.repeatedDouble = repeatedDouble; } - const repeatedBool = json[\\"repeatedBool\\"] ?? json.repeated_bool; + const repeatedBool = json.repeatedBool ?? json.repeated_bool; if (repeatedBool) { msg.repeatedBool = repeatedBool; } - const repeatedString = json[\\"repeatedString\\"] ?? json.repeated_string; + const repeatedString = json.repeatedString ?? json.repeated_string; if (repeatedString) { msg.repeatedString = repeatedString; } - const repeatedBytes = json[\\"repeatedBytes\\"] ?? json.repeated_bytes; + const repeatedBytes = json.repeatedBytes ?? json.repeated_bytes; if (repeatedBytes) { msg.repeatedBytes = repeatedBytes; } const repeatedNestedMessage = - json[\\"repeatedNestedMessage\\"] ?? json.repeated_nested_message; + json.repeatedNestedMessage ?? json.repeated_nested_message; if (repeatedNestedMessage) { for (const item of repeatedNestedMessage) { const m = TestAllTypes.NestedMessage.initialize(); @@ -77718,7 +79570,7 @@ export const TestAllTypes = { } } const repeatedForeignMessage = - json[\\"repeatedForeignMessage\\"] ?? json.repeated_foreign_message; + json.repeatedForeignMessage ?? json.repeated_foreign_message; if (repeatedForeignMessage) { for (const item of repeatedForeignMessage) { const m = ForeignMessage.initialize(); @@ -77727,7 +79579,7 @@ export const TestAllTypes = { } } const repeatedImportMessage = - json[\\"repeatedImportMessage\\"] ?? json.repeated_import_message; + json.repeatedImportMessage ?? json.repeated_import_message; if (repeatedImportMessage) { for (const item of repeatedImportMessage) { const m = ImportMessage.initialize(); @@ -77736,26 +79588,26 @@ export const TestAllTypes = { } } const repeatedNestedEnum = - json[\\"repeatedNestedEnum\\"] ?? json.repeated_nested_enum; + json.repeatedNestedEnum ?? json.repeated_nested_enum; if (repeatedNestedEnum) { msg.repeatedNestedEnum = repeatedNestedEnum; } const repeatedForeignEnum = - json[\\"repeatedForeignEnum\\"] ?? json.repeated_foreign_enum; + json.repeatedForeignEnum ?? json.repeated_foreign_enum; if (repeatedForeignEnum) { msg.repeatedForeignEnum = repeatedForeignEnum; } const repeatedStringPiece = - json[\\"repeatedStringPiece\\"] ?? json.repeated_string_piece; + json.repeatedStringPiece ?? json.repeated_string_piece; if (repeatedStringPiece) { msg.repeatedStringPiece = repeatedStringPiece; } - const repeatedCord = json[\\"repeatedCord\\"] ?? json.repeated_cord; + const repeatedCord = json.repeatedCord ?? json.repeated_cord; if (repeatedCord) { msg.repeatedCord = repeatedCord; } const repeatedLazyMessage = - json[\\"repeatedLazyMessage\\"] ?? json.repeated_lazy_message; + json.repeatedLazyMessage ?? json.repeated_lazy_message; if (repeatedLazyMessage) { for (const item of repeatedLazyMessage) { const m = TestAllTypes.NestedMessage.initialize(); @@ -77763,22 +79615,22 @@ export const TestAllTypes = { msg.repeatedLazyMessage.push(m); } } - const oneofUint32 = json[\\"oneofUint32\\"] ?? json.oneof_uint32; + const oneofUint32 = json.oneofUint32 ?? json.oneof_uint32; if (oneofUint32) { msg.oneofUint32 = oneofUint32; } const oneofNestedMessage = - json[\\"oneofNestedMessage\\"] ?? json.oneof_nested_message; + json.oneofNestedMessage ?? json.oneof_nested_message; if (oneofNestedMessage) { const m = TestAllTypes.NestedMessage.initialize(); TestAllTypes.NestedMessage._readMessageJSON(m, oneofNestedMessage); msg.oneofNestedMessage = m; } - const oneofString = json[\\"oneofString\\"] ?? json.oneof_string; + const oneofString = json.oneofString ?? json.oneof_string; if (oneofString) { msg.oneofString = oneofString; } - const oneofBytes = json[\\"oneofBytes\\"] ?? json.oneof_bytes; + const oneofBytes = json.oneofBytes ?? json.oneof_bytes; if (oneofBytes) { msg.oneofBytes = oneofBytes; } @@ -77861,7 +79713,7 @@ export const TestAllTypes = { ): Record { const json: Record = {}; if (msg.bb) { - json[\\"bb\\"] = msg.bb; + json.bb = msg.bb; } return json; }, @@ -77896,7 +79748,7 @@ export const TestAllTypes = { msg: TestAllTypes.NestedMessage, json: any ): TestAllTypes.NestedMessage { - const bb = json[\\"bb\\"] ?? json.bb; + const bb = json.bb ?? json.bb; if (bb) { msg.bb = bb; } @@ -77976,31 +79828,31 @@ export const TestPackedTypes = { writer.writeRepeatedInt32(90, msg.packedInt32); } if (msg.packedInt64?.length) { - writer.writeRepeatedInt64String(91, msg.packedInt64); + writer.writeRepeatedInt64String(91, msg.packedInt64.toString()); } if (msg.packedUint32?.length) { writer.writeRepeatedUint32(92, msg.packedUint32); } if (msg.packedUint64?.length) { - writer.writeRepeatedUint64String(93, msg.packedUint64); + writer.writeRepeatedUint64String(93, msg.packedUint64.toString()); } if (msg.packedSint32?.length) { writer.writeRepeatedSint32(94, msg.packedSint32); } if (msg.packedSint64?.length) { - writer.writeRepeatedSint64String(95, msg.packedSint64); + writer.writeRepeatedSint64String(95, msg.packedSint64.toString()); } if (msg.packedFixed32?.length) { writer.writeRepeatedFixed32(96, msg.packedFixed32); } if (msg.packedFixed64?.length) { - writer.writeRepeatedFixed64String(97, msg.packedFixed64); + writer.writeRepeatedFixed64String(97, msg.packedFixed64.toString()); } if (msg.packedSfixed32?.length) { writer.writeRepeatedSfixed32(98, msg.packedSfixed32); } if (msg.packedSfixed64?.length) { - writer.writeRepeatedSfixed64(99, msg.packedSfixed64); + writer.writeRepeatedSfixed64(99, msg.packedSfixed64.toString()); } if (msg.packedFloat?.length) { writer.writeRepeatedFloat(100, msg.packedFloat); @@ -78025,46 +79877,46 @@ export const TestPackedTypes = { ): Record { const json: Record = {}; if (msg.packedInt32?.length) { - json[\\"packedInt32\\"] = msg.packedInt32; + json.packedInt32 = msg.packedInt32; } if (msg.packedInt64?.length) { - json[\\"packedInt64\\"] = msg.packedInt64; + json.packedInt64 = msg.packedInt64.map((x) => x.toString()); } if (msg.packedUint32?.length) { - json[\\"packedUint32\\"] = msg.packedUint32; + json.packedUint32 = msg.packedUint32; } if (msg.packedUint64?.length) { - json[\\"packedUint64\\"] = msg.packedUint64; + json.packedUint64 = msg.packedUint64.map((x) => x.toString()); } if (msg.packedSint32?.length) { - json[\\"packedSint32\\"] = msg.packedSint32; + json.packedSint32 = msg.packedSint32; } if (msg.packedSint64?.length) { - json[\\"packedSint64\\"] = msg.packedSint64; + json.packedSint64 = msg.packedSint64.map((x) => x.toString()); } if (msg.packedFixed32?.length) { - json[\\"packedFixed32\\"] = msg.packedFixed32; + json.packedFixed32 = msg.packedFixed32; } if (msg.packedFixed64?.length) { - json[\\"packedFixed64\\"] = msg.packedFixed64; + json.packedFixed64 = msg.packedFixed64.map((x) => x.toString()); } if (msg.packedSfixed32?.length) { - json[\\"packedSfixed32\\"] = msg.packedSfixed32; + json.packedSfixed32 = msg.packedSfixed32; } if (msg.packedSfixed64?.length) { - json[\\"packedSfixed64\\"] = msg.packedSfixed64; + json.packedSfixed64 = msg.packedSfixed64.map((x) => x.toString()); } if (msg.packedFloat?.length) { - json[\\"packedFloat\\"] = msg.packedFloat; + json.packedFloat = msg.packedFloat; } if (msg.packedDouble?.length) { - json[\\"packedDouble\\"] = msg.packedDouble; + json.packedDouble = msg.packedDouble; } if (msg.packedBool?.length) { - json[\\"packedBool\\"] = msg.packedBool; + json.packedBool = msg.packedBool; } if (msg.packedEnum?.length) { - json[\\"packedEnum\\"] = msg.packedEnum; + json.packedEnum = msg.packedEnum; } return json; }, @@ -78084,7 +79936,7 @@ export const TestPackedTypes = { break; } case 91: { - msg.packedInt64.push(reader.readInt64String()); + msg.packedInt64 = reader.readInt64String().map(BigInt); break; } case 92: { @@ -78092,7 +79944,7 @@ export const TestPackedTypes = { break; } case 93: { - msg.packedUint64.push(reader.readUint64String()); + msg.packedUint64 = reader.readUint64String().map(BigInt); break; } case 94: { @@ -78100,7 +79952,7 @@ export const TestPackedTypes = { break; } case 95: { - msg.packedSint64.push(reader.readSint64()); + msg.packedSint64 = reader.readSint64().map(BigInt); break; } case 96: { @@ -78108,7 +79960,7 @@ export const TestPackedTypes = { break; } case 97: { - msg.packedFixed64.push(reader.readFixed64String()); + msg.packedFixed64 = reader.readFixed64String().map(BigInt); break; } case 98: { @@ -78116,7 +79968,7 @@ export const TestPackedTypes = { break; } case 99: { - msg.packedSfixed64.push(reader.readSfixed64()); + msg.packedSfixed64 = reader.readSfixed64().map(BigInt); break; } case 100: { @@ -78151,59 +80003,59 @@ export const TestPackedTypes = { msg: TestPackedTypes, json: any ): TestPackedTypes { - const packedInt32 = json[\\"packedInt32\\"] ?? json.packed_int32; + const packedInt32 = json.packedInt32 ?? json.packed_int32; if (packedInt32) { msg.packedInt32 = packedInt32; } - const packedInt64 = json[\\"packedInt64\\"] ?? json.packed_int64; + const packedInt64 = json.packedInt64 ?? json.packed_int64; if (packedInt64) { - msg.packedInt64 = packedInt64; + msg.packedInt64 = packedInt64.map(BigInt); } - const packedUint32 = json[\\"packedUint32\\"] ?? json.packed_uint32; + const packedUint32 = json.packedUint32 ?? json.packed_uint32; if (packedUint32) { msg.packedUint32 = packedUint32; } - const packedUint64 = json[\\"packedUint64\\"] ?? json.packed_uint64; + const packedUint64 = json.packedUint64 ?? json.packed_uint64; if (packedUint64) { - msg.packedUint64 = packedUint64; + msg.packedUint64 = packedUint64.map(BigInt); } - const packedSint32 = json[\\"packedSint32\\"] ?? json.packed_sint32; + const packedSint32 = json.packedSint32 ?? json.packed_sint32; if (packedSint32) { msg.packedSint32 = packedSint32; } - const packedSint64 = json[\\"packedSint64\\"] ?? json.packed_sint64; + const packedSint64 = json.packedSint64 ?? json.packed_sint64; if (packedSint64) { - msg.packedSint64 = packedSint64; + msg.packedSint64 = packedSint64.map(BigInt); } - const packedFixed32 = json[\\"packedFixed32\\"] ?? json.packed_fixed32; + const packedFixed32 = json.packedFixed32 ?? json.packed_fixed32; if (packedFixed32) { msg.packedFixed32 = packedFixed32; } - const packedFixed64 = json[\\"packedFixed64\\"] ?? json.packed_fixed64; + const packedFixed64 = json.packedFixed64 ?? json.packed_fixed64; if (packedFixed64) { - msg.packedFixed64 = packedFixed64; + msg.packedFixed64 = packedFixed64.map(BigInt); } - const packedSfixed32 = json[\\"packedSfixed32\\"] ?? json.packed_sfixed32; + const packedSfixed32 = json.packedSfixed32 ?? json.packed_sfixed32; if (packedSfixed32) { msg.packedSfixed32 = packedSfixed32; } - const packedSfixed64 = json[\\"packedSfixed64\\"] ?? json.packed_sfixed64; + const packedSfixed64 = json.packedSfixed64 ?? json.packed_sfixed64; if (packedSfixed64) { - msg.packedSfixed64 = packedSfixed64; + msg.packedSfixed64 = packedSfixed64.map(BigInt); } - const packedFloat = json[\\"packedFloat\\"] ?? json.packed_float; + const packedFloat = json.packedFloat ?? json.packed_float; if (packedFloat) { msg.packedFloat = packedFloat; } - const packedDouble = json[\\"packedDouble\\"] ?? json.packed_double; + const packedDouble = json.packedDouble ?? json.packed_double; if (packedDouble) { msg.packedDouble = packedDouble; } - const packedBool = json[\\"packedBool\\"] ?? json.packed_bool; + const packedBool = json.packedBool ?? json.packed_bool; if (packedBool) { msg.packedBool = packedBool; } - const packedEnum = json[\\"packedEnum\\"] ?? json.packed_enum; + const packedEnum = json.packedEnum ?? json.packed_enum; if (packedEnum) { msg.packedEnum = packedEnum; } @@ -78284,31 +80136,31 @@ export const TestUnpackedTypes = { writer.writeRepeatedInt32(1, msg.repeatedInt32); } if (msg.repeatedInt64?.length) { - writer.writeRepeatedInt64String(2, msg.repeatedInt64); + writer.writeRepeatedInt64String(2, msg.repeatedInt64.toString()); } if (msg.repeatedUint32?.length) { writer.writeRepeatedUint32(3, msg.repeatedUint32); } if (msg.repeatedUint64?.length) { - writer.writeRepeatedUint64String(4, msg.repeatedUint64); + writer.writeRepeatedUint64String(4, msg.repeatedUint64.toString()); } if (msg.repeatedSint32?.length) { writer.writeRepeatedSint32(5, msg.repeatedSint32); } if (msg.repeatedSint64?.length) { - writer.writeRepeatedSint64String(6, msg.repeatedSint64); + writer.writeRepeatedSint64String(6, msg.repeatedSint64.toString()); } if (msg.repeatedFixed32?.length) { writer.writeRepeatedFixed32(7, msg.repeatedFixed32); } if (msg.repeatedFixed64?.length) { - writer.writeRepeatedFixed64String(8, msg.repeatedFixed64); + writer.writeRepeatedFixed64String(8, msg.repeatedFixed64.toString()); } if (msg.repeatedSfixed32?.length) { writer.writeRepeatedSfixed32(9, msg.repeatedSfixed32); } if (msg.repeatedSfixed64?.length) { - writer.writeRepeatedSfixed64(10, msg.repeatedSfixed64); + writer.writeRepeatedSfixed64(10, msg.repeatedSfixed64.toString()); } if (msg.repeatedFloat?.length) { writer.writeRepeatedFloat(11, msg.repeatedFloat); @@ -78333,46 +80185,46 @@ export const TestUnpackedTypes = { ): Record { const json: Record = {}; if (msg.repeatedInt32?.length) { - json[\\"repeatedInt32\\"] = msg.repeatedInt32; + json.repeatedInt32 = msg.repeatedInt32; } if (msg.repeatedInt64?.length) { - json[\\"repeatedInt64\\"] = msg.repeatedInt64; + json.repeatedInt64 = msg.repeatedInt64.map((x) => x.toString()); } if (msg.repeatedUint32?.length) { - json[\\"repeatedUint32\\"] = msg.repeatedUint32; + json.repeatedUint32 = msg.repeatedUint32; } if (msg.repeatedUint64?.length) { - json[\\"repeatedUint64\\"] = msg.repeatedUint64; + json.repeatedUint64 = msg.repeatedUint64.map((x) => x.toString()); } if (msg.repeatedSint32?.length) { - json[\\"repeatedSint32\\"] = msg.repeatedSint32; + json.repeatedSint32 = msg.repeatedSint32; } if (msg.repeatedSint64?.length) { - json[\\"repeatedSint64\\"] = msg.repeatedSint64; + json.repeatedSint64 = msg.repeatedSint64.map((x) => x.toString()); } if (msg.repeatedFixed32?.length) { - json[\\"repeatedFixed32\\"] = msg.repeatedFixed32; + json.repeatedFixed32 = msg.repeatedFixed32; } if (msg.repeatedFixed64?.length) { - json[\\"repeatedFixed64\\"] = msg.repeatedFixed64; + json.repeatedFixed64 = msg.repeatedFixed64.map((x) => x.toString()); } if (msg.repeatedSfixed32?.length) { - json[\\"repeatedSfixed32\\"] = msg.repeatedSfixed32; + json.repeatedSfixed32 = msg.repeatedSfixed32; } if (msg.repeatedSfixed64?.length) { - json[\\"repeatedSfixed64\\"] = msg.repeatedSfixed64; + json.repeatedSfixed64 = msg.repeatedSfixed64.map((x) => x.toString()); } if (msg.repeatedFloat?.length) { - json[\\"repeatedFloat\\"] = msg.repeatedFloat; + json.repeatedFloat = msg.repeatedFloat; } if (msg.repeatedDouble?.length) { - json[\\"repeatedDouble\\"] = msg.repeatedDouble; + json.repeatedDouble = msg.repeatedDouble; } if (msg.repeatedBool?.length) { - json[\\"repeatedBool\\"] = msg.repeatedBool; + json.repeatedBool = msg.repeatedBool; } if (msg.repeatedNestedEnum?.length) { - json[\\"repeatedNestedEnum\\"] = msg.repeatedNestedEnum; + json.repeatedNestedEnum = msg.repeatedNestedEnum; } return json; }, @@ -78392,7 +80244,7 @@ export const TestUnpackedTypes = { break; } case 2: { - msg.repeatedInt64.push(reader.readInt64String()); + msg.repeatedInt64 = reader.readInt64String().map(BigInt); break; } case 3: { @@ -78400,7 +80252,7 @@ export const TestUnpackedTypes = { break; } case 4: { - msg.repeatedUint64.push(reader.readUint64String()); + msg.repeatedUint64 = reader.readUint64String().map(BigInt); break; } case 5: { @@ -78408,7 +80260,7 @@ export const TestUnpackedTypes = { break; } case 6: { - msg.repeatedSint64.push(reader.readSint64()); + msg.repeatedSint64 = reader.readSint64().map(BigInt); break; } case 7: { @@ -78416,7 +80268,7 @@ export const TestUnpackedTypes = { break; } case 8: { - msg.repeatedFixed64.push(reader.readFixed64String()); + msg.repeatedFixed64 = reader.readFixed64String().map(BigInt); break; } case 9: { @@ -78424,7 +80276,7 @@ export const TestUnpackedTypes = { break; } case 10: { - msg.repeatedSfixed64.push(reader.readSfixed64()); + msg.repeatedSfixed64 = reader.readSfixed64().map(BigInt); break; } case 11: { @@ -78461,60 +80313,60 @@ export const TestUnpackedTypes = { msg: TestUnpackedTypes, json: any ): TestUnpackedTypes { - const repeatedInt32 = json[\\"repeatedInt32\\"] ?? json.repeated_int32; + const repeatedInt32 = json.repeatedInt32 ?? json.repeated_int32; if (repeatedInt32) { msg.repeatedInt32 = repeatedInt32; } - const repeatedInt64 = json[\\"repeatedInt64\\"] ?? json.repeated_int64; + const repeatedInt64 = json.repeatedInt64 ?? json.repeated_int64; if (repeatedInt64) { - msg.repeatedInt64 = repeatedInt64; + msg.repeatedInt64 = repeatedInt64.map(BigInt); } - const repeatedUint32 = json[\\"repeatedUint32\\"] ?? json.repeated_uint32; + const repeatedUint32 = json.repeatedUint32 ?? json.repeated_uint32; if (repeatedUint32) { msg.repeatedUint32 = repeatedUint32; } - const repeatedUint64 = json[\\"repeatedUint64\\"] ?? json.repeated_uint64; + const repeatedUint64 = json.repeatedUint64 ?? json.repeated_uint64; if (repeatedUint64) { - msg.repeatedUint64 = repeatedUint64; + msg.repeatedUint64 = repeatedUint64.map(BigInt); } - const repeatedSint32 = json[\\"repeatedSint32\\"] ?? json.repeated_sint32; + const repeatedSint32 = json.repeatedSint32 ?? json.repeated_sint32; if (repeatedSint32) { msg.repeatedSint32 = repeatedSint32; } - const repeatedSint64 = json[\\"repeatedSint64\\"] ?? json.repeated_sint64; + const repeatedSint64 = json.repeatedSint64 ?? json.repeated_sint64; if (repeatedSint64) { - msg.repeatedSint64 = repeatedSint64; + msg.repeatedSint64 = repeatedSint64.map(BigInt); } - const repeatedFixed32 = json[\\"repeatedFixed32\\"] ?? json.repeated_fixed32; + const repeatedFixed32 = json.repeatedFixed32 ?? json.repeated_fixed32; if (repeatedFixed32) { msg.repeatedFixed32 = repeatedFixed32; } - const repeatedFixed64 = json[\\"repeatedFixed64\\"] ?? json.repeated_fixed64; + const repeatedFixed64 = json.repeatedFixed64 ?? json.repeated_fixed64; if (repeatedFixed64) { - msg.repeatedFixed64 = repeatedFixed64; + msg.repeatedFixed64 = repeatedFixed64.map(BigInt); } - const repeatedSfixed32 = json[\\"repeatedSfixed32\\"] ?? json.repeated_sfixed32; + const repeatedSfixed32 = json.repeatedSfixed32 ?? json.repeated_sfixed32; if (repeatedSfixed32) { msg.repeatedSfixed32 = repeatedSfixed32; } - const repeatedSfixed64 = json[\\"repeatedSfixed64\\"] ?? json.repeated_sfixed64; + const repeatedSfixed64 = json.repeatedSfixed64 ?? json.repeated_sfixed64; if (repeatedSfixed64) { - msg.repeatedSfixed64 = repeatedSfixed64; + msg.repeatedSfixed64 = repeatedSfixed64.map(BigInt); } - const repeatedFloat = json[\\"repeatedFloat\\"] ?? json.repeated_float; + const repeatedFloat = json.repeatedFloat ?? json.repeated_float; if (repeatedFloat) { msg.repeatedFloat = repeatedFloat; } - const repeatedDouble = json[\\"repeatedDouble\\"] ?? json.repeated_double; + const repeatedDouble = json.repeatedDouble ?? json.repeated_double; if (repeatedDouble) { msg.repeatedDouble = repeatedDouble; } - const repeatedBool = json[\\"repeatedBool\\"] ?? json.repeated_bool; + const repeatedBool = json.repeatedBool ?? json.repeated_bool; if (repeatedBool) { msg.repeatedBool = repeatedBool; } const repeatedNestedEnum = - json[\\"repeatedNestedEnum\\"] ?? json.repeated_nested_enum; + json.repeatedNestedEnum ?? json.repeated_nested_enum; if (repeatedNestedEnum) { msg.repeatedNestedEnum = repeatedNestedEnum; } @@ -78602,13 +80454,13 @@ export const NestedTestAllTypes = { if (msg.child) { const child = NestedTestAllTypes._writeMessageJSON(msg.child); if (Object.keys(child).length > 0) { - json[\\"child\\"] = child; + json.child = child; } } if (msg.payload) { const payload = TestAllTypes._writeMessageJSON(msg.payload); if (Object.keys(payload).length > 0) { - json[\\"payload\\"] = payload; + json.payload = payload; } } return json; @@ -78648,13 +80500,13 @@ export const NestedTestAllTypes = { msg: NestedTestAllTypes, json: any ): NestedTestAllTypes { - const child = json[\\"child\\"] ?? json.child; + const child = json.child ?? json.child; if (child) { const m = NestedTestAllTypes.initialize(); NestedTestAllTypes._readMessageJSON(m, child); msg.child = m; } - const payload = json[\\"payload\\"] ?? json.payload; + const payload = json.payload ?? json.payload; if (payload) { const m = TestAllTypes.initialize(); TestAllTypes._readMessageJSON(m, payload); @@ -78732,7 +80584,7 @@ export const ForeignMessage = { ): Record { const json: Record = {}; if (msg.c) { - json[\\"c\\"] = msg.c; + json.c = msg.c; } return json; }, @@ -78764,7 +80616,7 @@ export const ForeignMessage = { * @private */ _readMessageJSON: function (msg: ForeignMessage, json: any): ForeignMessage { - const c = json[\\"c\\"] ?? json.c; + const c = json.c ?? json.c; if (c) { msg.c = c; } @@ -78897,7 +80749,7 @@ export const TestMessageWithDummy = { ): Record { const json: Record = {}; if (msg.dummy) { - json[\\"dummy\\"] = msg.dummy; + json.dummy = msg.dummy; } return json; }, @@ -78932,7 +80784,7 @@ export const TestMessageWithDummy = { msg: TestMessageWithDummy, json: any ): TestMessageWithDummy { - const dummy = json[\\"dummy\\"] ?? json.dummy; + const dummy = json.dummy ?? json.dummy; if (dummy) { msg.dummy = dummy; } @@ -79006,7 +80858,7 @@ export const TestOneof2 = { ): Record { const json: Record = {}; if (msg.fooEnum != undefined) { - json[\\"fooEnum\\"] = msg.fooEnum; + json.fooEnum = msg.fooEnum; } return json; }, @@ -79035,7 +80887,7 @@ export const TestOneof2 = { * @private */ _readMessageJSON: function (msg: TestOneof2, json: any): TestOneof2 { - const fooEnum = json[\\"fooEnum\\"] ?? json.foo_enum; + const fooEnum = json.fooEnum ?? json.foo_enum; if (fooEnum) { msg.fooEnum = fooEnum; } diff --git a/src/test-serialization/message.pb.ts b/src/test-serialization/message.pb.ts index d4fccd3f..8fc47ee6 100644 --- a/src/test-serialization/message.pb.ts +++ b/src/test-serialization/message.pb.ts @@ -1,7 +1,6 @@ // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. // Source: message.proto -// Replaced from autogenerated output so that tests run against source code in current branch import type { ByteSource } from "../../src"; import { BinaryReader, BinaryWriter } from "../../src"; @@ -12,18 +11,19 @@ import { BinaryReader, BinaryWriter } from "../../src"; export type Baz = typeof Baz[keyof typeof Baz]; export interface Foo { - fieldOne: number; - fieldTwo: Record; + fieldOne?: number; + fieldTwo: Record; fieldThree: Bar[]; fieldFour: Bar; fieldFive: number[]; fieldSix: Baz; fieldSeven: Baz[]; + fieldEight: bigint; } export interface Bar { fieldOne: string; - fieldTwo: Record; + fieldTwo: Record; fieldThree: number[]; } @@ -67,13 +67,13 @@ export const Foo = { */ initialize: function (): Foo { return { - fieldOne: 0, fieldTwo: {}, fieldThree: [], fieldFour: Bar.initialize(), fieldFive: [], fieldSix: 0, fieldSeven: [], + fieldEight: 0n, }; }, @@ -84,15 +84,17 @@ export const Foo = { msg: Partial, writer: BinaryWriter ): BinaryWriter { - if (msg.fieldOne) { + if (msg.fieldOne != undefined) { writer.writeInt32(1, msg.fieldOne); } if (msg.fieldTwo) { - for (const key in msg.fieldTwo) { - writer.writeMessage(2, {}, (_, mapWriter) => { - mapWriter.writeString(1, key as unknown as string); - mapWriter.writeInt32(2, msg.fieldTwo![key]); - }); + for (const [key, value] of Object.entries(msg.fieldTwo)) { + if (key && value) { + writer.writeMessage(2, {}, (_, mapWriter) => { + mapWriter.writeString(1, key as any); + mapWriter.writeMessage(2, value, Bar._writeMessage); + }); + } } } if (msg.fieldThree?.length) { @@ -110,6 +112,9 @@ export const Foo = { if (msg.fieldSeven?.length) { writer.writeRepeatedEnum(7, msg.fieldSeven); } + if (msg.fieldEight) { + writer.writeInt64String(8, msg.fieldEight.toString()); + } return writer; }, @@ -118,32 +123,41 @@ export const Foo = { */ _writeMessageJSON: function (msg: Partial): Record { const json: Record = {}; - if (msg.fieldOne) { - json["fieldOne"] = msg.fieldOne; + if (msg.fieldOne != undefined) { + json.fieldOne = msg.fieldOne; } if (msg.fieldTwo) { - if (Object.keys(msg.fieldTwo).length > 0) { - json["fieldTwo"] = msg.fieldTwo; + if (msg.fieldTwo) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.fieldTwo)) { + if (key && value) { + map[key] = Bar._writeMessageJSON(value); + json.fieldTwo = map; + } + } } } if (msg.fieldThree?.length) { - json["fieldThree"] = msg.fieldThree.map(Bar._writeMessageJSON); + json.fieldThree = msg.fieldThree.map(Bar._writeMessageJSON); } if (msg.fieldFour) { const fieldFour = Bar._writeMessageJSON(msg.fieldFour); if (Object.keys(fieldFour).length > 0) { - json["fieldFour"] = fieldFour; + json.fieldFour = fieldFour; } } if (msg.fieldFive?.length) { - json["fieldFive"] = msg.fieldFive; + json.fieldFive = msg.fieldFive; } if (msg.fieldSix) { - json["fieldSix"] = msg.fieldSix; + json.fieldSix = msg.fieldSix; } if (msg.fieldSeven?.length) { json["luckySeven"] = msg.fieldSeven; } + if (msg.fieldEight) { + json.fieldEight = msg.fieldEight.toString(); + } return json; }, @@ -161,7 +175,7 @@ export const Foo = { case 2: { reader.readMessage(undefined, () => { let key: string | undefined; - let value = 0; + let value = undefined; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -170,7 +184,7 @@ export const Foo = { break; } case 2: { - value = reader.readInt32(); + reader.readMessage(Bar.initialize(), Bar._readMessage); break; } } @@ -203,6 +217,10 @@ export const Foo = { msg.fieldSeven.push(reader.readEnum() as Baz); break; } + case 8: { + msg.fieldEight = BigInt(reader.readInt64String()); + break; + } default: { reader.skipField(); break; @@ -216,15 +234,17 @@ export const Foo = { * @private */ _readMessageJSON: function (msg: Foo, json: any): Foo { - const fieldOne = json["fieldOne"] ?? json.field_one; + const fieldOne = json.fieldOne ?? json.field_one; if (fieldOne) { msg.fieldOne = fieldOne; } - const fieldTwo = json["fieldTwo"] ?? json.field_two; + const fieldTwo = json.fieldTwo ?? json.field_two; if (fieldTwo) { - msg.fieldTwo = fieldTwo; + for (const [key, value] of Object.entries(fieldTwo)) { + msg.fieldTwo[key] = Bar._readMessageJSON(Bar.initialize(), value); + } } - const fieldThree = json["fieldThree"] ?? json.field_three; + const fieldThree = json.fieldThree ?? json.field_three; if (fieldThree) { for (const item of fieldThree) { const m = Bar.initialize(); @@ -232,17 +252,17 @@ export const Foo = { msg.fieldThree.push(m); } } - const fieldFour = json["fieldFour"] ?? json.field_four; + const fieldFour = json.fieldFour ?? json.field_four; if (fieldFour) { const m = Bar.initialize(); Bar._readMessageJSON(m, fieldFour); msg.fieldFour = m; } - const fieldFive = json["fieldFive"] ?? json.field_five; + const fieldFive = json.fieldFive ?? json.field_five; if (fieldFive) { msg.fieldFive = fieldFive; } - const fieldSix = json["fieldSix"] ?? json.field_six; + const fieldSix = json.fieldSix ?? json.field_six; if (fieldSix) { msg.fieldSix = fieldSix; } @@ -250,6 +270,10 @@ export const Foo = { if (fieldSeven) { msg.fieldSeven = fieldSeven; } + const fieldEight = json.fieldEight ?? json.field_eight; + if (fieldEight) { + msg.fieldEight = BigInt(fieldEight); + } return msg; }, }; @@ -305,11 +329,13 @@ export const Bar = { writer.writeString(1, msg.fieldOne); } if (msg.fieldTwo) { - for (const key in msg.fieldTwo) { - writer.writeMessage(2, {}, (_, mapWriter) => { - mapWriter.writeString(1, key as unknown as string); - mapWriter.writeInt32(2, msg.fieldTwo![key]); - }); + for (const [key, value] of Object.entries(msg.fieldTwo)) { + if (key && value) { + writer.writeMessage(2, {}, (_, mapWriter) => { + mapWriter.writeString(1, key as any); + mapWriter.writeInt64String(2, value.toString()); + }); + } } } if (msg.fieldThree?.length) { @@ -324,15 +350,21 @@ export const Bar = { _writeMessageJSON: function (msg: Partial): Record { const json: Record = {}; if (msg.fieldOne) { - json["fieldOne"] = msg.fieldOne; + json.fieldOne = msg.fieldOne; } if (msg.fieldTwo) { - if (Object.keys(msg.fieldTwo).length > 0) { - json["fieldTwo"] = msg.fieldTwo; + if (msg.fieldTwo) { + const map: Record = {}; + for (const [key, value] of Object.entries(msg.fieldTwo)) { + if (key && value) { + map[key] = value.toString(); + json.fieldTwo = map; + } + } } } if (msg.fieldThree?.length) { - json["fieldThree"] = msg.fieldThree; + json.fieldThree = msg.fieldThree; } return json; }, @@ -351,7 +383,7 @@ export const Bar = { case 2: { reader.readMessage(undefined, () => { let key: string | undefined; - let value = 0; + let value = 0n; while (reader.nextField()) { const field = reader.getFieldNumber(); switch (field) { @@ -360,7 +392,7 @@ export const Bar = { break; } case 2: { - value = reader.readInt32(); + value = BigInt(reader.readInt64String()); break; } } @@ -388,15 +420,17 @@ export const Bar = { * @private */ _readMessageJSON: function (msg: Bar, json: any): Bar { - const fieldOne = json["fieldOne"] ?? json.field_one; + const fieldOne = json.fieldOne ?? json.field_one; if (fieldOne) { msg.fieldOne = fieldOne; } - const fieldTwo = json["fieldTwo"] ?? json.field_two; + const fieldTwo = json.fieldTwo ?? json.field_two; if (fieldTwo) { - msg.fieldTwo = fieldTwo; + for (const [key, value] of Object.entries(fieldTwo)) { + msg.fieldTwo[key] = BigInt(value as string); + } } - const fieldThree = json["fieldThree"] ?? json.field_three; + const fieldThree = json.fieldThree ?? json.field_three; if (fieldThree) { msg.fieldThree = fieldThree; } diff --git a/src/test-serialization/message.proto b/src/test-serialization/message.proto index e9130839..7e16706b 100644 --- a/src/test-serialization/message.proto +++ b/src/test-serialization/message.proto @@ -1,18 +1,19 @@ syntax = "proto3"; message Foo { - int32 field_one = 1; - map field_two = 2; + optional int32 field_one = 1; + map field_two = 2; repeated Bar field_three = 3; Bar field_four = 4; repeated int32 field_five = 5; Baz field_six = 6; repeated Baz field_seven = 7 [json_name="luckySeven"]; + int64 field_eight = 8; } message Bar { string field_one = 1; - map field_two = 2; + map field_two = 2; repeated int32 field_three = 3; } diff --git a/src/test-serialization/test.ts b/src/test-serialization/test.ts index b54a7d82..fcc1cc49 100644 --- a/src/test-serialization/test.ts +++ b/src/test-serialization/test.ts @@ -1,19 +1,65 @@ import { describe, it } from "@jest/globals"; import { Baz, Foo } from "./message.pb"; +const fullMessage: Foo = { + fieldOne: 3, + fieldTwo: { + foo: { + fieldOne: "foo", + fieldTwo: { + foo: 3n, + bar: 4n, + }, + + fieldThree: [1, 2, 3], + }, + }, + + fieldThree: [ + { + fieldOne: "foo", + fieldTwo: { + foo: 3n, + bar: 4n, + }, + + fieldThree: [1, 2, 3], + }, + ], + + fieldFour: { + fieldOne: "foo", + fieldTwo: { + foo: 3n, + bar: 4n, + }, + + fieldThree: [1, 2, 3], + }, + + fieldFive: [1, 2], + fieldSix: Baz.BAR, + fieldSeven: [Baz.BAR, Baz.FOO], + fieldEight: 223372036854775807n, +}; + +const partialMessage: Partial = { + fieldOne: 3, +}; + describe("Serialization/Deserialization", () => { describe("protobuf", () => { describe("deserialization", () => { it("empty deserialization", () => { expect(Foo.decode(Foo.encode({}))).toMatchInlineSnapshot(` Object { + "fieldEight": 0n, "fieldFive": Array [], "fieldFour": Object { "fieldOne": "", "fieldThree": Array [], "fieldTwo": Object {}, }, - "fieldOne": 0, "fieldSeven": Array [], "fieldSix": 0, "fieldThree": Array [], @@ -23,14 +69,9 @@ describe("Serialization/Deserialization", () => { }); it("partial deserialization", () => { - expect( - Foo.decode( - Foo.encode({ - fieldOne: 3, - }) - ) - ).toMatchInlineSnapshot(` + expect(Foo.decode(Foo.encode(partialMessage))).toMatchInlineSnapshot(` Object { + "fieldEight": 0n, "fieldFive": Array [], "fieldFour": Object { "fieldOne": "", @@ -49,13 +90,13 @@ describe("Serialization/Deserialization", () => { it("default message deserialization", () => { expect(Foo.decode(Foo.encode(Foo.initialize()))).toMatchInlineSnapshot(` Object { + "fieldEight": 0n, "fieldFive": Array [], "fieldFour": Object { "fieldOne": "", "fieldThree": Array [], "fieldTwo": Object {}, }, - "fieldOne": 0, "fieldSeven": Array [], "fieldSix": 0, "fieldThree": Array [], @@ -65,43 +106,9 @@ describe("Serialization/Deserialization", () => { }); it("full deserialization", () => { - expect( - Foo.decode( - Foo.encode({ - fieldOne: 3, - fieldTwo: { - foo: 4, - }, - - fieldThree: [ - { - fieldOne: "foo", - fieldTwo: { - foo: 3, - bar: 4, - }, - - fieldThree: [1, 2, 3], - }, - ], - - fieldFour: { - fieldOne: "foo", - fieldTwo: { - foo: 3, - bar: 4, - }, - - fieldThree: [1, 2, 3], - }, - - fieldFive: [1, 2], - fieldSix: Baz.BAR, - fieldSeven: [Baz.BAR, Baz.FOO], - }) - ) - ).toMatchInlineSnapshot(` + expect(Foo.decode(Foo.encode(fullMessage))).toMatchInlineSnapshot(` Object { + "fieldEight": 223372036854775807n, "fieldFive": Array [ 1, 2, @@ -114,8 +121,8 @@ describe("Serialization/Deserialization", () => { 3, ], "fieldTwo": Object { - "bar": 4, - "foo": 3, + "bar": 4n, + "foo": 3n, }, }, "fieldOne": 3, @@ -133,13 +140,13 @@ describe("Serialization/Deserialization", () => { 3, ], "fieldTwo": Object { - "bar": 4, - "foo": 3, + "bar": 4n, + "foo": 3n, }, }, ], "fieldTwo": Object { - "foo": 4, + "foo": undefined, }, } `); @@ -152,11 +159,7 @@ describe("Serialization/Deserialization", () => { }); it("partial serialization", () => { - expect( - Foo.encode({ - fieldOne: 3, - }) - ).toMatchInlineSnapshot(` + expect(Foo.encode(partialMessage)).toMatchInlineSnapshot(` Uint8Array [ 8, 3, @@ -174,44 +177,25 @@ describe("Serialization/Deserialization", () => { }); it("full serialization", () => { - expect( - Foo.encode({ - fieldOne: 3, - fieldTwo: { - foo: 4, - }, - - fieldThree: [ - { - fieldOne: "foo", - fieldTwo: { - foo: 3, - bar: 4, - }, - - fieldThree: [1, 2, 3], - }, - ], - - fieldFour: { - fieldOne: "foo", - fieldTwo: { - foo: 3, - bar: 4, - }, - - fieldThree: [1, 2, 3], - }, - - fieldFive: [1, 2], - fieldSix: Baz.BAR, - fieldSeven: [Baz.BAR, Baz.FOO], - }) - ).toMatchInlineSnapshot(` + expect(Foo.encode(fullMessage)).toMatchInlineSnapshot(` Uint8Array [ 8, 3, 18, + 36, + 10, + 3, + 102, + 111, + 111, + 18, + 29, + 10, + 3, + 102, + 111, + 111, + 18, 7, 10, 3, @@ -219,7 +203,22 @@ describe("Serialization/Deserialization", () => { 111, 111, 16, + 3, + 18, + 7, + 10, + 3, + 98, + 97, + 114, + 16, 4, + 24, + 1, + 24, + 2, + 24, + 3, 26, 29, 10, @@ -292,6 +291,16 @@ describe("Serialization/Deserialization", () => { 1, 56, 0, + 64, + 255, + 255, + 239, + 235, + 241, + 245, + 228, + 140, + 3, ] `); }); @@ -303,13 +312,13 @@ describe("Serialization/Deserialization", () => { it("empty deserialization", () => { expect(Foo.decodeJSON(Foo.encodeJSON({}))).toMatchInlineSnapshot(` Object { + "fieldEight": 0n, "fieldFive": Array [], "fieldFour": Object { "fieldOne": "", "fieldThree": Array [], "fieldTwo": Object {}, }, - "fieldOne": 0, "fieldSeven": Array [], "fieldSix": 0, "fieldThree": Array [], @@ -319,14 +328,10 @@ describe("Serialization/Deserialization", () => { }); it("partial deserialization", () => { - expect( - Foo.decodeJSON( - Foo.encodeJSON({ - fieldOne: 3, - }) - ) - ).toMatchInlineSnapshot(` + expect(Foo.decodeJSON(Foo.encodeJSON(partialMessage))) + .toMatchInlineSnapshot(` Object { + "fieldEight": 0n, "fieldFive": Array [], "fieldFour": Object { "fieldOne": "", @@ -346,13 +351,13 @@ describe("Serialization/Deserialization", () => { expect(Foo.decodeJSON(Foo.encodeJSON(Foo.initialize()))) .toMatchInlineSnapshot(` Object { + "fieldEight": 0n, "fieldFive": Array [], "fieldFour": Object { "fieldOne": "", "fieldThree": Array [], "fieldTwo": Object {}, }, - "fieldOne": 0, "fieldSeven": Array [], "fieldSix": 0, "fieldThree": Array [], @@ -362,43 +367,10 @@ describe("Serialization/Deserialization", () => { }); it("full deserialization", () => { - expect( - Foo.decodeJSON( - Foo.encodeJSON({ - fieldOne: 3, - fieldTwo: { - foo: 4, - }, - - fieldThree: [ - { - fieldOne: "foo", - fieldTwo: { - foo: 3, - bar: 4, - }, - - fieldThree: [1, 2, 3], - }, - ], - - fieldFour: { - fieldOne: "foo", - fieldTwo: { - foo: 3, - bar: 4, - }, - - fieldThree: [1, 2, 3], - }, - - fieldFive: [1, 2], - fieldSix: Baz.BAR, - fieldSeven: [Baz.BAR, Baz.FOO], - }) - ) - ).toMatchInlineSnapshot(` + expect(Foo.decodeJSON(Foo.encodeJSON(fullMessage))) + .toMatchInlineSnapshot(` Object { + "fieldEight": 223372036854775807n, "fieldFive": Array [ 1, 2, @@ -411,8 +383,8 @@ describe("Serialization/Deserialization", () => { 3, ], "fieldTwo": Object { - "bar": 4, - "foo": 3, + "bar": 4n, + "foo": 3n, }, }, "fieldOne": 3, @@ -430,13 +402,24 @@ describe("Serialization/Deserialization", () => { 3, ], "fieldTwo": Object { - "bar": 4, - "foo": 3, + "bar": 4n, + "foo": 3n, }, }, ], "fieldTwo": Object { - "foo": 4, + "foo": Object { + "fieldOne": "foo", + "fieldThree": Array [ + 1, + 2, + 3, + ], + "fieldTwo": Object { + "bar": 4n, + "foo": 3n, + }, + }, }, } `); @@ -445,6 +428,7 @@ describe("Serialization/Deserialization", () => { it("original proto field name", () => { expect(Foo.decodeJSON('{ "field_one": 3 }')).toMatchInlineSnapshot(` Object { + "fieldEight": 0n, "fieldFive": Array [], "fieldFour": Object { "fieldOne": "", @@ -467,11 +451,9 @@ describe("Serialization/Deserialization", () => { }); it("partial serialization", () => { - expect( - Foo.encodeJSON({ - fieldOne: 3, - }) - ).toMatchInlineSnapshot(`"{\\"fieldOne\\":3}"`); + expect(Foo.encodeJSON(partialMessage)).toMatchInlineSnapshot( + `"{\\"fieldOne\\":3}"` + ); }); it("default message serialization", () => { @@ -479,41 +461,8 @@ describe("Serialization/Deserialization", () => { }); it("full serialization", () => { - expect( - Foo.encodeJSON({ - fieldOne: 3, - fieldTwo: { - foo: 4, - }, - - fieldThree: [ - { - fieldOne: "foo", - fieldTwo: { - foo: 3, - bar: 4, - }, - - fieldThree: [1, 2, 3], - }, - ], - - fieldFour: { - fieldOne: "foo", - fieldTwo: { - foo: 3, - bar: 4, - }, - - fieldThree: [1, 2, 3], - }, - - fieldFive: [1, 2], - fieldSix: Baz.BAR, - fieldSeven: [Baz.BAR, Baz.FOO], - }) - ).toMatchInlineSnapshot( - `"{\\"fieldOne\\":3,\\"fieldTwo\\":{\\"foo\\":4},\\"fieldThree\\":[{\\"fieldOne\\":\\"foo\\",\\"fieldTwo\\":{\\"foo\\":3,\\"bar\\":4},\\"fieldThree\\":[1,2,3]}],\\"fieldFour\\":{\\"fieldOne\\":\\"foo\\",\\"fieldTwo\\":{\\"foo\\":3,\\"bar\\":4},\\"fieldThree\\":[1,2,3]},\\"fieldFive\\":[1,2],\\"fieldSix\\":1,\\"luckySeven\\":[1,0]}"` + expect(Foo.encodeJSON(fullMessage)).toMatchInlineSnapshot( + `"{\\"fieldOne\\":3,\\"fieldTwo\\":{\\"foo\\":{\\"fieldOne\\":\\"foo\\",\\"fieldTwo\\":{\\"foo\\":\\"3\\",\\"bar\\":\\"4\\"},\\"fieldThree\\":[1,2,3]}},\\"fieldThree\\":[{\\"fieldOne\\":\\"foo\\",\\"fieldTwo\\":{\\"foo\\":\\"3\\",\\"bar\\":\\"4\\"},\\"fieldThree\\":[1,2,3]}],\\"fieldFour\\":{\\"fieldOne\\":\\"foo\\",\\"fieldTwo\\":{\\"foo\\":\\"3\\",\\"bar\\":\\"4\\"},\\"fieldThree\\":[1,2,3]},\\"fieldFive\\":[1,2],\\"fieldSix\\":1,\\"luckySeven\\":[1,0],\\"fieldEight\\":\\"223372036854775807\\"}"` ); }); }); diff --git a/src/utils.ts b/src/utils.ts index 238655b5..197120db 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -105,21 +105,21 @@ export function getDescriptor( } case FieldDescriptorProto.Type.TYPE_INT64: { return { - defaultValue: "''", + defaultValue: "0n", optional, read: "readInt64String", repeated, - tsType: "string", + tsType: "bigint", write: repeated ? "writeRepeatedInt64String" : "writeInt64String", }; } case FieldDescriptorProto.Type.TYPE_UINT64: { return { - defaultValue: "''", + defaultValue: "0n", optional, read: "readUint64String", repeated, - tsType: "string", + tsType: "bigint", write: repeated ? "writeRepeatedUint64String" : "writeUint64String", }; } @@ -135,11 +135,11 @@ export function getDescriptor( } case FieldDescriptorProto.Type.TYPE_FIXED64: { return { - defaultValue: repeated ? "[]" : "''", + defaultValue: "0n", optional, read: "readFixed64String", repeated, - tsType: "string", + tsType: "bigint", write: repeated ? "writeRepeatedFixed64String" : "writeFixed64String", }; } @@ -259,11 +259,11 @@ export function getDescriptor( } case FieldDescriptorProto.Type.TYPE_SFIXED64: { return { - defaultValue: "''", + defaultValue: "0n", optional, read: "readSfixed64", repeated, - tsType: "string", + tsType: "bigint", write: repeated ? "writeRepeatedSfixed64" : "writeSfixed64", }; } @@ -279,11 +279,11 @@ export function getDescriptor( } case FieldDescriptorProto.Type.TYPE_SINT64: { return { - defaultValue: "''", + defaultValue: "0n", optional, read: "readSint64", repeated, - tsType: "string", + tsType: "bigint", write: repeated ? "writeRepeatedSint64String" : "writeSint64String", }; } diff --git a/tsconfig.json b/tsconfig.json index 01bb3e33..98800c6f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,5 @@ { "compilerOptions": { - "allowJs": true, "declaration": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, @@ -17,7 +16,7 @@ "skipLibCheck": true, "sourceMap": false, "strict": true, - "target": "ES2019" + "target": "ES2020" }, "include": ["src"] }