protobufjs 7.5.5 → 7.5.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 +230 -108
- 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 +90 -38
- 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 +234 -111
- package/dist/protobuf.js.map +1 -1
- package/dist/protobuf.min.js +3 -3
- package/dist/protobuf.min.js.map +1 -1
- package/ext/descriptor/index.d.ts +4 -0
- package/ext/descriptor/index.js +35 -16
- package/index.d.ts +22 -4
- package/package.json +7 -4
- package/src/converter.js +14 -5
- package/src/decoder.js +17 -9
- package/src/enum.js +4 -1
- package/src/namespace.js +10 -6
- package/src/object.js +4 -0
- package/src/parse.js +4 -3
- package/src/reader.js +12 -2
- package/src/service.js +8 -4
- package/src/type.js +22 -12
- package/src/types.js +1 -1
- package/src/util/minimal.js +24 -1
- package/src/util/patterns.js +8 -0
- package/src/util.js +9 -9
- package/src/verifier.js +7 -4
- package/src/wrappers.js +4 -3
package/dist/protobuf.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* protobuf.js v7.5.
|
|
3
|
-
* compiled
|
|
2
|
+
* protobuf.js v7.5.6 (c) 2016, daniel wirtz
|
|
3
|
+
* compiled tue, 28 apr 2026 00:45:19 utc
|
|
4
4
|
* licensed under the bsd-3-clause license
|
|
5
5
|
* see: https://github.com/dcodeio/protobuf.js for details
|
|
6
6
|
*/
|
|
@@ -236,6 +236,8 @@ base64.test = function test(string) {
|
|
|
236
236
|
"use strict";
|
|
237
237
|
module.exports = codegen;
|
|
238
238
|
|
|
239
|
+
var reservedRe = /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/;
|
|
240
|
+
|
|
239
241
|
/**
|
|
240
242
|
* Begins generating a function.
|
|
241
243
|
* @memberof util
|
|
@@ -310,7 +312,7 @@ function codegen(functionParams, functionName) {
|
|
|
310
312
|
}
|
|
311
313
|
|
|
312
314
|
function toString(functionNameOverride) {
|
|
313
|
-
return "function " + (functionNameOverride || functionName
|
|
315
|
+
return "function " + safeFunctionName(functionNameOverride || functionName) + "(" + (functionParams && functionParams.join(",") || "") + "){\n " + body.join("\n ") + "\n}";
|
|
314
316
|
}
|
|
315
317
|
|
|
316
318
|
Codegen.toString = toString;
|
|
@@ -332,6 +334,17 @@ function codegen(functionParams, functionName) {
|
|
|
332
334
|
* @type {boolean}
|
|
333
335
|
*/
|
|
334
336
|
codegen.verbose = false;
|
|
337
|
+
|
|
338
|
+
function safeFunctionName(name) {
|
|
339
|
+
if (!name)
|
|
340
|
+
return "";
|
|
341
|
+
name = String(name).replace(/[^\w$]/g, "");
|
|
342
|
+
if (!name)
|
|
343
|
+
return "";
|
|
344
|
+
if (/^\d/.test(name))
|
|
345
|
+
name = "_" + name;
|
|
346
|
+
return reservedRe.test(name) ? name + "_" : name;
|
|
347
|
+
}
|
|
335
348
|
|
|
336
349
|
},{}],4:[function(require,module,exports){
|
|
337
350
|
"use strict";
|
|
@@ -876,13 +889,33 @@ module.exports = inquire;
|
|
|
876
889
|
* @returns {?Object} Required module if available and not empty, otherwise `null`
|
|
877
890
|
*/
|
|
878
891
|
function inquire(moduleName) {
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
892
|
+
try {
|
|
893
|
+
if (typeof require !== "function") {
|
|
894
|
+
return null;
|
|
895
|
+
}
|
|
896
|
+
var mod = require(moduleName);
|
|
897
|
+
if (mod && (mod.length || Object.keys(mod).length)) return mod;
|
|
898
|
+
return null;
|
|
899
|
+
} catch (err) {
|
|
900
|
+
// ignore
|
|
884
901
|
return null;
|
|
902
|
+
}
|
|
885
903
|
}
|
|
904
|
+
|
|
905
|
+
/*
|
|
906
|
+
// maybe worth a shot to prevent renaming issues:
|
|
907
|
+
// see: https://github.com/webpack/webpack/blob/master/lib/dependencies/CommonJsRequireDependencyParserPlugin.js
|
|
908
|
+
// triggers on:
|
|
909
|
+
// - expression require.cache
|
|
910
|
+
// - expression require (???)
|
|
911
|
+
// - call require
|
|
912
|
+
// - call require:commonjs:item
|
|
913
|
+
// - call require:commonjs:context
|
|
914
|
+
|
|
915
|
+
Object.defineProperty(Function.prototype, "__self", { get: function() { return this; } });
|
|
916
|
+
var r = require.__self;
|
|
917
|
+
delete Function.prototype.__self;
|
|
918
|
+
*/
|
|
886
919
|
|
|
887
920
|
},{}],8:[function(require,module,exports){
|
|
888
921
|
"use strict";
|
|
@@ -1009,7 +1042,8 @@ function pool(alloc, slice, size) {
|
|
|
1009
1042
|
* @memberof util
|
|
1010
1043
|
* @namespace
|
|
1011
1044
|
*/
|
|
1012
|
-
var utf8 = exports
|
|
1045
|
+
var utf8 = exports,
|
|
1046
|
+
replacementChar = "\ufffd";
|
|
1013
1047
|
|
|
1014
1048
|
/**
|
|
1015
1049
|
* Calculates the UTF8 byte length of a string.
|
|
@@ -1042,36 +1076,34 @@ utf8.length = function utf8_length(string) {
|
|
|
1042
1076
|
* @returns {string} String read
|
|
1043
1077
|
*/
|
|
1044
1078
|
utf8.read = function utf8_read(buffer, start, end) {
|
|
1045
|
-
|
|
1046
|
-
if (len < 1)
|
|
1079
|
+
if (end - start < 1) {
|
|
1047
1080
|
return "";
|
|
1048
|
-
var parts = null,
|
|
1049
|
-
chunk = [],
|
|
1050
|
-
i = 0, // char offset
|
|
1051
|
-
t; // temporary
|
|
1052
|
-
while (start < end) {
|
|
1053
|
-
t = buffer[start++];
|
|
1054
|
-
if (t < 128)
|
|
1055
|
-
chunk[i++] = t;
|
|
1056
|
-
else if (t > 191 && t < 224)
|
|
1057
|
-
chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;
|
|
1058
|
-
else if (t > 239 && t < 365) {
|
|
1059
|
-
t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;
|
|
1060
|
-
chunk[i++] = 0xD800 + (t >> 10);
|
|
1061
|
-
chunk[i++] = 0xDC00 + (t & 1023);
|
|
1062
|
-
} else
|
|
1063
|
-
chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;
|
|
1064
|
-
if (i > 8191) {
|
|
1065
|
-
(parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
|
|
1066
|
-
i = 0;
|
|
1067
|
-
}
|
|
1068
1081
|
}
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1082
|
+
|
|
1083
|
+
var str = "";
|
|
1084
|
+
for (var i = start; i < end;) {
|
|
1085
|
+
var t = buffer[i++];
|
|
1086
|
+
if (t <= 0x7F) {
|
|
1087
|
+
str += String.fromCharCode(t);
|
|
1088
|
+
} else if (t >= 0xC0 && t < 0xE0) {
|
|
1089
|
+
var c2 = (t & 0x1F) << 6 | buffer[i++] & 0x3F;
|
|
1090
|
+
str += c2 >= 0x80 ? String.fromCharCode(c2) : replacementChar;
|
|
1091
|
+
} else if (t >= 0xE0 && t < 0xF0) {
|
|
1092
|
+
var c3 = (t & 0xF) << 12 | (buffer[i++] & 0x3F) << 6 | buffer[i++] & 0x3F;
|
|
1093
|
+
str += c3 >= 0x800 ? String.fromCharCode(c3) : replacementChar;
|
|
1094
|
+
} else if (t >= 0xF0) {
|
|
1095
|
+
var t2 = (t & 7) << 18 | (buffer[i++] & 0x3F) << 12 | (buffer[i++] & 0x3F) << 6 | buffer[i++] & 0x3F;
|
|
1096
|
+
if (t2 < 0x10000 || t2 > 0x10FFFF)
|
|
1097
|
+
str += replacementChar;
|
|
1098
|
+
else {
|
|
1099
|
+
t2 -= 0x10000;
|
|
1100
|
+
str += String.fromCharCode(0xD800 + (t2 >> 10));
|
|
1101
|
+
str += String.fromCharCode(0xDC00 + (t2 & 0x3FF));
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1073
1104
|
}
|
|
1074
|
-
|
|
1105
|
+
|
|
1106
|
+
return str;
|
|
1075
1107
|
};
|
|
1076
1108
|
|
|
1077
1109
|
/**
|
|
@@ -1555,7 +1587,7 @@ function genValuePartial_fromObject(gen, field, fieldIndex, prop) {
|
|
|
1555
1587
|
} else gen
|
|
1556
1588
|
("if(typeof d%s!==\"object\")", prop)
|
|
1557
1589
|
("throw TypeError(%j)", field.fullName + ": object expected")
|
|
1558
|
-
("m%s=types[%i].fromObject(d%s)", prop, fieldIndex, prop);
|
|
1590
|
+
("m%s=types[%i].fromObject(d%s,n+1)", prop, fieldIndex, prop);
|
|
1559
1591
|
} else {
|
|
1560
1592
|
var isUnsigned = false;
|
|
1561
1593
|
switch (field.type) {
|
|
@@ -1617,9 +1649,12 @@ function genValuePartial_fromObject(gen, field, fieldIndex, prop) {
|
|
|
1617
1649
|
converter.fromObject = function fromObject(mtype) {
|
|
1618
1650
|
/* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */
|
|
1619
1651
|
var fields = mtype.fieldsArray;
|
|
1620
|
-
var gen = util.codegen(["d"], mtype.name + "$fromObject")
|
|
1652
|
+
var gen = util.codegen(["d", "n"], mtype.name + "$fromObject")
|
|
1621
1653
|
("if(d instanceof this.ctor)")
|
|
1622
|
-
("return d")
|
|
1654
|
+
("return d")
|
|
1655
|
+
("if(n===undefined)n=0")
|
|
1656
|
+
("if(n>util.recursionLimit)")
|
|
1657
|
+
("throw Error(\"maximum nesting depth exceeded\")");
|
|
1623
1658
|
if (!fields.length) return gen
|
|
1624
1659
|
("return new this.ctor");
|
|
1625
1660
|
gen
|
|
@@ -1635,6 +1670,9 @@ converter.fromObject = function fromObject(mtype) {
|
|
|
1635
1670
|
("throw TypeError(%j)", field.fullName + ": object expected")
|
|
1636
1671
|
("m%s={}", prop)
|
|
1637
1672
|
("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){", prop);
|
|
1673
|
+
gen
|
|
1674
|
+
("if(ks[i]===\"__proto__\")")
|
|
1675
|
+
("util.makeProp(m%s,ks[i])", prop);
|
|
1638
1676
|
genValuePartial_fromObject(gen, field, /* not sorted */ i, prop + "[ks[i]]")
|
|
1639
1677
|
("}")
|
|
1640
1678
|
("}");
|
|
@@ -1765,11 +1803,11 @@ converter.toObject = function toObject(mtype) {
|
|
|
1765
1803
|
("}else")
|
|
1766
1804
|
("d%s=o.longs===String?%j:%i", prop, field.typeDefault.toString(), field.typeDefault.toNumber());
|
|
1767
1805
|
else if (field.bytes) {
|
|
1768
|
-
var arrayDefault =
|
|
1806
|
+
var arrayDefault = Array.prototype.slice.call(field.typeDefault);
|
|
1769
1807
|
gen
|
|
1770
1808
|
("if(o.bytes===String)d%s=%j", prop, String.fromCharCode.apply(String, field.typeDefault))
|
|
1771
1809
|
("else{")
|
|
1772
|
-
("d%s=%
|
|
1810
|
+
("d%s=%j", prop, arrayDefault)
|
|
1773
1811
|
("if(o.bytes!==Array)d%s=util.newBuffer(d%s)", prop, prop)
|
|
1774
1812
|
("}");
|
|
1775
1813
|
} else gen
|
|
@@ -1789,6 +1827,9 @@ converter.toObject = function toObject(mtype) {
|
|
|
1789
1827
|
("if(m%s&&(ks2=Object.keys(m%s)).length){", prop, prop)
|
|
1790
1828
|
("d%s={}", prop)
|
|
1791
1829
|
("for(var j=0;j<ks2.length;++j){");
|
|
1830
|
+
gen
|
|
1831
|
+
("if(ks2[j]===\"__proto__\")")
|
|
1832
|
+
("util.makeProp(d%s,ks2[j])", prop);
|
|
1792
1833
|
genValuePartial_toObject(gen, field, /* sorted */ index, prop + "[ks2[j]]")
|
|
1793
1834
|
("}");
|
|
1794
1835
|
} else if (field.repeated) { gen
|
|
@@ -1831,9 +1872,12 @@ function missing(field) {
|
|
|
1831
1872
|
*/
|
|
1832
1873
|
function decoder(mtype) {
|
|
1833
1874
|
/* eslint-disable no-unexpected-multiline */
|
|
1834
|
-
var gen = util.codegen(["r", "l", "e"], mtype.name + "$decode")
|
|
1875
|
+
var gen = util.codegen(["r", "l", "e", "n"], mtype.name + "$decode")
|
|
1835
1876
|
("if(!(r instanceof Reader))")
|
|
1836
1877
|
("r=Reader.create(r)")
|
|
1878
|
+
("if(n===undefined)n=0")
|
|
1879
|
+
("if(n>Reader.recursionLimit)")
|
|
1880
|
+
("throw Error(\"maximum nesting depth exceeded\")")
|
|
1837
1881
|
("var c=l===undefined?r.len:r.pos+l,m=new this.ctor" + (mtype.fieldsArray.filter(function(field) { return field.map; }).length ? ",k,value" : ""))
|
|
1838
1882
|
("while(r.pos<c){")
|
|
1839
1883
|
("var t=r.uint32()")
|
|
@@ -1872,22 +1916,27 @@ function decoder(mtype) {
|
|
|
1872
1916
|
("case 2:");
|
|
1873
1917
|
|
|
1874
1918
|
if (types.basic[type] === undefined) gen
|
|
1875
|
-
("value=types[%i].decode(r,r.uint32())", i); // can't be groups
|
|
1919
|
+
("value=types[%i].decode(r,r.uint32(),undefined,n+1)", i); // can't be groups
|
|
1876
1920
|
else gen
|
|
1877
1921
|
("value=r.%s()", type);
|
|
1878
1922
|
|
|
1879
1923
|
gen
|
|
1880
1924
|
("break")
|
|
1881
1925
|
("default:")
|
|
1882
|
-
("r.skipType(tag2&7)")
|
|
1926
|
+
("r.skipType(tag2&7,n)")
|
|
1883
1927
|
("break")
|
|
1884
1928
|
("}")
|
|
1885
1929
|
("}");
|
|
1886
1930
|
|
|
1887
1931
|
if (types.long[field.keyType] !== undefined) gen
|
|
1888
1932
|
("%s[typeof k===\"object\"?util.longToHash(k):k]=value", ref);
|
|
1889
|
-
else
|
|
1933
|
+
else {
|
|
1934
|
+
if (field.keyType === "string") gen
|
|
1935
|
+
("if(k===\"__proto__\")")
|
|
1936
|
+
("util.makeProp(%s,k)", ref);
|
|
1937
|
+
gen
|
|
1890
1938
|
("%s[k]=value", ref);
|
|
1939
|
+
}
|
|
1891
1940
|
|
|
1892
1941
|
// Repeated fields
|
|
1893
1942
|
} else if (field.repeated) { gen
|
|
@@ -1905,15 +1954,15 @@ function decoder(mtype) {
|
|
|
1905
1954
|
|
|
1906
1955
|
// Non-packed
|
|
1907
1956
|
if (types.basic[type] === undefined) gen(field.delimited
|
|
1908
|
-
? "%s.push(types[%i].decode(r,undefined,((t&~7)|4)))"
|
|
1909
|
-
: "%s.push(types[%i].decode(r,r.uint32()))", ref, i);
|
|
1957
|
+
? "%s.push(types[%i].decode(r,undefined,((t&~7)|4),n+1))"
|
|
1958
|
+
: "%s.push(types[%i].decode(r,r.uint32(),undefined,n+1))", ref, i);
|
|
1910
1959
|
else gen
|
|
1911
1960
|
("%s.push(r.%s())", ref, type);
|
|
1912
1961
|
|
|
1913
1962
|
// Non-repeated
|
|
1914
1963
|
} else if (types.basic[type] === undefined) gen(field.delimited
|
|
1915
|
-
? "%s=types[%i].decode(r,undefined,((t&~7)|4))"
|
|
1916
|
-
: "%s=types[%i].decode(r,r.uint32())", ref, i);
|
|
1964
|
+
? "%s=types[%i].decode(r,undefined,((t&~7)|4),n+1)"
|
|
1965
|
+
: "%s=types[%i].decode(r,r.uint32(),undefined,n+1)", ref, i);
|
|
1917
1966
|
else gen
|
|
1918
1967
|
("%s=r.%s()", ref, type);
|
|
1919
1968
|
gen
|
|
@@ -1922,7 +1971,7 @@ function decoder(mtype) {
|
|
|
1922
1971
|
// Unknown fields
|
|
1923
1972
|
} gen
|
|
1924
1973
|
("default:")
|
|
1925
|
-
("r.skipType(t&7)")
|
|
1974
|
+
("r.skipType(t&7,n)")
|
|
1926
1975
|
("break")
|
|
1927
1976
|
|
|
1928
1977
|
("}")
|
|
@@ -2120,7 +2169,7 @@ function Enum(name, values, options, comment, comments, valuesOptions) {
|
|
|
2120
2169
|
|
|
2121
2170
|
if (values)
|
|
2122
2171
|
for (var keys = Object.keys(values), i = 0; i < keys.length; ++i)
|
|
2123
|
-
if (typeof values[keys[i]] === "number") // use forward entries only
|
|
2172
|
+
if (keys[i] !== "__proto__" && typeof values[keys[i]] === "number") // use forward entries only
|
|
2124
2173
|
this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i];
|
|
2125
2174
|
}
|
|
2126
2175
|
|
|
@@ -2199,6 +2248,9 @@ Enum.prototype.add = function add(name, id, comment, options) {
|
|
|
2199
2248
|
if (!util.isInteger(id))
|
|
2200
2249
|
throw TypeError("id must be an integer");
|
|
2201
2250
|
|
|
2251
|
+
if (name === "__proto__")
|
|
2252
|
+
return this;
|
|
2253
|
+
|
|
2202
2254
|
if (this.values[name] !== undefined)
|
|
2203
2255
|
throw Error("duplicate name '" + name + "' in " + this);
|
|
2204
2256
|
|
|
@@ -2800,7 +2852,7 @@ protobuf.loadSync = loadSync;
|
|
|
2800
2852
|
// Serialization
|
|
2801
2853
|
protobuf.encoder = require(14);
|
|
2802
2854
|
protobuf.decoder = require(13);
|
|
2803
|
-
protobuf.verifier = require(
|
|
2855
|
+
protobuf.verifier = require(41);
|
|
2804
2856
|
protobuf.converter = require(12);
|
|
2805
2857
|
|
|
2806
2858
|
// Reflection
|
|
@@ -2817,7 +2869,7 @@ protobuf.Method = require(22);
|
|
|
2817
2869
|
|
|
2818
2870
|
// Runtime
|
|
2819
2871
|
protobuf.Message = require(21);
|
|
2820
|
-
protobuf.wrappers = require(
|
|
2872
|
+
protobuf.wrappers = require(42);
|
|
2821
2873
|
|
|
2822
2874
|
// Utility
|
|
2823
2875
|
protobuf.types = require(36);
|
|
@@ -2829,7 +2881,7 @@ protobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum);
|
|
|
2829
2881
|
protobuf.Root._configure(protobuf.Type);
|
|
2830
2882
|
protobuf.Field._configure(protobuf.Type);
|
|
2831
2883
|
|
|
2832
|
-
},{"12":12,"13":13,"14":14,"15":15,"16":16,"18":18,"20":20,"21":21,"22":22,"23":23,"24":24,"25":25,"29":29,"33":33,"35":35,"36":36,"37":37,"
|
|
2884
|
+
},{"12":12,"13":13,"14":14,"15":15,"16":16,"18":18,"20":20,"21":21,"22":22,"23":23,"24":24,"25":25,"29":29,"33":33,"35":35,"36":36,"37":37,"41":41,"42":42}],18:[function(require,module,exports){
|
|
2833
2885
|
"use strict";
|
|
2834
2886
|
var protobuf = exports;
|
|
2835
2887
|
|
|
@@ -2842,8 +2894,8 @@ var protobuf = exports;
|
|
|
2842
2894
|
protobuf.build = "minimal";
|
|
2843
2895
|
|
|
2844
2896
|
// Serialization
|
|
2845
|
-
protobuf.Writer = require(
|
|
2846
|
-
protobuf.BufferWriter = require(
|
|
2897
|
+
protobuf.Writer = require(43);
|
|
2898
|
+
protobuf.BufferWriter = require(44);
|
|
2847
2899
|
protobuf.Reader = require(27);
|
|
2848
2900
|
protobuf.BufferReader = require(28);
|
|
2849
2901
|
|
|
@@ -2867,7 +2919,7 @@ function configure() {
|
|
|
2867
2919
|
// Set up buffer utility according to the environment
|
|
2868
2920
|
configure();
|
|
2869
2921
|
|
|
2870
|
-
},{"27":27,"28":28,"30":30,"31":31,"39":39,"
|
|
2922
|
+
},{"27":27,"28":28,"30":30,"31":31,"39":39,"43":43,"44":44}],19:[function(require,module,exports){
|
|
2871
2923
|
"use strict";
|
|
2872
2924
|
var protobuf = module.exports = require(17);
|
|
2873
2925
|
|
|
@@ -3435,7 +3487,7 @@ function Namespace(name, options) {
|
|
|
3435
3487
|
* @type {Object.<string,ReflectionObject|null>}
|
|
3436
3488
|
* @private
|
|
3437
3489
|
*/
|
|
3438
|
-
this._lookupCache =
|
|
3490
|
+
this._lookupCache = Object.create(null);
|
|
3439
3491
|
|
|
3440
3492
|
/**
|
|
3441
3493
|
* Whether or not objects contained in this namespace need feature resolution.
|
|
@@ -3454,12 +3506,12 @@ function Namespace(name, options) {
|
|
|
3454
3506
|
|
|
3455
3507
|
function clearCache(namespace) {
|
|
3456
3508
|
namespace._nestedArray = null;
|
|
3457
|
-
namespace._lookupCache =
|
|
3509
|
+
namespace._lookupCache = Object.create(null);
|
|
3458
3510
|
|
|
3459
3511
|
// Also clear parent caches, since they include nested lookups.
|
|
3460
3512
|
var parent = namespace;
|
|
3461
3513
|
while(parent = parent.parent) {
|
|
3462
|
-
parent._lookupCache =
|
|
3514
|
+
parent._lookupCache = Object.create(null);
|
|
3463
3515
|
}
|
|
3464
3516
|
return namespace;
|
|
3465
3517
|
}
|
|
@@ -3540,8 +3592,9 @@ Namespace.prototype.addJSON = function addJSON(nestedJson) {
|
|
|
3540
3592
|
* @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist
|
|
3541
3593
|
*/
|
|
3542
3594
|
Namespace.prototype.get = function get(name) {
|
|
3543
|
-
return this.nested && this.nested
|
|
3544
|
-
|
|
3595
|
+
return this.nested && Object.prototype.hasOwnProperty.call(this.nested, name)
|
|
3596
|
+
? this.nested[name]
|
|
3597
|
+
: null;
|
|
3545
3598
|
};
|
|
3546
3599
|
|
|
3547
3600
|
/**
|
|
@@ -3552,7 +3605,7 @@ Namespace.prototype.get = function get(name) {
|
|
|
3552
3605
|
* @throws {Error} If there is no such enum
|
|
3553
3606
|
*/
|
|
3554
3607
|
Namespace.prototype.getEnum = function getEnum(name) {
|
|
3555
|
-
if (this.nested && this.nested[name] instanceof Enum)
|
|
3608
|
+
if (this.nested && Object.prototype.hasOwnProperty.call(this.nested, name) && this.nested[name] instanceof Enum)
|
|
3556
3609
|
return this.nested[name].values;
|
|
3557
3610
|
throw Error("no such enum: " + name);
|
|
3558
3611
|
};
|
|
@@ -3569,6 +3622,9 @@ Namespace.prototype.add = function add(object) {
|
|
|
3569
3622
|
if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof OneOf || object instanceof Enum || object instanceof Service || object instanceof Namespace))
|
|
3570
3623
|
throw TypeError("object must be a valid nested object");
|
|
3571
3624
|
|
|
3625
|
+
if (object.name === "__proto__")
|
|
3626
|
+
return this;
|
|
3627
|
+
|
|
3572
3628
|
if (!this.nested)
|
|
3573
3629
|
this.nested = {};
|
|
3574
3630
|
else {
|
|
@@ -4150,6 +4206,8 @@ ReflectionObject.prototype.getOption = function getOption(name) {
|
|
|
4150
4206
|
* @returns {ReflectionObject} `this`
|
|
4151
4207
|
*/
|
|
4152
4208
|
ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) {
|
|
4209
|
+
if (name === "__proto__")
|
|
4210
|
+
return this;
|
|
4153
4211
|
if (!this.options)
|
|
4154
4212
|
this.options = {};
|
|
4155
4213
|
if (/^features\./.test(name)) {
|
|
@@ -4170,6 +4228,8 @@ ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet)
|
|
|
4170
4228
|
* @returns {ReflectionObject} `this`
|
|
4171
4229
|
*/
|
|
4172
4230
|
ReflectionObject.prototype.setParsedOption = function setParsedOption(name, value, propName) {
|
|
4231
|
+
if (name === "__proto__")
|
|
4232
|
+
return this;
|
|
4173
4233
|
if (!this.parsedOptions) {
|
|
4174
4234
|
this.parsedOptions = [];
|
|
4175
4235
|
}
|
|
@@ -4494,9 +4554,9 @@ var base10Re = /^[1-9][0-9]*$/,
|
|
|
4494
4554
|
base16NegRe = /^-?0[x][0-9a-fA-F]+$/,
|
|
4495
4555
|
base8Re = /^0[0-7]+$/,
|
|
4496
4556
|
base8NegRe = /^-?0[0-7]+$/,
|
|
4497
|
-
numberRe =
|
|
4557
|
+
numberRe = util.patterns.numberRe,
|
|
4498
4558
|
nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/,
|
|
4499
|
-
typeRefRe =
|
|
4559
|
+
typeRefRe = util.patterns.typeRefRe;
|
|
4500
4560
|
|
|
4501
4561
|
/**
|
|
4502
4562
|
* Result object returned from {@link parse}.
|
|
@@ -5211,7 +5271,8 @@ function parse(source, root, options) {
|
|
|
5211
5271
|
if (prevValue)
|
|
5212
5272
|
value = [].concat(prevValue).concat(value);
|
|
5213
5273
|
|
|
5214
|
-
|
|
5274
|
+
if (propName !== "__proto__")
|
|
5275
|
+
objectResult[propName] = value;
|
|
5215
5276
|
|
|
5216
5277
|
// Semicolons and commas can be optional
|
|
5217
5278
|
skip(",", true);
|
|
@@ -5794,12 +5855,22 @@ Reader.prototype.skip = function skip(length) {
|
|
|
5794
5855
|
return this;
|
|
5795
5856
|
};
|
|
5796
5857
|
|
|
5858
|
+
/**
|
|
5859
|
+
* Recursion limit.
|
|
5860
|
+
* @type {number}
|
|
5861
|
+
*/
|
|
5862
|
+
Reader.recursionLimit = util.recursionLimit;
|
|
5863
|
+
|
|
5797
5864
|
/**
|
|
5798
5865
|
* Skips the next element of the specified wire type.
|
|
5799
5866
|
* @param {number} wireType Wire type received
|
|
5867
|
+
* @param {number} [depth] Depth of recursion to control nested calls; 0 if omitted
|
|
5800
5868
|
* @returns {Reader} `this`
|
|
5801
5869
|
*/
|
|
5802
|
-
Reader.prototype.skipType = function(wireType) {
|
|
5870
|
+
Reader.prototype.skipType = function(wireType, depth) {
|
|
5871
|
+
if (depth === undefined) depth = 0;
|
|
5872
|
+
if (depth > Reader.recursionLimit)
|
|
5873
|
+
throw Error("maximum nesting depth exceeded");
|
|
5803
5874
|
switch (wireType) {
|
|
5804
5875
|
case 0:
|
|
5805
5876
|
this.skip();
|
|
@@ -5812,7 +5883,7 @@ Reader.prototype.skipType = function(wireType) {
|
|
|
5812
5883
|
break;
|
|
5813
5884
|
case 3:
|
|
5814
5885
|
while ((wireType = this.uint32() & 7) !== 4) {
|
|
5815
|
-
this.skipType(wireType);
|
|
5886
|
+
this.skipType(wireType, depth + 1);
|
|
5816
5887
|
}
|
|
5817
5888
|
break;
|
|
5818
5889
|
case 5:
|
|
@@ -6530,6 +6601,8 @@ var Method = require(22),
|
|
|
6530
6601
|
util = require(37),
|
|
6531
6602
|
rpc = require(31);
|
|
6532
6603
|
|
|
6604
|
+
var reservedRe = util.patterns.reservedRe;
|
|
6605
|
+
|
|
6533
6606
|
/**
|
|
6534
6607
|
* Constructs a new service instance.
|
|
6535
6608
|
* @classdesc Reflected service.
|
|
@@ -6623,8 +6696,9 @@ function clearCache(service) {
|
|
|
6623
6696
|
* @override
|
|
6624
6697
|
*/
|
|
6625
6698
|
Service.prototype.get = function get(name) {
|
|
6626
|
-
return this.methods
|
|
6627
|
-
|
|
6699
|
+
return Object.prototype.hasOwnProperty.call(this.methods, name)
|
|
6700
|
+
? this.methods[name]
|
|
6701
|
+
: Namespace.prototype.get.call(this, name);
|
|
6628
6702
|
};
|
|
6629
6703
|
|
|
6630
6704
|
/**
|
|
@@ -6659,12 +6733,13 @@ Service.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive
|
|
|
6659
6733
|
* @override
|
|
6660
6734
|
*/
|
|
6661
6735
|
Service.prototype.add = function add(object) {
|
|
6662
|
-
|
|
6663
6736
|
/* istanbul ignore if */
|
|
6664
6737
|
if (this.get(object.name))
|
|
6665
6738
|
throw Error("duplicate name '" + object.name + "' in " + this);
|
|
6666
6739
|
|
|
6667
6740
|
if (object instanceof Method) {
|
|
6741
|
+
if (object.name === "__proto__")
|
|
6742
|
+
return this;
|
|
6668
6743
|
this.methods[object.name] = object;
|
|
6669
6744
|
object.parent = this;
|
|
6670
6745
|
return clearCache(this);
|
|
@@ -6700,7 +6775,7 @@ Service.prototype.create = function create(rpcImpl, requestDelimited, responseDe
|
|
|
6700
6775
|
var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited);
|
|
6701
6776
|
for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) {
|
|
6702
6777
|
var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\w_]/g, "");
|
|
6703
|
-
rpcService[methodName] = util.codegen(["r","c"],
|
|
6778
|
+
rpcService[methodName] = util.codegen(["r","c"], reservedRe.test(methodName) ? methodName + "_" : methodName)("return this.rpcCall(m,q,s,r,c)")({
|
|
6704
6779
|
m: method,
|
|
6705
6780
|
q: method.resolvedRequestType.ctor,
|
|
6706
6781
|
s: method.resolvedResponseType.ctor
|
|
@@ -7142,13 +7217,13 @@ var Enum = require(15),
|
|
|
7142
7217
|
Service = require(33),
|
|
7143
7218
|
Message = require(21),
|
|
7144
7219
|
Reader = require(27),
|
|
7145
|
-
Writer = require(
|
|
7220
|
+
Writer = require(43),
|
|
7146
7221
|
util = require(37),
|
|
7147
7222
|
encoder = require(14),
|
|
7148
7223
|
decoder = require(13),
|
|
7149
|
-
verifier = require(
|
|
7224
|
+
verifier = require(41),
|
|
7150
7225
|
converter = require(12),
|
|
7151
|
-
wrappers = require(
|
|
7226
|
+
wrappers = require(42);
|
|
7152
7227
|
|
|
7153
7228
|
/**
|
|
7154
7229
|
* Constructs a new reflected message type instance.
|
|
@@ -7335,7 +7410,7 @@ Type.generateConstructor = function generateConstructor(mtype) {
|
|
|
7335
7410
|
else if (field.repeated) gen
|
|
7336
7411
|
("this%s=[]", util.safeProp(field.name));
|
|
7337
7412
|
return gen
|
|
7338
|
-
("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)") // omit undefined or null
|
|
7413
|
+
("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null&&ks[i]!==\"__proto__\")") // omit undefined or null
|
|
7339
7414
|
("this[ks[i]]=p[ks[i]]");
|
|
7340
7415
|
/* eslint-enable no-unexpected-multiline */
|
|
7341
7416
|
};
|
|
@@ -7468,10 +7543,13 @@ Type.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(ed
|
|
|
7468
7543
|
* @override
|
|
7469
7544
|
*/
|
|
7470
7545
|
Type.prototype.get = function get(name) {
|
|
7471
|
-
|
|
7472
|
-
|
|
7473
|
-
|
|
7474
|
-
|
|
7546
|
+
if (Object.prototype.hasOwnProperty.call(this.fields, name))
|
|
7547
|
+
return this.fields[name];
|
|
7548
|
+
if (this.oneofs && Object.prototype.hasOwnProperty.call(this.oneofs, name))
|
|
7549
|
+
return this.oneofs[name];
|
|
7550
|
+
if (this.nested && Object.prototype.hasOwnProperty.call(this.nested, name))
|
|
7551
|
+
return this.nested[name];
|
|
7552
|
+
return null;
|
|
7475
7553
|
};
|
|
7476
7554
|
|
|
7477
7555
|
/**
|
|
@@ -7482,7 +7560,6 @@ Type.prototype.get = function get(name) {
|
|
|
7482
7560
|
* @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id
|
|
7483
7561
|
*/
|
|
7484
7562
|
Type.prototype.add = function add(object) {
|
|
7485
|
-
|
|
7486
7563
|
if (this.get(object.name))
|
|
7487
7564
|
throw Error("duplicate name '" + object.name + "' in " + this);
|
|
7488
7565
|
|
|
@@ -7498,6 +7575,8 @@ Type.prototype.add = function add(object) {
|
|
|
7498
7575
|
throw Error("id " + object.id + " is reserved in " + this);
|
|
7499
7576
|
if (this.isReservedName(object.name))
|
|
7500
7577
|
throw Error("name '" + object.name + "' is reserved in " + this);
|
|
7578
|
+
if (object.name === "__proto__")
|
|
7579
|
+
return this;
|
|
7501
7580
|
|
|
7502
7581
|
if (object.parent)
|
|
7503
7582
|
object.parent.remove(object);
|
|
@@ -7507,6 +7586,8 @@ Type.prototype.add = function add(object) {
|
|
|
7507
7586
|
return clearCache(this);
|
|
7508
7587
|
}
|
|
7509
7588
|
if (object instanceof OneOf) {
|
|
7589
|
+
if (object.name === "__proto__")
|
|
7590
|
+
return this;
|
|
7510
7591
|
if (!this.oneofs)
|
|
7511
7592
|
this.oneofs = {};
|
|
7512
7593
|
this.oneofs[object.name] = object;
|
|
@@ -7655,12 +7736,14 @@ Type.prototype.encodeDelimited = function encodeDelimited(message, writer) {
|
|
|
7655
7736
|
* Decodes a message of this type.
|
|
7656
7737
|
* @param {Reader|Uint8Array} reader Reader or buffer to decode from
|
|
7657
7738
|
* @param {number} [length] Length of the message, if known beforehand
|
|
7739
|
+
* @param {number} [end] Expected group end tag, if decoding a group
|
|
7740
|
+
* @param {number} [depth] Current nesting depth
|
|
7658
7741
|
* @returns {Message<{}>} Decoded message
|
|
7659
7742
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
7660
7743
|
* @throws {util.ProtocolError<{}>} If required fields are missing
|
|
7661
7744
|
*/
|
|
7662
|
-
Type.prototype.decode = function decode_setup(reader, length) {
|
|
7663
|
-
return this.setup().decode(reader, length); // overrides this method
|
|
7745
|
+
Type.prototype.decode = function decode_setup(reader, length, end, depth) {
|
|
7746
|
+
return this.setup().decode(reader, length, end, depth); // overrides this method
|
|
7664
7747
|
};
|
|
7665
7748
|
|
|
7666
7749
|
/**
|
|
@@ -7679,19 +7762,21 @@ Type.prototype.decodeDelimited = function decodeDelimited(reader) {
|
|
|
7679
7762
|
/**
|
|
7680
7763
|
* Verifies that field values are valid and that required fields are present.
|
|
7681
7764
|
* @param {Object.<string,*>} message Plain object to verify
|
|
7765
|
+
* @param {number} [depth] Current nesting depth
|
|
7682
7766
|
* @returns {null|string} `null` if valid, otherwise the reason why it is not
|
|
7683
7767
|
*/
|
|
7684
|
-
Type.prototype.verify = function verify_setup(message) {
|
|
7685
|
-
return this.setup().verify(message); // overrides this method
|
|
7768
|
+
Type.prototype.verify = function verify_setup(message, depth) {
|
|
7769
|
+
return this.setup().verify(message, depth); // overrides this method
|
|
7686
7770
|
};
|
|
7687
7771
|
|
|
7688
7772
|
/**
|
|
7689
7773
|
* Creates a new message of this type from a plain object. Also converts values to their respective internal types.
|
|
7690
7774
|
* @param {Object.<string,*>} object Plain object to convert
|
|
7775
|
+
* @param {number} [depth] Current nesting depth
|
|
7691
7776
|
* @returns {Message<{}>} Message instance
|
|
7692
7777
|
*/
|
|
7693
|
-
Type.prototype.fromObject = function fromObject(object) {
|
|
7694
|
-
return this.setup().fromObject(object);
|
|
7778
|
+
Type.prototype.fromObject = function fromObject(object, depth) {
|
|
7779
|
+
return this.setup().fromObject(object, depth);
|
|
7695
7780
|
};
|
|
7696
7781
|
|
|
7697
7782
|
/**
|
|
@@ -7744,7 +7829,7 @@ Type.d = function decorateType(typeName) {
|
|
|
7744
7829
|
};
|
|
7745
7830
|
};
|
|
7746
7831
|
|
|
7747
|
-
},{"12":12,"13":13,"14":14,"15":15,"16":16,"20":20,"21":21,"23":23,"25":25,"27":27,"33":33,"37":37,"
|
|
7832
|
+
},{"12":12,"13":13,"14":14,"15":15,"16":16,"20":20,"21":21,"23":23,"25":25,"27":27,"33":33,"37":37,"41":41,"42":42,"43":43}],36:[function(require,module,exports){
|
|
7748
7833
|
"use strict";
|
|
7749
7834
|
|
|
7750
7835
|
/**
|
|
@@ -7774,7 +7859,7 @@ var s = [
|
|
|
7774
7859
|
];
|
|
7775
7860
|
|
|
7776
7861
|
function bake(values, offset) {
|
|
7777
|
-
var i = 0, o =
|
|
7862
|
+
var i = 0, o = Object.create(null);
|
|
7778
7863
|
offset |= 0;
|
|
7779
7864
|
while (i < values.length) o[s[i + offset]] = values[i++];
|
|
7780
7865
|
return o;
|
|
@@ -7959,6 +8044,10 @@ var Type, // cyclic
|
|
|
7959
8044
|
util.codegen = require(3);
|
|
7960
8045
|
util.fetch = require(5);
|
|
7961
8046
|
util.path = require(8);
|
|
8047
|
+
util.patterns = require(40);
|
|
8048
|
+
|
|
8049
|
+
var reservedRe = util.patterns.reservedRe,
|
|
8050
|
+
unsafePropertyRe = util.patterns.unsafePropertyRe;
|
|
7962
8051
|
|
|
7963
8052
|
/**
|
|
7964
8053
|
* Node's fs module if available.
|
|
@@ -8000,16 +8089,13 @@ util.toObject = function toObject(array) {
|
|
|
8000
8089
|
return object;
|
|
8001
8090
|
};
|
|
8002
8091
|
|
|
8003
|
-
var safePropBackslashRe = /\\/g,
|
|
8004
|
-
safePropQuoteRe = /"/g;
|
|
8005
|
-
|
|
8006
8092
|
/**
|
|
8007
8093
|
* Tests whether the specified name is a reserved word in JS.
|
|
8008
8094
|
* @param {string} name Name to test
|
|
8009
8095
|
* @returns {boolean} `true` if reserved, otherwise `false`
|
|
8010
8096
|
*/
|
|
8011
8097
|
util.isReserved = function isReserved(name) {
|
|
8012
|
-
return
|
|
8098
|
+
return reservedRe.test(name);
|
|
8013
8099
|
};
|
|
8014
8100
|
|
|
8015
8101
|
/**
|
|
@@ -8018,8 +8104,8 @@ util.isReserved = function isReserved(name) {
|
|
|
8018
8104
|
* @returns {string} Safe accessor
|
|
8019
8105
|
*/
|
|
8020
8106
|
util.safeProp = function safeProp(prop) {
|
|
8021
|
-
if (!/^[$\w_]+$/.test(prop) ||
|
|
8022
|
-
return "[
|
|
8107
|
+
if (!/^[$\w_]+$/.test(prop) || reservedRe.test(prop))
|
|
8108
|
+
return "[" + JSON.stringify(prop) + "]";
|
|
8023
8109
|
return "." + prop;
|
|
8024
8110
|
};
|
|
8025
8111
|
|
|
@@ -8122,9 +8208,8 @@ util.decorateEnum = function decorateEnum(object) {
|
|
|
8122
8208
|
util.setProperty = function setProperty(dst, path, value, ifNotSet) {
|
|
8123
8209
|
function setProp(dst, path, value) {
|
|
8124
8210
|
var part = path.shift();
|
|
8125
|
-
if (part
|
|
8126
|
-
|
|
8127
|
-
}
|
|
8211
|
+
if (unsafePropertyRe.test(part))
|
|
8212
|
+
return dst;
|
|
8128
8213
|
if (path.length > 0) {
|
|
8129
8214
|
dst[part] = setProp(dst[part] || {}, path, value);
|
|
8130
8215
|
} else {
|
|
@@ -8159,7 +8244,7 @@ Object.defineProperty(util, "decorateRoot", {
|
|
|
8159
8244
|
}
|
|
8160
8245
|
});
|
|
8161
8246
|
|
|
8162
|
-
},{"15":15,"29":29,"3":3,"30":30,"35":35,"39":39,"5":5,"8":8}],38:[function(require,module,exports){
|
|
8247
|
+
},{"15":15,"29":29,"3":3,"30":30,"35":35,"39":39,"40":40,"5":5,"8":8}],38:[function(require,module,exports){
|
|
8163
8248
|
"use strict";
|
|
8164
8249
|
module.exports = LongBits;
|
|
8165
8250
|
|
|
@@ -8601,12 +8686,35 @@ util.longFromHash = function longFromHash(hash, unsigned) {
|
|
|
8601
8686
|
function merge(dst, src, ifNotSet) { // used by converters
|
|
8602
8687
|
for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)
|
|
8603
8688
|
if (dst[keys[i]] === undefined || !ifNotSet)
|
|
8604
|
-
|
|
8689
|
+
if (keys[i] !== "__proto__")
|
|
8690
|
+
dst[keys[i]] = src[keys[i]];
|
|
8605
8691
|
return dst;
|
|
8606
8692
|
}
|
|
8607
8693
|
|
|
8608
8694
|
util.merge = merge;
|
|
8609
8695
|
|
|
8696
|
+
/**
|
|
8697
|
+
* Recursion limit.
|
|
8698
|
+
* @memberof util
|
|
8699
|
+
* @type {number}
|
|
8700
|
+
*/
|
|
8701
|
+
util.recursionLimit = 100;
|
|
8702
|
+
|
|
8703
|
+
/**
|
|
8704
|
+
* Makes a property safe for assignment as an own property.
|
|
8705
|
+
* @memberof util
|
|
8706
|
+
* @param {Object.<string,*>} obj Object
|
|
8707
|
+
* @param {string} key Property key
|
|
8708
|
+
* @returns {undefined}
|
|
8709
|
+
*/
|
|
8710
|
+
util.makeProp = function makeProp(obj, key) {
|
|
8711
|
+
Object.defineProperty(obj, key, {
|
|
8712
|
+
enumerable: true,
|
|
8713
|
+
configurable: true,
|
|
8714
|
+
writable: true
|
|
8715
|
+
});
|
|
8716
|
+
};
|
|
8717
|
+
|
|
8610
8718
|
/**
|
|
8611
8719
|
* Converts the first character of a string to lower case.
|
|
8612
8720
|
* @param {string} str String to convert
|
|
@@ -8803,6 +8911,16 @@ util._configure = function() {
|
|
|
8803
8911
|
|
|
8804
8912
|
},{"1":1,"10":10,"2":2,"38":38,"4":4,"6":6,"7":7,"9":9}],40:[function(require,module,exports){
|
|
8805
8913
|
"use strict";
|
|
8914
|
+
|
|
8915
|
+
var patterns = exports;
|
|
8916
|
+
|
|
8917
|
+
patterns.numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;
|
|
8918
|
+
patterns.typeRefRe = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;
|
|
8919
|
+
patterns.reservedRe = /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/;
|
|
8920
|
+
patterns.unsafePropertyRe = /^(?:__proto__|prototype|constructor)$/;
|
|
8921
|
+
|
|
8922
|
+
},{}],41:[function(require,module,exports){
|
|
8923
|
+
"use strict";
|
|
8806
8924
|
module.exports = verifier;
|
|
8807
8925
|
|
|
8808
8926
|
var Enum = require(15),
|
|
@@ -8836,7 +8954,7 @@ function genVerifyValue(gen, field, fieldIndex, ref) {
|
|
|
8836
8954
|
} else {
|
|
8837
8955
|
gen
|
|
8838
8956
|
("{")
|
|
8839
|
-
("var e=types[%i].verify(%s);", fieldIndex, ref)
|
|
8957
|
+
("var e=types[%i].verify(%s,n+1);", fieldIndex, ref)
|
|
8840
8958
|
("if(e)")
|
|
8841
8959
|
("return%j+e", field.name + ".")
|
|
8842
8960
|
("}");
|
|
@@ -8926,9 +9044,12 @@ function genVerifyKey(gen, field, ref) {
|
|
|
8926
9044
|
function verifier(mtype) {
|
|
8927
9045
|
/* eslint-disable no-unexpected-multiline */
|
|
8928
9046
|
|
|
8929
|
-
var gen = util.codegen(["m"], mtype.name + "$verify")
|
|
9047
|
+
var gen = util.codegen(["m", "n"], mtype.name + "$verify")
|
|
8930
9048
|
("if(typeof m!==\"object\"||m===null)")
|
|
8931
|
-
("return%j", "object expected")
|
|
9049
|
+
("return%j", "object expected")
|
|
9050
|
+
("if(n===undefined)n=0")
|
|
9051
|
+
("if(n>util.recursionLimit)")
|
|
9052
|
+
("return%j", "maximum nesting depth exceeded");
|
|
8932
9053
|
var oneofs = mtype.oneofsArray,
|
|
8933
9054
|
seenFirstField = {};
|
|
8934
9055
|
if (oneofs.length) gen
|
|
@@ -8979,7 +9100,8 @@ function verifier(mtype) {
|
|
|
8979
9100
|
("return null");
|
|
8980
9101
|
/* eslint-enable no-unexpected-multiline */
|
|
8981
9102
|
}
|
|
8982
|
-
|
|
9103
|
+
|
|
9104
|
+
},{"15":15,"37":37}],42:[function(require,module,exports){
|
|
8983
9105
|
"use strict";
|
|
8984
9106
|
|
|
8985
9107
|
/**
|
|
@@ -9020,7 +9142,7 @@ var Message = require(21);
|
|
|
9020
9142
|
// Custom wrapper for Any
|
|
9021
9143
|
wrappers[".google.protobuf.Any"] = {
|
|
9022
9144
|
|
|
9023
|
-
fromObject: function(object) {
|
|
9145
|
+
fromObject: function(object, depth) {
|
|
9024
9146
|
|
|
9025
9147
|
// unwrap value type if mapped
|
|
9026
9148
|
if (object && object["@type"]) {
|
|
@@ -9036,14 +9158,15 @@ wrappers[".google.protobuf.Any"] = {
|
|
|
9036
9158
|
if (type_url.indexOf("/") === -1) {
|
|
9037
9159
|
type_url = "/" + type_url;
|
|
9038
9160
|
}
|
|
9161
|
+
var nextDepth = depth === undefined ? 1 : depth + 1;
|
|
9039
9162
|
return this.create({
|
|
9040
9163
|
type_url: type_url,
|
|
9041
|
-
value: type.encode(type.fromObject(object)).finish()
|
|
9164
|
+
value: type.encode(type.fromObject(object, nextDepth)).finish()
|
|
9042
9165
|
});
|
|
9043
9166
|
}
|
|
9044
9167
|
}
|
|
9045
9168
|
|
|
9046
|
-
return this.fromObject(object);
|
|
9169
|
+
return this.fromObject(object, depth);
|
|
9047
9170
|
},
|
|
9048
9171
|
|
|
9049
9172
|
toObject: function(message, options) {
|
|
@@ -9083,7 +9206,7 @@ wrappers[".google.protobuf.Any"] = {
|
|
|
9083
9206
|
}
|
|
9084
9207
|
};
|
|
9085
9208
|
|
|
9086
|
-
},{"21":21}],
|
|
9209
|
+
},{"21":21}],43:[function(require,module,exports){
|
|
9087
9210
|
"use strict";
|
|
9088
9211
|
module.exports = Writer;
|
|
9089
9212
|
|
|
@@ -9550,12 +9673,12 @@ Writer._configure = function(BufferWriter_) {
|
|
|
9550
9673
|
BufferWriter._configure();
|
|
9551
9674
|
};
|
|
9552
9675
|
|
|
9553
|
-
},{"39":39}],
|
|
9676
|
+
},{"39":39}],44:[function(require,module,exports){
|
|
9554
9677
|
"use strict";
|
|
9555
9678
|
module.exports = BufferWriter;
|
|
9556
9679
|
|
|
9557
9680
|
// extends Writer
|
|
9558
|
-
var Writer = require(
|
|
9681
|
+
var Writer = require(43);
|
|
9559
9682
|
(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;
|
|
9560
9683
|
|
|
9561
9684
|
var util = require(39);
|
|
@@ -9637,7 +9760,7 @@ BufferWriter.prototype.string = function write_string_buffer(value) {
|
|
|
9637
9760
|
|
|
9638
9761
|
BufferWriter._configure();
|
|
9639
9762
|
|
|
9640
|
-
},{"39":39,"
|
|
9763
|
+
},{"39":39,"43":43}]},{},[19])
|
|
9641
9764
|
|
|
9642
9765
|
})();
|
|
9643
9766
|
//# sourceMappingURL=protobuf.js.map
|