diff --git a/cli/targets/static.js b/cli/targets/static.js index 7e9bf43bc..8d57b141d 100644 --- a/cli/targets/static.js +++ b/cli/targets/static.js @@ -41,7 +41,7 @@ function static_target(root, options, callback) { buildNamespace(null, root); push(""); if (config.comments) - push("// Resolve lazy type names to actual types"); + push("// Resolve lazy type references to actual types"); push("$util.lazyResolve($root, $lazyTypes);"); return callback(null, out.join("\n")); } catch (err) { @@ -172,10 +172,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(/\bWriter\b/g, "$Writer") // use common aliases instead of binding through an iife - .replace(/\bReader\b/g, "$Reader") - .replace(/\butil\b/g, "$util") - .replace(/\btypes\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 = beautify(code); @@ -331,15 +331,21 @@ function buildType(ref, type) { type.fieldsArray.forEach(function(field, index) { if (field.resolve().resolvedType) { // including enums! hasTypes = true; - types.push(index + ":"+JSON.stringify(field.resolvedType.fullName.substring(1))); + types.push(index + ": "+JSON.stringify(field.resolvedType.fullName.substring(1))); } }); if (hasTypes && (config.encode || config.decode || config.verify || config.convert)) { push(""); if (config.comments) - push("// Lazily resolved referenced types"); - push("var $types = {" + types.join(",") + "}; $lazyTypes.push($types);"); + push("// Lazily resolved type references"); + push("var $types = {"); + ++indent; + types.forEach(function(line, i) { + push(line + (i === types.length - 1 ? "" : ",")); + }); + --indent; + push("}; $lazyTypes.push($types);"); } if (config.create) { diff --git a/cli/wrappers/amd.js b/cli/wrappers/amd.js index d6af6bbf7..d0bcccc54 100644 --- a/cli/wrappers/amd.js +++ b/cli/wrappers/amd.js @@ -3,7 +3,5 @@ define(["protobuf"], function($protobuf) { %OUTPUT% - $protobuf.roots[%ROOT%] = $root; - - return $root; + return $protobuf.roots[%ROOT%] = $root; }); diff --git a/cli/wrappers/commonjs.js b/cli/wrappers/commonjs.js index cd5ca5a35..6b5060d8d 100644 --- a/cli/wrappers/commonjs.js +++ b/cli/wrappers/commonjs.js @@ -4,6 +4,4 @@ var $protobuf = require(%DEPENDENCY%); %OUTPUT% -$protobuf.roots[%ROOT%] = $root; - -module.exports = $root; +module.exports = $protobuf.roots[%ROOT%] = $root; diff --git a/cli/wrappers/default.js b/cli/wrappers/default.js index b4699646d..bccf8228c 100644 --- a/cli/wrappers/default.js +++ b/cli/wrappers/default.js @@ -11,7 +11,5 @@ %OUTPUT% - $protobuf.roots[%ROOT%] = $root; - - return $root; + return $protobuf.roots[%ROOT%] = $root; }); diff --git a/tests/data/ambiguous-names.js b/tests/data/ambiguous-names.js index a1604d0a7..f7e06921a 100644 --- a/tests/data/ambiguous-names.js +++ b/tests/data/ambiguous-names.js @@ -210,8 +210,10 @@ $root.B = (function() { */ B.prototype.A = null; - // Lazily resolved referenced types - var $types = {0:"A"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 0: "A" + }; $lazyTypes.push($types); /** * Creates a new B instance using the specified properties. @@ -366,9 +368,7 @@ $root.B = (function() { return B; })(); -// Resolve lazy type names to actual types +// Resolve lazy type references to actual types $util.lazyResolve($root, $lazyTypes); -$protobuf.roots["test_ambiguous-names"] = $root; - -module.exports = $root; +module.exports = $protobuf.roots["test_ambiguous-names"] = $root; diff --git a/tests/data/comments.js b/tests/data/comments.js index 2dcf650f9..59fedba27 100644 --- a/tests/data/comments.js +++ b/tests/data/comments.js @@ -401,9 +401,7 @@ $root.Test3 = (function() { return values; })(); -// Resolve lazy type names to actual types +// Resolve lazy type references to actual types $util.lazyResolve($root, $lazyTypes); -$protobuf.roots["test_comments"] = $root; - -module.exports = $root; +module.exports = $protobuf.roots["test_comments"] = $root; diff --git a/tests/data/convert.js b/tests/data/convert.js index f1978a7c3..18f11dd98 100644 --- a/tests/data/convert.js +++ b/tests/data/convert.js @@ -84,8 +84,11 @@ $root.Message = (function() { */ Message.prototype.int64Map = $util.emptyObject; - // Lazily resolved referenced types - var $types = {6:"Message.SomeEnum",7:"Message.SomeEnum"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 6: "Message.SomeEnum", + 7: "Message.SomeEnum" + }; $lazyTypes.push($types); /** * Creates a new Message instance using the specified properties. @@ -637,9 +640,7 @@ $root.Message = (function() { return Message; })(); -// Resolve lazy type names to actual types +// Resolve lazy type references to actual types $util.lazyResolve($root, $lazyTypes); -$protobuf.roots["test_convert"] = $root; - -module.exports = $root; +module.exports = $protobuf.roots["test_convert"] = $root; diff --git a/tests/data/mapbox/vector_tile.js b/tests/data/mapbox/vector_tile.js index 921a88c21..ff38a08eb 100644 --- a/tests/data/mapbox/vector_tile.js +++ b/tests/data/mapbox/vector_tile.js @@ -45,8 +45,10 @@ $root.vector_tile = (function() { */ Tile.prototype.layers = $util.emptyArray; - // Lazily resolved referenced types - var $types = {0:"vector_tile.Tile.Layer"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 0: "vector_tile.Tile.Layer" + }; $lazyTypes.push($types); /** * Creates a new Tile instance using the specified properties. @@ -685,8 +687,10 @@ $root.vector_tile = (function() { */ Feature.prototype.geometry = $util.emptyArray; - // Lazily resolved referenced types - var $types = {2:"vector_tile.Tile.GeomType"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 2: "vector_tile.Tile.GeomType" + }; $lazyTypes.push($types); /** * Creates a new Feature instance using the specified properties. @@ -1058,8 +1062,11 @@ $root.vector_tile = (function() { */ Layer.prototype.extent = 4096; - // Lazily resolved referenced types - var $types = {2:"vector_tile.Tile.Feature",4:"vector_tile.Tile.Value"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 2: "vector_tile.Tile.Feature", + 4: "vector_tile.Tile.Value" + }; $lazyTypes.push($types); /** * Creates a new Layer instance using the specified properties. @@ -1373,9 +1380,7 @@ $root.vector_tile = (function() { return vector_tile; })(); -// Resolve lazy type names to actual types +// Resolve lazy type references to actual types $util.lazyResolve($root, $lazyTypes); -$protobuf.roots["test_vector_tile"] = $root; - -module.exports = $root; +module.exports = $protobuf.roots["test_vector_tile"] = $root; diff --git a/tests/data/package.js b/tests/data/package.js index ccb58521f..3880a8f73 100644 --- a/tests/data/package.js +++ b/tests/data/package.js @@ -132,8 +132,10 @@ $root.Package = (function() { */ Package.prototype.cliDependencies = $util.emptyArray; - // Lazily resolved referenced types - var $types = {5:"Package.Repository"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 5: "Package.Repository" + }; $lazyTypes.push($types); /** * Creates a new Package instance using the specified properties. @@ -211,8 +213,8 @@ $root.Package = (function() { writer.uint32(122).fork().uint32(10).string(keys[i]).uint32(18).string(message.devDependencies[keys[i]]).ldelim(); } } - if (message.$types !== undefined && message.$types !== "") { - writer.uint32(138).string(message.$types); + if (message.types !== undefined && message.types !== "") { + writer.uint32(138).string(message.types); } if (message.cliDependencies) { for (var i = 0; i < message.cliDependencies.length; ++i) { @@ -340,7 +342,7 @@ $root.Package = (function() { break; case 17: - message.$types = reader.string(); + message.types = reader.string(); break; case 18: @@ -485,9 +487,9 @@ $root.Package = (function() { } } } - if (message.$types !== undefined) { - if (!$util.isString(message.$types)) { - return "$types: string expected"; + if (message.types !== undefined) { + if (!$util.isString(message.types)) { + return "types: string expected"; } } if (message.cliDependencies !== undefined) { @@ -573,8 +575,8 @@ $root.Package = (function() { message.devDependencies[keys[i]] = String(object.devDependencies[keys[i]]); } } - if (object.$types !== undefined && object.$types !== null) { - message.$types = String(object.$types); + if (object.types !== undefined && object.types !== null) { + message.types = String(object.types); } if (object.cliDependencies) { message.cliDependencies = []; @@ -625,7 +627,7 @@ $root.Package = (function() { object.bugs = ""; object.homepage = ""; object.main = ""; - object.$types = ""; + object.types = ""; } for (var keys = Object.keys(message), i = 0; i < keys.length; ++i) { switch (keys[i]) { @@ -737,9 +739,9 @@ $root.Package = (function() { } break; - case "$types": - if (message.$types !== undefined && message.$types !== null) { - object.$types = message.$types; + case "types": + if (message.types !== undefined && message.types !== null) { + object.types = message.types; } break; @@ -978,9 +980,7 @@ $root.Package = (function() { return Package; })(); -// Resolve lazy type names to actual types +// Resolve lazy type references to actual types $util.lazyResolve($root, $lazyTypes); -$protobuf.roots["test_package"] = $root; - -module.exports = $root; +module.exports = $protobuf.roots["test_package"] = $root; diff --git a/tests/data/rpc.js b/tests/data/rpc.js index 899108c51..6e4d32a86 100644 --- a/tests/data/rpc.js +++ b/tests/data/rpc.js @@ -454,9 +454,7 @@ $root.MyResponse = (function() { return MyResponse; })(); -// Resolve lazy type names to actual types +// Resolve lazy type references to actual types $util.lazyResolve($root, $lazyTypes); -$protobuf.roots["test_rpc"] = $root; - -module.exports = $root; +module.exports = $protobuf.roots["test_rpc"] = $root; diff --git a/tests/data/test.js b/tests/data/test.js index 852e75004..9a3b31a4f 100644 --- a/tests/data/test.js +++ b/tests/data/test.js @@ -206,8 +206,10 @@ $root.jspb = (function() { */ EnumContainer.prototype.outerEnum = 1; - // Lazily resolved referenced types - var $types = {0:"jspb.test.OuterEnum"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 0: "jspb.test.OuterEnum" + }; $lazyTypes.push($types); /** * Creates a new EnumContainer instance using the specified properties. @@ -1125,8 +1127,11 @@ $root.jspb = (function() { */ OptionalFields.prototype.aRepeatedString = $util.emptyArray; - // Lazily resolved referenced types - var $types = {2:"jspb.test.OptionalFields.Nested",3:"jspb.test.OptionalFields.Nested"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 2: "jspb.test.OptionalFields.Nested", + 3: "jspb.test.OptionalFields.Nested" + }; $lazyTypes.push($types); /** * Creates a new OptionalFields instance using the specified properties. @@ -1650,8 +1655,13 @@ $root.jspb = (function() { */ HasExtensions.prototype[".jspb.test.simple1"] = null; - // Lazily resolved referenced types - var $types = {3:"jspb.test.IsExtension",4:"jspb.test.Simple1",7:"jspb.test.Simple1",8:"jspb.test.Simple1"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 3: "jspb.test.IsExtension", + 4: "jspb.test.Simple1", + 7: "jspb.test.Simple1", + 8: "jspb.test.Simple1" + }; $lazyTypes.push($types); /** * Creates a new HasExtensions instance using the specified properties. @@ -2065,8 +2075,11 @@ $root.jspb = (function() { */ Complex.prototype.aRepeatedString = $util.emptyArray; - // Lazily resolved referenced types - var $types = {2:"jspb.test.Complex.Nested",3:"jspb.test.Complex.Nested"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 2: "jspb.test.Complex.Nested", + 3: "jspb.test.Complex.Nested" + }; $lazyTypes.push($types); /** * Creates a new Complex instance using the specified properties. @@ -3178,8 +3191,10 @@ $root.jspb = (function() { */ DefaultValues.prototype.bytesField = $util.newBuffer([109,111,111]); - // Lazily resolved referenced types - var $types = {3:"jspb.test.DefaultValues.Enum"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 3: "jspb.test.DefaultValues.Enum" + }; $lazyTypes.push($types); /** * Creates a new DefaultValues instance using the specified properties. @@ -3964,8 +3979,12 @@ $root.jspb = (function() { */ TestClone.prototype[".jspb.test.CloneExtension.extField"] = null; - // Lazily resolved referenced types - var $types = {1:"jspb.test.Simple1",2:"jspb.test.Simple1",5:"jspb.test.CloneExtension"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 1: "jspb.test.Simple1", + 2: "jspb.test.Simple1", + 5: "jspb.test.CloneExtension" + }; $lazyTypes.push($types); /** * Creates a new TestClone instance using the specified properties. @@ -4482,8 +4501,14 @@ $root.jspb = (function() { */ TestGroup.prototype.optionalSimple = null; - // Lazily resolved referenced types - var $types = {0:"jspb.test.TestGroup.RepeatedGroup",1:"jspb.test.TestGroup.RequiredGroup",2:"jspb.test.TestGroup.OptionalGroup",4:"jspb.test.Simple2",5:"jspb.test.Simple2"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 0: "jspb.test.TestGroup.RepeatedGroup", + 1: "jspb.test.TestGroup.RequiredGroup", + 2: "jspb.test.TestGroup.OptionalGroup", + 4: "jspb.test.Simple2", + 5: "jspb.test.Simple2" + }; $lazyTypes.push($types); /** * Creates a new TestGroup instance using the specified properties. @@ -5356,8 +5381,10 @@ $root.jspb = (function() { */ TestGroup1.prototype.group = null; - // Lazily resolved referenced types - var $types = {0:"jspb.test.TestGroup.RepeatedGroup"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 0: "jspb.test.TestGroup.RepeatedGroup" + }; $lazyTypes.push($types); /** * Creates a new TestGroup1 instance using the specified properties. @@ -5970,8 +5997,10 @@ $root.jspb = (function() { set: $util.oneOfSetter($oneOfFields) }); - // Lazily resolved referenced types - var $types = {2:"jspb.test.TestMessageWithOneof"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 2: "jspb.test.TestMessageWithOneof" + }; $lazyTypes.push($types); /** * Creates a new TestMessageWithOneof instance using the specified properties. @@ -6650,8 +6679,13 @@ $root.jspb = (function() { */ TestMapFieldsNoBinary.prototype.mapStringTestmapfields = $util.emptyObject; - // Lazily resolved referenced types - var $types = {5:"jspb.test.MapValueEnumNoBinary",6:"jspb.test.MapValueMessageNoBinary",10:"jspb.test.TestMapFieldsNoBinary",11:"jspb.test.TestMapFieldsNoBinary"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 5: "jspb.test.MapValueEnumNoBinary", + 6: "jspb.test.MapValueMessageNoBinary", + 10: "jspb.test.TestMapFieldsNoBinary", + 11: "jspb.test.TestMapFieldsNoBinary" + }; $lazyTypes.push($types); /** * Creates a new TestMapFieldsNoBinary instance using the specified properties. @@ -8006,8 +8040,10 @@ $root.google = (function() { */ FileDescriptorSet.prototype.file = $util.emptyArray; - // Lazily resolved referenced types - var $types = {0:"google.protobuf.FileDescriptorProto"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 0: "google.protobuf.FileDescriptorProto" + }; $lazyTypes.push($types); /** * Creates a new FileDescriptorSet instance using the specified properties. @@ -8267,8 +8303,15 @@ $root.google = (function() { */ FileDescriptorProto.prototype.syntax = ""; - // Lazily resolved referenced types - var $types = {5:"google.protobuf.DescriptorProto",6:"google.protobuf.EnumDescriptorProto",7:"google.protobuf.ServiceDescriptorProto",8:"google.protobuf.FieldDescriptorProto",9:"google.protobuf.FileOptions",10:"google.protobuf.SourceCodeInfo"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 5: "google.protobuf.DescriptorProto", + 6: "google.protobuf.EnumDescriptorProto", + 7: "google.protobuf.ServiceDescriptorProto", + 8: "google.protobuf.FieldDescriptorProto", + 9: "google.protobuf.FileOptions", + 10: "google.protobuf.SourceCodeInfo" + }; $lazyTypes.push($types); /** * Creates a new FileDescriptorProto instance using the specified properties. @@ -8874,8 +8917,17 @@ $root.google = (function() { */ DescriptorProto.prototype.reservedName = $util.emptyArray; - // Lazily resolved referenced types - var $types = {1:"google.protobuf.FieldDescriptorProto",2:"google.protobuf.FieldDescriptorProto",3:"google.protobuf.DescriptorProto",4:"google.protobuf.EnumDescriptorProto",5:"google.protobuf.DescriptorProto.ExtensionRange",6:"google.protobuf.OneofDescriptorProto",7:"google.protobuf.MessageOptions",8:"google.protobuf.DescriptorProto.ReservedRange"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 1: "google.protobuf.FieldDescriptorProto", + 2: "google.protobuf.FieldDescriptorProto", + 3: "google.protobuf.DescriptorProto", + 4: "google.protobuf.EnumDescriptorProto", + 5: "google.protobuf.DescriptorProto.ExtensionRange", + 6: "google.protobuf.OneofDescriptorProto", + 7: "google.protobuf.MessageOptions", + 8: "google.protobuf.DescriptorProto.ReservedRange" + }; $lazyTypes.push($types); /** * Creates a new DescriptorProto instance using the specified properties. @@ -9845,8 +9897,12 @@ $root.google = (function() { */ FieldDescriptorProto.prototype.options = null; - // Lazily resolved referenced types - var $types = {2:"google.protobuf.FieldDescriptorProto.Label",3:"google.protobuf.FieldDescriptorProto.Type",9:"google.protobuf.FieldOptions"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 2: "google.protobuf.FieldDescriptorProto.Label", + 3: "google.protobuf.FieldDescriptorProto.Type", + 9: "google.protobuf.FieldOptions" + }; $lazyTypes.push($types); /** * Creates a new FieldDescriptorProto instance using the specified properties. @@ -10421,8 +10477,10 @@ $root.google = (function() { */ OneofDescriptorProto.prototype.options = null; - // Lazily resolved referenced types - var $types = {1:"google.protobuf.OneofOptions"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 1: "google.protobuf.OneofOptions" + }; $lazyTypes.push($types); /** * Creates a new OneofDescriptorProto instance using the specified properties. @@ -10633,8 +10691,11 @@ $root.google = (function() { */ EnumDescriptorProto.prototype.options = null; - // Lazily resolved referenced types - var $types = {1:"google.protobuf.EnumValueDescriptorProto",2:"google.protobuf.EnumOptions"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 1: "google.protobuf.EnumValueDescriptorProto", + 2: "google.protobuf.EnumOptions" + }; $lazyTypes.push($types); /** * Creates a new EnumDescriptorProto instance using the specified properties. @@ -10886,8 +10947,10 @@ $root.google = (function() { */ EnumValueDescriptorProto.prototype.options = null; - // Lazily resolved referenced types - var $types = {2:"google.protobuf.EnumValueOptions"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 2: "google.protobuf.EnumValueOptions" + }; $lazyTypes.push($types); /** * Creates a new EnumValueDescriptorProto instance using the specified properties. @@ -11120,8 +11183,11 @@ $root.google = (function() { */ ServiceDescriptorProto.prototype.options = null; - // Lazily resolved referenced types - var $types = {1:"google.protobuf.MethodDescriptorProto",2:"google.protobuf.ServiceOptions"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 1: "google.protobuf.MethodDescriptorProto", + 2: "google.protobuf.ServiceOptions" + }; $lazyTypes.push($types); /** * Creates a new ServiceDescriptorProto instance using the specified properties. @@ -11391,8 +11457,10 @@ $root.google = (function() { */ MethodDescriptorProto.prototype.serverStreaming = false; - // Lazily resolved referenced types - var $types = {3:"google.protobuf.MethodOptions"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 3: "google.protobuf.MethodOptions" + }; $lazyTypes.push($types); /** * Creates a new MethodDescriptorProto instance using the specified properties. @@ -11763,8 +11831,11 @@ $root.google = (function() { */ FileOptions.prototype.uninterpretedOption = $util.emptyArray; - // Lazily resolved referenced types - var $types = {5:"google.protobuf.FileOptions.OptimizeMode",14:"google.protobuf.UninterpretedOption"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 5: "google.protobuf.FileOptions.OptimizeMode", + 14: "google.protobuf.UninterpretedOption" + }; $lazyTypes.push($types); /** * Creates a new FileOptions instance using the specified properties. @@ -12328,8 +12399,10 @@ $root.google = (function() { */ MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - // Lazily resolved referenced types - var $types = {4:"google.protobuf.UninterpretedOption"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 4: "google.protobuf.UninterpretedOption" + }; $lazyTypes.push($types); /** * Creates a new MessageOptions instance using the specified properties. @@ -12648,8 +12721,12 @@ $root.google = (function() { */ FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - // Lazily resolved referenced types - var $types = {0:"google.protobuf.FieldOptions.CType",2:"google.protobuf.FieldOptions.JSType",6:"google.protobuf.UninterpretedOption"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 0: "google.protobuf.FieldOptions.CType", + 2: "google.protobuf.FieldOptions.JSType", + 6: "google.protobuf.UninterpretedOption" + }; $lazyTypes.push($types); /** * Creates a new FieldOptions instance using the specified properties. @@ -13050,8 +13127,10 @@ $root.google = (function() { */ OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - // Lazily resolved referenced types - var $types = {0:"google.protobuf.UninterpretedOption"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 0: "google.protobuf.UninterpretedOption" + }; $lazyTypes.push($types); /** * Creates a new OneofOptions instance using the specified properties. @@ -13263,8 +13342,10 @@ $root.google = (function() { */ EnumOptions.prototype[".jspb.test.IsExtension.simpleOption"] = ""; - // Lazily resolved referenced types - var $types = {2:"google.protobuf.UninterpretedOption"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 2: "google.protobuf.UninterpretedOption" + }; $lazyTypes.push($types); /** * Creates a new EnumOptions instance using the specified properties. @@ -13531,8 +13612,10 @@ $root.google = (function() { */ EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - // Lazily resolved referenced types - var $types = {1:"google.protobuf.UninterpretedOption"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 1: "google.protobuf.UninterpretedOption" + }; $lazyTypes.push($types); /** * Creates a new EnumValueOptions instance using the specified properties. @@ -13755,8 +13838,10 @@ $root.google = (function() { */ ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - // Lazily resolved referenced types - var $types = {1:"google.protobuf.UninterpretedOption"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 1: "google.protobuf.UninterpretedOption" + }; $lazyTypes.push($types); /** * Creates a new ServiceOptions instance using the specified properties. @@ -13985,8 +14070,11 @@ $root.google = (function() { */ MethodOptions.prototype.uninterpretedOption = $util.emptyArray; - // Lazily resolved referenced types - var $types = {1:"google.protobuf.MethodOptions.IdempotencyLevel",2:"google.protobuf.UninterpretedOption"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 1: "google.protobuf.MethodOptions.IdempotencyLevel", + 2: "google.protobuf.UninterpretedOption" + }; $lazyTypes.push($types); /** * Creates a new MethodOptions instance using the specified properties. @@ -14298,8 +14386,10 @@ $root.google = (function() { */ UninterpretedOption.prototype.aggregateValue = ""; - // Lazily resolved referenced types - var $types = {0:"google.protobuf.UninterpretedOption.NamePart"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 0: "google.protobuf.UninterpretedOption.NamePart" + }; $lazyTypes.push($types); /** * Creates a new UninterpretedOption instance using the specified properties. @@ -14872,8 +14962,10 @@ $root.google = (function() { */ SourceCodeInfo.prototype.location = $util.emptyArray; - // Lazily resolved referenced types - var $types = {0:"google.protobuf.SourceCodeInfo.Location"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 0: "google.protobuf.SourceCodeInfo.Location" + }; $lazyTypes.push($types); /** * Creates a new SourceCodeInfo instance using the specified properties. @@ -15420,8 +15512,10 @@ $root.google = (function() { */ GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - // Lazily resolved referenced types - var $types = {0:"google.protobuf.GeneratedCodeInfo.Annotation"}; $lazyTypes.push($types); + // Lazily resolved type references + var $types = { + 0: "google.protobuf.GeneratedCodeInfo.Annotation" + }; $lazyTypes.push($types); /** * Creates a new GeneratedCodeInfo instance using the specified properties. @@ -15883,9 +15977,7 @@ $root.google = (function() { return google; })(); -// Resolve lazy type names to actual types +// Resolve lazy type references to actual types $util.lazyResolve($root, $lazyTypes); -$protobuf.roots["test_test"] = $root; - -module.exports = $root; +module.exports = $protobuf.roots["test_test"] = $root; diff --git a/tests/data/test.min.js b/tests/data/test.min.js index e3c3219c4..08181bf39 100644 --- a/tests/data/test.min.js +++ b/tests/data/test.min.js @@ -1,6 +1,6 @@ -"use strict";var $protobuf=require("../../runtime"),$Reader=$protobuf.Reader,$Writer=$protobuf.Writer,$util=$protobuf.util,$lazyTypes=[],$root={};$root.jspb=function(){var e={};return e.test=function(){var e={};return e.Empty=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n>>3){default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(){return null},e.fromObject=function(){return new $root.jspb.test.Empty},e.from=e.fromObject,e.toObject=function(){return{}},e.prototype.toObject=function(e){return this.constructor.toObject(this,e)},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),e.OuterEnum=function(){var e={},t=Object.create(e);return t[e[1]="FOO"]=1,t[e[2]="BAR"]=2,t}(),e.EnumContainer=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n>>3){case 1:r.outerEnum=e.uint32();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(void 0!==e.outerEnum)switch(e.outerEnum){default:return"outerEnum: enum value expected";case 1:case 2:}return null},e.fromObject=function(e){var t=new $root.jspb.test.EnumContainer;switch(e.outerEnum){case"FOO":case 1:t.outerEnum=1;break;case"BAR":case 2:t.outerEnum=2}return t},e.from=e.fromObject,e.toObject=function(e,n){n||(n={});var r={};n.defaults&&(r.outerEnum=n.enums===String?"FOO":1);for(var o=Object.keys(e),i=0;i>>3){case 1:r.aString=e.string();break;case 2:r.aRepeatedString&&r.aRepeatedString.length||(r.aRepeatedString=[]),r.aRepeatedString.push(e.string());break;case 3:r.aBoolean=e.bool();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(!$util.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:r.aString=e.string();break;case 2:r.aRepeatedString&&r.aRepeatedString.length||(r.aRepeatedString=[]),r.aRepeatedString.push(e.string());break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(!$util.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:r.normal=e.string();break;case 2:r.default=e.string();break;case 3:r.function=e.string();break;case 4:r.var=e.string();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return $util.isString(e.normal)?$util.isString(e.default)?$util.isString(e.function)?$util.isString(e.var)?null:"var: string expected":"function: string expected":"default: string expected":"normal: string expected"},e.fromObject=function(e){var t=new $root.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},e.from=e.fromObject,e.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=t[2].decode(e,e.uint32());break;case 4:o.aRepeatedMessage&&o.aRepeatedMessage.length||(o.aRepeatedMessage=[]),o.aRepeatedMessage.push(t[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&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(void 0!==e.aString&&!$util.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 n=t[2].verify(e.aNestedMessage);if(n)return"aNestedMessage."+n}if(void 0!==e.aRepeatedMessage){if(!Array.isArray(e.aRepeatedMessage))return"aRepeatedMessage: array expected";for(var r=0;r>>3){case 1:r.anInt=e.int32();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return void 0===e.anInt||$util.isInteger(e.anInt)?null:"anInt: integer expected"},e.fromObject=function(e){var t=new $root.jspb.test.OptionalFields.Nested;return void 0!==e.anInt&&null!==e.anInt&&(t.anInt=0|e.anInt),t},e.from=e.fromObject,e.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"]=t[3].decode(e,e.uint32());break;case 101:o[".jspb.test.IndirectExtension.simple"]=t[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(t[7].decode(e,e.uint32()));break;case 105:o[".jspb.test.simple1"]=t[8].decode(e,e.uint32());break;default:e.skipType(7&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(void 0!==e.str1&&!$util.isString(e.str1))return"str1: string expected";if(void 0!==e.str2&&!$util.isString(e.str2))return"str2: string expected";if(void 0!==e.str3&&!$util.isString(e.str3))return"str3: string expected";if(void 0!==e[".jspb.test.IsExtension.extField"]&&null!==e[".jspb.test.IsExtension.extField"]){var n=t[3].verify(e[".jspb.test.IsExtension.extField"]);if(n)return".jspb.test.IsExtension.extField."+n}if(void 0!==e[".jspb.test.IndirectExtension.simple"]&&null!==e[".jspb.test.IndirectExtension.simple"]){var n=t[4].verify(e[".jspb.test.IndirectExtension.simple"]);if(n)return".jspb.test.IndirectExtension.simple."+n}if(void 0!==e[".jspb.test.IndirectExtension.str"]&&!$util.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 r=0;r>>3){case 1:o.aString=e.string();break;case 9:o.anOutOfOrderBool=e.bool();break;case 4:o.aNestedMessage=t[2].decode(e,e.uint32());break;case 5:o.aRepeatedMessage&&o.aRepeatedMessage.length||(o.aRepeatedMessage=[]),o.aRepeatedMessage.push(t[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&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(!$util.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 n=t[2].verify(e.aNestedMessage);if(n)return"aNestedMessage."+n}if(void 0!==e.aRepeatedMessage){if(!Array.isArray(e.aRepeatedMessage))return"aRepeatedMessage: array expected";for(var r=0;r>>3){case 2:r.anInt=e.int32();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return $util.isInteger(e.anInt)?null:"anInt: integer expected"},e.fromObject=function(e){var t=new $root.jspb.test.Complex.Nested;return void 0!==e.anInt&&null!==e.anInt&&(t.anInt=0|e.anInt),t},e.from=e.fromObject,e.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&o)}}return r},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(){return null},e.fromObject=function(){return new $root.jspb.test.OuterMessage},e.from=e.fromObject,e.toObject=function(){return{}},e.prototype.toObject=function(e){return this.constructor.toObject(this,e)},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e.Complex=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n>>3){case 1:r.innerComplexField=e.int32();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return void 0===e.innerComplexField||$util.isInteger(e.innerComplexField)?null:"innerComplexField: integer expected"},e.fromObject=function(e){var t=new $root.jspb.test.OuterMessage.Complex;return void 0!==e.innerComplexField&&null!==e.innerComplexField&&(t.innerComplexField=0|e.innerComplexField),t},e.from=e.fromObject,e.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:r.ext1=e.string();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return void 0===e.ext1||$util.isString(e.ext1)?null:"ext1: string expected"},e.fromObject=function(e){var t=new $root.jspb.test.IsExtension;return void 0!==e.ext1&&null!==e.ext1&&(t.ext1=String(e.ext1)),t},e.from=e.fromObject,e.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&o)}}return r},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(){return null},e.fromObject=function(){return new $root.jspb.test.IndirectExtension},e.from=e.fromObject,e.toObject=function(){return{}},e.prototype.toObject=function(e){return this.constructor.toObject(this,e)},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),e.DefaultValues=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n'\"abc",e.prototype.boolField=!0,e.prototype.intField=$util.Long?$util.Long.fromBits(11,0,!1):11,e.prototype.enumField=void 0,e.prototype.emptyField="",e.prototype.bytesField=$util.newBuffer([109,111,111]);var t={3:"jspb.test.DefaultValues.Enum"};return $lazyTypes.push(t),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=$Writer.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&&$util.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&&$util.arrayNe(e.bytesField,[109,111,111])&&t.uint32(66).bytes(e.bytesField),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof $Reader||(e=$Reader.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new $root.jspb.test.DefaultValues;e.pos>>3){case 1:r.stringField=e.string();break;case 2:r.boolField=e.bool();break;case 3:r.intField=e.int64();break;case 4:r.enumField=e.uint32();break;case 6:r.emptyField=e.string();break;case 8:r.bytesField=e.bytes();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(void 0!==e.stringField&&!$util.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&&!($util.isInteger(e.intField)||e.intField&&$util.isInteger(e.intField.low)&&$util.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||$util.isString(e.emptyField)?void 0===e.bytesField||e.bytesField&&"number"==typeof e.bytesField.length||$util.isString(e.bytesField)?null:"bytesField: buffer expected":"emptyField: string expected"},e.fromObject=function(e){var t=new $root.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&&($util.Long?(t.intField=$util.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 $util.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?$util.base64.decode(e.bytesField,t.bytesField=$util.newBuffer($util.base64.length(e.bytesField)),0):e.bytesField&&e.bytesField.length&&(t.bytesField=e.bytesField)),t},e.from=e.fromObject,e.toObject=function(e,n){n||(n={});var r={};if(n.defaults){if(r.stringField="default<>'\"abc",r.boolField=!0,$util.Long){var o=new $util.Long(11,0,!1);r.intField=n.longs===String?o.toString():n.longs===Number?o.toNumber():o}else r.intField=n.longs===String?"11":11;r.enumField=(n.enums===String,void 0),r.emptyField="",r.bytesField=n.bytes===String?"moo":[109,111,111]}for(var i=Object.keys(e),a=0;a>>3){case 1:r.optionalFloatField=e.float();break;case 2:r.requiredFloatField=e.float();break;case 3:if(r.repeatedFloatField&&r.repeatedFloatField.length||(r.repeatedFloatField=[]),2===(7&o))for(var i=e.uint32()+e.pos;e.pos>>3){case 1:o.str=e.string();break;case 3:o.simple1=t[1].decode(e,e.uint32());break;case 5:o.simple2&&o.simple2.length||(o.simple2=[]),o.simple2.push(t[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"]=t[5].decode(e,e.uint32());break;default:e.skipType(7&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(void 0!==e.str&&!$util.isString(e.str))return"str: string expected";if(void 0!==e.simple1&&null!==e.simple1){var n=t[1].verify(e.simple1);if(n)return"simple1."+n}if(void 0!==e.simple2){if(!Array.isArray(e.simple2))return"simple2: array expected";for(var r=0;r>>3){case 2:r.ext=e.string();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return void 0===e.ext||$util.isString(e.ext)?null:"ext: string expected"},e.fromObject=function(e){var t=new $root.jspb.test.CloneExtension;return void 0!==e.ext&&null!==e.ext&&(t.ext=String(e.ext)),t},e.from=e.fromObject,e.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(t[0].decode(e));break;case 2:o.requiredGroup=t[1].decode(e);break;case 3:o.optionalGroup=t[2].decode(e);break;case 4:o.id=e.string();break;case 5:o.requiredSimple=t[4].decode(e,e.uint32());break;case 6:o.optionalSimple=t[5].decode(e,e.uint32());break;default:e.skipType(7&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(void 0!==e.repeatedGroup){if(!Array.isArray(e.repeatedGroup))return"repeatedGroup: array expected";for(var n=0;n>>3){case 1:r.id=e.string();break;case 2:if(r.someBool&&r.someBool.length||(r.someBool=[]),2===(7&o))for(var i=e.uint32()+e.pos;e.pos>>3){case 1:r.id=e.string();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return $util.isString(e.id)?null:"id: string expected"},e.fromObject=function(e){var t=new $root.jspb.test.TestGroup.RequiredGroup;return void 0!==e.id&&null!==e.id&&(t.id=String(e.id)),t},e.from=e.fromObject,e.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.id="");for(var r=Object.keys(e),o=0;o>>3){case 1:r.id=e.string();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return $util.isString(e.id)?null:"id: string expected"},e.fromObject=function(e){var t=new $root.jspb.test.TestGroup.OptionalGroup;return void 0!==e.id&&null!==e.id&&(t.id=String(e.id)),t},e.from=e.fromObject,e.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=t[0].decode(e);break;default:e.skipType(7&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(void 0!==e.group&&null!==e.group){var n=t[0].verify(e.group);if(n)return"group."+n}return null},e.fromObject=function(e){var n=new $root.jspb.test.TestGroup1;return void 0!==e.group&&null!==e.group&&(n.group=t[0].fromObject(e.group)),n},e.from=e.fromObject,e.toObject=function(e,n){n||(n={});var r={};n.defaults&&(r.group=null);for(var o=Object.keys(e),i=0;i>>3){case 1:r.extension=e.int32();break;case 10:r[".jspb.test.TestReservedNamesExtension.foo"]=e.int32();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return void 0===e.extension||$util.isInteger(e.extension)?void 0===e[".jspb.test.TestReservedNamesExtension.foo"]||$util.isInteger(e[".jspb.test.TestReservedNamesExtension.foo"])?null:".jspb.test.TestReservedNamesExtension.foo: integer expected":"extension: integer expected"},e.fromObject=function(e){var t=new $root.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},e.from=e.fromObject,e.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&o)}}return r},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(){return null},e.fromObject=function(){return new $root.jspb.test.TestReservedNamesExtension},e.from=e.fromObject,e.toObject=function(){return{}},e.prototype.toObject=function(e){return this.constructor.toObject(this,e)},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e}(),e.TestMessageWithOneof=function(){function e(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=n[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&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(void 0!==e.pone&&!$util.isString(e.pone))return"pone: string expected";if(void 0!==e.pthree&&!$util.isString(e.pthree))return"pthree: string expected";if(void 0!==e.rone&&null!==e.rone){var t=n[2].verify(e.rone);if(t)return"rone."+t}if(void 0!==e.rtwo&&!$util.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 r=0;r>>3){case 1:r.value=e.int32();break;case 2:r.data=e.bytes();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return void 0===e.value||$util.isInteger(e.value)?void 0===e.data||e.data&&"number"==typeof e.data.length||$util.isString(e.data)?null:"data: buffer expected":"value: integer expected"},e.fromObject=function(e){var t=new $root.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?$util.base64.decode(e.data,t.data=$util.newBuffer($util.base64.length(e.data)),0):e.data&&e.data.length&&(t.data=e.data)),t},e.from=e.fromObject,e.toObject=function(e,t){t||(t={});var n={};t.defaults&&(n.value=0,n.data=t.bytes===String?"":[]);for(var r=Object.keys(e),o=0;o>>3){case 1:e.skip().pos++,o.mapStringString===$util.emptyObject&&(o.mapStringString={});var a=e.string();e.pos++,o.mapStringString["object"==typeof a?$util.longToHash(a):a]=e.string();break;case 2:e.skip().pos++,o.mapStringInt32===$util.emptyObject&&(o.mapStringInt32={});var a=e.string();e.pos++,o.mapStringInt32["object"==typeof a?$util.longToHash(a):a]=e.int32();break;case 3:e.skip().pos++,o.mapStringInt64===$util.emptyObject&&(o.mapStringInt64={});var a=e.string();e.pos++,o.mapStringInt64["object"==typeof a?$util.longToHash(a):a]=e.int64();break;case 4:e.skip().pos++,o.mapStringBool===$util.emptyObject&&(o.mapStringBool={});var a=e.string();e.pos++,o.mapStringBool["object"==typeof a?$util.longToHash(a):a]=e.bool();break;case 5:e.skip().pos++,o.mapStringDouble===$util.emptyObject&&(o.mapStringDouble={});var a=e.string();e.pos++,o.mapStringDouble["object"==typeof a?$util.longToHash(a):a]=e.double();break;case 6:e.skip().pos++,o.mapStringEnum===$util.emptyObject&&(o.mapStringEnum={});var a=e.string();e.pos++,o.mapStringEnum["object"==typeof a?$util.longToHash(a):a]=e.uint32();break;case 7:e.skip().pos++,o.mapStringMsg===$util.emptyObject&&(o.mapStringMsg={});var a=e.string();e.pos++,o.mapStringMsg["object"==typeof a?$util.longToHash(a):a]=t[6].decode(e,e.uint32());break;case 8:e.skip().pos++,o.mapInt32String===$util.emptyObject&&(o.mapInt32String={});var a=e.int32();e.pos++,o.mapInt32String["object"==typeof a?$util.longToHash(a):a]=e.string();break;case 9:e.skip().pos++,o.mapInt64String===$util.emptyObject&&(o.mapInt64String={});var a=e.int64();e.pos++,o.mapInt64String["object"==typeof a?$util.longToHash(a):a]=e.string();break;case 10:e.skip().pos++,o.mapBoolString===$util.emptyObject&&(o.mapBoolString={});var a=e.bool();e.pos++,o.mapBoolString["object"==typeof a?$util.longToHash(a):a]=e.string();break;case 11:o.testMapFields=t[10].decode(e,e.uint32());break;case 12:e.skip().pos++,o.mapStringTestmapfields===$util.emptyObject&&(o.mapStringTestmapfields={});var a=e.string();e.pos++,o.mapStringTestmapfields["object"==typeof a?$util.longToHash(a):a]=t[11].decode(e,e.uint32());break;default:e.skipType(7&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(void 0!==e.mapStringString){if(!$util.isObject(e.mapStringString))return"mapStringString: object expected";for(var n=Object.keys(e.mapStringString),r=0;r>>3){case 1:r.foo=e.int32();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return void 0===e.foo||$util.isInteger(e.foo)?null:"foo: integer expected"},e.fromObject=function(e){var t=new $root.jspb.test.MapValueMessageNoBinary;return void 0!==e.foo&&null!==e.foo&&(t.foo=0|e.foo),t},e.from=e.fromObject,e.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&o)}}return r},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(){return null},e.fromObject=function(){return new $root.jspb.test.Deeply},e.from=e.fromObject,e.toObject=function(){return{}},e.prototype.toObject=function(e){return this.constructor.toObject(this,e)},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e.Nested=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n>>3){default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(){return null},e.fromObject=function(){return new $root.jspb.test.Deeply.Nested},e.from=e.fromObject,e.toObject=function(){return{}},e.prototype.toObject=function(e){return this.constructor.toObject(this,e)},e.prototype.toJSON=function(){return this.constructor.toObject(this,$protobuf.util.toJSONOptions)},e.Message=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n>>3){case 1:r.count=e.int32();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return void 0===e.count||$util.isInteger(e.count)?null:"count: integer expected"},e.fromObject=function(e){var t=new $root.jspb.test.Deeply.Nested.Message;return void 0!==e.count&&null!==e.count&&(t.count=0|e.count),t},e.from=e.fromObject,e.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(t[0].decode(e,e.uint32()));break;default:e.skipType(7&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(void 0!==e.file){if(!Array.isArray(e.file))return"file: array expected";for(var n=0;n>>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&i))for(var a=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(t[1].decode(e,e.uint32()));break;case 6:o.extension&&o.extension.length||(o.extension=[]),o.extension.push(t[2].decode(e,e.uint32()));break;case 3:o.nestedType&&o.nestedType.length||(o.nestedType=[]),o.nestedType.push(t[3].decode(e,e.uint32()));break;case 4:o.enumType&&o.enumType.length||(o.enumType=[]),o.enumType.push(t[4].decode(e,e.uint32()));break;case 5:o.extensionRange&&o.extensionRange.length||(o.extensionRange=[]),o.extensionRange.push(t[5].decode(e,e.uint32()));break;case 8:o.oneofDecl&&o.oneofDecl.length||(o.oneofDecl=[]),o.oneofDecl.push(t[6].decode(e,e.uint32()));break;case 7:o.options=t[7].decode(e,e.uint32());break;case 9:o.reservedRange&&o.reservedRange.length||(o.reservedRange=[]),o.reservedRange.push(t[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&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(void 0!==e.name&&!$util.isString(e.name))return"name: string expected";if(void 0!==e.field){if(!Array.isArray(e.field))return"field: array expected";for(var n=0;n>>3){case 1:r.start=e.int32();break;case 2:r.end=e.int32();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return void 0===e.start||$util.isInteger(e.start)?void 0===e.end||$util.isInteger(e.end)?null:"end: integer expected":"start: integer expected"},e.fromObject=function(e){var t=new $root.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},e.from=e.fromObject,e.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:r.start=e.int32();break;case 2:r.end=e.int32();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return void 0===e.start||$util.isInteger(e.start)?void 0===e.end||$util.isInteger(e.end)?null:"end: integer expected":"start: integer expected"},e.fromObject=function(e){var t=new $root.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},e.from=e.fromObject,e.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=t[9].decode(e,e.uint32());break;default:e.skipType(7&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(void 0!==e.name&&!$util.isString(e.name))return"name: string expected";if(void 0!==e.number&&!$util.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&&!$util.isString(e.typeName))return"typeName: string expected";if(void 0!==e.extendee&&!$util.isString(e.extendee))return"extendee: string expected";if(void 0!==e.defaultValue&&!$util.isString(e.defaultValue))return"defaultValue: string expected";if(void 0!==e.oneofIndex&&!$util.isInteger(e.oneofIndex))return"oneofIndex: integer expected";if(void 0!==e.jsonName&&!$util.isString(e.jsonName))return"jsonName: string expected";if(void 0!==e.options&&null!==e.options){var n=t[9].verify(e.options);if(n)return"options."+n}return null},e.fromObject=function(e){var n=new $root.google.protobuf.FieldDescriptorProto;switch(void 0!==e.name&&null!==e.name&&(n.name=String(e.name)),void 0!==e.number&&null!==e.number&&(n.number=0|e.number),e.label){case"LABEL_OPTIONAL":case 1:n.label=1;break;case"LABEL_REQUIRED":case 2:n.label=2;break;case"LABEL_REPEATED":case 3:n.label=3}switch(e.type){case"TYPE_DOUBLE":case 1:n.type=1;break;case"TYPE_FLOAT":case 2:n.type=2;break;case"TYPE_INT64":case 3:n.type=3;break;case"TYPE_UINT64":case 4:n.type=4;break;case"TYPE_INT32":case 5:n.type=5;break;case"TYPE_FIXED64":case 6:n.type=6;break;case"TYPE_FIXED32":case 7:n.type=7;break;case"TYPE_BOOL":case 8:n.type=8;break;case"TYPE_STRING":case 9:n.type=9;break;case"TYPE_GROUP":case 10:n.type=10;break;case"TYPE_MESSAGE":case 11:n.type=11;break;case"TYPE_BYTES":case 12:n.type=12;break;case"TYPE_UINT32":case 13:n.type=13;break;case"TYPE_ENUM":case 14:n.type=14;break;case"TYPE_SFIXED32":case 15:n.type=15;break;case"TYPE_SFIXED64":case 16:n.type=16;break;case"TYPE_SINT32":case 17:n.type=17;break;case"TYPE_SINT64":case 18:n.type=18}return void 0!==e.typeName&&null!==e.typeName&&(n.typeName=String(e.typeName)),void 0!==e.extendee&&null!==e.extendee&&(n.extendee=String(e.extendee)),void 0!==e.defaultValue&&null!==e.defaultValue&&(n.defaultValue=String(e.defaultValue)),void 0!==e.oneofIndex&&null!==e.oneofIndex&&(n.oneofIndex=0|e.oneofIndex),void 0!==e.jsonName&&null!==e.jsonName&&(n.jsonName=String(e.jsonName)),void 0!==e.options&&null!==e.options&&(n.options=t[9].fromObject(e.options)),n},e.from=e.fromObject,e.toObject=function(e,n){n||(n={});var r={};n.defaults&&(r.name="",r.number=0,r.label=n.enums===String?"LABEL_OPTIONAL":1,r.type=n.enums===String?"TYPE_DOUBLE":1,r.typeName="",r.extendee="",r.defaultValue="",r.oneofIndex=0,r.jsonName="",r.options=null);for(var o=Object.keys(e),i=0;i>>3){case 1:o.name=e.string();break;case 2:o.options=t[1].decode(e,e.uint32());break;default:e.skipType(7&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(void 0!==e.name&&!$util.isString(e.name))return"name: string expected";if(void 0!==e.options&&null!==e.options){var n=t[1].verify(e.options);if(n)return"options."+n}return null},e.fromObject=function(e){var n=new $root.google.protobuf.OneofDescriptorProto;return void 0!==e.name&&null!==e.name&&(n.name=String(e.name)),void 0!==e.options&&null!==e.options&&(n.options=t[1].fromObject(e.options)),n},e.from=e.fromObject,e.toObject=function(e,n){n||(n={});var r={};n.defaults&&(r.name="",r.options=null);for(var o=Object.keys(e),i=0;i>>3){case 1:o.name=e.string();break;case 2:o.value&&o.value.length||(o.value=[]),o.value.push(t[1].decode(e,e.uint32()));break;case 3:o.options=t[2].decode(e,e.uint32());break;default:e.skipType(7&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(void 0!==e.name&&!$util.isString(e.name))return"name: string expected";if(void 0!==e.value){if(!Array.isArray(e.value))return"value: array expected";for(var n=0;n>>3){case 1:o.name=e.string();break;case 2:o.number=e.int32();break;case 3:o.options=t[2].decode(e,e.uint32());break;default:e.skipType(7&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(void 0!==e.name&&!$util.isString(e.name))return"name: string expected";if(void 0!==e.number&&!$util.isInteger(e.number))return"number: integer expected";if(void 0!==e.options&&null!==e.options){var n=t[2].verify(e.options);if(n)return"options."+n}return null},e.fromObject=function(e){var n=new $root.google.protobuf.EnumValueDescriptorProto;return void 0!==e.name&&null!==e.name&&(n.name=String(e.name)),void 0!==e.number&&null!==e.number&&(n.number=0|e.number),void 0!==e.options&&null!==e.options&&(n.options=t[2].fromObject(e.options)),n},e.from=e.fromObject,e.toObject=function(e,n){n||(n={});var r={};n.defaults&&(r.name="",r.number=0,r.options=null);for(var o=Object.keys(e),i=0;i>>3){case 1:o.name=e.string();break;case 2:o.method&&o.method.length||(o.method=[]),o.method.push(t[1].decode(e,e.uint32()));break;case 3:o.options=t[2].decode(e,e.uint32());break;default:e.skipType(7&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(void 0!==e.name&&!$util.isString(e.name))return"name: string expected";if(void 0!==e.method){if(!Array.isArray(e.method))return"method: array expected";for(var n=0;n>>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=t[3].decode(e,e.uint32());break;case 5:o.clientStreaming=e.bool();break;case 6:o.serverStreaming=e.bool();break;default:e.skipType(7&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(void 0!==e.name&&!$util.isString(e.name))return"name: string expected";if(void 0!==e.inputType&&!$util.isString(e.inputType))return"inputType: string expected";if(void 0!==e.outputType&&!$util.isString(e.outputType))return"outputType: string expected";if(void 0!==e.options&&null!==e.options){var n=t[3].verify(e.options);if(n)return"options."+n}return void 0!==e.clientStreaming&&"boolean"!=typeof e.clientStreaming?"clientStreaming: boolean expected":void 0!==e.serverStreaming&&"boolean"!=typeof e.serverStreaming?"serverStreaming: boolean expected":null},e.fromObject=function(e){var n=new $root.google.protobuf.MethodDescriptorProto;return void 0!==e.name&&null!==e.name&&(n.name=String(e.name)),void 0!==e.inputType&&null!==e.inputType&&(n.inputType=String(e.inputType)),void 0!==e.outputType&&null!==e.outputType&&(n.outputType=String(e.outputType)),void 0!==e.options&&null!==e.options&&(n.options=t[3].fromObject(e.options)),void 0!==e.clientStreaming&&null!==e.clientStreaming&&(n.clientStreaming=Boolean(e.clientStreaming)),void 0!==e.serverStreaming&&null!==e.serverStreaming&&(n.serverStreaming=Boolean(e.serverStreaming)),n},e.from=e.fromObject,e.toObject=function(e,n){n||(n={});var r={};n.defaults&&(r.name="",r.inputType="",r.outputType="",r.options=null,r.clientStreaming=!1,r.serverStreaming=!1);for(var o=Object.keys(e),i=0;i>>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(t[14].decode(e,e.uint32()));break;default:e.skipType(7&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(void 0!==e.javaPackage&&!$util.isString(e.javaPackage))return"javaPackage: string expected";if(void 0!==e.javaOuterClassname&&!$util.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&&!$util.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&&!$util.isString(e.objcClassPrefix))return"objcClassPrefix: string expected";if(void 0!==e.csharpNamespace&&!$util.isString(e.csharpNamespace))return"csharpNamespace: string expected";if(void 0!==e.uninterpretedOption){if(!Array.isArray(e.uninterpretedOption))return"uninterpretedOption: array expected";for(var n=0;n>>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(t[4].decode(e,e.uint32()));break;default:e.skipType(7&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.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 n=0;n>>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(t[6].decode(e,e.uint32()));break;default:e.skipType(7&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.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 n=0;n>>3){case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(t[0].decode(e,e.uint32()));break;default:e.skipType(7&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(void 0!==e.uninterpretedOption){if(!Array.isArray(e.uninterpretedOption))return"uninterpretedOption: array expected";for(var n=0;n>>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(t[2].decode(e,e.uint32()));break;case 42113038:o[".jspb.test.IsExtension.simpleOption"]=e.string();break;default:e.skipType(7&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.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 n=0;n>>3){case 1:o.deprecated=e.bool();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(t[1].decode(e,e.uint32()));break;default:e.skipType(7&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.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 n=0;n>>3){case 33:o.deprecated=e.bool();break;case 999:o.uninterpretedOption&&o.uninterpretedOption.length||(o.uninterpretedOption=[]),o.uninterpretedOption.push(t[1].decode(e,e.uint32()));break;default:e.skipType(7&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.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 n=0;n>>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(t[2].decode(e,e.uint32()));break;default:e.skipType(7&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.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 n=0;n>>3){case 2:o.name&&o.name.length||(o.name=[]),o.name.push(t[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&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(void 0!==e.name){if(!Array.isArray(e.name))return"name: array expected";for(var n=0;n>>3){case 1:r.namePart=e.string();break;case 2:r.isExtension=e.bool();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){return $util.isString(e.namePart)?"boolean"!=typeof e.isExtension?"isExtension: boolean expected":null:"namePart: string expected"},e.fromObject=function(e){var t=new $root.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},e.from=e.fromObject,e.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(t[0].decode(e,e.uint32()));break;default:e.skipType(7&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(void 0!==e.location){if(!Array.isArray(e.location))return"location: array expected";for(var n=0;n>>3){case 1:if(r.path&&r.path.length||(r.path=[]),2===(7&o))for(var i=e.uint32()+e.pos;e.pos>>3){case 1:o.annotation&&o.annotation.length||(o.annotation=[]),o.annotation.push(t[0].decode(e,e.uint32()));break;default:e.skipType(7&i)}}return o},e.decodeDelimited=function(e){return e=e instanceof $Reader?e:$Reader(e),this.decode(e,e.uint32())},e.verify=function(e){if(void 0!==e.annotation){if(!Array.isArray(e.annotation))return"annotation: array expected";for(var n=0;n>>3){case 1:if(r.path&&r.path.length||(r.path=[]),2===(7&o))for(var i=e.uint32()+e.pos;e.pos>>3){default:e.skipType(7&a)}}return o},r.decodeDelimited=function(e){return e=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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=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.pos