New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

protobufjs

Package Overview
Dependencies
Maintainers
1
Versions
168
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

protobufjs - npm Package Compare versions

Comparing version 3.2.1 to 3.2.2

2

bower.json
{
"name": "protobuf",
"description": "Protocol Buffers for JavaScript. Finally.",
"version": "3.2.1",
"version": "3.2.2",
"main": "ProtoBuf.js",

@@ -6,0 +6,0 @@ "license": "Apache-2.0",

@@ -6,3 +6,3 @@ /*

*/
(function(q){function r(k){var f={VERSION:"3.2.1",WIRE_TYPES:{}};f.WIRE_TYPES.VARINT=0;f.WIRE_TYPES.BITS64=1;f.WIRE_TYPES.LDELIM=2;f.WIRE_TYPES.STARTGROUP=3;f.WIRE_TYPES.ENDGROUP=4;f.WIRE_TYPES.BITS32=5;f.PACKABLE_WIRE_TYPES=[f.WIRE_TYPES.VARINT,f.WIRE_TYPES.BITS64,f.WIRE_TYPES.BITS32];f.TYPES={int32:{name:"int32",wireType:f.WIRE_TYPES.VARINT},uint32:{name:"uint32",wireType:f.WIRE_TYPES.VARINT},sint32:{name:"sint32",wireType:f.WIRE_TYPES.VARINT},int64:{name:"int64",wireType:f.WIRE_TYPES.VARINT},uint64:{name:"uint64",
(function(q){function r(k){var f={VERSION:"3.2.2",WIRE_TYPES:{}};f.WIRE_TYPES.VARINT=0;f.WIRE_TYPES.BITS64=1;f.WIRE_TYPES.LDELIM=2;f.WIRE_TYPES.STARTGROUP=3;f.WIRE_TYPES.ENDGROUP=4;f.WIRE_TYPES.BITS32=5;f.PACKABLE_WIRE_TYPES=[f.WIRE_TYPES.VARINT,f.WIRE_TYPES.BITS64,f.WIRE_TYPES.BITS32];f.TYPES={int32:{name:"int32",wireType:f.WIRE_TYPES.VARINT},uint32:{name:"uint32",wireType:f.WIRE_TYPES.VARINT},sint32:{name:"sint32",wireType:f.WIRE_TYPES.VARINT},int64:{name:"int64",wireType:f.WIRE_TYPES.VARINT},uint64:{name:"uint64",
wireType:f.WIRE_TYPES.VARINT},sint64:{name:"sint64",wireType:f.WIRE_TYPES.VARINT},bool:{name:"bool",wireType:f.WIRE_TYPES.VARINT},"double":{name:"double",wireType:f.WIRE_TYPES.BITS64},string:{name:"string",wireType:f.WIRE_TYPES.LDELIM},bytes:{name:"bytes",wireType:f.WIRE_TYPES.LDELIM},fixed32:{name:"fixed32",wireType:f.WIRE_TYPES.BITS32},sfixed32:{name:"sfixed32",wireType:f.WIRE_TYPES.BITS32},fixed64:{name:"fixed64",wireType:f.WIRE_TYPES.BITS64},sfixed64:{name:"sfixed64",wireType:f.WIRE_TYPES.BITS64},

@@ -56,34 +56,34 @@ "float":{name:"float",wireType:f.WIRE_TYPES.BITS32},"enum":{name:"enum",wireType:f.WIRE_TYPES.VARINT},message:{name:"message",wireType:f.WIRE_TYPES.LDELIM},group:{name:"group",wireType:f.WIRE_TYPES.STARTGROUP}};f.ID_MIN=1;f.ID_MAX=536870911;f.ByteBuffer=k;f.Long=k.Long||null;f.convertFieldsToCamelCase=!1;f.Util=function(){Object.create||(Object.create=function(e){function d(){}if(1<arguments.length)throw Error("Object.create polyfill only accepts the first parameter.");d.prototype=e;return new d});

e.prototype.encodeAB;e.prototype.encodeNB=function(){try{return this.encode().toBuffer()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toBuffer()),a;}};e.prototype.toBuffer=e.prototype.encodeNB;e.prototype.encode64=function(){try{return this.encode().toBase64()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toBase64()),a;}};e.prototype.toBase64=e.prototype.encode64;e.prototype.encodeHex=function(){try{return this.encode().toHex()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toHex()),a;}};e.prototype.toHex=
e.prototype.encodeHex;e.prototype.toRaw=function(a){return b(this,!!a)};e.decode=function(a,b){"string"===typeof a&&(a=k.wrap(a,b?b:"base64"));a=a instanceof k?a:k.wrap(a);var c=a.littleEndian;try{var e=d.decode(a.LE());a.LE(c);return e}catch(m){throw a.LE(c),m;}};e.decodeDelimited=function(a,b){"string"===typeof a&&(a=k.wrap(a,b?b:"base64"));a=a instanceof k?a:k.wrap(a);var c=a.readVarint32(),e=d.decode(a.slice(a.offset,a.offset+c).LE());a.offset+=c;return e};e.decode64=function(a){return e.decode(a,
"base64")};e.decodeHex=function(a){return e.decode(a,"hex")};e.prototype.toString=function(){return d.toString()};Object.defineProperty&&Object.defineProperty(e,"$options",{value:d.buildOpt()});return e}(d,this);for(var c=this.getChildren(),e=0;e<c.length;e++)if(c[e]instanceof h)b[c[e].name]=c[e].build();else if(c[e]instanceof a)b[c[e].name]=c[e].build();else if(!(c[e]instanceof a.Field))throw Error("Illegal reflect child of "+this.toString(!0)+": "+c[e].toString(!0));return this.clazz=b};a.prototype.encode=
function(d,b){for(var c=this.getChildren(a.Field),e=null,g=0,f;g<c.length;g++)f=d.$get(c[g].name),c[g].required&&null===f?null===e&&(e=c[g]):c[g].encode(f,b);if(null!==e)throw c=Error("Missing at least one required field for "+this.toString(!0)+": "+e),c.encoded=b,c;return b};a.prototype.calculate=function(d){for(var b=this.getChildren(a.Field),c=0,e=0,g;e<b.length;e++){g=d.$get(b[e].name);if(b[e].required&&null===g)throw Error("Missing at least one required field for "+this.toString(!0)+": "+b[e]);
c+=b[e].calculate(g)}return c};a.prototype.decode=function(a,b,c){b="number"===typeof b?b:-1;for(var g=a.offset,f=new this.clazz,h,l;a.offset<g+b||-1==b&&0<a.remaining();){h=a.readVarint32();l=h&7;h>>=3;if(l===d.WIRE_TYPES.ENDGROUP){if(h!==c)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+h+" ("+(c?c+" expected":"not a group")+")");break}var k=this.getChild(h);if(k)k.repeated&&!k.options.packed?f.$add(k.name,k.decode(l,a),!0):f.$set(k.name,k.decode(l,a),!0);else switch(l){case d.WIRE_TYPES.VARINT:a.readVarint32();
break;case d.WIRE_TYPES.BITS32:a.offset+=4;break;case d.WIRE_TYPES.BITS64:a.offset+=8;break;case d.WIRE_TYPES.LDELIM:l=a.readVarint32();a.offset+=l;break;case d.WIRE_TYPES.STARTGROUP:for(;e(h,a););break;default:throw Error("Illegal wire type for unknown field "+h+" in "+this.toString(!0)+"#decode: "+l);}}a=this.getChildren(d.Reflect.Field);for(b=0;b<a.length;b++)if(a[b].required&&null===f[a[b].name])throw a=Error("Missing at least one required field for "+this.toString(!0)+": "+a[b].name),a.decoded=
f,a;return f};l.Message=a;var g=function(a,b,e,g,f,h){c.call(this,a,g);this.className="Message.Field";this.required="required"==b;this.repeated="repeated"==b;this.type=e;this.resolvedType=null;this.id=f;this.options=h||{};this.originalName=this.name;d.convertFieldsToCamelCase&&(this.name=this.name.replace(/_([a-zA-Z])/g,function(a,b){return b.toUpperCase()}))};g.prototype=Object.create(c.prototype);g.prototype.verifyValue=function(a,b){b=b||!1;var c=function(a,b){throw Error("Illegal value for "+
this.toString(!0)+" of type "+this.type.name+": "+a+" ("+b+")");}.bind(this);if(null===a)return this.required&&c(typeof a,"required"),null;var e;if(this.repeated&&!b){d.Util.isArray(a)||(a=[a]);c=[];for(e=0;e<a.length;e++)c.push(this.verifyValue(a[e],!0));return c}!this.repeated&&d.Util.isArray(a)&&c(typeof a,"no array expected");switch(this.type){case d.TYPES.int32:case d.TYPES.sint32:case d.TYPES.sfixed32:return("number"!==typeof a||a===a&&0!==a%1)&&c(typeof a,"not an integer"),4294967295<a?a|0:
a;case d.TYPES.uint32:case d.TYPES.fixed32:return("number"!==typeof a||a===a&&0!==a%1)&&c(typeof a,"not an integer"),0>a?a>>>0:a;case d.TYPES.int64:case d.TYPES.sint64:case d.TYPES.sfixed64:if(d.Long)try{return f(a,!1)}catch(g){c(typeof a,g.message)}else c(typeof a,"requires Long.js");case d.TYPES.uint64:case d.TYPES.fixed64:if(d.Long)try{return f(a,!0)}catch(l){c(typeof a,l.message)}else c(typeof a,"requires Long.js");case d.TYPES.bool:return"boolean"!==typeof a&&c(typeof a,"not a boolean"),a;case d.TYPES["float"]:case d.TYPES["double"]:return"number"!==
typeof a&&c(typeof a,"not a number"),a;case d.TYPES.string:return"string"===typeof a||a&&a instanceof String||c(typeof a,"not a string"),""+a;case d.TYPES.bytes:return a&&a instanceof k?a:k.wrap(a);case d.TYPES["enum"]:var n=this.resolvedType.getChildren(h.Value);for(e=0;e<n.length;e++)if(n[e].name==a||n[e].id==a)return n[e].id;c(a,"not a valid enum value");case d.TYPES.group:case d.TYPES.message:return a&&"object"===typeof a||c(typeof a,"object expected"),a instanceof this.resolvedType.clazz?a:new this.resolvedType.clazz(a)}throw Error("[INTERNAL] Illegal value for "+
this.toString(!0)+": "+a+" (undefined type "+this.type+")");};g.prototype.encode=function(a,b){a=this.verifyValue(a);if(null===this.type||"object"!==typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===a||this.repeated&&0==a.length)return b;try{if(this.repeated){var c;if(this.options.packed&&0<=d.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)){b.writeVarint32(this.id<<3|d.WIRE_TYPES.LDELIM);b.ensureCapacity(b.offset+=1);var e=b.offset;for(c=0;c<
a.length;c++)this.encodeValue(a[c],b);var g=b.offset-e,f=k.calculateVarint32(g);if(1<f){var h=b.slice(e,b.offset),e=e+(f-1);b.offset=e;b.append(h)}b.writeVarint32(g,e-f)}else for(c=0;c<a.length;c++)b.writeVarint32(this.id<<3|this.type.wireType),this.encodeValue(a[c],b)}else b.writeVarint32(this.id<<3|this.type.wireType),this.encodeValue(a,b)}catch(l){throw Error("Illegal value for "+this.toString(!0)+": "+a+" ("+l+")");}return b};g.prototype.encodeValue=function(a,b){if(null===a)return b;switch(this.type){case d.TYPES.int32:0>
a?b.writeVarint64(a):b.writeVarint32(a);break;case d.TYPES.uint32:b.writeVarint32(a);break;case d.TYPES.sint32:b.writeVarint32ZigZag(a);break;case d.TYPES.fixed32:b.writeUint32(a);break;case d.TYPES.sfixed32:b.writeInt32(a);break;case d.TYPES.int64:case d.TYPES.uint64:b.writeVarint64(a);break;case d.TYPES.sint64:b.writeVarint64ZigZag(a);break;case d.TYPES.fixed64:b.writeUint64(a);break;case d.TYPES.sfixed64:b.writeInt64(a);break;case d.TYPES.bool:"string"===typeof a?b.writeVarint32("false"===a.toLowerCase()?
0:!!a):b.writeVarint32(a?1:0);break;case d.TYPES["enum"]:b.writeVarint32(a);break;case d.TYPES["float"]:b.writeFloat32(a);break;case d.TYPES["double"]:b.writeFloat64(a);break;case d.TYPES.string:b.writeVString(a);break;case d.TYPES.bytes:if(0>a.remaining())throw Error("Illegal value for "+this.toString(!0)+": "+a.remaining()+" bytes remaining");var c=a.offset;b.writeVarint32(a.remaining());b.append(a);a.offset=c;break;case d.TYPES.message:c=(new k).LE();this.resolvedType.encode(a,c);b.writeVarint32(c.offset);
b.append(c.flip());break;case d.TYPES.group:this.resolvedType.encode(a,b);b.writeVarint32(this.id<<3|d.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+a+" (unknown type)");}return b};g.prototype.calculate=function(a){a=this.verifyValue(a);if(null===this.type||"object"!==typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===a||this.repeated&&0==a.length)return 0;var b=0;try{if(this.repeated){var c,
e;if(this.options.packed&&0<=d.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)){b+=k.calculateVarint32(this.id<<3|d.WIRE_TYPES.LDELIM);for(c=e=0;c<a.length;c++)e+=this.calculateValue(a[c]);b+=k.calculateVarint32(e);b+=e}else for(c=0;c<a.length;c++)b+=k.calculateVarint32(this.id<<3|this.type.wireType),b+=this.calculateValue(a[c])}else b+=k.calculateVarint32(this.id<<3|this.type.wireType),b+=this.calculateValue(a)}catch(g){throw Error("Illegal value for "+this.toString(!0)+": "+a+" ("+g+")");}return b};
g.prototype.calculateValue=function(a){if(null===a)return 0;switch(this.type){case d.TYPES.int32:return 0>a?k.calculateVarint64(a):k.calculateVarint32(a);case d.TYPES.uint32:return k.calculateVarint32(a);case d.TYPES.sint32:return k.calculateVarint32(k.zigZagEncode32(a));case d.TYPES.fixed32:case d.TYPES.sfixed32:case d.TYPES["float"]:return 4;case d.TYPES.int64:case d.TYPES.uint64:return k.calculateVarint64(a);case d.TYPES.sint64:return k.calculateVarint64(k.zigZagEncode64(a));case d.TYPES.fixed64:case d.TYPES.sfixed64:return 8;
case d.TYPES.bool:return 1;case d.TYPES["enum"]:return k.calculateVarint32(a);case d.TYPES["double"]:return 8;case d.TYPES.string:return a=k.calculateUTF8Bytes(a),k.calculateVarint32(a)+a;case d.TYPES.bytes:if(0>a.remaining())throw Error("Illegal value for "+this.toString(!0)+": "+a.remaining()+" bytes remaining");return k.calculateVarint32(a.remaining())+a.remaining();case d.TYPES.message:return a=this.resolvedType.calculate(a),k.calculateVarint32(a)+a;case d.TYPES.group:return a=this.resolvedType.calculate(a),
a+k.calculateVarint32(this.id<<3|d.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+a+" (unknown type)");};g.prototype.decode=function(a,b,c){if(a!=this.type.wireType&&(c||a!=d.WIRE_TYPES.LDELIM||!this.repeated))throw Error("Illegal wire type for field "+this.toString(!0)+": "+a+" ("+this.type.wireType+" expected)");if(a==d.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&!c){a=b.readVarint32();a=b.offset+a;for(c=[];b.offset<a;)c.push(this.decode(this.type.wireType,
b,!0));return c}switch(this.type){case d.TYPES.int32:return b.readVarint32()|0;case d.TYPES.uint32:return b.readVarint32()>>>0;case d.TYPES.sint32:return b.readVarint32ZigZag()|0;case d.TYPES.fixed32:return b.readUint32()>>>0;case d.TYPES.sfixed32:return b.readInt32()|0;case d.TYPES.int64:return b.readVarint64();case d.TYPES.uint64:return b.readVarint64().toUnsigned();case d.TYPES.sint64:return b.readVarint64ZigZag();case d.TYPES.fixed64:return b.readUint64();case d.TYPES.sfixed64:return b.readInt64();
case d.TYPES.bool:return!!b.readVarint32();case d.TYPES["enum"]:return b.readVarint32();case d.TYPES["float"]:return b.readFloat();case d.TYPES["double"]:return b.readDouble();case d.TYPES.string:return b.readVString();case d.TYPES.bytes:a=b.readVarint32();if(b.remaining()<a)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+a+" required but got only "+b.remaining());c=b.clone();c.limit=c.offset+a;b.offset+=a;return c;case d.TYPES.message:return a=b.readVarint32(),this.resolvedType.decode(b,
a);case d.TYPES.group:return this.resolvedType.decode(b,-1,this.id)}throw Error("[INTERNAL] Illegal wire type for "+this.toString(!0)+": "+a);};l.Message.Field=g;var n=function(a,b,c,d,e,f){g.call(this,a,b,c,d,e,f)};n.prototype=Object.create(g.prototype);l.Message.ExtensionField=n;var h=function(a,c,d){b.call(this,a,c,d);this.className="Enum";this.object=null};h.prototype=Object.create(b.prototype);h.prototype.build=function(){for(var a={},b=this.getChildren(h.Value),c=0;c<b.length;c++)a[b[c].name]=
b[c].id;Object.defineProperty&&Object.defineProperty(a,"$options",{value:this.buildOpt()});return this.object=a};l.Enum=h;n=function(a,b,d){c.call(this,a,b);this.className="Enum.Value";this.id=d};n.prototype=Object.create(c.prototype);l.Enum.Value=n;n=function(a,c,d){b.call(this,a,c,d);this.className="Service";this.clazz=null};n.prototype=Object.create(b.prototype);n.prototype.build=function(a){return this.clazz&&!a?this.clazz:this.clazz=function(a,b){var c=function(b){a.Builder.Service.call(this);
this.rpcImpl=b||function(a,b,c){setTimeout(c.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}};c.prototype=Object.create(a.Builder.Service.prototype);Object.defineProperty&&(Object.defineProperty(c,"$options",{value:b.buildOpt()}),Object.defineProperty(c.prototype,"$options",{value:c.$options}));for(var d=b.getChildren(a.Reflect.Service.RPCMethod),e=0;e<d.length;e++)(function(a){c.prototype[a.name]=function(c,d){try{c&&c instanceof a.resolvedRequestType.clazz?
this.rpcImpl(a.fqn(),c,function(c,e){if(c)d(c);else{try{e=a.resolvedResponseType.clazz.decode(e)}catch(g){}e&&e instanceof a.resolvedResponseType.clazz?d(null,e):d(Error("Illegal response type received in service method "+b.name+"#"+a.name))}}):setTimeout(d.bind(this,Error("Illegal request type provided to service method "+b.name+"#"+a.name)),0)}catch(e){setTimeout(d.bind(this,e),0)}};c[a.name]=function(b,d,e){(new c(b))[a.name](d,e)};Object.defineProperty&&(Object.defineProperty(c[a.name],"$options",
{value:a.buildOpt()}),Object.defineProperty(c.prototype[a.name],"$options",{value:c[a.name].$options}))})(d[e]);return c}(d,this)};l.Service=n;var p=function(a,b,d){c.call(this,a,b);this.className="Service.Method";this.options=d||{}};p.prototype=Object.create(c.prototype);p.prototype.buildOpt=b.prototype.buildOpt;l.Service.Method=p;n=function(a,b,c,d,e){p.call(this,a,b,e);this.className="Service.RPCMethod";this.requestName=c;this.responseName=d;this.resolvedResponseType=this.resolvedRequestType=null};
n.prototype=Object.create(p.prototype);l.Service.RPCMethod=n;return l}(f);f.Builder=function(d,e,f){var l=function(){this.ptr=this.ns=new f.Namespace(null,"");this.resolved=!1;this.result=null;this.files={};this.importRoot=null};l.prototype.reset=function(){this.ptr=this.ns};l.prototype.define=function(c,b){if("string"!==typeof c||!e.TYPEREF.test(c))throw Error("Illegal package: "+c);var a=c.split("."),d;for(d=0;d<a.length;d++)if(!e.NAME.test(a[d]))throw Error("Illegal package: "+a[d]);for(d=0;d<
a.length;d++)this.ptr.hasChild(a[d])||this.ptr.addChild(new f.Namespace(this.ptr,a[d],b)),this.ptr=this.ptr.getChild(a[d]);return this};l.isValidMessage=function(c){if("string"!==typeof c.name||!e.NAME.test(c.name)||"undefined"!==typeof c.values||"undefined"!==typeof c.rpc)return!1;var b;if("undefined"!==typeof c.fields){if(!d.Util.isArray(c.fields))return!1;var a=[],g;for(b=0;b<c.fields.length;b++){if(!l.isValidMessageField(c.fields[b]))return!1;g=parseInt(c.fields[b].id,10);if(0<=a.indexOf(g))return!1;
a.push(g)}}if("undefined"!==typeof c.enums){if(!d.Util.isArray(c.enums))return!1;for(b=0;b<c.enums.length;b++)if(!l.isValidEnum(c.enums[b]))return!1}if("undefined"!==typeof c.messages){if(!d.Util.isArray(c.messages))return!1;for(b=0;b<c.messages.length;b++)if(!l.isValidMessage(c.messages[b])&&!l.isValidExtend(c.messages[b]))return!1}return"undefined"===typeof c.extensions||d.Util.isArray(c.extensions)&&2===c.extensions.length&&"number"===typeof c.extensions[0]&&"number"===typeof c.extensions[1]?!0:
!1};l.isValidMessageField=function(c){if("string"!==typeof c.rule||"string"!==typeof c.name||"string"!==typeof c.type||"undefined"===typeof c.id||!(e.RULE.test(c.rule)&&e.NAME.test(c.name)&&e.TYPEREF.test(c.type)&&e.ID.test(""+c.id)))return!1;if("undefined"!==typeof c.options){if("object"!==typeof c.options)return!1;for(var b=Object.keys(c.options),a=0,d;a<b.length;a++)if("string"!==typeof(d=b[a])||"string"!==typeof c.options[d]&&"number"!==typeof c.options[d]&&"boolean"!==typeof c.options[d])return!1}return!0};
l.isValidEnum=function(c){if("string"!==typeof c.name||!e.NAME.test(c.name)||"undefined"===typeof c.values||!d.Util.isArray(c.values)||0==c.values.length)return!1;for(var b=0;b<c.values.length;b++)if("object"!=typeof c.values[b]||"string"!==typeof c.values[b].name||"undefined"===typeof c.values[b].id||!e.NAME.test(c.values[b].name)||!e.NEGID.test(""+c.values[b].id))return!1;return!0};l.prototype.create=function(c){if(!c)return this;d.Util.isArray(c)||(c=[c]);if(0==c.length)return this;var b=[],a,
e,k,h,p;for(b.push(c);0<b.length;){c=b.pop();if(d.Util.isArray(c))for(;0<c.length;)if(a=c.shift(),l.isValidMessage(a)){e=new f.Message(this.ptr,a.name,a.options,a.isGroup);if(a.fields&&0<a.fields.length)for(h=0;h<a.fields.length;h++){if(e.hasChild(a.fields[h].id))throw Error("Duplicate field id in message "+e.name+": "+a.fields[h].id);if(a.fields[h].options)for(k=Object.keys(a.fields[h].options),p=0;p<k.length;p++){if("string"!==typeof k[p])throw Error("Illegal field option name in message "+e.name+
"#"+a.fields[h].name+": "+k[p]);if("string"!==typeof a.fields[h].options[k[p]]&&"number"!==typeof a.fields[h].options[k[p]]&&"boolean"!==typeof a.fields[h].options[k[p]])throw Error("Illegal field option value in message "+e.name+"#"+a.fields[h].name+"#"+k[p]+": "+a.fields[h].options[k[p]]);}e.addChild(new f.Message.Field(e,a.fields[h].rule,a.fields[h].type,a.fields[h].name,a.fields[h].id,a.fields[h].options))}k=[];if("undefined"!==typeof a.enums&&0<a.enums.length)for(h=0;h<a.enums.length;h++)k.push(a.enums[h]);
e.prototype.encodeHex;e.prototype.toRaw=function(a){return b(this,!!a)};e.decode=function(a,b){"string"===typeof a&&(a=k.wrap(a,b?b:"base64"));a=a instanceof k?a:k.wrap(a);var c=a.littleEndian;try{var e=d.decode(a.LE());a.LE(c);return e}catch(m){throw a.LE(c),m;}};e.decodeDelimited=function(a,b){"string"===typeof a&&(a=k.wrap(a,b?b:"base64"));a=a instanceof k?a:k.wrap(a);if(1>a.remaining())return null;var c=a.offset,e=a.readVarint32();if(a.remaining()<e)return a.offset=c,null;try{var m=d.decode(a.slice(a.offset,
a.offset+e).LE());a.offset+=e;return m}catch(g){throw a.offset+=e,g;}};e.decode64=function(a){return e.decode(a,"base64")};e.decodeHex=function(a){return e.decode(a,"hex")};e.prototype.toString=function(){return d.toString()};Object.defineProperty&&Object.defineProperty(e,"$options",{value:d.buildOpt()});return e}(d,this);for(var c=this.getChildren(),e=0;e<c.length;e++)if(c[e]instanceof h)b[c[e].name]=c[e].build();else if(c[e]instanceof a)b[c[e].name]=c[e].build();else if(!(c[e]instanceof a.Field))throw Error("Illegal reflect child of "+
this.toString(!0)+": "+c[e].toString(!0));return this.clazz=b};a.prototype.encode=function(d,b){for(var c=this.getChildren(a.Field),e=null,g=0,f;g<c.length;g++)f=d.$get(c[g].name),c[g].required&&null===f?null===e&&(e=c[g]):c[g].encode(f,b);if(null!==e)throw c=Error("Missing at least one required field for "+this.toString(!0)+": "+e),c.encoded=b,c;return b};a.prototype.calculate=function(d){for(var b=this.getChildren(a.Field),c=0,e=0,g;e<b.length;e++){g=d.$get(b[e].name);if(b[e].required&&null===g)throw Error("Missing at least one required field for "+
this.toString(!0)+": "+b[e]);c+=b[e].calculate(g)}return c};a.prototype.decode=function(a,b,c){b="number"===typeof b?b:-1;for(var g=a.offset,f=new this.clazz,h,l;a.offset<g+b||-1==b&&0<a.remaining();){h=a.readVarint32();l=h&7;h>>=3;if(l===d.WIRE_TYPES.ENDGROUP){if(h!==c)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+h+" ("+(c?c+" expected":"not a group")+")");break}var k=this.getChild(h);if(k)k.repeated&&!k.options.packed?f.$add(k.name,k.decode(l,a),!0):f.$set(k.name,k.decode(l,
a),!0);else switch(l){case d.WIRE_TYPES.VARINT:a.readVarint32();break;case d.WIRE_TYPES.BITS32:a.offset+=4;break;case d.WIRE_TYPES.BITS64:a.offset+=8;break;case d.WIRE_TYPES.LDELIM:l=a.readVarint32();a.offset+=l;break;case d.WIRE_TYPES.STARTGROUP:for(;e(h,a););break;default:throw Error("Illegal wire type for unknown field "+h+" in "+this.toString(!0)+"#decode: "+l);}}a=this.getChildren(d.Reflect.Field);for(b=0;b<a.length;b++)if(a[b].required&&null===f[a[b].name])throw a=Error("Missing at least one required field for "+
this.toString(!0)+": "+a[b].name),a.decoded=f,a;return f};l.Message=a;var g=function(a,b,e,g,f,h){c.call(this,a,g);this.className="Message.Field";this.required="required"==b;this.repeated="repeated"==b;this.type=e;this.resolvedType=null;this.id=f;this.options=h||{};this.originalName=this.name;d.convertFieldsToCamelCase&&(this.name=this.name.replace(/_([a-zA-Z])/g,function(a,b){return b.toUpperCase()}))};g.prototype=Object.create(c.prototype);g.prototype.verifyValue=function(a,b){b=b||!1;var c=function(a,
b){throw Error("Illegal value for "+this.toString(!0)+" of type "+this.type.name+": "+a+" ("+b+")");}.bind(this);if(null===a)return this.required&&c(typeof a,"required"),null;var e;if(this.repeated&&!b){d.Util.isArray(a)||(a=[a]);c=[];for(e=0;e<a.length;e++)c.push(this.verifyValue(a[e],!0));return c}!this.repeated&&d.Util.isArray(a)&&c(typeof a,"no array expected");switch(this.type){case d.TYPES.int32:case d.TYPES.sint32:case d.TYPES.sfixed32:return("number"!==typeof a||a===a&&0!==a%1)&&c(typeof a,
"not an integer"),4294967295<a?a|0:a;case d.TYPES.uint32:case d.TYPES.fixed32:return("number"!==typeof a||a===a&&0!==a%1)&&c(typeof a,"not an integer"),0>a?a>>>0:a;case d.TYPES.int64:case d.TYPES.sint64:case d.TYPES.sfixed64:if(d.Long)try{return f(a,!1)}catch(g){c(typeof a,g.message)}else c(typeof a,"requires Long.js");case d.TYPES.uint64:case d.TYPES.fixed64:if(d.Long)try{return f(a,!0)}catch(l){c(typeof a,l.message)}else c(typeof a,"requires Long.js");case d.TYPES.bool:return"boolean"!==typeof a&&
c(typeof a,"not a boolean"),a;case d.TYPES["float"]:case d.TYPES["double"]:return"number"!==typeof a&&c(typeof a,"not a number"),a;case d.TYPES.string:return"string"===typeof a||a&&a instanceof String||c(typeof a,"not a string"),""+a;case d.TYPES.bytes:return a&&a instanceof k?a:k.wrap(a);case d.TYPES["enum"]:var n=this.resolvedType.getChildren(h.Value);for(e=0;e<n.length;e++)if(n[e].name==a||n[e].id==a)return n[e].id;c(a,"not a valid enum value");case d.TYPES.group:case d.TYPES.message:return a&&
"object"===typeof a||c(typeof a,"object expected"),a instanceof this.resolvedType.clazz?a:new this.resolvedType.clazz(a)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+a+" (undefined type "+this.type+")");};g.prototype.encode=function(a,b){a=this.verifyValue(a);if(null===this.type||"object"!==typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===a||this.repeated&&0==a.length)return b;try{if(this.repeated){var c;if(this.options.packed&&
0<=d.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)){b.writeVarint32(this.id<<3|d.WIRE_TYPES.LDELIM);b.ensureCapacity(b.offset+=1);var e=b.offset;for(c=0;c<a.length;c++)this.encodeValue(a[c],b);var g=b.offset-e,f=k.calculateVarint32(g);if(1<f){var h=b.slice(e,b.offset),e=e+(f-1);b.offset=e;b.append(h)}b.writeVarint32(g,e-f)}else for(c=0;c<a.length;c++)b.writeVarint32(this.id<<3|this.type.wireType),this.encodeValue(a[c],b)}else b.writeVarint32(this.id<<3|this.type.wireType),this.encodeValue(a,b)}catch(l){throw Error("Illegal value for "+
this.toString(!0)+": "+a+" ("+l+")");}return b};g.prototype.encodeValue=function(a,b){if(null===a)return b;switch(this.type){case d.TYPES.int32:0>a?b.writeVarint64(a):b.writeVarint32(a);break;case d.TYPES.uint32:b.writeVarint32(a);break;case d.TYPES.sint32:b.writeVarint32ZigZag(a);break;case d.TYPES.fixed32:b.writeUint32(a);break;case d.TYPES.sfixed32:b.writeInt32(a);break;case d.TYPES.int64:case d.TYPES.uint64:b.writeVarint64(a);break;case d.TYPES.sint64:b.writeVarint64ZigZag(a);break;case d.TYPES.fixed64:b.writeUint64(a);
break;case d.TYPES.sfixed64:b.writeInt64(a);break;case d.TYPES.bool:"string"===typeof a?b.writeVarint32("false"===a.toLowerCase()?0:!!a):b.writeVarint32(a?1:0);break;case d.TYPES["enum"]:b.writeVarint32(a);break;case d.TYPES["float"]:b.writeFloat32(a);break;case d.TYPES["double"]:b.writeFloat64(a);break;case d.TYPES.string:b.writeVString(a);break;case d.TYPES.bytes:if(0>a.remaining())throw Error("Illegal value for "+this.toString(!0)+": "+a.remaining()+" bytes remaining");var c=a.offset;b.writeVarint32(a.remaining());
b.append(a);a.offset=c;break;case d.TYPES.message:c=(new k).LE();this.resolvedType.encode(a,c);b.writeVarint32(c.offset);b.append(c.flip());break;case d.TYPES.group:this.resolvedType.encode(a,b);b.writeVarint32(this.id<<3|d.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+a+" (unknown type)");}return b};g.prototype.calculate=function(a){a=this.verifyValue(a);if(null===this.type||"object"!==typeof this.type)throw Error("[INTERNAL] Unresolved type in "+
this.toString(!0)+": "+this.type);if(null===a||this.repeated&&0==a.length)return 0;var b=0;try{if(this.repeated){var c,e;if(this.options.packed&&0<=d.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)){b+=k.calculateVarint32(this.id<<3|d.WIRE_TYPES.LDELIM);for(c=e=0;c<a.length;c++)e+=this.calculateValue(a[c]);b+=k.calculateVarint32(e);b+=e}else for(c=0;c<a.length;c++)b+=k.calculateVarint32(this.id<<3|this.type.wireType),b+=this.calculateValue(a[c])}else b+=k.calculateVarint32(this.id<<3|this.type.wireType),
b+=this.calculateValue(a)}catch(g){throw Error("Illegal value for "+this.toString(!0)+": "+a+" ("+g+")");}return b};g.prototype.calculateValue=function(a){if(null===a)return 0;switch(this.type){case d.TYPES.int32:return 0>a?k.calculateVarint64(a):k.calculateVarint32(a);case d.TYPES.uint32:return k.calculateVarint32(a);case d.TYPES.sint32:return k.calculateVarint32(k.zigZagEncode32(a));case d.TYPES.fixed32:case d.TYPES.sfixed32:case d.TYPES["float"]:return 4;case d.TYPES.int64:case d.TYPES.uint64:return k.calculateVarint64(a);
case d.TYPES.sint64:return k.calculateVarint64(k.zigZagEncode64(a));case d.TYPES.fixed64:case d.TYPES.sfixed64:return 8;case d.TYPES.bool:return 1;case d.TYPES["enum"]:return k.calculateVarint32(a);case d.TYPES["double"]:return 8;case d.TYPES.string:return a=k.calculateUTF8Bytes(a),k.calculateVarint32(a)+a;case d.TYPES.bytes:if(0>a.remaining())throw Error("Illegal value for "+this.toString(!0)+": "+a.remaining()+" bytes remaining");return k.calculateVarint32(a.remaining())+a.remaining();case d.TYPES.message:return a=
this.resolvedType.calculate(a),k.calculateVarint32(a)+a;case d.TYPES.group:return a=this.resolvedType.calculate(a),a+k.calculateVarint32(this.id<<3|d.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+a+" (unknown type)");};g.prototype.decode=function(a,b,c){if(a!=this.type.wireType&&(c||a!=d.WIRE_TYPES.LDELIM||!this.repeated))throw Error("Illegal wire type for field "+this.toString(!0)+": "+a+" ("+this.type.wireType+" expected)");if(a==d.WIRE_TYPES.LDELIM&&
this.repeated&&this.options.packed&&0<=d.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)&&!c){a=b.readVarint32();a=b.offset+a;for(c=[];b.offset<a;)c.push(this.decode(this.type.wireType,b,!0));return c}switch(this.type){case d.TYPES.int32:return b.readVarint32()|0;case d.TYPES.uint32:return b.readVarint32()>>>0;case d.TYPES.sint32:return b.readVarint32ZigZag()|0;case d.TYPES.fixed32:return b.readUint32()>>>0;case d.TYPES.sfixed32:return b.readInt32()|0;case d.TYPES.int64:return b.readVarint64();case d.TYPES.uint64:return b.readVarint64().toUnsigned();
case d.TYPES.sint64:return b.readVarint64ZigZag();case d.TYPES.fixed64:return b.readUint64();case d.TYPES.sfixed64:return b.readInt64();case d.TYPES.bool:return!!b.readVarint32();case d.TYPES["enum"]:return b.readVarint32();case d.TYPES["float"]:return b.readFloat();case d.TYPES["double"]:return b.readDouble();case d.TYPES.string:return b.readVString();case d.TYPES.bytes:a=b.readVarint32();if(b.remaining()<a)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+a+" required but got only "+
b.remaining());c=b.clone();c.limit=c.offset+a;b.offset+=a;return c;case d.TYPES.message:return a=b.readVarint32(),this.resolvedType.decode(b,a);case d.TYPES.group:return this.resolvedType.decode(b,-1,this.id)}throw Error("[INTERNAL] Illegal wire type for "+this.toString(!0)+": "+a);};l.Message.Field=g;var n=function(a,b,c,d,e,f){g.call(this,a,b,c,d,e,f)};n.prototype=Object.create(g.prototype);l.Message.ExtensionField=n;var h=function(a,c,d){b.call(this,a,c,d);this.className="Enum";this.object=null};
h.prototype=Object.create(b.prototype);h.prototype.build=function(){for(var a={},b=this.getChildren(h.Value),c=0;c<b.length;c++)a[b[c].name]=b[c].id;Object.defineProperty&&Object.defineProperty(a,"$options",{value:this.buildOpt()});return this.object=a};l.Enum=h;n=function(a,b,d){c.call(this,a,b);this.className="Enum.Value";this.id=d};n.prototype=Object.create(c.prototype);l.Enum.Value=n;n=function(a,c,d){b.call(this,a,c,d);this.className="Service";this.clazz=null};n.prototype=Object.create(b.prototype);
n.prototype.build=function(a){return this.clazz&&!a?this.clazz:this.clazz=function(a,b){var c=function(b){a.Builder.Service.call(this);this.rpcImpl=b||function(a,b,c){setTimeout(c.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}};c.prototype=Object.create(a.Builder.Service.prototype);Object.defineProperty&&(Object.defineProperty(c,"$options",{value:b.buildOpt()}),Object.defineProperty(c.prototype,"$options",{value:c.$options}));for(var d=b.getChildren(a.Reflect.Service.RPCMethod),
e=0;e<d.length;e++)(function(a){c.prototype[a.name]=function(c,d){try{c&&c instanceof a.resolvedRequestType.clazz?this.rpcImpl(a.fqn(),c,function(c,e){if(c)d(c);else{try{e=a.resolvedResponseType.clazz.decode(e)}catch(g){}e&&e instanceof a.resolvedResponseType.clazz?d(null,e):d(Error("Illegal response type received in service method "+b.name+"#"+a.name))}}):setTimeout(d.bind(this,Error("Illegal request type provided to service method "+b.name+"#"+a.name)),0)}catch(e){setTimeout(d.bind(this,e),0)}};
c[a.name]=function(b,d,e){(new c(b))[a.name](d,e)};Object.defineProperty&&(Object.defineProperty(c[a.name],"$options",{value:a.buildOpt()}),Object.defineProperty(c.prototype[a.name],"$options",{value:c[a.name].$options}))})(d[e]);return c}(d,this)};l.Service=n;var p=function(a,b,d){c.call(this,a,b);this.className="Service.Method";this.options=d||{}};p.prototype=Object.create(c.prototype);p.prototype.buildOpt=b.prototype.buildOpt;l.Service.Method=p;n=function(a,b,c,d,e){p.call(this,a,b,e);this.className=
"Service.RPCMethod";this.requestName=c;this.responseName=d;this.resolvedResponseType=this.resolvedRequestType=null};n.prototype=Object.create(p.prototype);l.Service.RPCMethod=n;return l}(f);f.Builder=function(d,e,f){var l=function(){this.ptr=this.ns=new f.Namespace(null,"");this.resolved=!1;this.result=null;this.files={};this.importRoot=null};l.prototype.reset=function(){this.ptr=this.ns};l.prototype.define=function(c,b){if("string"!==typeof c||!e.TYPEREF.test(c))throw Error("Illegal package: "+c);
var a=c.split("."),d;for(d=0;d<a.length;d++)if(!e.NAME.test(a[d]))throw Error("Illegal package: "+a[d]);for(d=0;d<a.length;d++)this.ptr.hasChild(a[d])||this.ptr.addChild(new f.Namespace(this.ptr,a[d],b)),this.ptr=this.ptr.getChild(a[d]);return this};l.isValidMessage=function(c){if("string"!==typeof c.name||!e.NAME.test(c.name)||"undefined"!==typeof c.values||"undefined"!==typeof c.rpc)return!1;var b;if("undefined"!==typeof c.fields){if(!d.Util.isArray(c.fields))return!1;var a=[],g;for(b=0;b<c.fields.length;b++){if(!l.isValidMessageField(c.fields[b]))return!1;
g=parseInt(c.fields[b].id,10);if(0<=a.indexOf(g))return!1;a.push(g)}}if("undefined"!==typeof c.enums){if(!d.Util.isArray(c.enums))return!1;for(b=0;b<c.enums.length;b++)if(!l.isValidEnum(c.enums[b]))return!1}if("undefined"!==typeof c.messages){if(!d.Util.isArray(c.messages))return!1;for(b=0;b<c.messages.length;b++)if(!l.isValidMessage(c.messages[b])&&!l.isValidExtend(c.messages[b]))return!1}return"undefined"===typeof c.extensions||d.Util.isArray(c.extensions)&&2===c.extensions.length&&"number"===typeof c.extensions[0]&&
"number"===typeof c.extensions[1]?!0:!1};l.isValidMessageField=function(c){if("string"!==typeof c.rule||"string"!==typeof c.name||"string"!==typeof c.type||"undefined"===typeof c.id||!(e.RULE.test(c.rule)&&e.NAME.test(c.name)&&e.TYPEREF.test(c.type)&&e.ID.test(""+c.id)))return!1;if("undefined"!==typeof c.options){if("object"!==typeof c.options)return!1;for(var b=Object.keys(c.options),a=0,d;a<b.length;a++)if("string"!==typeof(d=b[a])||"string"!==typeof c.options[d]&&"number"!==typeof c.options[d]&&
"boolean"!==typeof c.options[d])return!1}return!0};l.isValidEnum=function(c){if("string"!==typeof c.name||!e.NAME.test(c.name)||"undefined"===typeof c.values||!d.Util.isArray(c.values)||0==c.values.length)return!1;for(var b=0;b<c.values.length;b++)if("object"!=typeof c.values[b]||"string"!==typeof c.values[b].name||"undefined"===typeof c.values[b].id||!e.NAME.test(c.values[b].name)||!e.NEGID.test(""+c.values[b].id))return!1;return!0};l.prototype.create=function(c){if(!c)return this;d.Util.isArray(c)||
(c=[c]);if(0==c.length)return this;var b=[],a,e,k,h,p;for(b.push(c);0<b.length;){c=b.pop();if(d.Util.isArray(c))for(;0<c.length;)if(a=c.shift(),l.isValidMessage(a)){e=new f.Message(this.ptr,a.name,a.options,a.isGroup);if(a.fields&&0<a.fields.length)for(h=0;h<a.fields.length;h++){if(e.hasChild(a.fields[h].id))throw Error("Duplicate field id in message "+e.name+": "+a.fields[h].id);if(a.fields[h].options)for(k=Object.keys(a.fields[h].options),p=0;p<k.length;p++){if("string"!==typeof k[p])throw Error("Illegal field option name in message "+
e.name+"#"+a.fields[h].name+": "+k[p]);if("string"!==typeof a.fields[h].options[k[p]]&&"number"!==typeof a.fields[h].options[k[p]]&&"boolean"!==typeof a.fields[h].options[k[p]])throw Error("Illegal field option value in message "+e.name+"#"+a.fields[h].name+"#"+k[p]+": "+a.fields[h].options[k[p]]);}e.addChild(new f.Message.Field(e,a.fields[h].rule,a.fields[h].type,a.fields[h].name,a.fields[h].id,a.fields[h].options))}k=[];if("undefined"!==typeof a.enums&&0<a.enums.length)for(h=0;h<a.enums.length;h++)k.push(a.enums[h]);
if(a.messages&&0<a.messages.length)for(h=0;h<a.messages.length;h++)k.push(a.messages[h]);a.extensions&&(e.extensions=a.extensions,e.extensions[0]<d.ID_MIN&&(e.extensions[0]=d.ID_MIN),e.extensions[1]>d.ID_MAX&&(e.extensions[1]=d.ID_MAX));this.ptr.addChild(e);0<k.length&&(b.push(c),c=k,this.ptr=e)}else if(l.isValidEnum(a)){e=new f.Enum(this.ptr,a.name,a.options);for(h=0;h<a.values.length;h++)e.addChild(new f.Enum.Value(e,a.values[h].name,a.values[h].id));this.ptr.addChild(e)}else if(l.isValidService(a)){e=

@@ -90,0 +90,0 @@ new f.Service(this.ptr,a.name,a.options);for(h in a.rpc)a.rpc.hasOwnProperty(h)&&e.addChild(new f.Service.RPCMethod(e,h,a.rpc[h].request,a.rpc[h].response,a.rpc[h].options));this.ptr.addChild(e)}else if(l.isValidExtend(a))if(e=this.ptr.resolve(a.ref))for(h=0;h<a.fields.length;h++){if(e.hasChild(a.fields[h].id))throw Error("Duplicate extended field id in message "+e.name+": "+a.fields[h].id);if(a.fields[h].id<e.extensions[0]||a.fields[h].id>e.extensions[1])throw Error("Illegal extended field id in message "+

@@ -6,3 +6,3 @@ /*

*/
(function(r){function s(g){var f={VERSION:"3.2.1",WIRE_TYPES:{}};f.WIRE_TYPES.VARINT=0;f.WIRE_TYPES.BITS64=1;f.WIRE_TYPES.LDELIM=2;f.WIRE_TYPES.STARTGROUP=3;f.WIRE_TYPES.ENDGROUP=4;f.WIRE_TYPES.BITS32=5;f.PACKABLE_WIRE_TYPES=[f.WIRE_TYPES.VARINT,f.WIRE_TYPES.BITS64,f.WIRE_TYPES.BITS32];f.TYPES={int32:{name:"int32",wireType:f.WIRE_TYPES.VARINT},uint32:{name:"uint32",wireType:f.WIRE_TYPES.VARINT},sint32:{name:"sint32",wireType:f.WIRE_TYPES.VARINT},int64:{name:"int64",wireType:f.WIRE_TYPES.VARINT},uint64:{name:"uint64",
(function(r){function s(g){var f={VERSION:"3.2.2",WIRE_TYPES:{}};f.WIRE_TYPES.VARINT=0;f.WIRE_TYPES.BITS64=1;f.WIRE_TYPES.LDELIM=2;f.WIRE_TYPES.STARTGROUP=3;f.WIRE_TYPES.ENDGROUP=4;f.WIRE_TYPES.BITS32=5;f.PACKABLE_WIRE_TYPES=[f.WIRE_TYPES.VARINT,f.WIRE_TYPES.BITS64,f.WIRE_TYPES.BITS32];f.TYPES={int32:{name:"int32",wireType:f.WIRE_TYPES.VARINT},uint32:{name:"uint32",wireType:f.WIRE_TYPES.VARINT},sint32:{name:"sint32",wireType:f.WIRE_TYPES.VARINT},int64:{name:"int64",wireType:f.WIRE_TYPES.VARINT},uint64:{name:"uint64",
wireType:f.WIRE_TYPES.VARINT},sint64:{name:"sint64",wireType:f.WIRE_TYPES.VARINT},bool:{name:"bool",wireType:f.WIRE_TYPES.VARINT},"double":{name:"double",wireType:f.WIRE_TYPES.BITS64},string:{name:"string",wireType:f.WIRE_TYPES.LDELIM},bytes:{name:"bytes",wireType:f.WIRE_TYPES.LDELIM},fixed32:{name:"fixed32",wireType:f.WIRE_TYPES.BITS32},sfixed32:{name:"sfixed32",wireType:f.WIRE_TYPES.BITS32},fixed64:{name:"fixed64",wireType:f.WIRE_TYPES.BITS64},sfixed64:{name:"sfixed64",wireType:f.WIRE_TYPES.BITS64},

@@ -28,11 +28,11 @@ "float":{name:"float",wireType:f.WIRE_TYPES.BITS32},"enum":{name:"enum",wireType:f.WIRE_TYPES.VARINT},message:{name:"message",wireType:f.WIRE_TYPES.LDELIM},group:{name:"group",wireType:f.WIRE_TYPES.STARTGROUP}};f.ID_MIN=1;f.ID_MAX=536870911;f.ByteBuffer=g;f.Long=g.Long||null;f.convertFieldsToCamelCase=!1;f.Util=function(){Object.create||(Object.create=function(d){function m(){}if(1<arguments.length)throw Error("Object.create polyfill only accepts the first parameter.");m.prototype=d;return new m});

(a.encoded=a.encoded.toBuffer()),a;}};c.prototype.toBuffer=c.prototype.encodeNB;c.prototype.encode64=function(){try{return this.encode().toBase64()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toBase64()),a;}};c.prototype.toBase64=c.prototype.encode64;c.prototype.encodeHex=function(){try{return this.encode().toHex()}catch(a){throw a.encoded&&(a.encoded=a.encoded.toHex()),a;}};c.prototype.toHex=c.prototype.encodeHex;c.prototype.toRaw=function(a){return d(this,!!a)};c.decode=function(a,d){"string"===
typeof a&&(a=g.wrap(a,d?d:"base64"));a=a instanceof g?a:g.wrap(a);var h=a.littleEndian;try{var c=b.decode(a.LE());a.LE(h);return c}catch(e){throw a.LE(h),e;}};c.decodeDelimited=function(a,d){"string"===typeof a&&(a=g.wrap(a,d?d:"base64"));a=a instanceof g?a:g.wrap(a);var h=a.readVarint32(),c=b.decode(a.slice(a.offset,a.offset+h).LE());a.offset+=h;return c};c.decode64=function(a){return c.decode(a,"base64")};c.decodeHex=function(a){return c.decode(a,"hex")};c.prototype.toString=function(){return b.toString()};
Object.defineProperty&&Object.defineProperty(c,"$options",{value:b.buildOpt()});return c}(d,this);for(var b=this.getChildren(),e=0;e<b.length;e++)if(b[e]instanceof l)a[b[e].name]=b[e].build();else if(b[e]instanceof c)a[b[e].name]=b[e].build();else if(!(b[e]instanceof c.Field))throw Error("Illegal reflect child of "+this.toString(!0)+": "+b[e].toString(!0));return this.clazz=a};c.prototype.encode=function(a,d){for(var b=this.getChildren(c.Field),e=null,k=0,l;k<b.length;k++)l=a.$get(b[k].name),b[k].required&&
null===l?null===e&&(e=b[k]):b[k].encode(l,d);if(null!==e)throw b=Error("Missing at least one required field for "+this.toString(!0)+": "+e),b.encoded=d,b;return d};c.prototype.calculate=function(a){for(var b=this.getChildren(c.Field),d=0,e=0,k;e<b.length;e++){k=a.$get(b[e].name);if(b[e].required&&null===k)throw Error("Missing at least one required field for "+this.toString(!0)+": "+b[e]);d+=b[e].calculate(k)}return d};c.prototype.decode=function(a,b,c){b="number"===typeof b?b:-1;for(var e=a.offset,
k=new this.clazz,l,m;a.offset<e+b||-1==b&&0<a.remaining();){l=a.readVarint32();m=l&7;l>>=3;if(m===d.WIRE_TYPES.ENDGROUP){if(l!==c)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+l+" ("+(c?c+" expected":"not a group")+")");break}var g=this.getChild(l);if(g)g.repeated&&!g.options.packed?k.$add(g.name,g.decode(m,a),!0):k.$set(g.name,g.decode(m,a),!0);else switch(m){case d.WIRE_TYPES.VARINT:a.readVarint32();break;case d.WIRE_TYPES.BITS32:a.offset+=4;break;case d.WIRE_TYPES.BITS64:a.offset+=
8;break;case d.WIRE_TYPES.LDELIM:m=a.readVarint32();a.offset+=m;break;case d.WIRE_TYPES.STARTGROUP:for(;f(l,a););break;default:throw Error("Illegal wire type for unknown field "+l+" in "+this.toString(!0)+"#decode: "+m);}}a=this.getChildren(d.Reflect.Field);for(b=0;b<a.length;b++)if(a[b].required&&null===k[a[b].name])throw a=Error("Missing at least one required field for "+this.toString(!0)+": "+a[b].name),a.decoded=k,a;return k};m.Message=c;var k=function(a,h,c,e,k,l){b.call(this,a,e);this.className=
"Message.Field";this.required="required"==h;this.repeated="repeated"==h;this.type=c;this.resolvedType=null;this.id=k;this.options=l||{};this.originalName=this.name;d.convertFieldsToCamelCase&&(this.name=this.name.replace(/_([a-zA-Z])/g,function(a,b){return b.toUpperCase()}))};k.prototype=Object.create(b.prototype);k.prototype.verifyValue=function(a,b){b=b||!1;var c=function(a,b){throw Error("Illegal value for "+this.toString(!0)+" of type "+this.type.name+": "+a+" ("+b+")");}.bind(this);if(null===
a)return this.required&&c(typeof a,"required"),null;var e;if(this.repeated&&!b){d.Util.isArray(a)||(a=[a]);c=[];for(e=0;e<a.length;e++)c.push(this.verifyValue(a[e],!0));return c}!this.repeated&&d.Util.isArray(a)&&c(typeof a,"no array expected");switch(this.type){case d.TYPES.int32:case d.TYPES.sint32:case d.TYPES.sfixed32:return("number"!==typeof a||a===a&&0!==a%1)&&c(typeof a,"not an integer"),4294967295<a?a|0:a;case d.TYPES.uint32:case d.TYPES.fixed32:return("number"!==typeof a||a===a&&0!==a%1)&&
c(typeof a,"not an integer"),0>a?a>>>0:a;case d.TYPES.int64:case d.TYPES.sint64:case d.TYPES.sfixed64:if(d.Long)try{return p(a,!1)}catch(k){c(typeof a,k.message)}else c(typeof a,"requires Long.js");case d.TYPES.uint64:case d.TYPES.fixed64:if(d.Long)try{return p(a,!0)}catch(m){c(typeof a,m.message)}else c(typeof a,"requires Long.js");case d.TYPES.bool:return"boolean"!==typeof a&&c(typeof a,"not a boolean"),a;case d.TYPES["float"]:case d.TYPES["double"]:return"number"!==typeof a&&c(typeof a,"not a number"),
a;case d.TYPES.string:return"string"===typeof a||a&&a instanceof String||c(typeof a,"not a string"),""+a;case d.TYPES.bytes:return a&&a instanceof g?a:g.wrap(a);case d.TYPES["enum"]:var f=this.resolvedType.getChildren(l.Value);for(e=0;e<f.length;e++)if(f[e].name==a||f[e].id==a)return f[e].id;c(a,"not a valid enum value");case d.TYPES.group:case d.TYPES.message:return a&&"object"===typeof a||c(typeof a,"object expected"),a instanceof this.resolvedType.clazz?a:new this.resolvedType.clazz(a)}throw Error("[INTERNAL] Illegal value for "+
typeof a&&(a=g.wrap(a,d?d:"base64"));a=a instanceof g?a:g.wrap(a);var h=a.littleEndian;try{var c=b.decode(a.LE());a.LE(h);return c}catch(e){throw a.LE(h),e;}};c.decodeDelimited=function(a,d){"string"===typeof a&&(a=g.wrap(a,d?d:"base64"));a=a instanceof g?a:g.wrap(a);if(1>a.remaining())return null;var h=a.offset,c=a.readVarint32();if(a.remaining()<c)return a.offset=h,null;try{var e=b.decode(a.slice(a.offset,a.offset+c).LE());a.offset+=c;return e}catch(t){throw a.offset+=c,t;}};c.decode64=function(a){return c.decode(a,
"base64")};c.decodeHex=function(a){return c.decode(a,"hex")};c.prototype.toString=function(){return b.toString()};Object.defineProperty&&Object.defineProperty(c,"$options",{value:b.buildOpt()});return c}(d,this);for(var b=this.getChildren(),e=0;e<b.length;e++)if(b[e]instanceof l)a[b[e].name]=b[e].build();else if(b[e]instanceof c)a[b[e].name]=b[e].build();else if(!(b[e]instanceof c.Field))throw Error("Illegal reflect child of "+this.toString(!0)+": "+b[e].toString(!0));return this.clazz=a};c.prototype.encode=
function(a,d){for(var b=this.getChildren(c.Field),e=null,k=0,l;k<b.length;k++)l=a.$get(b[k].name),b[k].required&&null===l?null===e&&(e=b[k]):b[k].encode(l,d);if(null!==e)throw b=Error("Missing at least one required field for "+this.toString(!0)+": "+e),b.encoded=d,b;return d};c.prototype.calculate=function(a){for(var b=this.getChildren(c.Field),d=0,e=0,k;e<b.length;e++){k=a.$get(b[e].name);if(b[e].required&&null===k)throw Error("Missing at least one required field for "+this.toString(!0)+": "+b[e]);
d+=b[e].calculate(k)}return d};c.prototype.decode=function(a,b,c){b="number"===typeof b?b:-1;for(var e=a.offset,k=new this.clazz,l,m;a.offset<e+b||-1==b&&0<a.remaining();){l=a.readVarint32();m=l&7;l>>=3;if(m===d.WIRE_TYPES.ENDGROUP){if(l!==c)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+l+" ("+(c?c+" expected":"not a group")+")");break}var g=this.getChild(l);if(g)g.repeated&&!g.options.packed?k.$add(g.name,g.decode(m,a),!0):k.$set(g.name,g.decode(m,a),!0);else switch(m){case d.WIRE_TYPES.VARINT:a.readVarint32();
break;case d.WIRE_TYPES.BITS32:a.offset+=4;break;case d.WIRE_TYPES.BITS64:a.offset+=8;break;case d.WIRE_TYPES.LDELIM:m=a.readVarint32();a.offset+=m;break;case d.WIRE_TYPES.STARTGROUP:for(;f(l,a););break;default:throw Error("Illegal wire type for unknown field "+l+" in "+this.toString(!0)+"#decode: "+m);}}a=this.getChildren(d.Reflect.Field);for(b=0;b<a.length;b++)if(a[b].required&&null===k[a[b].name])throw a=Error("Missing at least one required field for "+this.toString(!0)+": "+a[b].name),a.decoded=
k,a;return k};m.Message=c;var k=function(a,h,c,e,k,l){b.call(this,a,e);this.className="Message.Field";this.required="required"==h;this.repeated="repeated"==h;this.type=c;this.resolvedType=null;this.id=k;this.options=l||{};this.originalName=this.name;d.convertFieldsToCamelCase&&(this.name=this.name.replace(/_([a-zA-Z])/g,function(a,b){return b.toUpperCase()}))};k.prototype=Object.create(b.prototype);k.prototype.verifyValue=function(a,b){b=b||!1;var c=function(a,b){throw Error("Illegal value for "+
this.toString(!0)+" of type "+this.type.name+": "+a+" ("+b+")");}.bind(this);if(null===a)return this.required&&c(typeof a,"required"),null;var e;if(this.repeated&&!b){d.Util.isArray(a)||(a=[a]);c=[];for(e=0;e<a.length;e++)c.push(this.verifyValue(a[e],!0));return c}!this.repeated&&d.Util.isArray(a)&&c(typeof a,"no array expected");switch(this.type){case d.TYPES.int32:case d.TYPES.sint32:case d.TYPES.sfixed32:return("number"!==typeof a||a===a&&0!==a%1)&&c(typeof a,"not an integer"),4294967295<a?a|0:
a;case d.TYPES.uint32:case d.TYPES.fixed32:return("number"!==typeof a||a===a&&0!==a%1)&&c(typeof a,"not an integer"),0>a?a>>>0:a;case d.TYPES.int64:case d.TYPES.sint64:case d.TYPES.sfixed64:if(d.Long)try{return p(a,!1)}catch(k){c(typeof a,k.message)}else c(typeof a,"requires Long.js");case d.TYPES.uint64:case d.TYPES.fixed64:if(d.Long)try{return p(a,!0)}catch(m){c(typeof a,m.message)}else c(typeof a,"requires Long.js");case d.TYPES.bool:return"boolean"!==typeof a&&c(typeof a,"not a boolean"),a;case d.TYPES["float"]:case d.TYPES["double"]:return"number"!==
typeof a&&c(typeof a,"not a number"),a;case d.TYPES.string:return"string"===typeof a||a&&a instanceof String||c(typeof a,"not a string"),""+a;case d.TYPES.bytes:return a&&a instanceof g?a:g.wrap(a);case d.TYPES["enum"]:var f=this.resolvedType.getChildren(l.Value);for(e=0;e<f.length;e++)if(f[e].name==a||f[e].id==a)return f[e].id;c(a,"not a valid enum value");case d.TYPES.group:case d.TYPES.message:return a&&"object"===typeof a||c(typeof a,"object expected"),a instanceof this.resolvedType.clazz?a:new this.resolvedType.clazz(a)}throw Error("[INTERNAL] Illegal value for "+
this.toString(!0)+": "+a+" (undefined type "+this.type+")");};k.prototype.encode=function(a,b){a=this.verifyValue(a);if(null===this.type||"object"!==typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===a||this.repeated&&0==a.length)return b;try{if(this.repeated){var c;if(this.options.packed&&0<=d.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)){b.writeVarint32(this.id<<3|d.WIRE_TYPES.LDELIM);b.ensureCapacity(b.offset+=1);var e=b.offset;for(c=0;c<

@@ -46,7 +46,7 @@ a.length;c++)this.encodeValue(a[c],b);var k=b.offset-e,l=g.calculateVarint32(k);if(1<l){var m=b.slice(e,b.offset),e=e+(l-1);b.offset=e;b.append(m)}b.writeVarint32(k,e-l)}else for(c=0;c<a.length;c++)b.writeVarint32(this.id<<3|this.type.wireType),this.encodeValue(a[c],b)}else b.writeVarint32(this.id<<3|this.type.wireType),this.encodeValue(a,b)}catch(f){throw Error("Illegal value for "+this.toString(!0)+": "+a+" ("+f+")");}return b};k.prototype.encodeValue=function(a,b){if(null===a)return b;switch(this.type){case d.TYPES.int32:0>

case d.TYPES.bool:return 1;case d.TYPES["enum"]:return g.calculateVarint32(a);case d.TYPES["double"]:return 8;case d.TYPES.string:return a=g.calculateUTF8Bytes(a),g.calculateVarint32(a)+a;case d.TYPES.bytes:if(0>a.remaining())throw Error("Illegal value for "+this.toString(!0)+": "+a.remaining()+" bytes remaining");return g.calculateVarint32(a.remaining())+a.remaining();case d.TYPES.message:return a=this.resolvedType.calculate(a),g.calculateVarint32(a)+a;case d.TYPES.group:return a=this.resolvedType.calculate(a),
a+g.calculateVarint32(this.id<<3|d.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+a+" (unknown type)");};k.prototype.decode=function(a,b,c){if(a!=this.type.wireType&&(c||a!=d.WIRE_TYPES.LDELIM||!this.repeated))throw Error("Illegal wire type for field "+this.toString(!0)+": "+a+" ("+this.type.wireType+" expected)");if(a==d.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&!c){a=b.readVarint32();a=b.offset+a;for(c=[];b.offset<a;)c.push(this.decode(this.type.wireType,
b,!0));return c}switch(this.type){case d.TYPES.int32:return b.readVarint32()|0;case d.TYPES.uint32:return b.readVarint32()>>>0;case d.TYPES.sint32:return b.readVarint32ZigZag()|0;case d.TYPES.fixed32:return b.readUint32()>>>0;case d.TYPES.sfixed32:return b.readInt32()|0;case d.TYPES.int64:return b.readVarint64();case d.TYPES.uint64:return b.readVarint64().toUnsigned();case d.TYPES.sint64:return b.readVarint64ZigZag();case d.TYPES.fixed64:return b.readUint64();case d.TYPES.sfixed64:return b.readInt64();
case d.TYPES.bool:return!!b.readVarint32();case d.TYPES["enum"]:return b.readVarint32();case d.TYPES["float"]:return b.readFloat();case d.TYPES["double"]:return b.readDouble();case d.TYPES.string:return b.readVString();case d.TYPES.bytes:a=b.readVarint32();if(b.remaining()<a)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+a+" required but got only "+b.remaining());c=b.clone();c.limit=c.offset+a;b.offset+=a;return c;case d.TYPES.message:return a=b.readVarint32(),this.resolvedType.decode(b,
a);case d.TYPES.group:return this.resolvedType.decode(b,-1,this.id)}throw Error("[INTERNAL] Illegal wire type for "+this.toString(!0)+": "+a);};m.Message.Field=k;var q=function(a,b,c,d,e,l){k.call(this,a,b,c,d,e,l)};q.prototype=Object.create(k.prototype);m.Message.ExtensionField=q;var l=function(a,b,c){e.call(this,a,b,c);this.className="Enum";this.object=null};l.prototype=Object.create(e.prototype);l.prototype.build=function(){for(var a={},b=this.getChildren(l.Value),c=0;c<b.length;c++)a[b[c].name]=
b[c].id;Object.defineProperty&&Object.defineProperty(a,"$options",{value:this.buildOpt()});return this.object=a};m.Enum=l;q=function(a,c,d){b.call(this,a,c);this.className="Enum.Value";this.id=d};q.prototype=Object.create(b.prototype);m.Enum.Value=q;q=function(a,b,c){e.call(this,a,b,c);this.className="Service";this.clazz=null};q.prototype=Object.create(e.prototype);q.prototype.build=function(a){return this.clazz&&!a?this.clazz:this.clazz=function(a,b){var c=function(b){a.Builder.Service.call(this);
a+g.calculateVarint32(this.id<<3|d.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+a+" (unknown type)");};k.prototype.decode=function(a,b,c){if(a!=this.type.wireType&&(c||a!=d.WIRE_TYPES.LDELIM||!this.repeated))throw Error("Illegal wire type for field "+this.toString(!0)+": "+a+" ("+this.type.wireType+" expected)");if(a==d.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&0<=d.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)&&!c){a=b.readVarint32();
a=b.offset+a;for(c=[];b.offset<a;)c.push(this.decode(this.type.wireType,b,!0));return c}switch(this.type){case d.TYPES.int32:return b.readVarint32()|0;case d.TYPES.uint32:return b.readVarint32()>>>0;case d.TYPES.sint32:return b.readVarint32ZigZag()|0;case d.TYPES.fixed32:return b.readUint32()>>>0;case d.TYPES.sfixed32:return b.readInt32()|0;case d.TYPES.int64:return b.readVarint64();case d.TYPES.uint64:return b.readVarint64().toUnsigned();case d.TYPES.sint64:return b.readVarint64ZigZag();case d.TYPES.fixed64:return b.readUint64();
case d.TYPES.sfixed64:return b.readInt64();case d.TYPES.bool:return!!b.readVarint32();case d.TYPES["enum"]:return b.readVarint32();case d.TYPES["float"]:return b.readFloat();case d.TYPES["double"]:return b.readDouble();case d.TYPES.string:return b.readVString();case d.TYPES.bytes:a=b.readVarint32();if(b.remaining()<a)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+a+" required but got only "+b.remaining());c=b.clone();c.limit=c.offset+a;b.offset+=a;return c;case d.TYPES.message:return a=
b.readVarint32(),this.resolvedType.decode(b,a);case d.TYPES.group:return this.resolvedType.decode(b,-1,this.id)}throw Error("[INTERNAL] Illegal wire type for "+this.toString(!0)+": "+a);};m.Message.Field=k;var q=function(a,b,c,d,e,l){k.call(this,a,b,c,d,e,l)};q.prototype=Object.create(k.prototype);m.Message.ExtensionField=q;var l=function(a,b,c){e.call(this,a,b,c);this.className="Enum";this.object=null};l.prototype=Object.create(e.prototype);l.prototype.build=function(){for(var a={},b=this.getChildren(l.Value),
c=0;c<b.length;c++)a[b[c].name]=b[c].id;Object.defineProperty&&Object.defineProperty(a,"$options",{value:this.buildOpt()});return this.object=a};m.Enum=l;q=function(a,c,d){b.call(this,a,c);this.className="Enum.Value";this.id=d};q.prototype=Object.create(b.prototype);m.Enum.Value=q;q=function(a,b,c){e.call(this,a,b,c);this.className="Service";this.clazz=null};q.prototype=Object.create(e.prototype);q.prototype.build=function(a){return this.clazz&&!a?this.clazz:this.clazz=function(a,b){var c=function(b){a.Builder.Service.call(this);
this.rpcImpl=b||function(a,b,c){setTimeout(c.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}};c.prototype=Object.create(a.Builder.Service.prototype);Object.defineProperty&&(Object.defineProperty(c,"$options",{value:b.buildOpt()}),Object.defineProperty(c.prototype,"$options",{value:c.$options}));for(var d=b.getChildren(a.Reflect.Service.RPCMethod),e=0;e<d.length;e++)(function(a){c.prototype[a.name]=function(c,d){try{c&&c instanceof a.resolvedRequestType.clazz?

@@ -53,0 +53,0 @@ this.rpcImpl(a.fqn(),c,function(c,e){if(c)d(c);else{try{e=a.resolvedResponseType.clazz.decode(e)}catch(h){}e&&e instanceof a.resolvedResponseType.clazz?d(null,e):d(Error("Illegal response type received in service method "+b.name+"#"+a.name))}}):setTimeout(d.bind(this,Error("Illegal request type provided to service method "+b.name+"#"+a.name)),0)}catch(e){setTimeout(d.bind(this,e),0)}};c[a.name]=function(b,d,e){(new c(b))[a.name](d,e)};Object.defineProperty&&(Object.defineProperty(c[a.name],"$options",

{
"name": "protobufjs",
"version": "3.2.1",
"version": "3.2.2",
"description": "Protocol Buffers for JavaScript. Finally.",

@@ -5,0 +5,0 @@ "author": "Daniel Wirtz <dcode@dcode.io>",

@@ -468,3 +468,3 @@ /*?

* @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64
* @return {!ProtoBuf.Builder.Message} Decoded message
* @return {ProtoBuf.Builder.Message} Decoded message or `null` if not enough bytes are available yet
* @throws {Error} If the message cannot be decoded or if required fields are missing. The later still

@@ -478,6 +478,18 @@ * returns the decoded message with missing fields in the `decoded` property on the error.

buffer = buffer instanceof ByteBuffer ? buffer : ByteBuffer.wrap(buffer); // May throw
var len = buffer.readVarint32();
var msg = T.decode(buffer.slice(buffer.offset, buffer.offset + len).LE());
buffer.offset += len;
return msg;
if (buffer.remaining() < 1)
return null;
var off = buffer.offset,
len = buffer.readVarint32();
if (buffer.remaining() < len) {
buffer.offset = off;
return null;
}
try {
var msg = T.decode(buffer.slice(buffer.offset, buffer.offset + len).LE());
buffer.offset += len;
return msg;
} catch (err) {
buffer.offset += len;
throw err;
}
};

@@ -484,0 +496,0 @@

@@ -511,3 +511,3 @@ /**

throw Error("Illegal wire type for field "+this.toString(true)+": "+wireType+" ("+this.type.wireType+" expected)");
if (wireType == ProtoBuf.WIRE_TYPES.LDELIM && this.repeated && this.options["packed"]) {
if (wireType == ProtoBuf.WIRE_TYPES.LDELIM && this.repeated && this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
if (!skipRepeated) {

@@ -514,0 +514,0 @@ nBytes = buffer.readVarint32();

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc