protobufjs 7.6.5 → 7.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/light/protobuf.js +59 -6
- package/dist/light/protobuf.js.map +1 -1
- package/dist/light/protobuf.min.js +3 -3
- package/dist/light/protobuf.min.js.map +1 -1
- package/dist/minimal/protobuf.js +22 -2
- package/dist/minimal/protobuf.js.map +1 -1
- package/dist/minimal/protobuf.min.js +3 -3
- package/dist/minimal/protobuf.min.js.map +1 -1
- package/dist/protobuf.js +59 -6
- package/dist/protobuf.js.map +1 -1
- package/dist/protobuf.min.js +3 -3
- package/dist/protobuf.min.js.map +1 -1
- package/package.json +1 -1
- package/src/decoder.js +32 -3
- package/src/reader.js +20 -0
- package/src/wrappers.js +5 -1
package/dist/protobuf.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* protobuf.js v7.6.
|
|
3
|
-
* compiled
|
|
2
|
+
* protobuf.js v7.6.6 (c) 2016, daniel wirtz
|
|
3
|
+
* compiled thu, 27 aug 2026 10:13:18 utc
|
|
4
4
|
* licensed under the bsd-3-clause license
|
|
5
5
|
* see: https://github.com/dcodeio/protobuf.js for details
|
|
6
6
|
*/
|
|
@@ -1869,7 +1869,17 @@ function decoder(mtype) {
|
|
|
1869
1869
|
("if(n===undefined)n=0")
|
|
1870
1870
|
("if(n>Reader.recursionLimit)")
|
|
1871
1871
|
("throw Error(\"maximum nesting depth exceeded\")")
|
|
1872
|
-
("var c
|
|
1872
|
+
("var c,m" + (mtype.fieldsArray.filter(function(field) { return field.map; }).length ? ",k,value" : ""))
|
|
1873
|
+
("if(l===undefined)")
|
|
1874
|
+
("c=r.len")
|
|
1875
|
+
("else{")
|
|
1876
|
+
("c=r.pos+l")
|
|
1877
|
+
("if(c>r.len)")
|
|
1878
|
+
("throw RangeError(\"index out of range\")")
|
|
1879
|
+
("l=r.len")
|
|
1880
|
+
("r.len=c")
|
|
1881
|
+
("}")
|
|
1882
|
+
("m=new this.ctor")
|
|
1873
1883
|
("while(r.pos<c){")
|
|
1874
1884
|
("var t=r.uint32()")
|
|
1875
1885
|
("if(t===e)")
|
|
@@ -1887,7 +1897,10 @@ function decoder(mtype) {
|
|
|
1887
1897
|
if (field.map) { gen
|
|
1888
1898
|
("if(%s===util.emptyObject)", ref)
|
|
1889
1899
|
("%s={}", ref)
|
|
1890
|
-
("var c2
|
|
1900
|
+
("var c2=r.uint32()+r.pos")
|
|
1901
|
+
("if(c2>r.len)")
|
|
1902
|
+
("throw RangeError(\"index out of range\")")
|
|
1903
|
+
("r.len=c2");
|
|
1891
1904
|
|
|
1892
1905
|
if (types.defaults[field.keyType] !== undefined) gen
|
|
1893
1906
|
("k=%j", types.defaults[field.keyType]);
|
|
@@ -1917,7 +1930,10 @@ function decoder(mtype) {
|
|
|
1917
1930
|
("r.skipType(tag2&7,n)")
|
|
1918
1931
|
("break")
|
|
1919
1932
|
("}")
|
|
1920
|
-
("}")
|
|
1933
|
+
("}")
|
|
1934
|
+
("if(r.pos!==c2)")
|
|
1935
|
+
("throw RangeError(\"index out of range\")")
|
|
1936
|
+
("r.len=c");
|
|
1921
1937
|
|
|
1922
1938
|
if (types.long[field.keyType] !== undefined) gen
|
|
1923
1939
|
("%s[typeof k===\"object\"?util.longToHash(k):k]=value", ref);
|
|
@@ -1939,8 +1955,14 @@ function decoder(mtype) {
|
|
|
1939
1955
|
if (types.packed[type] !== undefined) gen
|
|
1940
1956
|
("if((t&7)===2){")
|
|
1941
1957
|
("var c2=r.uint32()+r.pos")
|
|
1958
|
+
("if(c2>r.len)")
|
|
1959
|
+
("throw RangeError(\"index out of range\")")
|
|
1960
|
+
("r.len=c2")
|
|
1942
1961
|
("while(r.pos<c2)")
|
|
1943
1962
|
("%s.push(r.%s())", ref, type)
|
|
1963
|
+
("if(r.pos!==c2)")
|
|
1964
|
+
("throw RangeError(\"index out of range\")")
|
|
1965
|
+
("r.len=c")
|
|
1944
1966
|
("}else");
|
|
1945
1967
|
|
|
1946
1968
|
// Non-packed
|
|
@@ -1968,6 +1990,13 @@ function decoder(mtype) {
|
|
|
1968
1990
|
("}")
|
|
1969
1991
|
("}");
|
|
1970
1992
|
|
|
1993
|
+
gen
|
|
1994
|
+
("if(l!==undefined){")
|
|
1995
|
+
("if(r.pos!==c)")
|
|
1996
|
+
("throw RangeError(\"index out of range\")")
|
|
1997
|
+
("r.len=l")
|
|
1998
|
+
("}");
|
|
1999
|
+
|
|
1971
2000
|
// Field presence
|
|
1972
2001
|
for (i = 0; i < mtype._fieldsArray.length; ++i) {
|
|
1973
2002
|
var rfield = mtype._fieldsArray[i];
|
|
@@ -5605,6 +5634,20 @@ Reader.create = create();
|
|
|
5605
5634
|
|
|
5606
5635
|
Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;
|
|
5607
5636
|
|
|
5637
|
+
function readVarint32NearEnd(reader) {
|
|
5638
|
+
// Safely read up to four bytes of a varint32 near the reader limit
|
|
5639
|
+
var value = 0;
|
|
5640
|
+
for (var i = 0; i < 4; ++i) {
|
|
5641
|
+
if (reader.pos >= reader.len)
|
|
5642
|
+
throw indexOutOfRange(reader);
|
|
5643
|
+
var b = reader.buf[reader.pos++];
|
|
5644
|
+
value = (value | (b & 127) << i * 7) >>> 0;
|
|
5645
|
+
if (b < 128)
|
|
5646
|
+
return value;
|
|
5647
|
+
}
|
|
5648
|
+
throw indexOutOfRange(reader);
|
|
5649
|
+
}
|
|
5650
|
+
|
|
5608
5651
|
/**
|
|
5609
5652
|
* Reads a varint as an unsigned 32 bit value.
|
|
5610
5653
|
* @function
|
|
@@ -5613,6 +5656,12 @@ Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore ne
|
|
|
5613
5656
|
Reader.prototype.uint32 = (function read_uint32_setup() {
|
|
5614
5657
|
var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)
|
|
5615
5658
|
return function read_uint32() {
|
|
5659
|
+
if (this.len - this.pos < 5) {
|
|
5660
|
+
if (this.pos >= this.len)
|
|
5661
|
+
throw indexOutOfRange(this);
|
|
5662
|
+
if (this.buf[this.pos] >= 128)
|
|
5663
|
+
return readVarint32NearEnd(this);
|
|
5664
|
+
}
|
|
5616
5665
|
value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;
|
|
5617
5666
|
value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;
|
|
5618
5667
|
value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;
|
|
@@ -9240,6 +9289,10 @@ var Message = require(22),
|
|
|
9240
9289
|
wrappers[".google.protobuf.Any"] = {
|
|
9241
9290
|
|
|
9242
9291
|
fromObject: function(object, depth) {
|
|
9292
|
+
if (depth === undefined)
|
|
9293
|
+
depth = 0;
|
|
9294
|
+
if (depth > util.recursionLimit)
|
|
9295
|
+
throw Error("max depth exceeded");
|
|
9243
9296
|
|
|
9244
9297
|
// unwrap value type if mapped
|
|
9245
9298
|
if (object && object["@type"]) {
|
|
@@ -9257,7 +9310,7 @@ wrappers[".google.protobuf.Any"] = {
|
|
|
9257
9310
|
}
|
|
9258
9311
|
return this.create({
|
|
9259
9312
|
type_url: type_url,
|
|
9260
|
-
value: type.encode(type.fromObject(object, depth
|
|
9313
|
+
value: type.encode(type.fromObject(object, depth + 1)).finish()
|
|
9261
9314
|
});
|
|
9262
9315
|
}
|
|
9263
9316
|
}
|