From 9b090bb1673aeb9b8f1d7162316fce4d7a3348f0 Mon Sep 17 00:00:00 2001 From: dcodeIO Date: Mon, 16 Jan 2017 18:33:27 +0100 Subject: [PATCH] New: Switched to own property-aware encoders for compatibility, see #639 --- cli/pbjs.js | 2 +- cli/targets/static.js | 8 +- src/converter.js | 32 +- src/encoder.js | 22 +- src/util/runtime.js | 28 - tests/data/ambiguous-names.js | 24 +- tests/data/comments.js | 27 +- tests/data/convert.js | 122 +- tests/data/mapbox/vector_tile.js | 206 ++- tests/data/package.js | 192 ++- tests/data/rpc.js | 24 +- tests/data/test.js | 2028 ++++++++++++------------------ tests/data/test.min.js | 6 - tests/data/test.min.js.gz | Bin 20144 -> 0 bytes tests/package.js | 2 + 15 files changed, 1046 insertions(+), 1677 deletions(-) delete mode 100644 tests/data/test.min.js delete mode 100644 tests/data/test.min.js.gz diff --git a/cli/pbjs.js b/cli/pbjs.js index dc513fe9e..56b337685 100644 --- a/cli/pbjs.js +++ b/cli/pbjs.js @@ -20,7 +20,7 @@ var targets = util.requireAll("./targets"); * @returns {number|undefined} Exit code, if known */ exports.main = function(args, callback) { - var lintDefault = "eslint-disable block-scoped-var, no-redeclare, no-control-regex"; + var lintDefault = "eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins"; var argv = minimist(args, { alias: { target : "t", diff --git a/cli/targets/static.js b/cli/targets/static.js index d881b6f9a..eb2a85d51 100644 --- a/cli/targets/static.js +++ b/cli/targets/static.js @@ -205,10 +205,10 @@ function buildFunction(type, functionName, gen, scope) { var code = gen.str(functionName) .replace(/\(this.ctor\)/g, " $root" + type.fullName) // types: construct directly instead of using reflected ctor .replace(/(types\[\d+])(\.values)/g, "$1") // enums: use types[N] instead of reflected types[N].values - .replace(/\b(?!\.)Writer\b/g, "$Writer") // use common aliases instead of binding through an iife - .replace(/\b(?!\.)Reader\b/g, "$Reader") - .replace(/\b(?!\.)util\.\b/g, "$util.") - .replace(/\b(?!\.)types\[\b/g, "$types["); + .replace(/\b(?!\.)Writer\b/g, "$Writer") // use common aliases instead of binding through an iife + .replace(/\b(?!\.)Reader\b/g, "$Reader") // " + .replace(/\b(?!\.)util\.\b/g, "$util.") // " + .replace(/\b(?!\.)types\[\b/g, "$types["); // " if (config.beautify) code = beautifyCode(code); diff --git a/src/converter.js b/src/converter.js index bda6a78b8..11011e3db 100644 --- a/src/converter.js +++ b/src/converter.js @@ -230,37 +230,27 @@ converter.toObject = function toObject(mtype) { ("d%s=%j", field._prop, field.typeDefault); // also messages (=null) }); gen ("}"); - } gen - ("for(var ks=Object.keys(m),i=0;i>> 0, 8 | types.mapKey[keyType], keyType); if (wireType === undefined) gen @@ -60,7 +62,7 @@ function encoder(mtype) { // Packed repeated if (field.packed && types.packed[type] !== undefined) { gen - ("if(%s&&%s.length){", ref, ref) + ("if(m.hasOwnProperty(%j)&&%s.length){", field.name, ref) ("w.uint32(%d).fork()", (field.id << 3 | 2) >>> 0) ("for(var i=0;i<%s.length;++i)", ref) ("w.%s(%s[i])", type, ref) @@ -70,7 +72,7 @@ function encoder(mtype) { // Non-packed } else { gen - ("if(%s){", ref) + ("if(m.hasOwnProperty(%j)){", field.name) ("for(var i=0;i<%s.length;++i)", ref); if (wireType === undefined) genTypePartial(gen, field, i, ref + "[i]"); @@ -82,18 +84,18 @@ function encoder(mtype) { } // Non-repeated - } else if (!field.partOf) { // see below for oneofs + } else { if (!field.required) { if (field.long) gen - ("if(%s!==undefined&&%s!==null&&util.longNe(%s,%d,%d))", ref, ref, ref, field.defaultValue.low, field.defaultValue.high); + ("if(m.hasOwnProperty(%j)&&%s!==undefined&&%s!==null)", field.name, ref, ref); else if (field.bytes) gen - ("if(%s&&%s.length" + (field.defaultValue.length ? "&&util.arrayNe(%s,%j)" : "") + ")", ref, ref, ref, Array.prototype.slice.call(field.defaultValue)); + ("if(m.hasOwnProperty(%j)&&%s)", field.name, ref); else gen - ("if(%s!==undefined&&%s!==%j)", ref, ref, field.defaultValue); + ("if(m.hasOwnProperty(%j)&&%s!==undefined)", field.name, ref); } - + if (wireType === undefined) genTypePartial(gen, field, i, ref); else gen diff --git a/src/util/runtime.js b/src/util/runtime.js index b142687b7..17bc96d29 100644 --- a/src/util/runtime.js +++ b/src/util/runtime.js @@ -106,20 +106,6 @@ util.newBuffer = function newBuffer(sizeOrArray) { */ util.Array = typeof Uint8Array === "undefined" ? Array : Uint8Array; -/** - * Tests if two arrays are not equal. - * @param {Array.<*>} a Array 1 - * @param {Array.<*>} b Array 2 - * @returns {boolean} `true` if not equal, otherwise `false` - */ -util.arrayNe = function arrayNe(a, b) { - if (a.length === b.length) - for (var i = 0; i < a.length; ++i) - if (a[i] !== b[i]) - return true; - return false; -}; - util.LongBits = require("./longbits"); /** @@ -152,20 +138,6 @@ util.longFromHash = function longFromHash(hash, unsigned) { return bits.toNumber(Boolean(unsigned)); }; -/** - * Tests if a possibily long value equals the specified low and high bits. - * @param {number|string|Long} val Value to test - * @param {number} lo Low bits to test against - * @param {number} hi High bits to test against - * @returns {boolean} `true` if not equal - */ -util.longNe = function longNe(val, lo, hi) { - if (typeof val === "object") // Long-like, null is invalid and throws - return val.low !== lo || val.high !== hi; - var bits = util.LongBits.from(val); - return bits.lo !== lo || bits.hi !== hi; -}; - /** * Merges the properties of the source object into the destination object. * @param {Object.} dst Destination object diff --git a/tests/data/ambiguous-names.js b/tests/data/ambiguous-names.js index 12c62a4f1..387e30a7f 100644 --- a/tests/data/ambiguous-names.js +++ b/tests/data/ambiguous-names.js @@ -1,4 +1,4 @@ -/*eslint-disable block-scoped-var, no-redeclare, no-control-regex*/ +/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/ "use strict"; var $protobuf = require("../../runtime"); @@ -54,7 +54,7 @@ $root.A = (function() { A.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.whatever !== undefined && message.whatever !== "") + if (message.hasOwnProperty("whatever") && message.whatever !== undefined) writer.uint32(/* id 1, wireType 2 =*/10).string(message.whatever); return writer; }; @@ -148,13 +148,8 @@ $root.A = (function() { var object = {}; if (options.defaults) object.whatever = ""; - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "whatever": - object.whatever = message.whatever; - break; - } + if (message.hasOwnProperty("whatever") && message.whatever !== undefined && message.whatever !== null) + object.whatever = message.whatever; return object; }; @@ -223,7 +218,7 @@ $root.B = (function() { B.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.A !== undefined && message.A !== null) + if (message.hasOwnProperty("A") && message.A !== undefined) $types[0].encode(message.A, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; @@ -319,13 +314,8 @@ $root.B = (function() { var object = {}; if (options.defaults) object.A = null; - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "A": - object.A = $types[0].toObject(message.A, options); - break; - } + if (message.hasOwnProperty("A") && message.A !== undefined && message.A !== null) + object.A = $types[0].toObject(message.A, options); return object; }; diff --git a/tests/data/comments.js b/tests/data/comments.js index 1b2870522..0bb7695d5 100644 --- a/tests/data/comments.js +++ b/tests/data/comments.js @@ -1,4 +1,4 @@ -/*eslint-disable block-scoped-var, no-redeclare, no-control-regex*/ +/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/ "use strict"; var $protobuf = require("../../runtime"); @@ -70,11 +70,11 @@ $root.Test1 = (function() { Test1.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.field1 !== undefined && message.field1 !== "") + if (message.hasOwnProperty("field1") && message.field1 !== undefined) writer.uint32(/* id 1, wireType 2 =*/10).string(message.field1); - if (message.field2 !== undefined && message.field2 !== 0) + if (message.hasOwnProperty("field2") && message.field2 !== undefined) writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.field2); - if (message.field3 !== undefined && message.field3 !== false) + if (message.hasOwnProperty("field3") && message.field3 !== undefined) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.field3); return writer; }; @@ -187,19 +187,12 @@ $root.Test1 = (function() { object.field2 = 0; object.field3 = false; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "field1": - object.field1 = message.field1; - break; - case "field2": - object.field2 = message.field2; - break; - case "field3": - object.field3 = message.field3; - break; - } + if (message.hasOwnProperty("field1") && message.field1 !== undefined && message.field1 !== null) + object.field1 = message.field1; + if (message.hasOwnProperty("field2") && message.field2 !== undefined && message.field2 !== null) + object.field2 = message.field2; + if (message.hasOwnProperty("field3") && message.field3 !== undefined && message.field3 !== null) + object.field3 = message.field3; return object; }; diff --git a/tests/data/convert.js b/tests/data/convert.js index 63759b2ac..34ef803d0 100644 --- a/tests/data/convert.js +++ b/tests/data/convert.js @@ -1,4 +1,4 @@ -/*eslint-disable block-scoped-var, no-redeclare, no-control-regex*/ +/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/ "use strict"; var $protobuf = require("../../runtime"); @@ -108,33 +108,33 @@ $root.Message = (function() { Message.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.stringVal !== undefined && message.stringVal !== "") + if (message.hasOwnProperty("stringVal") && message.stringVal !== undefined) writer.uint32(/* id 1, wireType 2 =*/10).string(message.stringVal); - if (message.stringRepeated) + if (message.hasOwnProperty("stringRepeated")) for (var i = 0; i < message.stringRepeated.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).string(message.stringRepeated[i]); - if (message.uint64Val !== undefined && message.uint64Val !== null && $util.longNe(message.uint64Val, 0, 0)) + if (message.hasOwnProperty("uint64Val") && message.uint64Val !== undefined && message.uint64Val !== null) writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.uint64Val); - if (message.uint64Repeated && message.uint64Repeated.length) { + if (message.hasOwnProperty("uint64Repeated") && message.uint64Repeated.length) { writer.uint32(/* id 4, wireType 2 =*/34).fork(); for (var i = 0; i < message.uint64Repeated.length; ++i) writer.uint64(message.uint64Repeated[i]); writer.ldelim(); } - if (message.bytesVal && message.bytesVal.length) + if (message.hasOwnProperty("bytesVal") && message.bytesVal) writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.bytesVal); - if (message.bytesRepeated) + if (message.hasOwnProperty("bytesRepeated")) for (var i = 0; i < message.bytesRepeated.length; ++i) writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.bytesRepeated[i]); - if (message.enumVal !== undefined && message.enumVal !== 1) + if (message.hasOwnProperty("enumVal") && message.enumVal !== undefined) writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.enumVal); - if (message.enumRepeated && message.enumRepeated.length) { + if (message.hasOwnProperty("enumRepeated") && message.enumRepeated.length) { writer.uint32(/* id 8, wireType 2 =*/66).fork(); for (var i = 0; i < message.enumRepeated.length; ++i) writer.uint32(message.enumRepeated[i]); writer.ldelim(); } - if (message.int64Map && message.int64Map !== $util.emptyObject) + if (message.hasOwnProperty("int64Map") && message.int64Map) for (var keys = Object.keys(message.int64Map), i = 0; i < keys.length; ++i) writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.int64Map[keys[i]]).ldelim(); return writer; @@ -423,66 +423,48 @@ $root.Message = (function() { object.bytesVal = options.bytes === String ? "" : []; object.enumVal = options.enums === String ? "ONE" : 1; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "stringVal": - object.stringVal = message.stringVal; - break; - case "stringRepeated": - if (message.stringRepeated.length) { - object.stringRepeated = []; - for (var j = 0; j < message.stringRepeated.length; ++j) - object.stringRepeated[j] = message.stringRepeated[j]; - } - break; - case "uint64Val": - if (typeof message.uint64Val === "number") - object.uint64Val = options.longs === String ? String(message.uint64Val) : message.uint64Val; - else - object.uint64Val = options.longs === String ? $util.Long.prototype.toString.call(message.uint64Val) : options.longs === Number ? new $util.LongBits(message.uint64Val.low, message.uint64Val.high).toNumber(true) : message.uint64Val; - break; - case "uint64Repeated": - if (message.uint64Repeated.length) { - object.uint64Repeated = []; - for (var j = 0; j < message.uint64Repeated.length; ++j) - if (typeof message.uint64Repeated[j] === "number") - object.uint64Repeated[j] = options.longs === String ? String(message.uint64Repeated[j]) : message.uint64Repeated[j]; - else - object.uint64Repeated[j] = options.longs === String ? $util.Long.prototype.toString.call(message.uint64Repeated[j]) : options.longs === Number ? new $util.LongBits(message.uint64Repeated[j].low, message.uint64Repeated[j].high).toNumber(true) : message.uint64Repeated[j]; - } - break; - case "bytesVal": - object.bytesVal = options.bytes === String ? $util.base64.encode(message.bytesVal, 0, message.bytesVal.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesVal) : message.bytesVal; - break; - case "bytesRepeated": - if (message.bytesRepeated.length) { - object.bytesRepeated = []; - for (var j = 0; j < message.bytesRepeated.length; ++j) - object.bytesRepeated[j] = options.bytes === String ? $util.base64.encode(message.bytesRepeated[j], 0, message.bytesRepeated[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesRepeated[j]) : message.bytesRepeated[j]; - } - break; - case "enumVal": - object.enumVal = options.enums === String ? $types[6][message.enumVal] : message.enumVal; - break; - case "enumRepeated": - if (message.enumRepeated.length) { - object.enumRepeated = []; - for (var j = 0; j < message.enumRepeated.length; ++j) - object.enumRepeated[j] = options.enums === String ? $types[7][message.enumRepeated[j]] : message.enumRepeated[j]; - } - break; - case "int64Map": - if (message.int64Map !== $util.emptyObject) { - object.int64Map = {}; - for (var keys2 = Object.keys(message.int64Map), j = 0; j < keys2.length; ++j) - if (typeof message.int64Map[keys2[j]] === "number") - object.int64Map[keys2[j]] = options.longs === String ? String(message.int64Map[keys2[j]]) : message.int64Map[keys2[j]]; - else - object.int64Map[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.int64Map[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.int64Map[keys2[j]].low, message.int64Map[keys2[j]].high).toNumber() : message.int64Map[keys2[j]]; - } - break; - } + if (message.hasOwnProperty("stringVal") && message.stringVal !== undefined && message.stringVal !== null) + object.stringVal = message.stringVal; + if (message.hasOwnProperty("stringRepeated") && message.stringRepeated !== undefined && message.stringRepeated !== null) { + object.stringRepeated = []; + for (var j = 0; j < message.stringRepeated.length; ++j) + object.stringRepeated[j] = message.stringRepeated[j]; + } + if (message.hasOwnProperty("uint64Val") && message.uint64Val !== undefined && message.uint64Val !== null) + if (typeof message.uint64Val === "number") + object.uint64Val = options.longs === String ? String(message.uint64Val) : message.uint64Val; + else + object.uint64Val = options.longs === String ? $util.Long.prototype.toString.call(message.uint64Val) : options.longs === Number ? new $util.LongBits(message.uint64Val.low, message.uint64Val.high).toNumber(true) : message.uint64Val; + if (message.hasOwnProperty("uint64Repeated") && message.uint64Repeated !== undefined && message.uint64Repeated !== null) { + object.uint64Repeated = []; + for (var j = 0; j < message.uint64Repeated.length; ++j) + if (typeof message.uint64Repeated[j] === "number") + object.uint64Repeated[j] = options.longs === String ? String(message.uint64Repeated[j]) : message.uint64Repeated[j]; + else + object.uint64Repeated[j] = options.longs === String ? $util.Long.prototype.toString.call(message.uint64Repeated[j]) : options.longs === Number ? new $util.LongBits(message.uint64Repeated[j].low, message.uint64Repeated[j].high).toNumber(true) : message.uint64Repeated[j]; + } + if (message.hasOwnProperty("bytesVal") && message.bytesVal !== undefined && message.bytesVal !== null) + object.bytesVal = options.bytes === String ? $util.base64.encode(message.bytesVal, 0, message.bytesVal.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesVal) : message.bytesVal; + if (message.hasOwnProperty("bytesRepeated") && message.bytesRepeated !== undefined && message.bytesRepeated !== null) { + object.bytesRepeated = []; + for (var j = 0; j < message.bytesRepeated.length; ++j) + object.bytesRepeated[j] = options.bytes === String ? $util.base64.encode(message.bytesRepeated[j], 0, message.bytesRepeated[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesRepeated[j]) : message.bytesRepeated[j]; + } + if (message.hasOwnProperty("enumVal") && message.enumVal !== undefined && message.enumVal !== null) + object.enumVal = options.enums === String ? $types[6][message.enumVal] : message.enumVal; + if (message.hasOwnProperty("enumRepeated") && message.enumRepeated !== undefined && message.enumRepeated !== null) { + object.enumRepeated = []; + for (var j = 0; j < message.enumRepeated.length; ++j) + object.enumRepeated[j] = options.enums === String ? $types[7][message.enumRepeated[j]] : message.enumRepeated[j]; + } + if (message.hasOwnProperty("int64Map") && message.int64Map !== undefined && message.int64Map !== null) { + object.int64Map = {}; + for (var keys2 = Object.keys(message.int64Map), j = 0; j < keys2.length; ++j) + if (typeof message.int64Map[keys2[j]] === "number") + object.int64Map[keys2[j]] = options.longs === String ? String(message.int64Map[keys2[j]]) : message.int64Map[keys2[j]]; + else + object.int64Map[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.int64Map[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.int64Map[keys2[j]].low, message.int64Map[keys2[j]].high).toNumber() : message.int64Map[keys2[j]]; + } return object; }; diff --git a/tests/data/mapbox/vector_tile.js b/tests/data/mapbox/vector_tile.js index 4f46be07b..cd561659c 100644 --- a/tests/data/mapbox/vector_tile.js +++ b/tests/data/mapbox/vector_tile.js @@ -1,4 +1,4 @@ -/*eslint-disable block-scoped-var, no-redeclare, no-control-regex*/ +/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/ "use strict"; var $protobuf = require("../../../runtime"); @@ -68,7 +68,7 @@ $root.vector_tile = (function() { Tile.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.layers) + if (message.hasOwnProperty("layers")) for (var i = 0; i < message.layers.length; ++i) $types[0].encode(message.layers[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; @@ -174,17 +174,11 @@ $root.vector_tile = (function() { var object = {}; if (options.arrays || options.defaults) object.layers = []; - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "layers": - if (message.layers.length) { - object.layers = []; - for (var j = 0; j < message.layers.length; ++j) - object.layers[j] = $types[0].toObject(message.layers[j], options); - } - break; - } + if (message.hasOwnProperty("layers") && message.layers !== undefined && message.layers !== null) { + object.layers = []; + for (var j = 0; j < message.layers.length; ++j) + object.layers[j] = $types[0].toObject(message.layers[j], options); + } return object; }; @@ -301,19 +295,19 @@ $root.vector_tile = (function() { Value.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.stringValue !== undefined && message.stringValue !== "") + if (message.hasOwnProperty("stringValue") && message.stringValue !== undefined) writer.uint32(/* id 1, wireType 2 =*/10).string(message.stringValue); - if (message.floatValue !== undefined && message.floatValue !== 0) + if (message.hasOwnProperty("floatValue") && message.floatValue !== undefined) writer.uint32(/* id 2, wireType 5 =*/21).float(message.floatValue); - if (message.doubleValue !== undefined && message.doubleValue !== 0) + if (message.hasOwnProperty("doubleValue") && message.doubleValue !== undefined) writer.uint32(/* id 3, wireType 1 =*/25).double(message.doubleValue); - if (message.intValue !== undefined && message.intValue !== null && $util.longNe(message.intValue, 0, 0)) + if (message.hasOwnProperty("intValue") && message.intValue !== undefined && message.intValue !== null) writer.uint32(/* id 4, wireType 0 =*/32).int64(message.intValue); - if (message.uintValue !== undefined && message.uintValue !== null && $util.longNe(message.uintValue, 0, 0)) + if (message.hasOwnProperty("uintValue") && message.uintValue !== undefined && message.uintValue !== null) writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.uintValue); - if (message.sintValue !== undefined && message.sintValue !== null && $util.longNe(message.sintValue, 0, 0)) + if (message.hasOwnProperty("sintValue") && message.sintValue !== undefined && message.sintValue !== null) writer.uint32(/* id 6, wireType 0 =*/48).sint64(message.sintValue); - if (message.boolValue !== undefined && message.boolValue !== false) + if (message.hasOwnProperty("boolValue") && message.boolValue !== undefined) writer.uint32(/* id 7, wireType 0 =*/56).bool(message.boolValue); return writer; }; @@ -495,40 +489,29 @@ $root.vector_tile = (function() { object.sintValue = options.longs === String ? "0" : 0; object.boolValue = false; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "stringValue": - object.stringValue = message.stringValue; - break; - case "floatValue": - object.floatValue = message.floatValue; - break; - case "doubleValue": - object.doubleValue = message.doubleValue; - break; - case "intValue": - if (typeof message.intValue === "number") - object.intValue = options.longs === String ? String(message.intValue) : message.intValue; - else - object.intValue = options.longs === String ? $util.Long.prototype.toString.call(message.intValue) : options.longs === Number ? new $util.LongBits(message.intValue.low, message.intValue.high).toNumber() : message.intValue; - break; - case "uintValue": - if (typeof message.uintValue === "number") - object.uintValue = options.longs === String ? String(message.uintValue) : message.uintValue; - else - object.uintValue = options.longs === String ? $util.Long.prototype.toString.call(message.uintValue) : options.longs === Number ? new $util.LongBits(message.uintValue.low, message.uintValue.high).toNumber(true) : message.uintValue; - break; - case "sintValue": - if (typeof message.sintValue === "number") - object.sintValue = options.longs === String ? String(message.sintValue) : message.sintValue; - else - object.sintValue = options.longs === String ? $util.Long.prototype.toString.call(message.sintValue) : options.longs === Number ? new $util.LongBits(message.sintValue.low, message.sintValue.high).toNumber() : message.sintValue; - break; - case "boolValue": - object.boolValue = message.boolValue; - break; - } + if (message.hasOwnProperty("stringValue") && message.stringValue !== undefined && message.stringValue !== null) + object.stringValue = message.stringValue; + if (message.hasOwnProperty("floatValue") && message.floatValue !== undefined && message.floatValue !== null) + object.floatValue = message.floatValue; + if (message.hasOwnProperty("doubleValue") && message.doubleValue !== undefined && message.doubleValue !== null) + object.doubleValue = message.doubleValue; + if (message.hasOwnProperty("intValue") && message.intValue !== undefined && message.intValue !== null) + if (typeof message.intValue === "number") + object.intValue = options.longs === String ? String(message.intValue) : message.intValue; + else + object.intValue = options.longs === String ? $util.Long.prototype.toString.call(message.intValue) : options.longs === Number ? new $util.LongBits(message.intValue.low, message.intValue.high).toNumber() : message.intValue; + if (message.hasOwnProperty("uintValue") && message.uintValue !== undefined && message.uintValue !== null) + if (typeof message.uintValue === "number") + object.uintValue = options.longs === String ? String(message.uintValue) : message.uintValue; + else + object.uintValue = options.longs === String ? $util.Long.prototype.toString.call(message.uintValue) : options.longs === Number ? new $util.LongBits(message.uintValue.low, message.uintValue.high).toNumber(true) : message.uintValue; + if (message.hasOwnProperty("sintValue") && message.sintValue !== undefined && message.sintValue !== null) + if (typeof message.sintValue === "number") + object.sintValue = options.longs === String ? String(message.sintValue) : message.sintValue; + else + object.sintValue = options.longs === String ? $util.Long.prototype.toString.call(message.sintValue) : options.longs === Number ? new $util.LongBits(message.sintValue.low, message.sintValue.high).toNumber() : message.sintValue; + if (message.hasOwnProperty("boolValue") && message.boolValue !== undefined && message.boolValue !== null) + object.boolValue = message.boolValue; return object; }; @@ -615,17 +598,17 @@ $root.vector_tile = (function() { Feature.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.id !== undefined && message.id !== null && $util.longNe(message.id, 0, 0)) + if (message.hasOwnProperty("id") && message.id !== undefined && message.id !== null) writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.id); - if (message.tags && message.tags.length) { + if (message.hasOwnProperty("tags") && message.tags.length) { writer.uint32(/* id 2, wireType 2 =*/18).fork(); for (var i = 0; i < message.tags.length; ++i) writer.uint32(message.tags[i]); writer.ldelim(); } - if (message.type !== undefined && message.type !== undefined) + if (message.hasOwnProperty("type") && message.type !== undefined) writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.type); - if (message.geometry && message.geometry.length) { + if (message.hasOwnProperty("geometry") && message.geometry.length) { writer.uint32(/* id 4, wireType 2 =*/34).fork(); for (var i = 0; i < message.geometry.length; ++i) writer.uint32(message.geometry[i]); @@ -815,33 +798,23 @@ $root.vector_tile = (function() { object.id = options.longs === String ? "0" : 0; object.type = options.enums === String ? undefined : undefined; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "id": - if (typeof message.id === "number") - object.id = options.longs === String ? String(message.id) : message.id; - else - object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low, message.id.high).toNumber(true) : message.id; - break; - case "tags": - if (message.tags.length) { - object.tags = []; - for (var j = 0; j < message.tags.length; ++j) - object.tags[j] = message.tags[j]; - } - break; - case "type": - object.type = options.enums === String ? $types[2][message.type] : message.type; - break; - case "geometry": - if (message.geometry.length) { - object.geometry = []; - for (var j = 0; j < message.geometry.length; ++j) - object.geometry[j] = message.geometry[j]; - } - break; - } + if (message.hasOwnProperty("id") && message.id !== undefined && message.id !== null) + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low, message.id.high).toNumber(true) : message.id; + if (message.hasOwnProperty("tags") && message.tags !== undefined && message.tags !== null) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + if (message.hasOwnProperty("type") && message.type !== undefined && message.type !== null) + object.type = options.enums === String ? $types[2][message.type] : message.type; + if (message.hasOwnProperty("geometry") && message.geometry !== undefined && message.geometry !== null) { + object.geometry = []; + for (var j = 0; j < message.geometry.length; ++j) + object.geometry[j] = message.geometry[j]; + } return object; }; @@ -943,16 +916,16 @@ $root.vector_tile = (function() { writer = $Writer.create(); writer.uint32(/* id 15, wireType 0 =*/120).uint32(message.version); writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.features) + if (message.hasOwnProperty("features")) for (var i = 0; i < message.features.length; ++i) $types[2].encode(message.features[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.keys) + if (message.hasOwnProperty("keys")) for (var i = 0; i < message.keys.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.keys[i]); - if (message.values) + if (message.hasOwnProperty("values")) for (var i = 0; i < message.values.length; ++i) $types[4].encode(message.values[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extent !== undefined && message.extent !== 4096) + if (message.hasOwnProperty("extent") && message.extent !== undefined) writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.extent); return writer; }; @@ -1123,40 +1096,27 @@ $root.vector_tile = (function() { object.name = ""; object.extent = 4096; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "version": - object.version = message.version; - break; - case "name": - object.name = message.name; - break; - case "features": - if (message.features.length) { - object.features = []; - for (var j = 0; j < message.features.length; ++j) - object.features[j] = $types[2].toObject(message.features[j], options); - } - break; - case "keys": - if (message.keys.length) { - object.keys = []; - for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = message.keys[j]; - } - break; - case "values": - if (message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $types[4].toObject(message.values[j], options); - } - break; - case "extent": - object.extent = message.extent; - break; - } + if (message.hasOwnProperty("version") && message.version !== undefined && message.version !== null) + object.version = message.version; + if (message.hasOwnProperty("name") && message.name !== undefined && message.name !== null) + object.name = message.name; + if (message.hasOwnProperty("features") && message.features !== undefined && message.features !== null) { + object.features = []; + for (var j = 0; j < message.features.length; ++j) + object.features[j] = $types[2].toObject(message.features[j], options); + } + if (message.hasOwnProperty("keys") && message.keys !== undefined && message.keys !== null) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = message.keys[j]; + } + if (message.hasOwnProperty("values") && message.values !== undefined && message.values !== null) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $types[4].toObject(message.values[j], options); + } + if (message.hasOwnProperty("extent") && message.extent !== undefined && message.extent !== null) + object.extent = message.extent; return object; }; diff --git a/tests/data/package.js b/tests/data/package.js index 8eb81f13d..db446831b 100644 --- a/tests/data/package.js +++ b/tests/data/package.js @@ -1,4 +1,4 @@ -/*eslint-disable block-scoped-var, no-redeclare, no-control-regex*/ +/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/ "use strict"; var $protobuf = require("../../runtime"); @@ -155,45 +155,45 @@ $root.Package = (function() { Package.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name !== undefined && message.name !== "") + if (message.hasOwnProperty("name") && message.name !== undefined) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.version !== undefined && message.version !== "") + if (message.hasOwnProperty("version") && message.version !== undefined) writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); - if (message.description !== undefined && message.description !== "") + if (message.hasOwnProperty("description") && message.description !== undefined) writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.author !== undefined && message.author !== "") + if (message.hasOwnProperty("author") && message.author !== undefined) writer.uint32(/* id 4, wireType 2 =*/34).string(message.author); - if (message.license !== undefined && message.license !== "") + if (message.hasOwnProperty("license") && message.license !== undefined) writer.uint32(/* id 5, wireType 2 =*/42).string(message.license); - if (message.repository !== undefined && message.repository !== null) + if (message.hasOwnProperty("repository") && message.repository !== undefined) $types[5].encode(message.repository, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.bugs !== undefined && message.bugs !== "") + if (message.hasOwnProperty("bugs") && message.bugs !== undefined) writer.uint32(/* id 7, wireType 2 =*/58).string(message.bugs); - if (message.homepage !== undefined && message.homepage !== "") + if (message.hasOwnProperty("homepage") && message.homepage !== undefined) writer.uint32(/* id 8, wireType 2 =*/66).string(message.homepage); - if (message.keywords) + if (message.hasOwnProperty("keywords")) for (var i = 0; i < message.keywords.length; ++i) writer.uint32(/* id 9, wireType 2 =*/74).string(message.keywords[i]); - if (message.main !== undefined && message.main !== "") + if (message.hasOwnProperty("main") && message.main !== undefined) writer.uint32(/* id 10, wireType 2 =*/82).string(message.main); - if (message.bin && message.bin !== $util.emptyObject) + if (message.hasOwnProperty("bin") && message.bin) for (var keys = Object.keys(message.bin), i = 0; i < keys.length; ++i) writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.bin[keys[i]]).ldelim(); - if (message.scripts && message.scripts !== $util.emptyObject) + if (message.hasOwnProperty("scripts") && message.scripts) for (var keys = Object.keys(message.scripts), i = 0; i < keys.length; ++i) writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.scripts[keys[i]]).ldelim(); - if (message.dependencies && message.dependencies !== $util.emptyObject) + if (message.hasOwnProperty("dependencies") && message.dependencies) for (var keys = Object.keys(message.dependencies), i = 0; i < keys.length; ++i) writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.dependencies[keys[i]]).ldelim(); - if (message.optionalDependencies && message.optionalDependencies !== $util.emptyObject) + if (message.hasOwnProperty("optionalDependencies") && message.optionalDependencies) for (var keys = Object.keys(message.optionalDependencies), i = 0; i < keys.length; ++i) writer.uint32(/* id 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.optionalDependencies[keys[i]]).ldelim(); - if (message.devDependencies && message.devDependencies !== $util.emptyObject) + if (message.hasOwnProperty("devDependencies") && message.devDependencies) for (var keys = Object.keys(message.devDependencies), i = 0; i < keys.length; ++i) writer.uint32(/* id 15, wireType 2 =*/122).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.devDependencies[keys[i]]).ldelim(); - if (message.types !== undefined && message.types !== "") + if (message.hasOwnProperty("types") && message.types !== undefined) writer.uint32(/* id 17, wireType 2 =*/138).string(message.types); - if (message.cliDependencies) + if (message.hasOwnProperty("cliDependencies")) for (var i = 0; i < message.cliDependencies.length; ++i) writer.uint32(/* id 18, wireType 2 =*/146).string(message.cliDependencies[i]); return writer; @@ -522,89 +522,61 @@ $root.Package = (function() { object.main = ""; object.types = ""; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "name": - object.name = message.name; - break; - case "version": - object.version = message.version; - break; - case "description": - object.description = message.description; - break; - case "author": - object.author = message.author; - break; - case "license": - object.license = message.license; - break; - case "repository": - object.repository = $types[5].toObject(message.repository, options); - break; - case "bugs": - object.bugs = message.bugs; - break; - case "homepage": - object.homepage = message.homepage; - break; - case "keywords": - if (message.keywords.length) { - object.keywords = []; - for (var j = 0; j < message.keywords.length; ++j) - object.keywords[j] = message.keywords[j]; - } - break; - case "main": - object.main = message.main; - break; - case "bin": - if (message.bin !== $util.emptyObject) { - object.bin = {}; - for (var keys2 = Object.keys(message.bin), j = 0; j < keys2.length; ++j) - object.bin[keys2[j]] = message.bin[keys2[j]]; - } - break; - case "scripts": - if (message.scripts !== $util.emptyObject) { - object.scripts = {}; - for (var keys2 = Object.keys(message.scripts), j = 0; j < keys2.length; ++j) - object.scripts[keys2[j]] = message.scripts[keys2[j]]; - } - break; - case "dependencies": - if (message.dependencies !== $util.emptyObject) { - object.dependencies = {}; - for (var keys2 = Object.keys(message.dependencies), j = 0; j < keys2.length; ++j) - object.dependencies[keys2[j]] = message.dependencies[keys2[j]]; - } - break; - case "optionalDependencies": - if (message.optionalDependencies !== $util.emptyObject) { - object.optionalDependencies = {}; - for (var keys2 = Object.keys(message.optionalDependencies), j = 0; j < keys2.length; ++j) - object.optionalDependencies[keys2[j]] = message.optionalDependencies[keys2[j]]; - } - break; - case "devDependencies": - if (message.devDependencies !== $util.emptyObject) { - object.devDependencies = {}; - for (var keys2 = Object.keys(message.devDependencies), j = 0; j < keys2.length; ++j) - object.devDependencies[keys2[j]] = message.devDependencies[keys2[j]]; - } - break; - case "types": - object.types = message.types; - break; - case "cliDependencies": - if (message.cliDependencies.length) { - object.cliDependencies = []; - for (var j = 0; j < message.cliDependencies.length; ++j) - object.cliDependencies[j] = message.cliDependencies[j]; - } - break; - } + if (message.hasOwnProperty("name") && message.name !== undefined && message.name !== null) + object.name = message.name; + if (message.hasOwnProperty("version") && message.version !== undefined && message.version !== null) + object.version = message.version; + if (message.hasOwnProperty("description") && message.description !== undefined && message.description !== null) + object.description = message.description; + if (message.hasOwnProperty("author") && message.author !== undefined && message.author !== null) + object.author = message.author; + if (message.hasOwnProperty("license") && message.license !== undefined && message.license !== null) + object.license = message.license; + if (message.hasOwnProperty("repository") && message.repository !== undefined && message.repository !== null) + object.repository = $types[5].toObject(message.repository, options); + if (message.hasOwnProperty("bugs") && message.bugs !== undefined && message.bugs !== null) + object.bugs = message.bugs; + if (message.hasOwnProperty("homepage") && message.homepage !== undefined && message.homepage !== null) + object.homepage = message.homepage; + if (message.hasOwnProperty("keywords") && message.keywords !== undefined && message.keywords !== null) { + object.keywords = []; + for (var j = 0; j < message.keywords.length; ++j) + object.keywords[j] = message.keywords[j]; + } + if (message.hasOwnProperty("main") && message.main !== undefined && message.main !== null) + object.main = message.main; + if (message.hasOwnProperty("bin") && message.bin !== undefined && message.bin !== null) { + object.bin = {}; + for (var keys2 = Object.keys(message.bin), j = 0; j < keys2.length; ++j) + object.bin[keys2[j]] = message.bin[keys2[j]]; + } + if (message.hasOwnProperty("scripts") && message.scripts !== undefined && message.scripts !== null) { + object.scripts = {}; + for (var keys2 = Object.keys(message.scripts), j = 0; j < keys2.length; ++j) + object.scripts[keys2[j]] = message.scripts[keys2[j]]; + } + if (message.hasOwnProperty("dependencies") && message.dependencies !== undefined && message.dependencies !== null) { + object.dependencies = {}; + for (var keys2 = Object.keys(message.dependencies), j = 0; j < keys2.length; ++j) + object.dependencies[keys2[j]] = message.dependencies[keys2[j]]; + } + if (message.hasOwnProperty("optionalDependencies") && message.optionalDependencies !== undefined && message.optionalDependencies !== null) { + object.optionalDependencies = {}; + for (var keys2 = Object.keys(message.optionalDependencies), j = 0; j < keys2.length; ++j) + object.optionalDependencies[keys2[j]] = message.optionalDependencies[keys2[j]]; + } + if (message.hasOwnProperty("devDependencies") && message.devDependencies !== undefined && message.devDependencies !== null) { + object.devDependencies = {}; + for (var keys2 = Object.keys(message.devDependencies), j = 0; j < keys2.length; ++j) + object.devDependencies[keys2[j]] = message.devDependencies[keys2[j]]; + } + if (message.hasOwnProperty("types") && message.types !== undefined && message.types !== null) + object.types = message.types; + if (message.hasOwnProperty("cliDependencies") && message.cliDependencies !== undefined && message.cliDependencies !== null) { + object.cliDependencies = []; + for (var j = 0; j < message.cliDependencies.length; ++j) + object.cliDependencies[j] = message.cliDependencies[j]; + } return object; }; @@ -671,9 +643,9 @@ $root.Package = (function() { Repository.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type !== undefined && message.type !== "") + if (message.hasOwnProperty("type") && message.type !== undefined) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.url !== undefined && message.url !== "") + if (message.hasOwnProperty("url") && message.url !== undefined) writer.uint32(/* id 2, wireType 2 =*/18).string(message.url); return writer; }; @@ -777,16 +749,10 @@ $root.Package = (function() { object.type = ""; object.url = ""; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "type": - object.type = message.type; - break; - case "url": - object.url = message.url; - break; - } + if (message.hasOwnProperty("type") && message.type !== undefined && message.type !== null) + object.type = message.type; + if (message.hasOwnProperty("url") && message.url !== undefined && message.url !== null) + object.url = message.url; return object; }; diff --git a/tests/data/rpc.js b/tests/data/rpc.js index ba236735c..70b9ddaa8 100644 --- a/tests/data/rpc.js +++ b/tests/data/rpc.js @@ -1,4 +1,4 @@ -/*eslint-disable block-scoped-var, no-redeclare, no-control-regex*/ +/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/ "use strict"; var $protobuf = require("../../runtime"); @@ -146,7 +146,7 @@ $root.MyRequest = (function() { MyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.path !== undefined && message.path !== "") + if (message.hasOwnProperty("path") && message.path !== undefined) writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); return writer; }; @@ -240,13 +240,8 @@ $root.MyRequest = (function() { var object = {}; if (options.defaults) object.path = ""; - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "path": - object.path = message.path; - break; - } + if (message.hasOwnProperty("path") && message.path !== undefined && message.path !== null) + object.path = message.path; return object; }; @@ -310,7 +305,7 @@ $root.MyResponse = (function() { MyResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.status !== undefined && message.status !== 0) + if (message.hasOwnProperty("status") && message.status !== undefined) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.status); return writer; }; @@ -404,13 +399,8 @@ $root.MyResponse = (function() { var object = {}; if (options.defaults) object.status = 0; - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "status": - object.status = message.status; - break; - } + if (message.hasOwnProperty("status") && message.status !== undefined && message.status !== null) + object.status = message.status; return object; }; diff --git a/tests/data/test.js b/tests/data/test.js index 39e85744a..80f254fe2 100644 --- a/tests/data/test.js +++ b/tests/data/test.js @@ -1,4 +1,4 @@ -/*eslint-disable block-scoped-var, no-redeclare, no-control-regex*/ +/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/ "use strict"; var $protobuf = require("../../runtime"); @@ -228,7 +228,7 @@ $root.jspb = (function() { EnumContainer.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.outerEnum !== undefined && message.outerEnum !== 1) + if (message.hasOwnProperty("outerEnum") && message.outerEnum !== undefined) writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.outerEnum); return writer; }; @@ -335,13 +335,8 @@ $root.jspb = (function() { var object = {}; if (options.defaults) object.outerEnum = options.enums === String ? "FOO" : 1; - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "outerEnum": - object.outerEnum = options.enums === String ? $types[0][message.outerEnum] : message.outerEnum; - break; - } + if (message.hasOwnProperty("outerEnum") && message.outerEnum !== undefined && message.outerEnum !== null) + object.outerEnum = options.enums === String ? $types[0][message.outerEnum] : message.outerEnum; return object; }; @@ -418,10 +413,10 @@ $root.jspb = (function() { if (!writer) writer = $Writer.create(); writer.uint32(/* id 1, wireType 2 =*/10).string(message.aString); - if (message.aRepeatedString) + if (message.hasOwnProperty("aRepeatedString")) for (var i = 0; i < message.aRepeatedString.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).string(message.aRepeatedString[i]); - if (message.aBoolean !== undefined && message.aBoolean !== false) + if (message.hasOwnProperty("aBoolean") && message.aBoolean !== undefined) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.aBoolean); return writer; }; @@ -543,23 +538,15 @@ $root.jspb = (function() { object.aString = ""; object.aBoolean = false; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "aString": - object.aString = message.aString; - break; - case "aRepeatedString": - if (message.aRepeatedString.length) { - object.aRepeatedString = []; - for (var j = 0; j < message.aRepeatedString.length; ++j) - object.aRepeatedString[j] = message.aRepeatedString[j]; - } - break; - case "aBoolean": - object.aBoolean = message.aBoolean; - break; - } + if (message.hasOwnProperty("aString") && message.aString !== undefined && message.aString !== null) + object.aString = message.aString; + if (message.hasOwnProperty("aRepeatedString") && message.aRepeatedString !== undefined && message.aRepeatedString !== null) { + object.aRepeatedString = []; + for (var j = 0; j < message.aRepeatedString.length; ++j) + object.aRepeatedString[j] = message.aRepeatedString[j]; + } + if (message.hasOwnProperty("aBoolean") && message.aBoolean !== undefined && message.aBoolean !== null) + object.aBoolean = message.aBoolean; return object; }; @@ -630,7 +617,7 @@ $root.jspb = (function() { if (!writer) writer = $Writer.create(); writer.uint32(/* id 1, wireType 2 =*/10).string(message.aString); - if (message.aRepeatedString) + if (message.hasOwnProperty("aRepeatedString")) for (var i = 0; i < message.aRepeatedString.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).string(message.aRepeatedString[i]); return writer; @@ -743,20 +730,13 @@ $root.jspb = (function() { object.aRepeatedString = []; if (options.defaults) object.aString = ""; - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "aString": - object.aString = message.aString; - break; - case "aRepeatedString": - if (message.aRepeatedString.length) { - object.aRepeatedString = []; - for (var j = 0; j < message.aRepeatedString.length; ++j) - object.aRepeatedString[j] = message.aRepeatedString[j]; - } - break; - } + if (message.hasOwnProperty("aString") && message.aString !== undefined && message.aString !== null) + object.aString = message.aString; + if (message.hasOwnProperty("aRepeatedString") && message.aRepeatedString !== undefined && message.aRepeatedString !== null) { + object.aRepeatedString = []; + for (var j = 0; j < message.aRepeatedString.length; ++j) + object.aRepeatedString[j] = message.aRepeatedString[j]; + } return object; }; @@ -961,22 +941,14 @@ $root.jspb = (function() { object["function"] = ""; object["var"] = ""; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "normal": - object.normal = message.normal; - break; - case "default": - object["default"] = message["default"]; - break; - case "function": - object["function"] = message["function"]; - break; - case "var": - object["var"] = message["var"]; - break; - } + if (message.hasOwnProperty("normal") && message.normal !== undefined && message.normal !== null) + object.normal = message.normal; + if (message.hasOwnProperty("default") && message["default"] !== undefined && message["default"] !== null) + object["default"] = message["default"]; + if (message.hasOwnProperty("function") && message["function"] !== undefined && message["function"] !== null) + object["function"] = message["function"]; + if (message.hasOwnProperty("var") && message["var"] !== undefined && message["var"] !== null) + object["var"] = message["var"]; return object; }; @@ -1070,15 +1042,15 @@ $root.jspb = (function() { OptionalFields.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.aString !== undefined && message.aString !== "") + if (message.hasOwnProperty("aString") && message.aString !== undefined) writer.uint32(/* id 1, wireType 2 =*/10).string(message.aString); writer.uint32(/* id 2, wireType 0 =*/16).bool(message.aBool); - if (message.aNestedMessage !== undefined && message.aNestedMessage !== null) + if (message.hasOwnProperty("aNestedMessage") && message.aNestedMessage !== undefined) $types[2].encode(message.aNestedMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.aRepeatedMessage) + if (message.hasOwnProperty("aRepeatedMessage")) for (var i = 0; i < message.aRepeatedMessage.length; ++i) $types[3].encode(message.aRepeatedMessage[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.aRepeatedString) + if (message.hasOwnProperty("aRepeatedString")) for (var i = 0; i < message.aRepeatedString.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.aRepeatedString[i]); return writer; @@ -1233,33 +1205,22 @@ $root.jspb = (function() { object.aBool = false; object.aNestedMessage = null; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "aString": - object.aString = message.aString; - break; - case "aBool": - object.aBool = message.aBool; - break; - case "aNestedMessage": - object.aNestedMessage = $types[2].toObject(message.aNestedMessage, options); - break; - case "aRepeatedMessage": - if (message.aRepeatedMessage.length) { - object.aRepeatedMessage = []; - for (var j = 0; j < message.aRepeatedMessage.length; ++j) - object.aRepeatedMessage[j] = $types[3].toObject(message.aRepeatedMessage[j], options); - } - break; - case "aRepeatedString": - if (message.aRepeatedString.length) { - object.aRepeatedString = []; - for (var j = 0; j < message.aRepeatedString.length; ++j) - object.aRepeatedString[j] = message.aRepeatedString[j]; - } - break; - } + if (message.hasOwnProperty("aString") && message.aString !== undefined && message.aString !== null) + object.aString = message.aString; + if (message.hasOwnProperty("aBool") && message.aBool !== undefined && message.aBool !== null) + object.aBool = message.aBool; + if (message.hasOwnProperty("aNestedMessage") && message.aNestedMessage !== undefined && message.aNestedMessage !== null) + object.aNestedMessage = $types[2].toObject(message.aNestedMessage, options); + if (message.hasOwnProperty("aRepeatedMessage") && message.aRepeatedMessage !== undefined && message.aRepeatedMessage !== null) { + object.aRepeatedMessage = []; + for (var j = 0; j < message.aRepeatedMessage.length; ++j) + object.aRepeatedMessage[j] = $types[3].toObject(message.aRepeatedMessage[j], options); + } + if (message.hasOwnProperty("aRepeatedString") && message.aRepeatedString !== undefined && message.aRepeatedString !== null) { + object.aRepeatedString = []; + for (var j = 0; j < message.aRepeatedString.length; ++j) + object.aRepeatedString[j] = message.aRepeatedString[j]; + } return object; }; @@ -1320,7 +1281,7 @@ $root.jspb = (function() { Nested.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.anInt !== undefined && message.anInt !== 0) + if (message.hasOwnProperty("anInt") && message.anInt !== undefined) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.anInt); return writer; }; @@ -1414,13 +1375,8 @@ $root.jspb = (function() { var object = {}; if (options.defaults) object.anInt = 0; - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "anInt": - object.anInt = message.anInt; - break; - } + if (message.hasOwnProperty("anInt") && message.anInt !== undefined && message.anInt !== null) + object.anInt = message.anInt; return object; }; @@ -1549,25 +1505,25 @@ $root.jspb = (function() { HasExtensions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.str1 !== undefined && message.str1 !== "") + if (message.hasOwnProperty("str1") && message.str1 !== undefined) writer.uint32(/* id 1, wireType 2 =*/10).string(message.str1); - if (message.str2 !== undefined && message.str2 !== "") + if (message.hasOwnProperty("str2") && message.str2 !== undefined) writer.uint32(/* id 2, wireType 2 =*/18).string(message.str2); - if (message.str3 !== undefined && message.str3 !== "") + if (message.hasOwnProperty("str3") && message.str3 !== undefined) writer.uint32(/* id 3, wireType 2 =*/26).string(message.str3); - if (message[".jspb.test.IsExtension.extField"] !== undefined && message[".jspb.test.IsExtension.extField"] !== null) + if (message.hasOwnProperty(".jspb.test.IsExtension.extField") && message[".jspb.test.IsExtension.extField"] !== undefined) $types[3].encode(message[".jspb.test.IsExtension.extField"], writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); - if (message[".jspb.test.IndirectExtension.simple"] !== undefined && message[".jspb.test.IndirectExtension.simple"] !== null) + if (message.hasOwnProperty(".jspb.test.IndirectExtension.simple") && message[".jspb.test.IndirectExtension.simple"] !== undefined) $types[4].encode(message[".jspb.test.IndirectExtension.simple"], writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); - if (message[".jspb.test.IndirectExtension.str"] !== undefined && message[".jspb.test.IndirectExtension.str"] !== "") + if (message.hasOwnProperty(".jspb.test.IndirectExtension.str") && message[".jspb.test.IndirectExtension.str"] !== undefined) writer.uint32(/* id 102, wireType 2 =*/818).string(message[".jspb.test.IndirectExtension.str"]); - if (message[".jspb.test.IndirectExtension.repeatedStr"]) + if (message.hasOwnProperty(".jspb.test.IndirectExtension.repeatedStr")) for (var i = 0; i < message[".jspb.test.IndirectExtension.repeatedStr"].length; ++i) writer.uint32(/* id 103, wireType 2 =*/826).string(message[".jspb.test.IndirectExtension.repeatedStr"][i]); - if (message[".jspb.test.IndirectExtension.repeatedSimple"]) + if (message.hasOwnProperty(".jspb.test.IndirectExtension.repeatedSimple")) for (var i = 0; i < message[".jspb.test.IndirectExtension.repeatedSimple"].length; ++i) $types[7].encode(message[".jspb.test.IndirectExtension.repeatedSimple"][i], writer.uint32(/* id 104, wireType 2 =*/834).fork()).ldelim(); - if (message[".jspb.test.simple1"] !== undefined && message[".jspb.test.simple1"] !== null) + if (message.hasOwnProperty(".jspb.test.simple1") && message[".jspb.test.simple1"] !== undefined) $types[8].encode(message[".jspb.test.simple1"], writer.uint32(/* id 105, wireType 2 =*/842).fork()).ldelim(); return writer; }; @@ -1762,45 +1718,30 @@ $root.jspb = (function() { object[".jspb.test.IndirectExtension.str"] = ""; object[".jspb.test.simple1"] = null; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "str1": - object.str1 = message.str1; - break; - case "str2": - object.str2 = message.str2; - break; - case "str3": - object.str3 = message.str3; - break; - case ".jspb.test.IsExtension.extField": - object[".jspb.test.IsExtension.extField"] = $types[3].toObject(message[".jspb.test.IsExtension.extField"], options); - break; - case ".jspb.test.IndirectExtension.simple": - object[".jspb.test.IndirectExtension.simple"] = $types[4].toObject(message[".jspb.test.IndirectExtension.simple"], options); - break; - case ".jspb.test.IndirectExtension.str": - object[".jspb.test.IndirectExtension.str"] = message[".jspb.test.IndirectExtension.str"]; - break; - case ".jspb.test.IndirectExtension.repeatedStr": - if (message[".jspb.test.IndirectExtension.repeatedStr"].length) { - object[".jspb.test.IndirectExtension.repeatedStr"] = []; - for (var j = 0; j < message[".jspb.test.IndirectExtension.repeatedStr"].length; ++j) - object[".jspb.test.IndirectExtension.repeatedStr"][j] = message[".jspb.test.IndirectExtension.repeatedStr"][j]; - } - break; - case ".jspb.test.IndirectExtension.repeatedSimple": - if (message[".jspb.test.IndirectExtension.repeatedSimple"].length) { - object[".jspb.test.IndirectExtension.repeatedSimple"] = []; - for (var j = 0; j < message[".jspb.test.IndirectExtension.repeatedSimple"].length; ++j) - object[".jspb.test.IndirectExtension.repeatedSimple"][j] = $types[7].toObject(message[".jspb.test.IndirectExtension.repeatedSimple"][j], options); - } - break; - case ".jspb.test.simple1": - object[".jspb.test.simple1"] = $types[8].toObject(message[".jspb.test.simple1"], options); - break; - } + if (message.hasOwnProperty("str1") && message.str1 !== undefined && message.str1 !== null) + object.str1 = message.str1; + if (message.hasOwnProperty("str2") && message.str2 !== undefined && message.str2 !== null) + object.str2 = message.str2; + if (message.hasOwnProperty("str3") && message.str3 !== undefined && message.str3 !== null) + object.str3 = message.str3; + if (message.hasOwnProperty(".jspb.test.IsExtension.extField") && message[".jspb.test.IsExtension.extField"] !== undefined && message[".jspb.test.IsExtension.extField"] !== null) + object[".jspb.test.IsExtension.extField"] = $types[3].toObject(message[".jspb.test.IsExtension.extField"], options); + if (message.hasOwnProperty(".jspb.test.IndirectExtension.simple") && message[".jspb.test.IndirectExtension.simple"] !== undefined && message[".jspb.test.IndirectExtension.simple"] !== null) + object[".jspb.test.IndirectExtension.simple"] = $types[4].toObject(message[".jspb.test.IndirectExtension.simple"], options); + if (message.hasOwnProperty(".jspb.test.IndirectExtension.str") && message[".jspb.test.IndirectExtension.str"] !== undefined && message[".jspb.test.IndirectExtension.str"] !== null) + object[".jspb.test.IndirectExtension.str"] = message[".jspb.test.IndirectExtension.str"]; + if (message.hasOwnProperty(".jspb.test.IndirectExtension.repeatedStr") && message[".jspb.test.IndirectExtension.repeatedStr"] !== undefined && message[".jspb.test.IndirectExtension.repeatedStr"] !== null) { + object[".jspb.test.IndirectExtension.repeatedStr"] = []; + for (var j = 0; j < message[".jspb.test.IndirectExtension.repeatedStr"].length; ++j) + object[".jspb.test.IndirectExtension.repeatedStr"][j] = message[".jspb.test.IndirectExtension.repeatedStr"][j]; + } + if (message.hasOwnProperty(".jspb.test.IndirectExtension.repeatedSimple") && message[".jspb.test.IndirectExtension.repeatedSimple"] !== undefined && message[".jspb.test.IndirectExtension.repeatedSimple"] !== null) { + object[".jspb.test.IndirectExtension.repeatedSimple"] = []; + for (var j = 0; j < message[".jspb.test.IndirectExtension.repeatedSimple"].length; ++j) + object[".jspb.test.IndirectExtension.repeatedSimple"][j] = $types[7].toObject(message[".jspb.test.IndirectExtension.repeatedSimple"][j], options); + } + if (message.hasOwnProperty(".jspb.test.simple1") && message[".jspb.test.simple1"] !== undefined && message[".jspb.test.simple1"] !== null) + object[".jspb.test.simple1"] = $types[8].toObject(message[".jspb.test.simple1"], options); return object; }; @@ -1896,12 +1837,12 @@ $root.jspb = (function() { writer = $Writer.create(); writer.uint32(/* id 1, wireType 2 =*/10).string(message.aString); writer.uint32(/* id 9, wireType 0 =*/72).bool(message.anOutOfOrderBool); - if (message.aNestedMessage !== undefined && message.aNestedMessage !== null) + if (message.hasOwnProperty("aNestedMessage") && message.aNestedMessage !== undefined) $types[2].encode(message.aNestedMessage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.aRepeatedMessage) + if (message.hasOwnProperty("aRepeatedMessage")) for (var i = 0; i < message.aRepeatedMessage.length; ++i) $types[3].encode(message.aRepeatedMessage[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.aRepeatedString) + if (message.hasOwnProperty("aRepeatedString")) for (var i = 0; i < message.aRepeatedString.length; ++i) writer.uint32(/* id 7, wireType 2 =*/58).string(message.aRepeatedString[i]); return writer; @@ -2055,33 +1996,22 @@ $root.jspb = (function() { object.anOutOfOrderBool = false; object.aNestedMessage = null; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "aString": - object.aString = message.aString; - break; - case "anOutOfOrderBool": - object.anOutOfOrderBool = message.anOutOfOrderBool; - break; - case "aNestedMessage": - object.aNestedMessage = $types[2].toObject(message.aNestedMessage, options); - break; - case "aRepeatedMessage": - if (message.aRepeatedMessage.length) { - object.aRepeatedMessage = []; - for (var j = 0; j < message.aRepeatedMessage.length; ++j) - object.aRepeatedMessage[j] = $types[3].toObject(message.aRepeatedMessage[j], options); - } - break; - case "aRepeatedString": - if (message.aRepeatedString.length) { - object.aRepeatedString = []; - for (var j = 0; j < message.aRepeatedString.length; ++j) - object.aRepeatedString[j] = message.aRepeatedString[j]; - } - break; - } + if (message.hasOwnProperty("aString") && message.aString !== undefined && message.aString !== null) + object.aString = message.aString; + if (message.hasOwnProperty("anOutOfOrderBool") && message.anOutOfOrderBool !== undefined && message.anOutOfOrderBool !== null) + object.anOutOfOrderBool = message.anOutOfOrderBool; + if (message.hasOwnProperty("aNestedMessage") && message.aNestedMessage !== undefined && message.aNestedMessage !== null) + object.aNestedMessage = $types[2].toObject(message.aNestedMessage, options); + if (message.hasOwnProperty("aRepeatedMessage") && message.aRepeatedMessage !== undefined && message.aRepeatedMessage !== null) { + object.aRepeatedMessage = []; + for (var j = 0; j < message.aRepeatedMessage.length; ++j) + object.aRepeatedMessage[j] = $types[3].toObject(message.aRepeatedMessage[j], options); + } + if (message.hasOwnProperty("aRepeatedString") && message.aRepeatedString !== undefined && message.aRepeatedString !== null) { + object.aRepeatedString = []; + for (var j = 0; j < message.aRepeatedString.length; ++j) + object.aRepeatedString[j] = message.aRepeatedString[j]; + } return object; }; @@ -2234,13 +2164,8 @@ $root.jspb = (function() { var object = {}; if (options.defaults) object.anInt = 0; - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "anInt": - object.anInt = message.anInt; - break; - } + if (message.hasOwnProperty("anInt") && message.anInt !== undefined && message.anInt !== null) + object.anInt = message.anInt; return object; }; @@ -2439,7 +2364,7 @@ $root.jspb = (function() { Complex.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.innerComplexField !== undefined && message.innerComplexField !== 0) + if (message.hasOwnProperty("innerComplexField") && message.innerComplexField !== undefined) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.innerComplexField); return writer; }; @@ -2533,13 +2458,8 @@ $root.jspb = (function() { var object = {}; if (options.defaults) object.innerComplexField = 0; - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "innerComplexField": - object.innerComplexField = message.innerComplexField; - break; - } + if (message.hasOwnProperty("innerComplexField") && message.innerComplexField !== undefined && message.innerComplexField !== null) + object.innerComplexField = message.innerComplexField; return object; }; @@ -2606,7 +2526,7 @@ $root.jspb = (function() { IsExtension.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.ext1 !== undefined && message.ext1 !== "") + if (message.hasOwnProperty("ext1") && message.ext1 !== undefined) writer.uint32(/* id 1, wireType 2 =*/10).string(message.ext1); return writer; }; @@ -2700,13 +2620,8 @@ $root.jspb = (function() { var object = {}; if (options.defaults) object.ext1 = ""; - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "ext1": - object.ext1 = message.ext1; - break; - } + if (message.hasOwnProperty("ext1") && message.ext1 !== undefined && message.ext1 !== null) + object.ext1 = message.ext1; return object; }; @@ -2940,21 +2855,17 @@ $root.jspb = (function() { DefaultValues.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.stringField !== undefined && message.stringField !== "default<>'\"abc") + if (message.hasOwnProperty("stringField") && message.stringField !== undefined) writer.uint32(/* id 1, wireType 2 =*/10).string(message.stringField); - if (message.boolField !== undefined && message.boolField !== true) + if (message.hasOwnProperty("boolField") && message.boolField !== undefined) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.boolField); - if (message.intField !== undefined && message.intField !== null && $util.longNe(message.intField, 11, 0)) + if (message.hasOwnProperty("intField") && message.intField !== undefined && message.intField !== null) writer.uint32(/* id 3, wireType 0 =*/24).int64(message.intField); - if (message.enumField !== undefined && message.enumField !== undefined) + if (message.hasOwnProperty("enumField") && message.enumField !== undefined) writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.enumField); - if (message.emptyField !== undefined && message.emptyField !== "") + if (message.hasOwnProperty("emptyField") && message.emptyField !== undefined) writer.uint32(/* id 6, wireType 2 =*/50).string(message.emptyField); - if (message.bytesField && message.bytesField.length && $util.arrayNe(message.bytesField, [ - 109, - 111, - 111 - ])) + if (message.hasOwnProperty("bytesField") && message.bytesField) writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.bytesField); return writer; }; @@ -3125,31 +3036,21 @@ $root.jspb = (function() { 111 ]; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "stringField": - object.stringField = message.stringField; - break; - case "boolField": - object.boolField = message.boolField; - break; - case "intField": - if (typeof message.intField === "number") - object.intField = options.longs === String ? String(message.intField) : message.intField; - else - object.intField = options.longs === String ? $util.Long.prototype.toString.call(message.intField) : options.longs === Number ? new $util.LongBits(message.intField.low, message.intField.high).toNumber() : message.intField; - break; - case "enumField": - object.enumField = options.enums === String ? $types[3][message.enumField] : message.enumField; - break; - case "emptyField": - object.emptyField = message.emptyField; - break; - case "bytesField": - object.bytesField = options.bytes === String ? $util.base64.encode(message.bytesField, 0, message.bytesField.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesField) : message.bytesField; - break; - } + if (message.hasOwnProperty("stringField") && message.stringField !== undefined && message.stringField !== null) + object.stringField = message.stringField; + if (message.hasOwnProperty("boolField") && message.boolField !== undefined && message.boolField !== null) + object.boolField = message.boolField; + if (message.hasOwnProperty("intField") && message.intField !== undefined && message.intField !== null) + if (typeof message.intField === "number") + object.intField = options.longs === String ? String(message.intField) : message.intField; + else + object.intField = options.longs === String ? $util.Long.prototype.toString.call(message.intField) : options.longs === Number ? new $util.LongBits(message.intField.low, message.intField.high).toNumber() : message.intField; + if (message.hasOwnProperty("enumField") && message.enumField !== undefined && message.enumField !== null) + object.enumField = options.enums === String ? $types[3][message.enumField] : message.enumField; + if (message.hasOwnProperty("emptyField") && message.emptyField !== undefined && message.emptyField !== null) + object.emptyField = message.emptyField; + if (message.hasOwnProperty("bytesField") && message.bytesField !== undefined && message.bytesField !== null) + object.bytesField = options.bytes === String ? $util.base64.encode(message.bytesField, 0, message.bytesField.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesField) : message.bytesField; return object; }; @@ -3271,21 +3172,21 @@ $root.jspb = (function() { FloatingPointFields.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.optionalFloatField !== undefined && message.optionalFloatField !== 0) + if (message.hasOwnProperty("optionalFloatField") && message.optionalFloatField !== undefined) writer.uint32(/* id 1, wireType 5 =*/13).float(message.optionalFloatField); writer.uint32(/* id 2, wireType 5 =*/21).float(message.requiredFloatField); - if (message.repeatedFloatField) + if (message.hasOwnProperty("repeatedFloatField")) for (var i = 0; i < message.repeatedFloatField.length; ++i) writer.uint32(/* id 3, wireType 5 =*/29).float(message.repeatedFloatField[i]); - if (message.defaultFloatField !== undefined && message.defaultFloatField !== 2) + if (message.hasOwnProperty("defaultFloatField") && message.defaultFloatField !== undefined) writer.uint32(/* id 4, wireType 5 =*/37).float(message.defaultFloatField); - if (message.optionalDoubleField !== undefined && message.optionalDoubleField !== 0) + if (message.hasOwnProperty("optionalDoubleField") && message.optionalDoubleField !== undefined) writer.uint32(/* id 5, wireType 1 =*/41).double(message.optionalDoubleField); writer.uint32(/* id 6, wireType 1 =*/49).double(message.requiredDoubleField); - if (message.repeatedDoubleField) + if (message.hasOwnProperty("repeatedDoubleField")) for (var i = 0; i < message.repeatedDoubleField.length; ++i) writer.uint32(/* id 7, wireType 1 =*/57).double(message.repeatedDoubleField[i]); - if (message.defaultDoubleField !== undefined && message.defaultDoubleField !== 2) + if (message.hasOwnProperty("defaultDoubleField") && message.defaultDoubleField !== undefined) writer.uint32(/* id 8, wireType 1 =*/65).double(message.defaultDoubleField); return writer; }; @@ -3471,42 +3372,28 @@ $root.jspb = (function() { object.requiredDoubleField = 0; object.defaultDoubleField = 2; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "optionalFloatField": - object.optionalFloatField = message.optionalFloatField; - break; - case "requiredFloatField": - object.requiredFloatField = message.requiredFloatField; - break; - case "repeatedFloatField": - if (message.repeatedFloatField.length) { - object.repeatedFloatField = []; - for (var j = 0; j < message.repeatedFloatField.length; ++j) - object.repeatedFloatField[j] = message.repeatedFloatField[j]; - } - break; - case "defaultFloatField": - object.defaultFloatField = message.defaultFloatField; - break; - case "optionalDoubleField": - object.optionalDoubleField = message.optionalDoubleField; - break; - case "requiredDoubleField": - object.requiredDoubleField = message.requiredDoubleField; - break; - case "repeatedDoubleField": - if (message.repeatedDoubleField.length) { - object.repeatedDoubleField = []; - for (var j = 0; j < message.repeatedDoubleField.length; ++j) - object.repeatedDoubleField[j] = message.repeatedDoubleField[j]; - } - break; - case "defaultDoubleField": - object.defaultDoubleField = message.defaultDoubleField; - break; - } + if (message.hasOwnProperty("optionalFloatField") && message.optionalFloatField !== undefined && message.optionalFloatField !== null) + object.optionalFloatField = message.optionalFloatField; + if (message.hasOwnProperty("requiredFloatField") && message.requiredFloatField !== undefined && message.requiredFloatField !== null) + object.requiredFloatField = message.requiredFloatField; + if (message.hasOwnProperty("repeatedFloatField") && message.repeatedFloatField !== undefined && message.repeatedFloatField !== null) { + object.repeatedFloatField = []; + for (var j = 0; j < message.repeatedFloatField.length; ++j) + object.repeatedFloatField[j] = message.repeatedFloatField[j]; + } + if (message.hasOwnProperty("defaultFloatField") && message.defaultFloatField !== undefined && message.defaultFloatField !== null) + object.defaultFloatField = message.defaultFloatField; + if (message.hasOwnProperty("optionalDoubleField") && message.optionalDoubleField !== undefined && message.optionalDoubleField !== null) + object.optionalDoubleField = message.optionalDoubleField; + if (message.hasOwnProperty("requiredDoubleField") && message.requiredDoubleField !== undefined && message.requiredDoubleField !== null) + object.requiredDoubleField = message.requiredDoubleField; + if (message.hasOwnProperty("repeatedDoubleField") && message.repeatedDoubleField !== undefined && message.repeatedDoubleField !== null) { + object.repeatedDoubleField = []; + for (var j = 0; j < message.repeatedDoubleField.length; ++j) + object.repeatedDoubleField[j] = message.repeatedDoubleField[j]; + } + if (message.hasOwnProperty("defaultDoubleField") && message.defaultDoubleField !== undefined && message.defaultDoubleField !== null) + object.defaultDoubleField = message.defaultDoubleField; return object; }; @@ -3608,18 +3495,18 @@ $root.jspb = (function() { TestClone.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.str !== undefined && message.str !== "") + if (message.hasOwnProperty("str") && message.str !== undefined) writer.uint32(/* id 1, wireType 2 =*/10).string(message.str); - if (message.simple1 !== undefined && message.simple1 !== null) + if (message.hasOwnProperty("simple1") && message.simple1 !== undefined) $types[1].encode(message.simple1, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.simple2) + if (message.hasOwnProperty("simple2")) for (var i = 0; i < message.simple2.length; ++i) $types[2].encode(message.simple2[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.bytesField && message.bytesField.length) + if (message.hasOwnProperty("bytesField") && message.bytesField) writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.bytesField); - if (message.unused !== undefined && message.unused !== "") + if (message.hasOwnProperty("unused") && message.unused !== undefined) writer.uint32(/* id 7, wireType 2 =*/58).string(message.unused); - if (message[".jspb.test.CloneExtension.extField"] !== undefined && message[".jspb.test.CloneExtension.extField"] !== null) + if (message.hasOwnProperty(".jspb.test.CloneExtension.extField") && message[".jspb.test.CloneExtension.extField"] !== undefined) $types[5].encode(message[".jspb.test.CloneExtension.extField"], writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); return writer; }; @@ -3778,32 +3665,21 @@ $root.jspb = (function() { object.unused = ""; object[".jspb.test.CloneExtension.extField"] = null; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "str": - object.str = message.str; - break; - case "simple1": - object.simple1 = $types[1].toObject(message.simple1, options); - break; - case "simple2": - if (message.simple2.length) { - object.simple2 = []; - for (var j = 0; j < message.simple2.length; ++j) - object.simple2[j] = $types[2].toObject(message.simple2[j], options); - } - break; - case "bytesField": - object.bytesField = options.bytes === String ? $util.base64.encode(message.bytesField, 0, message.bytesField.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesField) : message.bytesField; - break; - case "unused": - object.unused = message.unused; - break; - case ".jspb.test.CloneExtension.extField": - object[".jspb.test.CloneExtension.extField"] = $types[5].toObject(message[".jspb.test.CloneExtension.extField"], options); - break; - } + if (message.hasOwnProperty("str") && message.str !== undefined && message.str !== null) + object.str = message.str; + if (message.hasOwnProperty("simple1") && message.simple1 !== undefined && message.simple1 !== null) + object.simple1 = $types[1].toObject(message.simple1, options); + if (message.hasOwnProperty("simple2") && message.simple2 !== undefined && message.simple2 !== null) { + object.simple2 = []; + for (var j = 0; j < message.simple2.length; ++j) + object.simple2[j] = $types[2].toObject(message.simple2[j], options); + } + if (message.hasOwnProperty("bytesField") && message.bytesField !== undefined && message.bytesField !== null) + object.bytesField = options.bytes === String ? $util.base64.encode(message.bytesField, 0, message.bytesField.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesField) : message.bytesField; + if (message.hasOwnProperty("unused") && message.unused !== undefined && message.unused !== null) + object.unused = message.unused; + if (message.hasOwnProperty(".jspb.test.CloneExtension.extField") && message[".jspb.test.CloneExtension.extField"] !== undefined && message[".jspb.test.CloneExtension.extField"] !== null) + object[".jspb.test.CloneExtension.extField"] = $types[5].toObject(message[".jspb.test.CloneExtension.extField"], options); return object; }; @@ -3867,7 +3743,7 @@ $root.jspb = (function() { CloneExtension.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.ext !== undefined && message.ext !== "") + if (message.hasOwnProperty("ext") && message.ext !== undefined) writer.uint32(/* id 2, wireType 2 =*/18).string(message.ext); return writer; }; @@ -3961,13 +3837,8 @@ $root.jspb = (function() { var object = {}; if (options.defaults) object.ext = ""; - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "ext": - object.ext = message.ext; - break; - } + if (message.hasOwnProperty("ext") && message.ext !== undefined && message.ext !== null) + object.ext = message.ext; return object; }; @@ -4070,16 +3941,16 @@ $root.jspb = (function() { TestGroup.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.repeatedGroup) + if (message.hasOwnProperty("repeatedGroup")) for (var i = 0; i < message.repeatedGroup.length; ++i) $types[0].encode(message.repeatedGroup[i], writer.uint32(/* id 1, wireType 3 =*/11)).uint32(/* id 1, wireType 4 =*/12); $types[1].encode(message.requiredGroup, writer.uint32(/* id 2, wireType 3 =*/19)).uint32(/* id 2, wireType 4 =*/20); - if (message.optionalGroup !== undefined && message.optionalGroup !== null) + if (message.hasOwnProperty("optionalGroup") && message.optionalGroup !== undefined) $types[2].encode(message.optionalGroup, writer.uint32(/* id 3, wireType 3 =*/27)).uint32(/* id 3, wireType 4 =*/28); - if (message.id !== undefined && message.id !== "") + if (message.hasOwnProperty("id") && message.id !== undefined) writer.uint32(/* id 4, wireType 2 =*/34).string(message.id); $types[4].encode(message.requiredSimple, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.optionalSimple !== undefined && message.optionalSimple !== null) + if (message.hasOwnProperty("optionalSimple") && message.optionalSimple !== undefined) $types[5].encode(message.optionalSimple, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -4235,32 +4106,21 @@ $root.jspb = (function() { object.requiredSimple = null; object.optionalSimple = null; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "repeatedGroup": - if (message.repeatedGroup.length) { - object.repeatedGroup = []; - for (var j = 0; j < message.repeatedGroup.length; ++j) - object.repeatedGroup[j] = $types[0].toObject(message.repeatedGroup[j], options); - } - break; - case "requiredGroup": - object.requiredGroup = $types[1].toObject(message.requiredGroup, options); - break; - case "optionalGroup": - object.optionalGroup = $types[2].toObject(message.optionalGroup, options); - break; - case "id": - object.id = message.id; - break; - case "requiredSimple": - object.requiredSimple = $types[4].toObject(message.requiredSimple, options); - break; - case "optionalSimple": - object.optionalSimple = $types[5].toObject(message.optionalSimple, options); - break; - } + if (message.hasOwnProperty("repeatedGroup") && message.repeatedGroup !== undefined && message.repeatedGroup !== null) { + object.repeatedGroup = []; + for (var j = 0; j < message.repeatedGroup.length; ++j) + object.repeatedGroup[j] = $types[0].toObject(message.repeatedGroup[j], options); + } + if (message.hasOwnProperty("requiredGroup") && message.requiredGroup !== undefined && message.requiredGroup !== null) + object.requiredGroup = $types[1].toObject(message.requiredGroup, options); + if (message.hasOwnProperty("optionalGroup") && message.optionalGroup !== undefined && message.optionalGroup !== null) + object.optionalGroup = $types[2].toObject(message.optionalGroup, options); + if (message.hasOwnProperty("id") && message.id !== undefined && message.id !== null) + object.id = message.id; + if (message.hasOwnProperty("requiredSimple") && message.requiredSimple !== undefined && message.requiredSimple !== null) + object.requiredSimple = $types[4].toObject(message.requiredSimple, options); + if (message.hasOwnProperty("optionalSimple") && message.optionalSimple !== undefined && message.optionalSimple !== null) + object.optionalSimple = $types[5].toObject(message.optionalSimple, options); return object; }; @@ -4328,7 +4188,7 @@ $root.jspb = (function() { if (!writer) writer = $Writer.create(); writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.someBool) + if (message.hasOwnProperty("someBool")) for (var i = 0; i < message.someBool.length; ++i) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.someBool[i]); return writer; @@ -4448,20 +4308,13 @@ $root.jspb = (function() { object.someBool = []; if (options.defaults) object.id = ""; - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "id": - object.id = message.id; - break; - case "someBool": - if (message.someBool.length) { - object.someBool = []; - for (var j = 0; j < message.someBool.length; ++j) - object.someBool[j] = message.someBool[j]; - } - break; - } + if (message.hasOwnProperty("id") && message.id !== undefined && message.id !== null) + object.id = message.id; + if (message.hasOwnProperty("someBool") && message.someBool !== undefined && message.someBool !== null) { + object.someBool = []; + for (var j = 0; j < message.someBool.length; ++j) + object.someBool[j] = message.someBool[j]; + } return object; }; @@ -4619,13 +4472,8 @@ $root.jspb = (function() { var object = {}; if (options.defaults) object.id = ""; - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "id": - object.id = message.id; - break; - } + if (message.hasOwnProperty("id") && message.id !== undefined && message.id !== null) + object.id = message.id; return object; }; @@ -4783,13 +4631,8 @@ $root.jspb = (function() { var object = {}; if (options.defaults) object.id = ""; - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "id": - object.id = message.id; - break; - } + if (message.hasOwnProperty("id") && message.id !== undefined && message.id !== null) + object.id = message.id; return object; }; @@ -4861,7 +4704,7 @@ $root.jspb = (function() { TestGroup1.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.group !== undefined && message.group !== null) + if (message.hasOwnProperty("group") && message.group !== undefined) $types[0].encode(message.group, writer.uint32(/* id 1, wireType 3 =*/11)).uint32(/* id 1, wireType 4 =*/12); return writer; }; @@ -4957,13 +4800,8 @@ $root.jspb = (function() { var object = {}; if (options.defaults) object.group = null; - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "group": - object.group = $types[0].toObject(message.group, options); - break; - } + if (message.hasOwnProperty("group") && message.group !== undefined && message.group !== null) + object.group = $types[0].toObject(message.group, options); return object; }; @@ -5034,9 +4872,9 @@ $root.jspb = (function() { TestReservedNames.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.extension !== undefined && message.extension !== 0) + if (message.hasOwnProperty("extension") && message.extension !== undefined) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.extension); - if (message[".jspb.test.TestReservedNamesExtension.foo"] !== undefined && message[".jspb.test.TestReservedNamesExtension.foo"] !== 0) + if (message.hasOwnProperty(".jspb.test.TestReservedNamesExtension.foo") && message[".jspb.test.TestReservedNamesExtension.foo"] !== undefined) writer.uint32(/* id 10, wireType 0 =*/80).int32(message[".jspb.test.TestReservedNamesExtension.foo"]); return writer; }; @@ -5140,16 +4978,10 @@ $root.jspb = (function() { object.extension = 0; object[".jspb.test.TestReservedNamesExtension.foo"] = 0; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "extension": - object.extension = message.extension; - break; - case ".jspb.test.TestReservedNamesExtension.foo": - object[".jspb.test.TestReservedNamesExtension.foo"] = message[".jspb.test.TestReservedNamesExtension.foo"]; - break; - } + if (message.hasOwnProperty("extension") && message.extension !== undefined && message.extension !== null) + object.extension = message.extension; + if (message.hasOwnProperty(".jspb.test.TestReservedNamesExtension.foo") && message[".jspb.test.TestReservedNamesExtension.foo"] !== undefined && message[".jspb.test.TestReservedNamesExtension.foo"] !== null) + object[".jspb.test.TestReservedNamesExtension.foo"] = message[".jspb.test.TestReservedNamesExtension.foo"]; return object; }; @@ -5450,9 +5282,9 @@ $root.jspb = (function() { TestMessageWithOneof.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.normalField !== undefined && message.normalField !== false) + if (message.hasOwnProperty("normalField") && message.normalField !== undefined) writer.uint32(/* id 8, wireType 0 =*/64).bool(message.normalField); - if (message.repeatedField) + if (message.hasOwnProperty("repeatedField")) for (var i = 0; i < message.repeatedField.length; ++i) writer.uint32(/* id 9, wireType 2 =*/74).string(message.repeatedField[i]); switch (message.partialOneof) { @@ -5673,44 +5505,29 @@ $root.jspb = (function() { object.bone = 0; object.btwo = 1234; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "pone": - object.pone = message.pone; - break; - case "pthree": - object.pthree = message.pthree; - break; - case "rone": - object.rone = $types[2].toObject(message.rone, options); - break; - case "rtwo": - object.rtwo = message.rtwo; - break; - case "normalField": - object.normalField = message.normalField; - break; - case "repeatedField": - if (message.repeatedField.length) { - object.repeatedField = []; - for (var j = 0; j < message.repeatedField.length; ++j) - object.repeatedField[j] = message.repeatedField[j]; - } - break; - case "aone": - object.aone = message.aone; - break; - case "atwo": - object.atwo = message.atwo; - break; - case "bone": - object.bone = message.bone; - break; - case "btwo": - object.btwo = message.btwo; - break; - } + if (message.hasOwnProperty("pone") && message.pone !== undefined && message.pone !== null) + object.pone = message.pone; + if (message.hasOwnProperty("pthree") && message.pthree !== undefined && message.pthree !== null) + object.pthree = message.pthree; + if (message.hasOwnProperty("rone") && message.rone !== undefined && message.rone !== null) + object.rone = $types[2].toObject(message.rone, options); + if (message.hasOwnProperty("rtwo") && message.rtwo !== undefined && message.rtwo !== null) + object.rtwo = message.rtwo; + if (message.hasOwnProperty("normalField") && message.normalField !== undefined && message.normalField !== null) + object.normalField = message.normalField; + if (message.hasOwnProperty("repeatedField") && message.repeatedField !== undefined && message.repeatedField !== null) { + object.repeatedField = []; + for (var j = 0; j < message.repeatedField.length; ++j) + object.repeatedField[j] = message.repeatedField[j]; + } + if (message.hasOwnProperty("aone") && message.aone !== undefined && message.aone !== null) + object.aone = message.aone; + if (message.hasOwnProperty("atwo") && message.atwo !== undefined && message.atwo !== null) + object.atwo = message.atwo; + if (message.hasOwnProperty("bone") && message.bone !== undefined && message.bone !== null) + object.bone = message.bone; + if (message.hasOwnProperty("btwo") && message.btwo !== undefined && message.btwo !== null) + object.btwo = message.btwo; return object; }; @@ -5780,9 +5597,9 @@ $root.jspb = (function() { TestEndsWithBytes.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.value !== undefined && message.value !== 0) + if (message.hasOwnProperty("value") && message.value !== undefined) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); - if (message.data && message.data.length) + if (message.hasOwnProperty("data") && message.data) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); return writer; }; @@ -5889,16 +5706,10 @@ $root.jspb = (function() { object.value = 0; object.data = options.bytes === String ? "" : []; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "value": - object.value = message.value; - break; - case "data": - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; - break; - } + if (message.hasOwnProperty("value") && message.value !== undefined && message.value !== null) + object.value = message.value; + if (message.hasOwnProperty("data") && message.data !== undefined && message.data !== null) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; return object; }; @@ -6036,41 +5847,41 @@ $root.jspb = (function() { TestMapFieldsNoBinary.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.mapStringString && message.mapStringString !== $util.emptyObject) + if (message.hasOwnProperty("mapStringString") && message.mapStringString) for (var keys = Object.keys(message.mapStringString), i = 0; i < keys.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.mapStringString[keys[i]]).ldelim(); - if (message.mapStringInt32 && message.mapStringInt32 !== $util.emptyObject) + if (message.hasOwnProperty("mapStringInt32") && message.mapStringInt32) for (var keys = Object.keys(message.mapStringInt32), i = 0; i < keys.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.mapStringInt32[keys[i]]).ldelim(); - if (message.mapStringInt64 && message.mapStringInt64 !== $util.emptyObject) + if (message.hasOwnProperty("mapStringInt64") && message.mapStringInt64) for (var keys = Object.keys(message.mapStringInt64), i = 0; i < keys.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.mapStringInt64[keys[i]]).ldelim(); - if (message.mapStringBool && message.mapStringBool !== $util.emptyObject) + if (message.hasOwnProperty("mapStringBool") && message.mapStringBool) for (var keys = Object.keys(message.mapStringBool), i = 0; i < keys.length; ++i) writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).bool(message.mapStringBool[keys[i]]).ldelim(); - if (message.mapStringDouble && message.mapStringDouble !== $util.emptyObject) + if (message.hasOwnProperty("mapStringDouble") && message.mapStringDouble) for (var keys = Object.keys(message.mapStringDouble), i = 0; i < keys.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 1 =*/17).double(message.mapStringDouble[keys[i]]).ldelim(); - if (message.mapStringEnum && message.mapStringEnum !== $util.emptyObject) + if (message.hasOwnProperty("mapStringEnum") && message.mapStringEnum) for (var keys = Object.keys(message.mapStringEnum), i = 0; i < keys.length; ++i) writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).uint32(message.mapStringEnum[keys[i]]).ldelim(); - if (message.mapStringMsg && message.mapStringMsg !== $util.emptyObject) + if (message.hasOwnProperty("mapStringMsg") && message.mapStringMsg) for (var keys = Object.keys(message.mapStringMsg), i = 0; i < keys.length; ++i) { writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $types[6].encode(message.mapStringMsg[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } - if (message.mapInt32String && message.mapInt32String !== $util.emptyObject) + if (message.hasOwnProperty("mapInt32String") && message.mapInt32String) for (var keys = Object.keys(message.mapInt32String), i = 0; i < keys.length; ++i) writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.mapInt32String[keys[i]]).ldelim(); - if (message.mapInt64String && message.mapInt64String !== $util.emptyObject) + if (message.hasOwnProperty("mapInt64String") && message.mapInt64String) for (var keys = Object.keys(message.mapInt64String), i = 0; i < keys.length; ++i) writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 0 =*/8).int64(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.mapInt64String[keys[i]]).ldelim(); - if (message.mapBoolString && message.mapBoolString !== $util.emptyObject) + if (message.hasOwnProperty("mapBoolString") && message.mapBoolString) for (var keys = Object.keys(message.mapBoolString), i = 0; i < keys.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 0 =*/8).bool(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.mapBoolString[keys[i]]).ldelim(); - if (message.testMapFields !== undefined && message.testMapFields !== null) + if (message.hasOwnProperty("testMapFields") && message.testMapFields !== undefined) $types[10].encode(message.testMapFields, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.mapStringTestmapfields && message.mapStringTestmapfields !== $util.emptyObject) + if (message.hasOwnProperty("mapStringTestmapfields") && message.mapStringTestmapfields) for (var keys = Object.keys(message.mapStringTestmapfields), i = 0; i < keys.length; ++i) { writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); $types[11].encode(message.mapStringTestmapfields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); @@ -6452,93 +6263,66 @@ $root.jspb = (function() { } if (options.defaults) object.testMapFields = null; - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "mapStringString": - if (message.mapStringString !== $util.emptyObject) { - object.mapStringString = {}; - for (var keys2 = Object.keys(message.mapStringString), j = 0; j < keys2.length; ++j) - object.mapStringString[keys2[j]] = message.mapStringString[keys2[j]]; - } - break; - case "mapStringInt32": - if (message.mapStringInt32 !== $util.emptyObject) { - object.mapStringInt32 = {}; - for (var keys2 = Object.keys(message.mapStringInt32), j = 0; j < keys2.length; ++j) - object.mapStringInt32[keys2[j]] = message.mapStringInt32[keys2[j]]; - } - break; - case "mapStringInt64": - if (message.mapStringInt64 !== $util.emptyObject) { - object.mapStringInt64 = {}; - for (var keys2 = Object.keys(message.mapStringInt64), j = 0; j < keys2.length; ++j) - if (typeof message.mapStringInt64[keys2[j]] === "number") - object.mapStringInt64[keys2[j]] = options.longs === String ? String(message.mapStringInt64[keys2[j]]) : message.mapStringInt64[keys2[j]]; - else - object.mapStringInt64[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.mapStringInt64[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.mapStringInt64[keys2[j]].low, message.mapStringInt64[keys2[j]].high).toNumber() : message.mapStringInt64[keys2[j]]; - } - break; - case "mapStringBool": - if (message.mapStringBool !== $util.emptyObject) { - object.mapStringBool = {}; - for (var keys2 = Object.keys(message.mapStringBool), j = 0; j < keys2.length; ++j) - object.mapStringBool[keys2[j]] = message.mapStringBool[keys2[j]]; - } - break; - case "mapStringDouble": - if (message.mapStringDouble !== $util.emptyObject) { - object.mapStringDouble = {}; - for (var keys2 = Object.keys(message.mapStringDouble), j = 0; j < keys2.length; ++j) - object.mapStringDouble[keys2[j]] = message.mapStringDouble[keys2[j]]; - } - break; - case "mapStringEnum": - if (message.mapStringEnum !== $util.emptyObject) { - object.mapStringEnum = {}; - for (var keys2 = Object.keys(message.mapStringEnum), j = 0; j < keys2.length; ++j) - object.mapStringEnum[keys2[j]] = options.enums === String ? $types[5][message.mapStringEnum[keys2[j]]] : message.mapStringEnum[keys2[j]]; - } - break; - case "mapStringMsg": - if (message.mapStringMsg !== $util.emptyObject) { - object.mapStringMsg = {}; - for (var keys2 = Object.keys(message.mapStringMsg), j = 0; j < keys2.length; ++j) - object.mapStringMsg[keys2[j]] = $types[6].toObject(message.mapStringMsg[keys2[j]], options); - } - break; - case "mapInt32String": - if (message.mapInt32String !== $util.emptyObject) { - object.mapInt32String = {}; - for (var keys2 = Object.keys(message.mapInt32String), j = 0; j < keys2.length; ++j) - object.mapInt32String[keys2[j]] = message.mapInt32String[keys2[j]]; - } - break; - case "mapInt64String": - if (message.mapInt64String !== $util.emptyObject) { - object.mapInt64String = {}; - for (var keys2 = Object.keys(message.mapInt64String), j = 0; j < keys2.length; ++j) - object.mapInt64String[keys2[j]] = message.mapInt64String[keys2[j]]; - } - break; - case "mapBoolString": - if (message.mapBoolString !== $util.emptyObject) { - object.mapBoolString = {}; - for (var keys2 = Object.keys(message.mapBoolString), j = 0; j < keys2.length; ++j) - object.mapBoolString[keys2[j]] = message.mapBoolString[keys2[j]]; - } - break; - case "testMapFields": - object.testMapFields = $types[10].toObject(message.testMapFields, options); - break; - case "mapStringTestmapfields": - if (message.mapStringTestmapfields !== $util.emptyObject) { - object.mapStringTestmapfields = {}; - for (var keys2 = Object.keys(message.mapStringTestmapfields), j = 0; j < keys2.length; ++j) - object.mapStringTestmapfields[keys2[j]] = $types[11].toObject(message.mapStringTestmapfields[keys2[j]], options); - } - break; - } + if (message.hasOwnProperty("mapStringString") && message.mapStringString !== undefined && message.mapStringString !== null) { + object.mapStringString = {}; + for (var keys2 = Object.keys(message.mapStringString), j = 0; j < keys2.length; ++j) + object.mapStringString[keys2[j]] = message.mapStringString[keys2[j]]; + } + if (message.hasOwnProperty("mapStringInt32") && message.mapStringInt32 !== undefined && message.mapStringInt32 !== null) { + object.mapStringInt32 = {}; + for (var keys2 = Object.keys(message.mapStringInt32), j = 0; j < keys2.length; ++j) + object.mapStringInt32[keys2[j]] = message.mapStringInt32[keys2[j]]; + } + if (message.hasOwnProperty("mapStringInt64") && message.mapStringInt64 !== undefined && message.mapStringInt64 !== null) { + object.mapStringInt64 = {}; + for (var keys2 = Object.keys(message.mapStringInt64), j = 0; j < keys2.length; ++j) + if (typeof message.mapStringInt64[keys2[j]] === "number") + object.mapStringInt64[keys2[j]] = options.longs === String ? String(message.mapStringInt64[keys2[j]]) : message.mapStringInt64[keys2[j]]; + else + object.mapStringInt64[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.mapStringInt64[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.mapStringInt64[keys2[j]].low, message.mapStringInt64[keys2[j]].high).toNumber() : message.mapStringInt64[keys2[j]]; + } + if (message.hasOwnProperty("mapStringBool") && message.mapStringBool !== undefined && message.mapStringBool !== null) { + object.mapStringBool = {}; + for (var keys2 = Object.keys(message.mapStringBool), j = 0; j < keys2.length; ++j) + object.mapStringBool[keys2[j]] = message.mapStringBool[keys2[j]]; + } + if (message.hasOwnProperty("mapStringDouble") && message.mapStringDouble !== undefined && message.mapStringDouble !== null) { + object.mapStringDouble = {}; + for (var keys2 = Object.keys(message.mapStringDouble), j = 0; j < keys2.length; ++j) + object.mapStringDouble[keys2[j]] = message.mapStringDouble[keys2[j]]; + } + if (message.hasOwnProperty("mapStringEnum") && message.mapStringEnum !== undefined && message.mapStringEnum !== null) { + object.mapStringEnum = {}; + for (var keys2 = Object.keys(message.mapStringEnum), j = 0; j < keys2.length; ++j) + object.mapStringEnum[keys2[j]] = options.enums === String ? $types[5][message.mapStringEnum[keys2[j]]] : message.mapStringEnum[keys2[j]]; + } + if (message.hasOwnProperty("mapStringMsg") && message.mapStringMsg !== undefined && message.mapStringMsg !== null) { + object.mapStringMsg = {}; + for (var keys2 = Object.keys(message.mapStringMsg), j = 0; j < keys2.length; ++j) + object.mapStringMsg[keys2[j]] = $types[6].toObject(message.mapStringMsg[keys2[j]], options); + } + if (message.hasOwnProperty("mapInt32String") && message.mapInt32String !== undefined && message.mapInt32String !== null) { + object.mapInt32String = {}; + for (var keys2 = Object.keys(message.mapInt32String), j = 0; j < keys2.length; ++j) + object.mapInt32String[keys2[j]] = message.mapInt32String[keys2[j]]; + } + if (message.hasOwnProperty("mapInt64String") && message.mapInt64String !== undefined && message.mapInt64String !== null) { + object.mapInt64String = {}; + for (var keys2 = Object.keys(message.mapInt64String), j = 0; j < keys2.length; ++j) + object.mapInt64String[keys2[j]] = message.mapInt64String[keys2[j]]; + } + if (message.hasOwnProperty("mapBoolString") && message.mapBoolString !== undefined && message.mapBoolString !== null) { + object.mapBoolString = {}; + for (var keys2 = Object.keys(message.mapBoolString), j = 0; j < keys2.length; ++j) + object.mapBoolString[keys2[j]] = message.mapBoolString[keys2[j]]; + } + if (message.hasOwnProperty("testMapFields") && message.testMapFields !== undefined && message.testMapFields !== null) + object.testMapFields = $types[10].toObject(message.testMapFields, options); + if (message.hasOwnProperty("mapStringTestmapfields") && message.mapStringTestmapfields !== undefined && message.mapStringTestmapfields !== null) { + object.mapStringTestmapfields = {}; + for (var keys2 = Object.keys(message.mapStringTestmapfields), j = 0; j < keys2.length; ++j) + object.mapStringTestmapfields[keys2[j]] = $types[11].toObject(message.mapStringTestmapfields[keys2[j]], options); + } return object; }; @@ -6620,7 +6404,7 @@ $root.jspb = (function() { MapValueMessageNoBinary.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.foo !== undefined && message.foo !== 0) + if (message.hasOwnProperty("foo") && message.foo !== undefined) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.foo); return writer; }; @@ -6714,13 +6498,8 @@ $root.jspb = (function() { var object = {}; if (options.defaults) object.foo = 0; - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "foo": - object.foo = message.foo; - break; - } + if (message.hasOwnProperty("foo") && message.foo !== undefined && message.foo !== null) + object.foo = message.foo; return object; }; @@ -7048,7 +6827,7 @@ $root.jspb = (function() { Message.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.count !== undefined && message.count !== 0) + if (message.hasOwnProperty("count") && message.count !== undefined) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.count); return writer; }; @@ -7142,13 +6921,8 @@ $root.jspb = (function() { var object = {}; if (options.defaults) object.count = 0; - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "count": - object.count = message.count; - break; - } + if (message.hasOwnProperty("count") && message.count !== undefined && message.count !== null) + object.count = message.count; return object; }; @@ -7247,7 +7021,7 @@ $root.google = (function() { FileDescriptorSet.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.file) + if (message.hasOwnProperty("file")) for (var i = 0; i < message.file.length; ++i) $types[0].encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; @@ -7353,17 +7127,11 @@ $root.google = (function() { var object = {}; if (options.arrays || options.defaults) object.file = []; - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "file": - if (message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $types[0].toObject(message.file[j], options); - } - break; - } + if (message.hasOwnProperty("file") && message.file !== undefined && message.file !== null) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $types[0].toObject(message.file[j], options); + } return object; }; @@ -7504,36 +7272,36 @@ $root.google = (function() { FileDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name !== undefined && message.name !== "") + if (message.hasOwnProperty("name") && message.name !== undefined) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] !== undefined && message["package"] !== "") + if (message.hasOwnProperty("package") && message["package"] !== undefined) writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency) + if (message.hasOwnProperty("dependency")) for (var i = 0; i < message.dependency.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.publicDependency) + if (message.hasOwnProperty("publicDependency")) for (var i = 0; i < message.publicDependency.length; ++i) writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); - if (message.weakDependency) + if (message.hasOwnProperty("weakDependency")) for (var i = 0; i < message.weakDependency.length; ++i) writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.messageType) + if (message.hasOwnProperty("messageType")) for (var i = 0; i < message.messageType.length; ++i) $types[5].encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumType) + if (message.hasOwnProperty("enumType")) for (var i = 0; i < message.enumType.length; ++i) $types[6].encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service) + if (message.hasOwnProperty("service")) for (var i = 0; i < message.service.length; ++i) $types[7].encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension) + if (message.hasOwnProperty("extension")) for (var i = 0; i < message.extension.length; ++i) $types[8].encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options !== undefined && message.options !== null) + if (message.hasOwnProperty("options") && message.options !== undefined) $types[9].encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo !== undefined && message.sourceCodeInfo !== null) + if (message.hasOwnProperty("sourceCodeInfo") && message.sourceCodeInfo !== undefined) $types[10].encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.syntax !== undefined && message.syntax !== "") + if (message.hasOwnProperty("syntax") && message.syntax !== undefined) writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); return writer; }; @@ -7814,74 +7582,51 @@ $root.google = (function() { object.sourceCodeInfo = null; object.syntax = ""; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "name": - object.name = message.name; - break; - case "package": - object["package"] = message["package"]; - break; - case "dependency": - if (message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - break; - case "publicDependency": - if (message.publicDependency.length) { - object.publicDependency = []; - for (var j = 0; j < message.publicDependency.length; ++j) - object.publicDependency[j] = message.publicDependency[j]; - } - break; - case "weakDependency": - if (message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; - } - break; - case "messageType": - if (message.messageType.length) { - object.messageType = []; - for (var j = 0; j < message.messageType.length; ++j) - object.messageType[j] = $types[5].toObject(message.messageType[j], options); - } - break; - case "enumType": - if (message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $types[6].toObject(message.enumType[j], options); - } - break; - case "service": - if (message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $types[7].toObject(message.service[j], options); - } - break; - case "extension": - if (message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $types[8].toObject(message.extension[j], options); - } - break; - case "options": - object.options = $types[9].toObject(message.options, options); - break; - case "sourceCodeInfo": - object.sourceCodeInfo = $types[10].toObject(message.sourceCodeInfo, options); - break; - case "syntax": - object.syntax = message.syntax; - break; - } + if (message.hasOwnProperty("name") && message.name !== undefined && message.name !== null) + object.name = message.name; + if (message.hasOwnProperty("package") && message["package"] !== undefined && message["package"] !== null) + object["package"] = message["package"]; + if (message.hasOwnProperty("dependency") && message.dependency !== undefined && message.dependency !== null) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.hasOwnProperty("publicDependency") && message.publicDependency !== undefined && message.publicDependency !== null) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.hasOwnProperty("weakDependency") && message.weakDependency !== undefined && message.weakDependency !== null) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.hasOwnProperty("messageType") && message.messageType !== undefined && message.messageType !== null) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $types[5].toObject(message.messageType[j], options); + } + if (message.hasOwnProperty("enumType") && message.enumType !== undefined && message.enumType !== null) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $types[6].toObject(message.enumType[j], options); + } + if (message.hasOwnProperty("service") && message.service !== undefined && message.service !== null) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $types[7].toObject(message.service[j], options); + } + if (message.hasOwnProperty("extension") && message.extension !== undefined && message.extension !== null) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $types[8].toObject(message.extension[j], options); + } + if (message.hasOwnProperty("options") && message.options !== undefined && message.options !== null) + object.options = $types[9].toObject(message.options, options); + if (message.hasOwnProperty("sourceCodeInfo") && message.sourceCodeInfo !== undefined && message.sourceCodeInfo !== null) + object.sourceCodeInfo = $types[10].toObject(message.sourceCodeInfo, options); + if (message.hasOwnProperty("syntax") && message.syntax !== undefined && message.syntax !== null) + object.syntax = message.syntax; return object; }; @@ -8011,32 +7756,32 @@ $root.google = (function() { DescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name !== undefined && message.name !== "") + if (message.hasOwnProperty("name") && message.name !== undefined) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field) + if (message.hasOwnProperty("field")) for (var i = 0; i < message.field.length; ++i) $types[1].encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.extension) + if (message.hasOwnProperty("extension")) for (var i = 0; i < message.extension.length; ++i) $types[2].encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.nestedType) + if (message.hasOwnProperty("nestedType")) for (var i = 0; i < message.nestedType.length; ++i) $types[3].encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enumType) + if (message.hasOwnProperty("enumType")) for (var i = 0; i < message.enumType.length; ++i) $types[4].encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extensionRange) + if (message.hasOwnProperty("extensionRange")) for (var i = 0; i < message.extensionRange.length; ++i) $types[5].encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.oneofDecl) + if (message.hasOwnProperty("oneofDecl")) for (var i = 0; i < message.oneofDecl.length; ++i) $types[6].encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.options !== undefined && message.options !== null) + if (message.hasOwnProperty("options") && message.options !== undefined) $types[7].encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.reservedRange) + if (message.hasOwnProperty("reservedRange")) for (var i = 0; i < message.reservedRange.length; ++i) $types[8].encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reservedName) + if (message.hasOwnProperty("reservedName")) for (var i = 0; i < message.reservedName.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); return writer; @@ -8303,72 +8048,50 @@ $root.google = (function() { object.name = ""; object.options = null; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "name": - object.name = message.name; - break; - case "field": - if (message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $types[1].toObject(message.field[j], options); - } - break; - case "extension": - if (message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $types[2].toObject(message.extension[j], options); - } - break; - case "nestedType": - if (message.nestedType.length) { - object.nestedType = []; - for (var j = 0; j < message.nestedType.length; ++j) - object.nestedType[j] = $types[3].toObject(message.nestedType[j], options); - } - break; - case "enumType": - if (message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $types[4].toObject(message.enumType[j], options); - } - break; - case "extensionRange": - if (message.extensionRange.length) { - object.extensionRange = []; - for (var j = 0; j < message.extensionRange.length; ++j) - object.extensionRange[j] = $types[5].toObject(message.extensionRange[j], options); - } - break; - case "oneofDecl": - if (message.oneofDecl.length) { - object.oneofDecl = []; - for (var j = 0; j < message.oneofDecl.length; ++j) - object.oneofDecl[j] = $types[6].toObject(message.oneofDecl[j], options); - } - break; - case "options": - object.options = $types[7].toObject(message.options, options); - break; - case "reservedRange": - if (message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $types[8].toObject(message.reservedRange[j], options); - } - break; - case "reservedName": - if (message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - break; - } + if (message.hasOwnProperty("name") && message.name !== undefined && message.name !== null) + object.name = message.name; + if (message.hasOwnProperty("field") && message.field !== undefined && message.field !== null) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $types[1].toObject(message.field[j], options); + } + if (message.hasOwnProperty("extension") && message.extension !== undefined && message.extension !== null) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $types[2].toObject(message.extension[j], options); + } + if (message.hasOwnProperty("nestedType") && message.nestedType !== undefined && message.nestedType !== null) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $types[3].toObject(message.nestedType[j], options); + } + if (message.hasOwnProperty("enumType") && message.enumType !== undefined && message.enumType !== null) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $types[4].toObject(message.enumType[j], options); + } + if (message.hasOwnProperty("extensionRange") && message.extensionRange !== undefined && message.extensionRange !== null) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $types[5].toObject(message.extensionRange[j], options); + } + if (message.hasOwnProperty("oneofDecl") && message.oneofDecl !== undefined && message.oneofDecl !== null) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $types[6].toObject(message.oneofDecl[j], options); + } + if (message.hasOwnProperty("options") && message.options !== undefined && message.options !== null) + object.options = $types[7].toObject(message.options, options); + if (message.hasOwnProperty("reservedRange") && message.reservedRange !== undefined && message.reservedRange !== null) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $types[8].toObject(message.reservedRange[j], options); + } + if (message.hasOwnProperty("reservedName") && message.reservedName !== undefined && message.reservedName !== null) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } return object; }; @@ -8435,9 +8158,9 @@ $root.google = (function() { ExtensionRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start !== undefined && message.start !== 0) + if (message.hasOwnProperty("start") && message.start !== undefined) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end !== undefined && message.end !== 0) + if (message.hasOwnProperty("end") && message.end !== undefined) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; @@ -8541,16 +8264,10 @@ $root.google = (function() { object.start = 0; object.end = 0; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "start": - object.start = message.start; - break; - case "end": - object.end = message.end; - break; - } + if (message.hasOwnProperty("start") && message.start !== undefined && message.start !== null) + object.start = message.start; + if (message.hasOwnProperty("end") && message.end !== undefined && message.end !== null) + object.end = message.end; return object; }; @@ -8620,9 +8337,9 @@ $root.google = (function() { ReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start !== undefined && message.start !== 0) + if (message.hasOwnProperty("start") && message.start !== undefined) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end !== undefined && message.end !== 0) + if (message.hasOwnProperty("end") && message.end !== undefined) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; @@ -8726,16 +8443,10 @@ $root.google = (function() { object.start = 0; object.end = 0; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "start": - object.start = message.start; - break; - case "end": - object.end = message.end; - break; - } + if (message.hasOwnProperty("start") && message.start !== undefined && message.start !== null) + object.start = message.start; + if (message.hasOwnProperty("end") && message.end !== undefined && message.end !== null) + object.end = message.end; return object; }; @@ -8863,25 +8574,25 @@ $root.google = (function() { FieldDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name !== undefined && message.name !== "") + if (message.hasOwnProperty("name") && message.name !== undefined) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number !== undefined && message.number !== 0) + if (message.hasOwnProperty("number") && message.number !== undefined) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label !== undefined && message.label !== 1) + if (message.hasOwnProperty("label") && message.label !== undefined) writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.label); - if (message.type !== undefined && message.type !== 1) + if (message.hasOwnProperty("type") && message.type !== undefined) writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.type); - if (message.typeName !== undefined && message.typeName !== "") + if (message.hasOwnProperty("typeName") && message.typeName !== undefined) writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.extendee !== undefined && message.extendee !== "") + if (message.hasOwnProperty("extendee") && message.extendee !== undefined) writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.defaultValue !== undefined && message.defaultValue !== "") + if (message.hasOwnProperty("defaultValue") && message.defaultValue !== undefined) writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.oneofIndex !== undefined && message.oneofIndex !== 0) + if (message.hasOwnProperty("oneofIndex") && message.oneofIndex !== undefined) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName !== undefined && message.jsonName !== "") + if (message.hasOwnProperty("jsonName") && message.jsonName !== undefined) writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); - if (message.options !== undefined && message.options !== null) + if (message.hasOwnProperty("options") && message.options !== undefined) $types[9].encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -9170,40 +8881,26 @@ $root.google = (function() { object.jsonName = ""; object.options = null; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "name": - object.name = message.name; - break; - case "number": - object.number = message.number; - break; - case "label": - object.label = options.enums === String ? $types[2][message.label] : message.label; - break; - case "type": - object.type = options.enums === String ? $types[3][message.type] : message.type; - break; - case "typeName": - object.typeName = message.typeName; - break; - case "extendee": - object.extendee = message.extendee; - break; - case "defaultValue": - object.defaultValue = message.defaultValue; - break; - case "oneofIndex": - object.oneofIndex = message.oneofIndex; - break; - case "jsonName": - object.jsonName = message.jsonName; - break; - case "options": - object.options = $types[9].toObject(message.options, options); - break; - } + if (message.hasOwnProperty("name") && message.name !== undefined && message.name !== null) + object.name = message.name; + if (message.hasOwnProperty("number") && message.number !== undefined && message.number !== null) + object.number = message.number; + if (message.hasOwnProperty("label") && message.label !== undefined && message.label !== null) + object.label = options.enums === String ? $types[2][message.label] : message.label; + if (message.hasOwnProperty("type") && message.type !== undefined && message.type !== null) + object.type = options.enums === String ? $types[3][message.type] : message.type; + if (message.hasOwnProperty("typeName") && message.typeName !== undefined && message.typeName !== null) + object.typeName = message.typeName; + if (message.hasOwnProperty("extendee") && message.extendee !== undefined && message.extendee !== null) + object.extendee = message.extendee; + if (message.hasOwnProperty("defaultValue") && message.defaultValue !== undefined && message.defaultValue !== null) + object.defaultValue = message.defaultValue; + if (message.hasOwnProperty("oneofIndex") && message.oneofIndex !== undefined && message.oneofIndex !== null) + object.oneofIndex = message.oneofIndex; + if (message.hasOwnProperty("jsonName") && message.jsonName !== undefined && message.jsonName !== null) + object.jsonName = message.jsonName; + if (message.hasOwnProperty("options") && message.options !== undefined && message.options !== null) + object.options = $types[9].toObject(message.options, options); return object; }; @@ -9344,9 +9041,9 @@ $root.google = (function() { OneofDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name !== undefined && message.name !== "") + if (message.hasOwnProperty("name") && message.name !== undefined) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options !== undefined && message.options !== null) + if (message.hasOwnProperty("options") && message.options !== undefined) $types[1].encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -9452,16 +9149,10 @@ $root.google = (function() { object.name = ""; object.options = null; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "name": - object.name = message.name; - break; - case "options": - object.options = $types[1].toObject(message.options, options); - break; - } + if (message.hasOwnProperty("name") && message.name !== undefined && message.name !== null) + object.name = message.name; + if (message.hasOwnProperty("options") && message.options !== undefined && message.options !== null) + object.options = $types[1].toObject(message.options, options); return object; }; @@ -9543,12 +9234,12 @@ $root.google = (function() { EnumDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name !== undefined && message.name !== "") + if (message.hasOwnProperty("name") && message.name !== undefined) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value) + if (message.hasOwnProperty("value")) for (var i = 0; i < message.value.length; ++i) $types[1].encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options !== undefined && message.options !== null) + if (message.hasOwnProperty("options") && message.options !== undefined) $types[2].encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -9675,23 +9366,15 @@ $root.google = (function() { object.name = ""; object.options = null; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "name": - object.name = message.name; - break; - case "value": - if (message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $types[1].toObject(message.value[j], options); - } - break; - case "options": - object.options = $types[2].toObject(message.options, options); - break; - } + if (message.hasOwnProperty("name") && message.name !== undefined && message.name !== null) + object.name = message.name; + if (message.hasOwnProperty("value") && message.value !== undefined && message.value !== null) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $types[1].toObject(message.value[j], options); + } + if (message.hasOwnProperty("options") && message.options !== undefined && message.options !== null) + object.options = $types[2].toObject(message.options, options); return object; }; @@ -9772,11 +9455,11 @@ $root.google = (function() { EnumValueDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name !== undefined && message.name !== "") + if (message.hasOwnProperty("name") && message.name !== undefined) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number !== undefined && message.number !== 0) + if (message.hasOwnProperty("number") && message.number !== undefined) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options !== undefined && message.options !== null) + if (message.hasOwnProperty("options") && message.options !== undefined) $types[2].encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -9891,19 +9574,12 @@ $root.google = (function() { object.number = 0; object.options = null; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "name": - object.name = message.name; - break; - case "number": - object.number = message.number; - break; - case "options": - object.options = $types[2].toObject(message.options, options); - break; - } + if (message.hasOwnProperty("name") && message.name !== undefined && message.name !== null) + object.name = message.name; + if (message.hasOwnProperty("number") && message.number !== undefined && message.number !== null) + object.number = message.number; + if (message.hasOwnProperty("options") && message.options !== undefined && message.options !== null) + object.options = $types[2].toObject(message.options, options); return object; }; @@ -9985,12 +9661,12 @@ $root.google = (function() { ServiceDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name !== undefined && message.name !== "") + if (message.hasOwnProperty("name") && message.name !== undefined) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method) + if (message.hasOwnProperty("method")) for (var i = 0; i < message.method.length; ++i) $types[1].encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options !== undefined && message.options !== null) + if (message.hasOwnProperty("options") && message.options !== undefined) $types[2].encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -10117,23 +9793,15 @@ $root.google = (function() { object.name = ""; object.options = null; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "name": - object.name = message.name; - break; - case "method": - if (message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = $types[1].toObject(message.method[j], options); - } - break; - case "options": - object.options = $types[2].toObject(message.options, options); - break; - } + if (message.hasOwnProperty("name") && message.name !== undefined && message.name !== null) + object.name = message.name; + if (message.hasOwnProperty("method") && message.method !== undefined && message.method !== null) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $types[1].toObject(message.method[j], options); + } + if (message.hasOwnProperty("options") && message.options !== undefined && message.options !== null) + object.options = $types[2].toObject(message.options, options); return object; }; @@ -10232,17 +9900,17 @@ $root.google = (function() { MethodDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name !== undefined && message.name !== "") + if (message.hasOwnProperty("name") && message.name !== undefined) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType !== undefined && message.inputType !== "") + if (message.hasOwnProperty("inputType") && message.inputType !== undefined) writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType !== undefined && message.outputType !== "") + if (message.hasOwnProperty("outputType") && message.outputType !== undefined) writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options !== undefined && message.options !== null) + if (message.hasOwnProperty("options") && message.options !== undefined) $types[3].encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming !== undefined && message.clientStreaming !== false) + if (message.hasOwnProperty("clientStreaming") && message.clientStreaming !== undefined) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming !== undefined && message.serverStreaming !== false) + if (message.hasOwnProperty("serverStreaming") && message.serverStreaming !== undefined) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); return writer; }; @@ -10384,28 +10052,18 @@ $root.google = (function() { object.clientStreaming = false; object.serverStreaming = false; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "name": - object.name = message.name; - break; - case "inputType": - object.inputType = message.inputType; - break; - case "outputType": - object.outputType = message.outputType; - break; - case "options": - object.options = $types[3].toObject(message.options, options); - break; - case "clientStreaming": - object.clientStreaming = message.clientStreaming; - break; - case "serverStreaming": - object.serverStreaming = message.serverStreaming; - break; - } + if (message.hasOwnProperty("name") && message.name !== undefined && message.name !== null) + object.name = message.name; + if (message.hasOwnProperty("inputType") && message.inputType !== undefined && message.inputType !== null) + object.inputType = message.inputType; + if (message.hasOwnProperty("outputType") && message.outputType !== undefined && message.outputType !== null) + object.outputType = message.outputType; + if (message.hasOwnProperty("options") && message.options !== undefined && message.options !== null) + object.options = $types[3].toObject(message.options, options); + if (message.hasOwnProperty("clientStreaming") && message.clientStreaming !== undefined && message.clientStreaming !== null) + object.clientStreaming = message.clientStreaming; + if (message.hasOwnProperty("serverStreaming") && message.serverStreaming !== undefined && message.serverStreaming !== null) + object.serverStreaming = message.serverStreaming; return object; }; @@ -10559,35 +10217,35 @@ $root.google = (function() { FileOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.javaPackage !== undefined && message.javaPackage !== "") + if (message.hasOwnProperty("javaPackage") && message.javaPackage !== undefined) writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname !== undefined && message.javaOuterClassname !== "") + if (message.hasOwnProperty("javaOuterClassname") && message.javaOuterClassname !== undefined) writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.javaMultipleFiles !== undefined && message.javaMultipleFiles !== false) + if (message.hasOwnProperty("javaMultipleFiles") && message.javaMultipleFiles !== undefined) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.javaGenerateEqualsAndHash !== undefined && message.javaGenerateEqualsAndHash !== false) + if (message.hasOwnProperty("javaGenerateEqualsAndHash") && message.javaGenerateEqualsAndHash !== undefined) writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.javaStringCheckUtf8 !== undefined && message.javaStringCheckUtf8 !== false) + if (message.hasOwnProperty("javaStringCheckUtf8") && message.javaStringCheckUtf8 !== undefined) writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.optimizeFor !== undefined && message.optimizeFor !== undefined) + if (message.hasOwnProperty("optimizeFor") && message.optimizeFor !== undefined) writer.uint32(/* id 9, wireType 0 =*/72).uint32(message.optimizeFor); - if (message.goPackage !== undefined && message.goPackage !== "") + if (message.hasOwnProperty("goPackage") && message.goPackage !== undefined) writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices !== undefined && message.ccGenericServices !== false) + if (message.hasOwnProperty("ccGenericServices") && message.ccGenericServices !== undefined) writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices !== undefined && message.javaGenericServices !== false) + if (message.hasOwnProperty("javaGenericServices") && message.javaGenericServices !== undefined) writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices !== undefined && message.pyGenericServices !== false) + if (message.hasOwnProperty("pyGenericServices") && message.pyGenericServices !== undefined) writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.deprecated !== undefined && message.deprecated !== false) + if (message.hasOwnProperty("deprecated") && message.deprecated !== undefined) writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.ccEnableArenas !== undefined && message.ccEnableArenas !== false) + if (message.hasOwnProperty("ccEnableArenas") && message.ccEnableArenas !== undefined) writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix !== undefined && message.objcClassPrefix !== "") + if (message.hasOwnProperty("objcClassPrefix") && message.objcClassPrefix !== undefined) writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace !== undefined && message.csharpNamespace !== "") + if (message.hasOwnProperty("csharpNamespace") && message.csharpNamespace !== undefined) writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.uninterpretedOption) + if (message.hasOwnProperty("uninterpretedOption")) for (var i = 0; i < message.uninterpretedOption.length; ++i) $types[14].encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; @@ -10839,59 +10497,39 @@ $root.google = (function() { object.objcClassPrefix = ""; object.csharpNamespace = ""; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "javaPackage": - object.javaPackage = message.javaPackage; - break; - case "javaOuterClassname": - object.javaOuterClassname = message.javaOuterClassname; - break; - case "javaMultipleFiles": - object.javaMultipleFiles = message.javaMultipleFiles; - break; - case "javaGenerateEqualsAndHash": - object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - break; - case "javaStringCheckUtf8": - object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - break; - case "optimizeFor": - object.optimizeFor = options.enums === String ? $types[5][message.optimizeFor] : message.optimizeFor; - break; - case "goPackage": - object.goPackage = message.goPackage; - break; - case "ccGenericServices": - object.ccGenericServices = message.ccGenericServices; - break; - case "javaGenericServices": - object.javaGenericServices = message.javaGenericServices; - break; - case "pyGenericServices": - object.pyGenericServices = message.pyGenericServices; - break; - case "deprecated": - object.deprecated = message.deprecated; - break; - case "ccEnableArenas": - object.ccEnableArenas = message.ccEnableArenas; - break; - case "objcClassPrefix": - object.objcClassPrefix = message.objcClassPrefix; - break; - case "csharpNamespace": - object.csharpNamespace = message.csharpNamespace; - break; - case "uninterpretedOption": - if (message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $types[14].toObject(message.uninterpretedOption[j], options); - } - break; - } + if (message.hasOwnProperty("javaPackage") && message.javaPackage !== undefined && message.javaPackage !== null) + object.javaPackage = message.javaPackage; + if (message.hasOwnProperty("javaOuterClassname") && message.javaOuterClassname !== undefined && message.javaOuterClassname !== null) + object.javaOuterClassname = message.javaOuterClassname; + if (message.hasOwnProperty("javaMultipleFiles") && message.javaMultipleFiles !== undefined && message.javaMultipleFiles !== null) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.hasOwnProperty("javaGenerateEqualsAndHash") && message.javaGenerateEqualsAndHash !== undefined && message.javaGenerateEqualsAndHash !== null) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.hasOwnProperty("javaStringCheckUtf8") && message.javaStringCheckUtf8 !== undefined && message.javaStringCheckUtf8 !== null) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.hasOwnProperty("optimizeFor") && message.optimizeFor !== undefined && message.optimizeFor !== null) + object.optimizeFor = options.enums === String ? $types[5][message.optimizeFor] : message.optimizeFor; + if (message.hasOwnProperty("goPackage") && message.goPackage !== undefined && message.goPackage !== null) + object.goPackage = message.goPackage; + if (message.hasOwnProperty("ccGenericServices") && message.ccGenericServices !== undefined && message.ccGenericServices !== null) + object.ccGenericServices = message.ccGenericServices; + if (message.hasOwnProperty("javaGenericServices") && message.javaGenericServices !== undefined && message.javaGenericServices !== null) + object.javaGenericServices = message.javaGenericServices; + if (message.hasOwnProperty("pyGenericServices") && message.pyGenericServices !== undefined && message.pyGenericServices !== null) + object.pyGenericServices = message.pyGenericServices; + if (message.hasOwnProperty("deprecated") && message.deprecated !== undefined && message.deprecated !== null) + object.deprecated = message.deprecated; + if (message.hasOwnProperty("ccEnableArenas") && message.ccEnableArenas !== undefined && message.ccEnableArenas !== null) + object.ccEnableArenas = message.ccEnableArenas; + if (message.hasOwnProperty("objcClassPrefix") && message.objcClassPrefix !== undefined && message.objcClassPrefix !== null) + object.objcClassPrefix = message.objcClassPrefix; + if (message.hasOwnProperty("csharpNamespace") && message.csharpNamespace !== undefined && message.csharpNamespace !== null) + object.csharpNamespace = message.csharpNamespace; + if (message.hasOwnProperty("uninterpretedOption") && message.uninterpretedOption !== undefined && message.uninterpretedOption !== null) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $types[14].toObject(message.uninterpretedOption[j], options); + } return object; }; @@ -11002,15 +10640,15 @@ $root.google = (function() { MessageOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.messageSetWireFormat !== undefined && message.messageSetWireFormat !== false) + if (message.hasOwnProperty("messageSetWireFormat") && message.messageSetWireFormat !== undefined) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor !== undefined && message.noStandardDescriptorAccessor !== false) + if (message.hasOwnProperty("noStandardDescriptorAccessor") && message.noStandardDescriptorAccessor !== undefined) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated !== undefined && message.deprecated !== false) + if (message.hasOwnProperty("deprecated") && message.deprecated !== undefined) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry !== undefined && message.mapEntry !== false) + if (message.hasOwnProperty("mapEntry") && message.mapEntry !== undefined) writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); - if (message.uninterpretedOption) + if (message.hasOwnProperty("uninterpretedOption")) for (var i = 0; i < message.uninterpretedOption.length; ++i) $types[4].encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; @@ -11154,29 +10792,19 @@ $root.google = (function() { object.deprecated = false; object.mapEntry = false; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "messageSetWireFormat": - object.messageSetWireFormat = message.messageSetWireFormat; - break; - case "noStandardDescriptorAccessor": - object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - break; - case "deprecated": - object.deprecated = message.deprecated; - break; - case "mapEntry": - object.mapEntry = message.mapEntry; - break; - case "uninterpretedOption": - if (message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $types[4].toObject(message.uninterpretedOption[j], options); - } - break; - } + if (message.hasOwnProperty("messageSetWireFormat") && message.messageSetWireFormat !== undefined && message.messageSetWireFormat !== null) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.hasOwnProperty("noStandardDescriptorAccessor") && message.noStandardDescriptorAccessor !== undefined && message.noStandardDescriptorAccessor !== null) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.hasOwnProperty("deprecated") && message.deprecated !== undefined && message.deprecated !== null) + object.deprecated = message.deprecated; + if (message.hasOwnProperty("mapEntry") && message.mapEntry !== undefined && message.mapEntry !== null) + object.mapEntry = message.mapEntry; + if (message.hasOwnProperty("uninterpretedOption") && message.uninterpretedOption !== undefined && message.uninterpretedOption !== null) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $types[4].toObject(message.uninterpretedOption[j], options); + } return object; }; @@ -11283,19 +10911,19 @@ $root.google = (function() { FieldOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.ctype !== undefined && message.ctype !== undefined) + if (message.hasOwnProperty("ctype") && message.ctype !== undefined) writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.ctype); - if (message.packed !== undefined && message.packed !== false) + if (message.hasOwnProperty("packed") && message.packed !== undefined) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.jstype !== undefined && message.jstype !== undefined) + if (message.hasOwnProperty("jstype") && message.jstype !== undefined) writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.jstype); - if (message.lazy !== undefined && message.lazy !== false) + if (message.hasOwnProperty("lazy") && message.lazy !== undefined) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.deprecated !== undefined && message.deprecated !== false) + if (message.hasOwnProperty("deprecated") && message.deprecated !== undefined) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.weak !== undefined && message.weak !== false) + if (message.hasOwnProperty("weak") && message.weak !== undefined) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.uninterpretedOption) + if (message.hasOwnProperty("uninterpretedOption")) for (var i = 0; i < message.uninterpretedOption.length; ++i) $types[6].encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; @@ -11493,35 +11121,23 @@ $root.google = (function() { object.deprecated = false; object.weak = false; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "ctype": - object.ctype = options.enums === String ? $types[0][message.ctype] : message.ctype; - break; - case "packed": - object.packed = message.packed; - break; - case "jstype": - object.jstype = options.enums === String ? $types[2][message.jstype] : message.jstype; - break; - case "lazy": - object.lazy = message.lazy; - break; - case "deprecated": - object.deprecated = message.deprecated; - break; - case "weak": - object.weak = message.weak; - break; - case "uninterpretedOption": - if (message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $types[6].toObject(message.uninterpretedOption[j], options); - } - break; - } + if (message.hasOwnProperty("ctype") && message.ctype !== undefined && message.ctype !== null) + object.ctype = options.enums === String ? $types[0][message.ctype] : message.ctype; + if (message.hasOwnProperty("packed") && message.packed !== undefined && message.packed !== null) + object.packed = message.packed; + if (message.hasOwnProperty("jstype") && message.jstype !== undefined && message.jstype !== null) + object.jstype = options.enums === String ? $types[2][message.jstype] : message.jstype; + if (message.hasOwnProperty("lazy") && message.lazy !== undefined && message.lazy !== null) + object.lazy = message.lazy; + if (message.hasOwnProperty("deprecated") && message.deprecated !== undefined && message.deprecated !== null) + object.deprecated = message.deprecated; + if (message.hasOwnProperty("weak") && message.weak !== undefined && message.weak !== null) + object.weak = message.weak; + if (message.hasOwnProperty("uninterpretedOption") && message.uninterpretedOption !== undefined && message.uninterpretedOption !== null) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $types[6].toObject(message.uninterpretedOption[j], options); + } return object; }; @@ -11626,7 +11242,7 @@ $root.google = (function() { OneofOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.uninterpretedOption) + if (message.hasOwnProperty("uninterpretedOption")) for (var i = 0; i < message.uninterpretedOption.length; ++i) $types[0].encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; @@ -11732,17 +11348,11 @@ $root.google = (function() { var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "uninterpretedOption": - if (message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $types[0].toObject(message.uninterpretedOption[j], options); - } - break; - } + if (message.hasOwnProperty("uninterpretedOption") && message.uninterpretedOption !== undefined && message.uninterpretedOption !== null) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $types[0].toObject(message.uninterpretedOption[j], options); + } return object; }; @@ -11830,14 +11440,14 @@ $root.google = (function() { EnumOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.allowAlias !== undefined && message.allowAlias !== false) + if (message.hasOwnProperty("allowAlias") && message.allowAlias !== undefined) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated !== undefined && message.deprecated !== false) + if (message.hasOwnProperty("deprecated") && message.deprecated !== undefined) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.uninterpretedOption) + if (message.hasOwnProperty("uninterpretedOption")) for (var i = 0; i < message.uninterpretedOption.length; ++i) $types[2].encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".jspb.test.IsExtension.simpleOption"] !== undefined && message[".jspb.test.IsExtension.simpleOption"] !== "") + if (message.hasOwnProperty(".jspb.test.IsExtension.simpleOption") && message[".jspb.test.IsExtension.simpleOption"] !== undefined) writer.uint32(/* id 42113038, wireType 2 =*/336904306).string(message[".jspb.test.IsExtension.simpleOption"]); return writer; }; @@ -11971,26 +11581,17 @@ $root.google = (function() { object.deprecated = false; object[".jspb.test.IsExtension.simpleOption"] = ""; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "allowAlias": - object.allowAlias = message.allowAlias; - break; - case "deprecated": - object.deprecated = message.deprecated; - break; - case "uninterpretedOption": - if (message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $types[2].toObject(message.uninterpretedOption[j], options); - } - break; - case ".jspb.test.IsExtension.simpleOption": - object[".jspb.test.IsExtension.simpleOption"] = message[".jspb.test.IsExtension.simpleOption"]; - break; - } + if (message.hasOwnProperty("allowAlias") && message.allowAlias !== undefined && message.allowAlias !== null) + object.allowAlias = message.allowAlias; + if (message.hasOwnProperty("deprecated") && message.deprecated !== undefined && message.deprecated !== null) + object.deprecated = message.deprecated; + if (message.hasOwnProperty("uninterpretedOption") && message.uninterpretedOption !== undefined && message.uninterpretedOption !== null) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $types[2].toObject(message.uninterpretedOption[j], options); + } + if (message.hasOwnProperty(".jspb.test.IsExtension.simpleOption") && message[".jspb.test.IsExtension.simpleOption"] !== undefined && message[".jspb.test.IsExtension.simpleOption"] !== null) + object[".jspb.test.IsExtension.simpleOption"] = message[".jspb.test.IsExtension.simpleOption"]; return object; }; @@ -12065,9 +11666,9 @@ $root.google = (function() { EnumValueOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated !== undefined && message.deprecated !== false) + if (message.hasOwnProperty("deprecated") && message.deprecated !== undefined) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.uninterpretedOption) + if (message.hasOwnProperty("uninterpretedOption")) for (var i = 0; i < message.uninterpretedOption.length; ++i) $types[1].encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; @@ -12183,20 +11784,13 @@ $root.google = (function() { object.uninterpretedOption = []; if (options.defaults) object.deprecated = false; - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "deprecated": - object.deprecated = message.deprecated; - break; - case "uninterpretedOption": - if (message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $types[1].toObject(message.uninterpretedOption[j], options); - } - break; - } + if (message.hasOwnProperty("deprecated") && message.deprecated !== undefined && message.deprecated !== null) + object.deprecated = message.deprecated; + if (message.hasOwnProperty("uninterpretedOption") && message.uninterpretedOption !== undefined && message.uninterpretedOption !== null) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $types[1].toObject(message.uninterpretedOption[j], options); + } return object; }; @@ -12271,9 +11865,9 @@ $root.google = (function() { ServiceOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated !== undefined && message.deprecated !== false) + if (message.hasOwnProperty("deprecated") && message.deprecated !== undefined) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.uninterpretedOption) + if (message.hasOwnProperty("uninterpretedOption")) for (var i = 0; i < message.uninterpretedOption.length; ++i) $types[1].encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; @@ -12389,20 +11983,13 @@ $root.google = (function() { object.uninterpretedOption = []; if (options.defaults) object.deprecated = false; - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "deprecated": - object.deprecated = message.deprecated; - break; - case "uninterpretedOption": - if (message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $types[1].toObject(message.uninterpretedOption[j], options); - } - break; - } + if (message.hasOwnProperty("deprecated") && message.deprecated !== undefined && message.deprecated !== null) + object.deprecated = message.deprecated; + if (message.hasOwnProperty("uninterpretedOption") && message.uninterpretedOption !== undefined && message.uninterpretedOption !== null) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $types[1].toObject(message.uninterpretedOption[j], options); + } return object; }; @@ -12484,11 +12071,11 @@ $root.google = (function() { MethodOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated !== undefined && message.deprecated !== false) + if (message.hasOwnProperty("deprecated") && message.deprecated !== undefined) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel !== undefined && message.idempotencyLevel !== undefined) + if (message.hasOwnProperty("idempotencyLevel") && message.idempotencyLevel !== undefined) writer.uint32(/* id 34, wireType 0 =*/272).uint32(message.idempotencyLevel); - if (message.uninterpretedOption) + if (message.hasOwnProperty("uninterpretedOption")) for (var i = 0; i < message.uninterpretedOption.length; ++i) $types[2].encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); return writer; @@ -12632,23 +12219,15 @@ $root.google = (function() { object.deprecated = false; object.idempotencyLevel = options.enums === String ? undefined : undefined; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "deprecated": - object.deprecated = message.deprecated; - break; - case "idempotencyLevel": - object.idempotencyLevel = options.enums === String ? $types[1][message.idempotencyLevel] : message.idempotencyLevel; - break; - case "uninterpretedOption": - if (message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $types[2].toObject(message.uninterpretedOption[j], options); - } - break; - } + if (message.hasOwnProperty("deprecated") && message.deprecated !== undefined && message.deprecated !== null) + object.deprecated = message.deprecated; + if (message.hasOwnProperty("idempotencyLevel") && message.idempotencyLevel !== undefined && message.idempotencyLevel !== null) + object.idempotencyLevel = options.enums === String ? $types[1][message.idempotencyLevel] : message.idempotencyLevel; + if (message.hasOwnProperty("uninterpretedOption") && message.uninterpretedOption !== undefined && message.uninterpretedOption !== null) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $types[2].toObject(message.uninterpretedOption[j], options); + } return object; }; @@ -12771,20 +12350,20 @@ $root.google = (function() { UninterpretedOption.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name) + if (message.hasOwnProperty("name")) for (var i = 0; i < message.name.length; ++i) $types[0].encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue !== undefined && message.identifierValue !== "") + if (message.hasOwnProperty("identifierValue") && message.identifierValue !== undefined) writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue !== undefined && message.positiveIntValue !== null && $util.longNe(message.positiveIntValue, 0, 0)) + if (message.hasOwnProperty("positiveIntValue") && message.positiveIntValue !== undefined && message.positiveIntValue !== null) writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue !== undefined && message.negativeIntValue !== null && $util.longNe(message.negativeIntValue, 0, 0)) + if (message.hasOwnProperty("negativeIntValue") && message.negativeIntValue !== undefined && message.negativeIntValue !== null) writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue !== undefined && message.doubleValue !== 0) + if (message.hasOwnProperty("doubleValue") && message.doubleValue !== undefined) writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue && message.stringValue.length) + if (message.hasOwnProperty("stringValue") && message.stringValue) writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue !== undefined && message.aggregateValue !== "") + if (message.hasOwnProperty("aggregateValue") && message.aggregateValue !== undefined) writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); return writer; }; @@ -12970,41 +12549,29 @@ $root.google = (function() { object.stringValue = options.bytes === String ? "" : []; object.aggregateValue = ""; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "name": - if (message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $types[0].toObject(message.name[j], options); - } - break; - case "identifierValue": - object.identifierValue = message.identifierValue; - break; - case "positiveIntValue": - if (typeof message.positiveIntValue === "number") - object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; - else - object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low, message.positiveIntValue.high).toNumber(true) : message.positiveIntValue; - break; - case "negativeIntValue": - if (typeof message.negativeIntValue === "number") - object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; - else - object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low, message.negativeIntValue.high).toNumber() : message.negativeIntValue; - break; - case "doubleValue": - object.doubleValue = message.doubleValue; - break; - case "stringValue": - object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; - break; - case "aggregateValue": - object.aggregateValue = message.aggregateValue; - break; - } + if (message.hasOwnProperty("name") && message.name !== undefined && message.name !== null) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $types[0].toObject(message.name[j], options); + } + if (message.hasOwnProperty("identifierValue") && message.identifierValue !== undefined && message.identifierValue !== null) + object.identifierValue = message.identifierValue; + if (message.hasOwnProperty("positiveIntValue") && message.positiveIntValue !== undefined && message.positiveIntValue !== null) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low, message.positiveIntValue.high).toNumber(true) : message.positiveIntValue; + if (message.hasOwnProperty("negativeIntValue") && message.negativeIntValue !== undefined && message.negativeIntValue !== null) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low, message.negativeIntValue.high).toNumber() : message.negativeIntValue; + if (message.hasOwnProperty("doubleValue") && message.doubleValue !== undefined && message.doubleValue !== null) + object.doubleValue = message.doubleValue; + if (message.hasOwnProperty("stringValue") && message.stringValue !== undefined && message.stringValue !== null) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.hasOwnProperty("aggregateValue") && message.aggregateValue !== undefined && message.aggregateValue !== null) + object.aggregateValue = message.aggregateValue; return object; }; @@ -13173,16 +12740,10 @@ $root.google = (function() { object.namePart = ""; object.isExtension = false; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "namePart": - object.namePart = message.namePart; - break; - case "isExtension": - object.isExtension = message.isExtension; - break; - } + if (message.hasOwnProperty("namePart") && message.namePart !== undefined && message.namePart !== null) + object.namePart = message.namePart; + if (message.hasOwnProperty("isExtension") && message.isExtension !== undefined && message.isExtension !== null) + object.isExtension = message.isExtension; return object; }; @@ -13254,7 +12815,7 @@ $root.google = (function() { SourceCodeInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.location) + if (message.hasOwnProperty("location")) for (var i = 0; i < message.location.length; ++i) $types[0].encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; @@ -13360,17 +12921,11 @@ $root.google = (function() { var object = {}; if (options.arrays || options.defaults) object.location = []; - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "location": - if (message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $types[0].toObject(message.location[j], options); - } - break; - } + if (message.hasOwnProperty("location") && message.location !== undefined && message.location !== null) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $types[0].toObject(message.location[j], options); + } return object; }; @@ -13455,23 +13010,23 @@ $root.google = (function() { Location.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.path && message.path.length) { + if (message.hasOwnProperty("path") && message.path.length) { writer.uint32(/* id 1, wireType 2 =*/10).fork(); for (var i = 0; i < message.path.length; ++i) writer.int32(message.path[i]); writer.ldelim(); } - if (message.span && message.span.length) { + if (message.hasOwnProperty("span") && message.span.length) { writer.uint32(/* id 2, wireType 2 =*/18).fork(); for (var i = 0; i < message.span.length; ++i) writer.int32(message.span[i]); writer.ldelim(); } - if (message.leadingComments !== undefined && message.leadingComments !== "") + if (message.hasOwnProperty("leadingComments") && message.leadingComments !== undefined) writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments !== undefined && message.trailingComments !== "") + if (message.hasOwnProperty("trailingComments") && message.trailingComments !== undefined) writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments) + if (message.hasOwnProperty("leadingDetachedComments")) for (var i = 0; i < message.leadingDetachedComments.length; ++i) writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); return writer; @@ -13642,37 +13197,25 @@ $root.google = (function() { object.leadingComments = ""; object.trailingComments = ""; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "path": - if (message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - break; - case "span": - if (message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - break; - case "leadingComments": - object.leadingComments = message.leadingComments; - break; - case "trailingComments": - object.trailingComments = message.trailingComments; - break; - case "leadingDetachedComments": - if (message.leadingDetachedComments.length) { - object.leadingDetachedComments = []; - for (var j = 0; j < message.leadingDetachedComments.length; ++j) - object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; - } - break; - } + if (message.hasOwnProperty("path") && message.path !== undefined && message.path !== null) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.hasOwnProperty("span") && message.span !== undefined && message.span !== null) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.hasOwnProperty("leadingComments") && message.leadingComments !== undefined && message.leadingComments !== null) + object.leadingComments = message.leadingComments; + if (message.hasOwnProperty("trailingComments") && message.trailingComments !== undefined && message.trailingComments !== null) + object.trailingComments = message.trailingComments; + if (message.hasOwnProperty("leadingDetachedComments") && message.leadingDetachedComments !== undefined && message.leadingDetachedComments !== null) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } return object; }; @@ -13744,7 +13287,7 @@ $root.google = (function() { GeneratedCodeInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.annotation) + if (message.hasOwnProperty("annotation")) for (var i = 0; i < message.annotation.length; ++i) $types[0].encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; @@ -13850,17 +13393,11 @@ $root.google = (function() { var object = {}; if (options.arrays || options.defaults) object.annotation = []; - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "annotation": - if (message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $types[0].toObject(message.annotation[j], options); - } - break; - } + if (message.hasOwnProperty("annotation") && message.annotation !== undefined && message.annotation !== null) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $types[0].toObject(message.annotation[j], options); + } return object; }; @@ -13939,17 +13476,17 @@ $root.google = (function() { Annotation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.path && message.path.length) { + if (message.hasOwnProperty("path") && message.path.length) { writer.uint32(/* id 1, wireType 2 =*/10).fork(); for (var i = 0; i < message.path.length; ++i) writer.int32(message.path[i]); writer.ldelim(); } - if (message.sourceFile !== undefined && message.sourceFile !== "") + if (message.hasOwnProperty("sourceFile") && message.sourceFile !== undefined) writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin !== undefined && message.begin !== 0) + if (message.hasOwnProperty("begin") && message.begin !== undefined) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end !== undefined && message.end !== 0) + if (message.hasOwnProperty("end") && message.end !== undefined) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); return writer; }; @@ -14086,26 +13623,17 @@ $root.google = (function() { object.begin = 0; object.end = 0; } - for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) - if (message[keys[i]] !== undefined && message[keys[i]] !== null) - switch (keys[i]) { - case "path": - if (message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - break; - case "sourceFile": - object.sourceFile = message.sourceFile; - break; - case "begin": - object.begin = message.begin; - break; - case "end": - object.end = message.end; - break; - } + if (message.hasOwnProperty("path") && message.path !== undefined && message.path !== null) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.hasOwnProperty("sourceFile") && message.sourceFile !== undefined && message.sourceFile !== null) + object.sourceFile = message.sourceFile; + if (message.hasOwnProperty("begin") && message.begin !== undefined && message.begin !== null) + object.begin = message.begin; + if (message.hasOwnProperty("end") && message.end !== undefined && message.end !== null) + object.end = message.end; return object; }; diff --git a/tests/data/test.min.js b/tests/data/test.min.js deleted file mode 100644 index 5d4636445..000000000 --- a/tests/data/test.min.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict";var e=require("../../runtime"),t=e.Reader,n=e.Writer,r=e.util,o=[],i={};i.jspb=function(){var a={};return a.test=function(){var a={};return a.Empty=function(){function r(e){if(e)for(var t=Object.keys(e),n=0;n>>3){default:e.skipType(7&a)}}return o},r.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},r.verify=function(){return null},r.fromObject=function(){return new i.jspb.test.Empty},r.from=r.fromObject,r.toObject=function(){return{}},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),a.OuterEnum=function(){var e={},t=Object.create(e);return t[e[1]="FOO"]=1,t[e[2]="BAR"]=2,t}(),a.EnumContainer=function(){function r(e){if(e)for(var t=Object.keys(e),n=0;n>>3){case 1:o.outerEnum=e.uint32();break;default:e.skipType(7&a)}}return o},r.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},r.verify=function(e){if(void 0!==e.outerEnum)switch(e.outerEnum){default:return"outerEnum: enum value expected";case 1:case 2:}return null},r.fromObject=function(e){var t=new i.jspb.test.EnumContainer;switch(e.outerEnum){case"FOO":case 1:t.outerEnum=1;break;case"BAR":case 2:t.outerEnum=2}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.outerEnum=t.enums===String?"FOO":1);for(var r=Object.keys(e),o=0;o>>3){case 1:o.aString=e.string();break;case 2:o.aRepeatedString&&o.aRepeatedString.length||(o.aRepeatedString=[]),o.aRepeatedString.push(e.string());break;case 3:o.aBoolean=e.bool();break;default:e.skipType(7&a)}}return o},o.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},o.verify=function(e){if(!r.isString(e.aString))return"aString: string expected";if(void 0!==e.aRepeatedString){if(!Array.isArray(e.aRepeatedString))return"aRepeatedString: array expected";for(var t=0;t>>3){case 1:o.aString=e.string();break;case 2:o.aRepeatedString&&o.aRepeatedString.length||(o.aRepeatedString=[]),o.aRepeatedString.push(e.string());break;default:e.skipType(7&a)}}return o},o.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},o.verify=function(e){if(!r.isString(e.aString))return"aString: string expected";if(void 0!==e.aRepeatedString){if(!Array.isArray(e.aRepeatedString))return"aRepeatedString: array expected";for(var t=0;t>>3){case 1:o.normal=e.string();break;case 2:o.default=e.string();break;case 3:o.function=e.string();break;case 4:o.var=e.string();break;default:e.skipType(7&a)}}return o},o.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},o.verify=function(e){return r.isString(e.normal)?r.isString(e.default)?r.isString(e.function)?r.isString(e.var)?null:"var: string expected":"function: string expected":"default: string expected":"normal: string expected"},o.fromObject=function(e){var t=new i.jspb.test.SpecialCases;return void 0!==e.normal&&null!==e.normal&&(t.normal=String(e.normal)),void 0!==e.default&&null!==e.default&&(t.default=String(e.default)),void 0!==e.function&&null!==e.function&&(t.function=String(e.function)),void 0!==e.var&&null!==e.var&&(t.var=String(e.var)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.normal="",n.default="",n.function="",n.var="");for(var r=Object.keys(e),o=0;o>>3){case 1:o.aString=e.string();break;case 2:o.aBool=e.bool();break;case 3:o.aNestedMessage=s[2].decode(e,e.uint32());break;case 4:o.aRepeatedMessage&&o.aRepeatedMessage.length||(o.aRepeatedMessage=[]),o.aRepeatedMessage.push(s[3].decode(e,e.uint32()));break;case 5:o.aRepeatedString&&o.aRepeatedString.length||(o.aRepeatedString=[]),o.aRepeatedString.push(e.string());break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.aString&&!r.isString(e.aString))return"aString: string expected";if("boolean"!=typeof e.aBool)return"aBool: boolean expected";if(void 0!==e.aNestedMessage&&null!==e.aNestedMessage){var t=s[2].verify(e.aNestedMessage);if(t)return"aNestedMessage."+t}if(void 0!==e.aRepeatedMessage){if(!Array.isArray(e.aRepeatedMessage))return"aRepeatedMessage: array expected";for(var n=0;n>>3){case 1:o.anInt=e.int32();break;default:e.skipType(7&a)}}return o},o.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},o.verify=function(e){return void 0===e.anInt||r.isInteger(e.anInt)?null:"anInt: integer expected"},o.fromObject=function(e){var t=new i.jspb.test.OptionalFields.Nested;return void 0!==e.anInt&&null!==e.anInt&&(t.anInt=0|e.anInt),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.anInt=0);for(var r=Object.keys(e),o=0;o>>3){case 1:o.str1=e.string();break;case 2:o.str2=e.string();break;case 3:o.str3=e.string();break;case 100:o[".jspb.test.IsExtension.extField"]=s[3].decode(e,e.uint32());break;case 101:o[".jspb.test.IndirectExtension.simple"]=s[4].decode(e,e.uint32());break;case 102:o[".jspb.test.IndirectExtension.str"]=e.string();break;case 103:o[".jspb.test.IndirectExtension.repeatedStr"]&&o[".jspb.test.IndirectExtension.repeatedStr"].length||(o[".jspb.test.IndirectExtension.repeatedStr"]=[]),o[".jspb.test.IndirectExtension.repeatedStr"].push(e.string());break;case 104:o[".jspb.test.IndirectExtension.repeatedSimple"]&&o[".jspb.test.IndirectExtension.repeatedSimple"].length||(o[".jspb.test.IndirectExtension.repeatedSimple"]=[]),o[".jspb.test.IndirectExtension.repeatedSimple"].push(s[7].decode(e,e.uint32()));break;case 105:o[".jspb.test.simple1"]=s[8].decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.str1&&!r.isString(e.str1))return"str1: string expected";if(void 0!==e.str2&&!r.isString(e.str2))return"str2: string expected";if(void 0!==e.str3&&!r.isString(e.str3))return"str3: string expected";if(void 0!==e[".jspb.test.IsExtension.extField"]&&null!==e[".jspb.test.IsExtension.extField"]){var t=s[3].verify(e[".jspb.test.IsExtension.extField"]);if(t)return".jspb.test.IsExtension.extField."+t}if(void 0!==e[".jspb.test.IndirectExtension.simple"]&&null!==e[".jspb.test.IndirectExtension.simple"]){var t=s[4].verify(e[".jspb.test.IndirectExtension.simple"]);if(t)return".jspb.test.IndirectExtension.simple."+t}if(void 0!==e[".jspb.test.IndirectExtension.str"]&&!r.isString(e[".jspb.test.IndirectExtension.str"]))return".jspb.test.IndirectExtension.str: string expected";if(void 0!==e[".jspb.test.IndirectExtension.repeatedStr"]){if(!Array.isArray(e[".jspb.test.IndirectExtension.repeatedStr"]))return".jspb.test.IndirectExtension.repeatedStr: array expected";for(var n=0;n>>3){case 1:o.aString=e.string();break;case 9:o.anOutOfOrderBool=e.bool();break;case 4:o.aNestedMessage=s[2].decode(e,e.uint32());break;case 5:o.aRepeatedMessage&&o.aRepeatedMessage.length||(o.aRepeatedMessage=[]),o.aRepeatedMessage.push(s[3].decode(e,e.uint32()));break;case 7:o.aRepeatedString&&o.aRepeatedString.length||(o.aRepeatedString=[]),o.aRepeatedString.push(e.string());break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(!r.isString(e.aString))return"aString: string expected";if("boolean"!=typeof e.anOutOfOrderBool)return"anOutOfOrderBool: boolean expected";if(void 0!==e.aNestedMessage&&null!==e.aNestedMessage){var t=s[2].verify(e.aNestedMessage);if(t)return"aNestedMessage."+t}if(void 0!==e.aRepeatedMessage){if(!Array.isArray(e.aRepeatedMessage))return"aRepeatedMessage: array expected";for(var n=0;n>>3){case 2:o.anInt=e.int32();break;default:e.skipType(7&a)}}return o},o.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},o.verify=function(e){return r.isInteger(e.anInt)?null:"anInt: integer expected"},o.fromObject=function(e){var t=new i.jspb.test.Complex.Nested;return void 0!==e.anInt&&null!==e.anInt&&(t.anInt=0|e.anInt),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.anInt=0);for(var r=Object.keys(e),o=0;o>>3){default:e.skipType(7&a)}}return o},o.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},o.verify=function(){return null},o.fromObject=function(){return new i.jspb.test.OuterMessage},o.from=o.fromObject,o.toObject=function(){return{}},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.Complex=function(){function o(e){if(e)for(var t=Object.keys(e),n=0;n>>3){case 1:o.innerComplexField=e.int32();break;default:e.skipType(7&a)}}return o},o.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},o.verify=function(e){return void 0===e.innerComplexField||r.isInteger(e.innerComplexField)?null:"innerComplexField: integer expected"},o.fromObject=function(e){var t=new i.jspb.test.OuterMessage.Complex;return void 0!==e.innerComplexField&&null!==e.innerComplexField&&(t.innerComplexField=0|e.innerComplexField),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.innerComplexField=0);for(var r=Object.keys(e),o=0;o>>3){case 1:o.ext1=e.string();break;default:e.skipType(7&a)}}return o},o.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},o.verify=function(e){return void 0===e.ext1||r.isString(e.ext1)?null:"ext1: string expected"},o.fromObject=function(e){var t=new i.jspb.test.IsExtension;return void 0!==e.ext1&&null!==e.ext1&&(t.ext1=String(e.ext1)), -t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.ext1="");for(var r=Object.keys(e),o=0;o>>3){default:e.skipType(7&a)}}return o},r.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},r.verify=function(){return null},r.fromObject=function(){return new i.jspb.test.IndirectExtension},r.from=r.fromObject,r.toObject=function(){return{}},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),a.DefaultValues=function(){function a(e){if(e)for(var t=Object.keys(e),n=0;n'\"abc",a.prototype.boolField=!0,a.prototype.intField=r.Long?r.Long.fromBits(11,0,!1):11,a.prototype.enumField=void 0,a.prototype.emptyField="",a.prototype.bytesField=r.newBuffer([109,111,111]);var s={3:"jspb.test.DefaultValues.Enum"};return o.push(s),a.create=function(e){return new a(e)},a.encode=function(e,t){return t||(t=n.create()),void 0!==e.stringField&&"default<>'\"abc"!==e.stringField&&t.uint32(10).string(e.stringField),void 0!==e.boolField&&e.boolField!==!0&&t.uint32(16).bool(e.boolField),void 0!==e.intField&&null!==e.intField&&r.longNe(e.intField,11,0)&&t.uint32(24).int64(e.intField),void 0!==e.enumField&&void 0!==e.enumField&&t.uint32(32).uint32(e.enumField),void 0!==e.emptyField&&""!==e.emptyField&&t.uint32(50).string(e.emptyField),e.bytesField&&e.bytesField.length&&r.arrayNe(e.bytesField,[109,111,111])&&t.uint32(66).bytes(e.bytesField),t},a.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},a.decode=function(e,n){e instanceof t||(e=t.create(e));for(var r=void 0===n?e.len:e.pos+n,o=new i.jspb.test.DefaultValues;e.pos>>3){case 1:o.stringField=e.string();break;case 2:o.boolField=e.bool();break;case 3:o.intField=e.int64();break;case 4:o.enumField=e.uint32();break;case 6:o.emptyField=e.string();break;case 8:o.bytesField=e.bytes();break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.stringField&&!r.isString(e.stringField))return"stringField: string expected";if(void 0!==e.boolField&&"boolean"!=typeof e.boolField)return"boolField: boolean expected";if(void 0!==e.intField&&!(r.isInteger(e.intField)||e.intField&&r.isInteger(e.intField.low)&&r.isInteger(e.intField.high)))return"intField: integer|Long expected";if(void 0!==e.enumField)switch(e.enumField){default:return"enumField: enum value expected";case 13:case 77:}return void 0===e.emptyField||r.isString(e.emptyField)?void 0===e.bytesField||e.bytesField&&"number"==typeof e.bytesField.length||r.isString(e.bytesField)?null:"bytesField: buffer expected":"emptyField: string expected"},a.fromObject=function(e){var t=new i.jspb.test.DefaultValues;switch(void 0!==e.stringField&&null!==e.stringField&&(t.stringField=String(e.stringField)),void 0!==e.boolField&&null!==e.boolField&&(t.boolField=Boolean(e.boolField)),void 0!==e.intField&&null!==e.intField&&(r.Long?(t.intField=r.Long.fromValue(e.intField)).unsigned=!1:"string"==typeof e.intField?t.intField=parseInt(e.intField,10):"number"==typeof e.intField?t.intField=e.intField:"object"==typeof e.intField&&(t.intField=new r.LongBits(e.intField.low,e.intField.high).toNumber())),e.enumField){case"E1":case 13:t.enumField=13;break;case"E2":case 77:t.enumField=77}return void 0!==e.emptyField&&null!==e.emptyField&&(t.emptyField=String(e.emptyField)),void 0!==e.bytesField&&null!==e.bytesField&&("string"==typeof e.bytesField?r.base64.decode(e.bytesField,t.bytesField=r.newBuffer(r.base64.length(e.bytesField)),0):e.bytesField&&e.bytesField.length&&(t.bytesField=e.bytesField)),t},a.from=a.fromObject,a.toObject=function(e,t){t||(t={});var n={};if(t.defaults){if(n.stringField="default<>'\"abc",n.boolField=!0,r.Long){var o=new r.Long(11,0,!1);n.intField=t.longs===String?o.toString():t.longs===Number?o.toNumber():o}else n.intField=t.longs===String?"11":11;n.enumField=(t.enums===String,void 0),n.emptyField="",n.bytesField=t.bytes===String?"moo":[109,111,111]}for(var i=Object.keys(e),a=0;a>>3){case 1:o.optionalFloatField=e.float();break;case 2:o.requiredFloatField=e.float();break;case 3:if(o.repeatedFloatField&&o.repeatedFloatField.length||(o.repeatedFloatField=[]),2===(7&a))for(var s=e.uint32()+e.pos;e.pos>>3){case 1:o.str=e.string();break;case 3:o.simple1=s[1].decode(e,e.uint32());break;case 5:o.simple2&&o.simple2.length||(o.simple2=[]),o.simple2.push(s[2].decode(e,e.uint32()));break;case 6:o.bytesField=e.bytes();break;case 7:o.unused=e.string();break;case 100:o[".jspb.test.CloneExtension.extField"]=s[5].decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.str&&!r.isString(e.str))return"str: string expected";if(void 0!==e.simple1&&null!==e.simple1){var t=s[1].verify(e.simple1);if(t)return"simple1."+t}if(void 0!==e.simple2){if(!Array.isArray(e.simple2))return"simple2: array expected";for(var n=0;n>>3){case 2:o.ext=e.string();break;default:e.skipType(7&a)}}return o},o.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},o.verify=function(e){return void 0===e.ext||r.isString(e.ext)?null:"ext: string expected"},o.fromObject=function(e){var t=new i.jspb.test.CloneExtension;return void 0!==e.ext&&null!==e.ext&&(t.ext=String(e.ext)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.ext="");for(var r=Object.keys(e),o=0;o>>3){case 1:o.repeatedGroup&&o.repeatedGroup.length||(o.repeatedGroup=[]),o.repeatedGroup.push(s[0].decode(e));break;case 2:o.requiredGroup=s[1].decode(e);break;case 3:o.optionalGroup=s[2].decode(e);break;case 4:o.id=e.string();break;case 5:o.requiredSimple=s[4].decode(e,e.uint32());break;case 6:o.optionalSimple=s[5].decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.repeatedGroup){if(!Array.isArray(e.repeatedGroup))return"repeatedGroup: array expected";for(var t=0;t>>3){case 1:o.id=e.string();break;case 2:if(o.someBool&&o.someBool.length||(o.someBool=[]),2===(7&a))for(var s=e.uint32()+e.pos;e.pos>>3){case 1:o.id=e.string();break;default:e.skipType(7&a)}}return o},o.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},o.verify=function(e){return r.isString(e.id)?null:"id: string expected"},o.fromObject=function(e){var t=new i.jspb.test.TestGroup.RequiredGroup;return void 0!==e.id&&null!==e.id&&(t.id=String(e.id)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.id="");for(var r=Object.keys(e),o=0;o>>3){case 1:o.id=e.string();break;default:e.skipType(7&a)}}return o},o.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},o.verify=function(e){return r.isString(e.id)?null:"id: string expected"},o.fromObject=function(e){var t=new i.jspb.test.TestGroup.OptionalGroup;return void 0!==e.id&&null!==e.id&&(t.id=String(e.id)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.id="");for(var r=Object.keys(e),o=0;o>>3){case 1:o.group=a[0].decode(e);break;default:e.skipType(7&s)}}return o},r.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},r.verify=function(e){if(void 0!==e.group&&null!==e.group){var t=a[0].verify(e.group);if(t)return"group."+t}return null},r.fromObject=function(e){var t=new i.jspb.test.TestGroup1;return void 0!==e.group&&null!==e.group&&(t.group=a[0].fromObject(e.group)),t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.group=null);for(var r=Object.keys(e),o=0;o>>3){case 1:o.extension=e.int32();break;case 10:o[".jspb.test.TestReservedNamesExtension.foo"]=e.int32();break;default:e.skipType(7&a)}}return o},o.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},o.verify=function(e){return void 0===e.extension||r.isInteger(e.extension)?void 0===e[".jspb.test.TestReservedNamesExtension.foo"]||r.isInteger(e[".jspb.test.TestReservedNamesExtension.foo"])?null:".jspb.test.TestReservedNamesExtension.foo: integer expected":"extension: integer expected"},o.fromObject=function(e){var t=new i.jspb.test.TestReservedNames;return void 0!==e.extension&&null!==e.extension&&(t.extension=0|e.extension),void 0!==e[".jspb.test.TestReservedNamesExtension.foo"]&&null!==e[".jspb.test.TestReservedNamesExtension.foo"]&&(t[".jspb.test.TestReservedNamesExtension.foo"]=0|e[".jspb.test.TestReservedNamesExtension.foo"]),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.extension=0,n[".jspb.test.TestReservedNamesExtension.foo"]=0);for(var r=Object.keys(e),o=0;o>>3){default:e.skipType(7&a)}}return o},r.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},r.verify=function(){return null},r.fromObject=function(){return new i.jspb.test.TestReservedNamesExtension},r.from=r.fromObject,r.toObject=function(){return{}},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),a.TestMessageWithOneof=function(){function a(e){if(e)for(var t=Object.keys(e),n=0;n>>3){case 3:o.pone=e.string();break;case 5:o.pthree=e.string();break;case 6:o.rone=p[2].decode(e,e.uint32());break;case 7:o.rtwo=e.string();break;case 8:o.normalField=e.bool();break;case 9:o.repeatedField&&o.repeatedField.length||(o.repeatedField=[]),o.repeatedField.push(e.string());break;case 10:o.aone=e.int32();break;case 11:o.atwo=e.int32();break;case 12:o.bone=e.int32();break;case 13:o.btwo=e.int32();break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.pone&&!r.isString(e.pone))return"pone: string expected";if(void 0!==e.pthree&&!r.isString(e.pthree))return"pthree: string expected";if(void 0!==e.rone&&null!==e.rone){var t=p[2].verify(e.rone);if(t)return"rone."+t}if(void 0!==e.rtwo&&!r.isString(e.rtwo))return"rtwo: string expected";if(void 0!==e.normalField&&"boolean"!=typeof e.normalField)return"normalField: boolean expected";if(void 0!==e.repeatedField){if(!Array.isArray(e.repeatedField))return"repeatedField: array expected";for(var n=0;n>>3){case 1:o.value=e.int32();break;case 2:o.data=e.bytes();break;default:e.skipType(7&a)}}return o},o.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},o.verify=function(e){return void 0===e.value||r.isInteger(e.value)?void 0===e.data||e.data&&"number"==typeof e.data.length||r.isString(e.data)?null:"data: buffer expected":"value: integer expected"},o.fromObject=function(e){var t=new i.jspb.test.TestEndsWithBytes;return void 0!==e.value&&null!==e.value&&(t.value=0|e.value),void 0!==e.data&&null!==e.data&&("string"==typeof e.data?r.base64.decode(e.data,t.data=r.newBuffer(r.base64.length(e.data)),0):e.data&&e.data.length&&(t.data=e.data)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.value=0,n.data=t.bytes===String?"":[]);for(var o=Object.keys(e),i=0;i>>3){case 1:e.skip().pos++,a.mapStringString===r.emptyObject&&(a.mapStringString={});var l=e.string();e.pos++,a.mapStringString["object"==typeof l?r.longToHash(l):l]=e.string();break;case 2:e.skip().pos++,a.mapStringInt32===r.emptyObject&&(a.mapStringInt32={});var l=e.string();e.pos++,a.mapStringInt32["object"==typeof l?r.longToHash(l):l]=e.int32();break;case 3:e.skip().pos++,a.mapStringInt64===r.emptyObject&&(a.mapStringInt64={});var l=e.string();e.pos++,a.mapStringInt64["object"==typeof l?r.longToHash(l):l]=e.int64();break;case 4:e.skip().pos++,a.mapStringBool===r.emptyObject&&(a.mapStringBool={});var l=e.string();e.pos++,a.mapStringBool["object"==typeof l?r.longToHash(l):l]=e.bool();break;case 5:e.skip().pos++,a.mapStringDouble===r.emptyObject&&(a.mapStringDouble={});var l=e.string();e.pos++,a.mapStringDouble["object"==typeof l?r.longToHash(l):l]=e.double();break;case 6:e.skip().pos++,a.mapStringEnum===r.emptyObject&&(a.mapStringEnum={});var l=e.string();e.pos++,a.mapStringEnum["object"==typeof l?r.longToHash(l):l]=e.uint32();break;case 7:e.skip().pos++,a.mapStringMsg===r.emptyObject&&(a.mapStringMsg={});var l=e.string();e.pos++,a.mapStringMsg["object"==typeof l?r.longToHash(l):l]=s[6].decode(e,e.uint32());break;case 8:e.skip().pos++,a.mapInt32String===r.emptyObject&&(a.mapInt32String={});var l=e.int32();e.pos++,a.mapInt32String["object"==typeof l?r.longToHash(l):l]=e.string();break;case 9:e.skip().pos++,a.mapInt64String===r.emptyObject&&(a.mapInt64String={});var l=e.int64();e.pos++,a.mapInt64String["object"==typeof l?r.longToHash(l):l]=e.string();break;case 10:e.skip().pos++,a.mapBoolString===r.emptyObject&&(a.mapBoolString={});var l=e.bool();e.pos++,a.mapBoolString["object"==typeof l?r.longToHash(l):l]=e.string();break;case 11:a.testMapFields=s[10].decode(e,e.uint32());break;case 12:e.skip().pos++,a.mapStringTestmapfields===r.emptyObject&&(a.mapStringTestmapfields={});var l=e.string();e.pos++,a.mapStringTestmapfields["object"==typeof l?r.longToHash(l):l]=s[11].decode(e,e.uint32());break;default:e.skipType(7&p)}}return a},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.mapStringString){if(!r.isObject(e.mapStringString))return"mapStringString: object expected";for(var t=Object.keys(e.mapStringString),n=0;n>>3){case 1:o.foo=e.int32();break;default:e.skipType(7&a)}}return o},o.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},o.verify=function(e){return void 0===e.foo||r.isInteger(e.foo)?null:"foo: integer expected"},o.fromObject=function(e){var t=new i.jspb.test.MapValueMessageNoBinary;return void 0!==e.foo&&null!==e.foo&&(t.foo=0|e.foo),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.foo=0);for(var r=Object.keys(e),o=0;o>>3){default:e.skipType(7&a)}}return o},o.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},o.verify=function(){return null},o.fromObject=function(){return new i.jspb.test.Deeply},o.from=o.fromObject,o.toObject=function(){return{}},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.Nested=function(){function o(e){if(e)for(var t=Object.keys(e),n=0;n>>3){default:e.skipType(7&a)}}return o},o.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},o.verify=function(){return null},o.fromObject=function(){return new i.jspb.test.Deeply.Nested},o.from=o.fromObject,o.toObject=function(){return{}},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.Message=function(){function o(e){if(e)for(var t=Object.keys(e),n=0;n>>3){case 1:o.count=e.int32();break;default:e.skipType(7&a)}}return o},o.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},o.verify=function(e){return void 0===e.count||r.isInteger(e.count)?null:"count: integer expected"},o.fromObject=function(e){var t=new i.jspb.test.Deeply.Nested.Message;return void 0!==e.count&&null!==e.count&&(t.count=0|e.count),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.count=0);for(var r=Object.keys(e),o=0;o>>3){case 1:o.file&&o.file.length||(o.file=[]),o.file.push(s[0].decode(e,e.uint32()));break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.file){if(!Array.isArray(e.file))return"file: array expected";for(var t=0;t>>3){case 1:o.name=e.string();break;case 2:o.package=e.string();break;case 3:o.dependency&&o.dependency.length||(o.dependency=[]),o.dependency.push(e.string());break;case 10:if(o.publicDependency&&o.publicDependency.length||(o.publicDependency=[]),2===(7&a))for(var p=e.uint32()+e.pos;e.pos>>3){case 1:o.name=e.string();break;case 2:o.field&&o.field.length||(o.field=[]),o.field.push(s[1].decode(e,e.uint32()));break;case 6:o.extension&&o.extension.length||(o.extension=[]),o.extension.push(s[2].decode(e,e.uint32()));break;case 3:o.nestedType&&o.nestedType.length||(o.nestedType=[]),o.nestedType.push(s[3].decode(e,e.uint32()));break;case 4:o.enumType&&o.enumType.length||(o.enumType=[]),o.enumType.push(s[4].decode(e,e.uint32()));break;case 5:o.extensionRange&&o.extensionRange.length||(o.extensionRange=[]),o.extensionRange.push(s[5].decode(e,e.uint32()));break;case 8:o.oneofDecl&&o.oneofDecl.length||(o.oneofDecl=[]),o.oneofDecl.push(s[6].decode(e,e.uint32()));break;case 7:o.options=s[7].decode(e,e.uint32());break;case 9:o.reservedRange&&o.reservedRange.length||(o.reservedRange=[]),o.reservedRange.push(s[8].decode(e,e.uint32()));break;case 10:o.reservedName&&o.reservedName.length||(o.reservedName=[]),o.reservedName.push(e.string());break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.name&&!r.isString(e.name))return"name: string expected";if(void 0!==e.field){if(!Array.isArray(e.field))return"field: array expected";for(var t=0;t>>3){case 1:o.start=e.int32();break;case 2:o.end=e.int32();break;default:e.skipType(7&a)}}return o},o.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},o.verify=function(e){return void 0===e.start||r.isInteger(e.start)?void 0===e.end||r.isInteger(e.end)?null:"end: integer expected":"start: integer expected"},o.fromObject=function(e){var t=new i.google.protobuf.DescriptorProto.ExtensionRange;return void 0!==e.start&&null!==e.start&&(t.start=0|e.start),void 0!==e.end&&null!==e.end&&(t.end=0|e.end),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.start=0,n.end=0);for(var r=Object.keys(e),o=0;o>>3){case 1:o.start=e.int32();break;case 2:o.end=e.int32();break;default:e.skipType(7&a)}}return o},o.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},o.verify=function(e){return void 0===e.start||r.isInteger(e.start)?void 0===e.end||r.isInteger(e.end)?null:"end: integer expected":"start: integer expected"},o.fromObject=function(e){var t=new i.google.protobuf.DescriptorProto.ReservedRange;return void 0!==e.start&&null!==e.start&&(t.start=0|e.start),void 0!==e.end&&null!==e.end&&(t.end=0|e.end),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.start=0,n.end=0);for(var r=Object.keys(e),o=0;o>>3){case 1:o.name=e.string();break;case 3:o.number=e.int32();break;case 4:o.label=e.uint32();break;case 5:o.type=e.uint32();break;case 6:o.typeName=e.string();break;case 2:o.extendee=e.string();break;case 7:o.defaultValue=e.string();break;case 9:o.oneofIndex=e.int32();break;case 10:o.jsonName=e.string();break;case 8:o.options=s[9].decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.name&&!r.isString(e.name))return"name: string expected";if(void 0!==e.number&&!r.isInteger(e.number))return"number: integer expected";if(void 0!==e.label)switch(e.label){default:return"label: enum value expected";case 1:case 2:case 3:}if(void 0!==e.type)switch(e.type){default:return"type: enum value expected";case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:}if(void 0!==e.typeName&&!r.isString(e.typeName))return"typeName: string expected";if(void 0!==e.extendee&&!r.isString(e.extendee))return"extendee: string expected";if(void 0!==e.defaultValue&&!r.isString(e.defaultValue))return"defaultValue: string expected";if(void 0!==e.oneofIndex&&!r.isInteger(e.oneofIndex))return"oneofIndex: integer expected";if(void 0!==e.jsonName&&!r.isString(e.jsonName))return"jsonName: string expected";if(void 0!==e.options&&null!==e.options){var t=s[9].verify(e.options);if(t)return"options."+t}return null},a.fromObject=function(e){var t=new i.google.protobuf.FieldDescriptorProto;switch(void 0!==e.name&&null!==e.name&&(t.name=String(e.name)),void 0!==e.number&&null!==e.number&&(t.number=0|e.number),e.label){case"LABEL_OPTIONAL":case 1:t.label=1;break;case"LABEL_REQUIRED":case 2:t.label=2;break;case"LABEL_REPEATED":case 3:t.label=3}switch(e.type){case"TYPE_DOUBLE":case 1:t.type=1;break;case"TYPE_FLOAT":case 2:t.type=2;break;case"TYPE_INT64":case 3:t.type=3;break;case"TYPE_UINT64":case 4:t.type=4;break;case"TYPE_INT32":case 5:t.type=5;break;case"TYPE_FIXED64":case 6:t.type=6;break;case"TYPE_FIXED32":case 7:t.type=7;break;case"TYPE_BOOL":case 8:t.type=8;break;case"TYPE_STRING":case 9:t.type=9;break;case"TYPE_GROUP":case 10:t.type=10;break;case"TYPE_MESSAGE":case 11:t.type=11;break;case"TYPE_BYTES":case 12:t.type=12;break;case"TYPE_UINT32":case 13:t.type=13;break;case"TYPE_ENUM":case 14:t.type=14;break;case"TYPE_SFIXED32":case 15:t.type=15;break;case"TYPE_SFIXED64":case 16:t.type=16;break;case"TYPE_SINT32":case 17:t.type=17;break;case"TYPE_SINT64":case 18:t.type=18}return void 0!==e.typeName&&null!==e.typeName&&(t.typeName=String(e.typeName)),void 0!==e.extendee&&null!==e.extendee&&(t.extendee=String(e.extendee)),void 0!==e.defaultValue&&null!==e.defaultValue&&(t.defaultValue=String(e.defaultValue)),void 0!==e.oneofIndex&&null!==e.oneofIndex&&(t.oneofIndex=0|e.oneofIndex),void 0!==e.jsonName&&null!==e.jsonName&&(t.jsonName=String(e.jsonName)),void 0!==e.options&&null!==e.options&&(t.options=s[9].fromObject(e.options)),t},a.from=a.fromObject,a.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.name="",n.number=0,n.label=t.enums===String?"LABEL_OPTIONAL":1,n.type=t.enums===String?"TYPE_DOUBLE":1,n.typeName="",n.extendee="",n.defaultValue="",n.oneofIndex=0,n.jsonName="",n.options=null);for(var r=Object.keys(e),o=0;o>>3){case 1:o.name=e.string();break;case 2:o.options=s[1].decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.name&&!r.isString(e.name))return"name: string expected";if(void 0!==e.options&&null!==e.options){var t=s[1].verify(e.options);if(t)return"options."+t}return null},a.fromObject=function(e){var t=new i.google.protobuf.OneofDescriptorProto;return void 0!==e.name&&null!==e.name&&(t.name=String(e.name)),void 0!==e.options&&null!==e.options&&(t.options=s[1].fromObject(e.options)),t},a.from=a.fromObject,a.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.name="",n.options=null);for(var r=Object.keys(e),o=0;o>>3){case 1:o.name=e.string();break;case 2:o.value&&o.value.length||(o.value=[]),o.value.push(s[1].decode(e,e.uint32()));break;case 3:o.options=s[2].decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.name&&!r.isString(e.name))return"name: string expected";if(void 0!==e.value){if(!Array.isArray(e.value))return"value: array expected";for(var t=0;t>>3){case 1:o.name=e.string();break;case 2:o.number=e.int32();break;case 3:o.options=s[2].decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.name&&!r.isString(e.name))return"name: string expected";if(void 0!==e.number&&!r.isInteger(e.number))return"number: integer expected";if(void 0!==e.options&&null!==e.options){var t=s[2].verify(e.options);if(t)return"options."+t}return null},a.fromObject=function(e){var t=new i.google.protobuf.EnumValueDescriptorProto;return void 0!==e.name&&null!==e.name&&(t.name=String(e.name)),void 0!==e.number&&null!==e.number&&(t.number=0|e.number),void 0!==e.options&&null!==e.options&&(t.options=s[2].fromObject(e.options)),t},a.from=a.fromObject,a.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.name="",n.number=0,n.options=null);for(var r=Object.keys(e),o=0;o>>3){case 1:o.name=e.string();break;case 2:o.method&&o.method.length||(o.method=[]),o.method.push(s[1].decode(e,e.uint32()));break;case 3:o.options=s[2].decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.name&&!r.isString(e.name))return"name: string expected";if(void 0!==e.method){if(!Array.isArray(e.method))return"method: array expected";for(var t=0;t>>3){case 1:o.name=e.string();break;case 2:o.inputType=e.string();break;case 3:o.outputType=e.string();break;case 4:o.options=s[3].decode(e,e.uint32());break;case 5:o.clientStreaming=e.bool();break;case 6:o.serverStreaming=e.bool();break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.name&&!r.isString(e.name))return"name: string expected";if(void 0!==e.inputType&&!r.isString(e.inputType))return"inputType: string expected";if(void 0!==e.outputType&&!r.isString(e.outputType))return"outputType: string expected";if(void 0!==e.options&&null!==e.options){var t=s[3].verify(e.options);if(t)return"options."+t}return void 0!==e.clientStreaming&&"boolean"!=typeof e.clientStreaming?"clientStreaming: boolean expected":void 0!==e.serverStreaming&&"boolean"!=typeof e.serverStreaming?"serverStreaming: boolean expected":null},a.fromObject=function(e){var t=new i.google.protobuf.MethodDescriptorProto;return void 0!==e.name&&null!==e.name&&(t.name=String(e.name)),void 0!==e.inputType&&null!==e.inputType&&(t.inputType=String(e.inputType)),void 0!==e.outputType&&null!==e.outputType&&(t.outputType=String(e.outputType)),void 0!==e.options&&null!==e.options&&(t.options=s[3].fromObject(e.options)),void 0!==e.clientStreaming&&null!==e.clientStreaming&&(t.clientStreaming=Boolean(e.clientStreaming)),void 0!==e.serverStreaming&&null!==e.serverStreaming&&(t.serverStreaming=Boolean(e.serverStreaming)),t},a.from=a.fromObject,a.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.name="",n.inputType="",n.outputType="",n.options=null,n.clientStreaming=!1,n.serverStreaming=!1);for(var r=Object.keys(e),o=0;o>>3){case 1:o.javaPackage=e.string();break;case 8:o.javaOuterClassname=e.string();break;case 10:o.javaMultipleFiles=e.bool();break;case 20:o.javaGenerateEqualsAndHash=e.bool();break;case 27:o.javaStringCheckUtf8=e.bool();break;case 9:o.optimizeFor=e.uint32();break;case 11:o.goPackage=e.string();break;case 16:o.ccGenericServices=e.bool();break;case 17:o.javaGenericServices=e.bool();break;case 18:o.pyGenericServices=e.bool();break;case 23:o.deprecated=e.bool();break;case 31:o.ccEnableArenas=e.bool();break;case 36:o.objcClassPrefix=e.string();break;case 37:o.csharpNamespace=e.string();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(s[14].decode(e,e.uint32()));break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.javaPackage&&!r.isString(e.javaPackage))return"javaPackage: string expected";if(void 0!==e.javaOuterClassname&&!r.isString(e.javaOuterClassname))return"javaOuterClassname: string expected";if(void 0!==e.javaMultipleFiles&&"boolean"!=typeof e.javaMultipleFiles)return"javaMultipleFiles: boolean expected";if(void 0!==e.javaGenerateEqualsAndHash&&"boolean"!=typeof e.javaGenerateEqualsAndHash)return"javaGenerateEqualsAndHash: boolean expected";if(void 0!==e.javaStringCheckUtf8&&"boolean"!=typeof e.javaStringCheckUtf8)return"javaStringCheckUtf8: boolean expected";if(void 0!==e.optimizeFor)switch(e.optimizeFor){default:return"optimizeFor: enum value expected";case 1:case 2:case 3:}if(void 0!==e.goPackage&&!r.isString(e.goPackage))return"goPackage: string expected";if(void 0!==e.ccGenericServices&&"boolean"!=typeof e.ccGenericServices)return"ccGenericServices: boolean expected";if(void 0!==e.javaGenericServices&&"boolean"!=typeof e.javaGenericServices)return"javaGenericServices: boolean expected";if(void 0!==e.pyGenericServices&&"boolean"!=typeof e.pyGenericServices)return"pyGenericServices: boolean expected";if(void 0!==e.deprecated&&"boolean"!=typeof e.deprecated)return"deprecated: boolean expected";if(void 0!==e.ccEnableArenas&&"boolean"!=typeof e.ccEnableArenas)return"ccEnableArenas: boolean expected";if(void 0!==e.objcClassPrefix&&!r.isString(e.objcClassPrefix))return"objcClassPrefix: string expected";if(void 0!==e.csharpNamespace&&!r.isString(e.csharpNamespace))return"csharpNamespace: string expected";if(void 0!==e.uninterpretedOption){if(!Array.isArray(e.uninterpretedOption))return"uninterpretedOption: array expected";for(var t=0;t>>3){case 1:o.messageSetWireFormat=e.bool();break;case 2:o.noStandardDescriptorAccessor=e.bool();break;case 3:o.deprecated=e.bool();break;case 7:o.mapEntry=e.bool();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(s[4].decode(e,e.uint32()));break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.messageSetWireFormat&&"boolean"!=typeof e.messageSetWireFormat)return"messageSetWireFormat: boolean expected";if(void 0!==e.noStandardDescriptorAccessor&&"boolean"!=typeof e.noStandardDescriptorAccessor)return"noStandardDescriptorAccessor: boolean expected";if(void 0!==e.deprecated&&"boolean"!=typeof e.deprecated)return"deprecated: boolean expected";if(void 0!==e.mapEntry&&"boolean"!=typeof e.mapEntry)return"mapEntry: boolean expected";if(void 0!==e.uninterpretedOption){if(!Array.isArray(e.uninterpretedOption))return"uninterpretedOption: array expected";for(var t=0;t>>3){case 1:o.ctype=e.uint32();break;case 2:o.packed=e.bool();break;case 6:o.jstype=e.uint32();break;case 5:o.lazy=e.bool();break;case 3:o.deprecated=e.bool();break;case 10:o.weak=e.bool();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(s[6].decode(e,e.uint32()));break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.ctype)switch(e.ctype){default:return"ctype: enum value expected";case 0:case 1:case 2:}if(void 0!==e.packed&&"boolean"!=typeof e.packed)return"packed: boolean expected";if(void 0!==e.jstype)switch(e.jstype){default:return"jstype: enum value expected";case 0:case 1:case 2:}if(void 0!==e.lazy&&"boolean"!=typeof e.lazy)return"lazy: boolean expected";if(void 0!==e.deprecated&&"boolean"!=typeof e.deprecated)return"deprecated: boolean expected";if(void 0!==e.weak&&"boolean"!=typeof e.weak)return"weak: boolean expected";if(void 0!==e.uninterpretedOption){if(!Array.isArray(e.uninterpretedOption))return"uninterpretedOption: array expected";for(var t=0;t>>3){case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(s[0].decode(e,e.uint32()));break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.uninterpretedOption){if(!Array.isArray(e.uninterpretedOption))return"uninterpretedOption: array expected";for(var t=0;t>>3){case 2:o.allowAlias=e.bool();break;case 3:o.deprecated=e.bool();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(s[2].decode(e,e.uint32()));break;case 42113038:o[".jspb.test.IsExtension.simpleOption"]=e.string();break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.allowAlias&&"boolean"!=typeof e.allowAlias)return"allowAlias: boolean expected";if(void 0!==e.deprecated&&"boolean"!=typeof e.deprecated)return"deprecated: boolean expected";if(void 0!==e.uninterpretedOption){if(!Array.isArray(e.uninterpretedOption))return"uninterpretedOption: array expected";for(var t=0;t>>3){case 1:o.deprecated=e.bool();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(s[1].decode(e,e.uint32()));break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.deprecated&&"boolean"!=typeof e.deprecated)return"deprecated: boolean expected";if(void 0!==e.uninterpretedOption){if(!Array.isArray(e.uninterpretedOption))return"uninterpretedOption: array expected";for(var t=0;t>>3){case 33:o.deprecated=e.bool();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(s[1].decode(e,e.uint32()));break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.deprecated&&"boolean"!=typeof e.deprecated)return"deprecated: boolean expected";if(void 0!==e.uninterpretedOption){if(!Array.isArray(e.uninterpretedOption))return"uninterpretedOption: array expected";for(var t=0;t>>3){case 33:o.deprecated=e.bool();break;case 34:o.idempotencyLevel=e.uint32();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(s[2].decode(e,e.uint32()));break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.deprecated&&"boolean"!=typeof e.deprecated)return"deprecated: boolean expected";if(void 0!==e.idempotencyLevel)switch(e.idempotencyLevel){default:return"idempotencyLevel: enum value expected";case 0:case 1:case 2:}if(void 0!==e.uninterpretedOption){if(!Array.isArray(e.uninterpretedOption))return"uninterpretedOption: array expected";for(var t=0;t>>3){case 2:o.name&&o.name.length||(o.name=[]),o.name.push(s[0].decode(e,e.uint32()));break;case 3:o.identifierValue=e.string();break;case 4:o.positiveIntValue=e.uint64();break;case 5:o.negativeIntValue=e.int64();break;case 6:o.doubleValue=e.double();break;case 7:o.stringValue=e.bytes();break;case 8:o.aggregateValue=e.string();break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.name){if(!Array.isArray(e.name))return"name: array expected";for(var t=0;t>>3){case 1:o.namePart=e.string();break;case 2:o.isExtension=e.bool();break;default:e.skipType(7&a)}}return o},o.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},o.verify=function(e){return r.isString(e.namePart)?"boolean"!=typeof e.isExtension?"isExtension: boolean expected":null:"namePart: string expected"},o.fromObject=function(e){var t=new i.google.protobuf.UninterpretedOption.NamePart;return void 0!==e.namePart&&null!==e.namePart&&(t.namePart=String(e.namePart)),void 0!==e.isExtension&&null!==e.isExtension&&(t.isExtension=Boolean(e.isExtension)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.namePart="",n.isExtension=!1);for(var r=Object.keys(e),o=0;o>>3){case 1:o.location&&o.location.length||(o.location=[]),o.location.push(s[0].decode(e,e.uint32()));break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.location){if(!Array.isArray(e.location))return"location: array expected";for(var t=0;t>>3){case 1:if(o.path&&o.path.length||(o.path=[]),2===(7&a))for(var s=e.uint32()+e.pos;e.pos>>3){case 1:o.annotation&&o.annotation.length||(o.annotation=[]),o.annotation.push(s[0].decode(e,e.uint32()));break;default:e.skipType(7&a)}}return o},a.decodeDelimited=function(e){return e instanceof t||(e=t(e)),this.decode(e,e.uint32())},a.verify=function(e){if(void 0!==e.annotation){if(!Array.isArray(e.annotation))return"annotation: array expected";for(var t=0;t>>3){case 1:if(o.path&&o.path.length||(o.path=[]),2===(7&a))for(var s=e.uint32()+e.pos;e.posQ0(Hk94h^H?AY$uv0+oXizq@`ZIc;$ZqH1|MeBwP8o}$iK-15d4@k+$ zr*+Lqg7W;5{NrmX>W>7anJ7vAoZtoF8I_N(crD~3myc^vFEduos;n+I+i9J@Z&t6% zH)}cPR0<}R_11D=p{Q@@e_-!Pu2ouYj9`aPM8 z`~&&cNVpX6WJ+&{d`akA@oswYB2C4+x|xX?t*Vmf&#mFb^EoG25MU6|C?%;h7i_slmi0$ztwnsVlFY1Z;rVi*HY6?61?e)S>4pqy z+6YYNguQ85lTujLBu%H*F1-BA>c!xsEK7QeC~FiXU$N#QmF`liX;-!0&<3Bj_#1p` zT%x>NQ!yDQ>9qM$i}||*-@JKql5Q5{4PGyWB-nhYS1-S zzfad6yC;vxlb6{;1c5ZQOlM>^s!H_W*)vp?qfEVz<@=r6&*l3#6PmoDe3wyyYfAX} zo?O>fY^T*|YSPF_fp*>ntMoR}Bi(Q~>H>rf>g%a}a`4BP zLfi=GpGxLfR-sYBKzDcTYbn%+>0gy@bQH(DoEps>5Tr^i0@`7U0g?X)pYd`{2IT9C z%%#w1YRu7ojEilL%to|{#VHPn$)>op2fHwAg?pfk@fE5)?M5hX(b!5TdZkc^U43pg z+q6BlR8@bG8(THQVL}}yB3GtrWE8#-yryq&X_-e(pms9}lbM9w;E+j}bq=4gN^1_j zKt=q}Dzp2r(O&6IH}-bB@3H3-2(tB$$>LMj1OL*|Rp;vuLtc`h|&pm%&FTY2LJ=Bs-bYERZvW zXg!(o8v!2d!&9Jr9cXtq%y_jc)4Ko$t%pN+mWT@@r|66?r}=A%N?=J_a@fHohyA&d zW8-rFVzY}ZVvTD{jmdGWYwO{V{ls5VmjG4Hsx%9ry72&(9?wa^AYO@f&K~uTom2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8BZ zWVW;|Y(qD^dr9L;MTRW6-A`=I0pEs|>=e+&+QU)4z2PXox#1|c_BNd5uNKqvBtI`* zqhIsgZEKk4(@C4lg57)`e4~@^W@#VUrESg%5xyE&QP76w(eT!7XLeg?jbYAIR21Pi zmS+KzF&p)HYi{^8h4HRi0&CV54WMrQ5=m>;FhNM`m;$k_y|Sz)LX=(n0?kazHK4N% z4N`cQZGhd?Mo+s0n+}AARWCt3x!VpQjQ1LHbK%B(i#fSXEABXc%65Zb>mhjE&c-bZI=}FMCh3X}U{UuW3T}>7%+Nw1 zBGqVNVJ`D=|UX9-F;wxl4W_(CbZ9)J@`cM*kODhxuys|P~jNArnwVQel*tl zfqv9h6zMMt_5&)%APu-Z0e=+7>rn%bDGosOeluw60{0VAm6>jH92*~^syIXnD( zHczWz{TJ!QtQ6|N((L@>VV7h1yjcbnAVS~-vP1lcLxaMaO6n?$BKyOABTxO(I4h~F z*(kzK``|i~m6*=%N(=Z|w0e+4ZQKsm$$v80$L!y`)8}yG3_! zwn|xyzUB2?{P}qH;amR$j@QSA`^f?T?5H_Q diff --git a/tests/package.js b/tests/package.js index e844201e8..aa721747e 100644 --- a/tests/package.js +++ b/tests/package.js @@ -3,6 +3,8 @@ var tape = require("tape"); var protobuf = require(".."), pkg = require("../package.json"); +process.stdout._handle.setBlocking(true); + tape.test("package.json", function(test) { protobuf.load("tests/data/package.proto", function(err, root) {