protobufjs 7.5.5 → 7.5.7
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 +233 -109
- 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 +237 -112
- 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 +13 -7
- 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.7 (c) 2016, daniel wirtz
|
|
3
|
+
* compiled sat, 09 may 2026 05:45:39 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 {
|
|
@@ -3781,8 +3837,10 @@ Namespace.prototype._lookupImpl = function lookup(path, flatPath) {
|
|
|
3781
3837
|
// Otherwise try each nested namespace
|
|
3782
3838
|
} else {
|
|
3783
3839
|
for (var i = 0; i < this.nestedArray.length; ++i)
|
|
3784
|
-
if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i]._lookupImpl(path, flatPath)))
|
|
3840
|
+
if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i]._lookupImpl(path, flatPath))) {
|
|
3785
3841
|
exact = found;
|
|
3842
|
+
break;
|
|
3843
|
+
}
|
|
3786
3844
|
}
|
|
3787
3845
|
|
|
3788
3846
|
// Set this even when null, so that when we walk up the tree we can quickly bail on repeated checks back down.
|
|
@@ -4150,6 +4208,8 @@ ReflectionObject.prototype.getOption = function getOption(name) {
|
|
|
4150
4208
|
* @returns {ReflectionObject} `this`
|
|
4151
4209
|
*/
|
|
4152
4210
|
ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) {
|
|
4211
|
+
if (name === "__proto__")
|
|
4212
|
+
return this;
|
|
4153
4213
|
if (!this.options)
|
|
4154
4214
|
this.options = {};
|
|
4155
4215
|
if (/^features\./.test(name)) {
|
|
@@ -4170,6 +4230,8 @@ ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet)
|
|
|
4170
4230
|
* @returns {ReflectionObject} `this`
|
|
4171
4231
|
*/
|
|
4172
4232
|
ReflectionObject.prototype.setParsedOption = function setParsedOption(name, value, propName) {
|
|
4233
|
+
if (name === "__proto__")
|
|
4234
|
+
return this;
|
|
4173
4235
|
if (!this.parsedOptions) {
|
|
4174
4236
|
this.parsedOptions = [];
|
|
4175
4237
|
}
|
|
@@ -4494,9 +4556,9 @@ var base10Re = /^[1-9][0-9]*$/,
|
|
|
4494
4556
|
base16NegRe = /^-?0[x][0-9a-fA-F]+$/,
|
|
4495
4557
|
base8Re = /^0[0-7]+$/,
|
|
4496
4558
|
base8NegRe = /^-?0[0-7]+$/,
|
|
4497
|
-
numberRe =
|
|
4559
|
+
numberRe = util.patterns.numberRe,
|
|
4498
4560
|
nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/,
|
|
4499
|
-
typeRefRe =
|
|
4561
|
+
typeRefRe = util.patterns.typeRefRe;
|
|
4500
4562
|
|
|
4501
4563
|
/**
|
|
4502
4564
|
* Result object returned from {@link parse}.
|
|
@@ -5211,7 +5273,8 @@ function parse(source, root, options) {
|
|
|
5211
5273
|
if (prevValue)
|
|
5212
5274
|
value = [].concat(prevValue).concat(value);
|
|
5213
5275
|
|
|
5214
|
-
|
|
5276
|
+
if (propName !== "__proto__")
|
|
5277
|
+
objectResult[propName] = value;
|
|
5215
5278
|
|
|
5216
5279
|
// Semicolons and commas can be optional
|
|
5217
5280
|
skip(",", true);
|
|
@@ -5794,12 +5857,22 @@ Reader.prototype.skip = function skip(length) {
|
|
|
5794
5857
|
return this;
|
|
5795
5858
|
};
|
|
5796
5859
|
|
|
5860
|
+
/**
|
|
5861
|
+
* Recursion limit.
|
|
5862
|
+
* @type {number}
|
|
5863
|
+
*/
|
|
5864
|
+
Reader.recursionLimit = util.recursionLimit;
|
|
5865
|
+
|
|
5797
5866
|
/**
|
|
5798
5867
|
* Skips the next element of the specified wire type.
|
|
5799
5868
|
* @param {number} wireType Wire type received
|
|
5869
|
+
* @param {number} [depth] Depth of recursion to control nested calls; 0 if omitted
|
|
5800
5870
|
* @returns {Reader} `this`
|
|
5801
5871
|
*/
|
|
5802
|
-
Reader.prototype.skipType = function(wireType) {
|
|
5872
|
+
Reader.prototype.skipType = function(wireType, depth) {
|
|
5873
|
+
if (depth === undefined) depth = 0;
|
|
5874
|
+
if (depth > Reader.recursionLimit)
|
|
5875
|
+
throw Error("maximum nesting depth exceeded");
|
|
5803
5876
|
switch (wireType) {
|
|
5804
5877
|
case 0:
|
|
5805
5878
|
this.skip();
|
|
@@ -5812,7 +5885,7 @@ Reader.prototype.skipType = function(wireType) {
|
|
|
5812
5885
|
break;
|
|
5813
5886
|
case 3:
|
|
5814
5887
|
while ((wireType = this.uint32() & 7) !== 4) {
|
|
5815
|
-
this.skipType(wireType);
|
|
5888
|
+
this.skipType(wireType, depth + 1);
|
|
5816
5889
|
}
|
|
5817
5890
|
break;
|
|
5818
5891
|
case 5:
|
|
@@ -6530,6 +6603,8 @@ var Method = require(22),
|
|
|
6530
6603
|
util = require(37),
|
|
6531
6604
|
rpc = require(31);
|
|
6532
6605
|
|
|
6606
|
+
var reservedRe = util.patterns.reservedRe;
|
|
6607
|
+
|
|
6533
6608
|
/**
|
|
6534
6609
|
* Constructs a new service instance.
|
|
6535
6610
|
* @classdesc Reflected service.
|
|
@@ -6623,8 +6698,9 @@ function clearCache(service) {
|
|
|
6623
6698
|
* @override
|
|
6624
6699
|
*/
|
|
6625
6700
|
Service.prototype.get = function get(name) {
|
|
6626
|
-
return this.methods
|
|
6627
|
-
|
|
6701
|
+
return Object.prototype.hasOwnProperty.call(this.methods, name)
|
|
6702
|
+
? this.methods[name]
|
|
6703
|
+
: Namespace.prototype.get.call(this, name);
|
|
6628
6704
|
};
|
|
6629
6705
|
|
|
6630
6706
|
/**
|
|
@@ -6659,12 +6735,13 @@ Service.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive
|
|
|
6659
6735
|
* @override
|
|
6660
6736
|
*/
|
|
6661
6737
|
Service.prototype.add = function add(object) {
|
|
6662
|
-
|
|
6663
6738
|
/* istanbul ignore if */
|
|
6664
6739
|
if (this.get(object.name))
|
|
6665
6740
|
throw Error("duplicate name '" + object.name + "' in " + this);
|
|
6666
6741
|
|
|
6667
6742
|
if (object instanceof Method) {
|
|
6743
|
+
if (object.name === "__proto__")
|
|
6744
|
+
return this;
|
|
6668
6745
|
this.methods[object.name] = object;
|
|
6669
6746
|
object.parent = this;
|
|
6670
6747
|
return clearCache(this);
|
|
@@ -6700,7 +6777,7 @@ Service.prototype.create = function create(rpcImpl, requestDelimited, responseDe
|
|
|
6700
6777
|
var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited);
|
|
6701
6778
|
for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) {
|
|
6702
6779
|
var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\w_]/g, "");
|
|
6703
|
-
rpcService[methodName] = util.codegen(["r","c"],
|
|
6780
|
+
rpcService[methodName] = util.codegen(["r","c"], reservedRe.test(methodName) ? methodName + "_" : methodName)("return this.rpcCall(m,q,s,r,c)")({
|
|
6704
6781
|
m: method,
|
|
6705
6782
|
q: method.resolvedRequestType.ctor,
|
|
6706
6783
|
s: method.resolvedResponseType.ctor
|
|
@@ -7142,13 +7219,13 @@ var Enum = require(15),
|
|
|
7142
7219
|
Service = require(33),
|
|
7143
7220
|
Message = require(21),
|
|
7144
7221
|
Reader = require(27),
|
|
7145
|
-
Writer = require(
|
|
7222
|
+
Writer = require(43),
|
|
7146
7223
|
util = require(37),
|
|
7147
7224
|
encoder = require(14),
|
|
7148
7225
|
decoder = require(13),
|
|
7149
|
-
verifier = require(
|
|
7226
|
+
verifier = require(41),
|
|
7150
7227
|
converter = require(12),
|
|
7151
|
-
wrappers = require(
|
|
7228
|
+
wrappers = require(42);
|
|
7152
7229
|
|
|
7153
7230
|
/**
|
|
7154
7231
|
* Constructs a new reflected message type instance.
|
|
@@ -7335,7 +7412,7 @@ Type.generateConstructor = function generateConstructor(mtype) {
|
|
|
7335
7412
|
else if (field.repeated) gen
|
|
7336
7413
|
("this%s=[]", util.safeProp(field.name));
|
|
7337
7414
|
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
|
|
7415
|
+
("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
7416
|
("this[ks[i]]=p[ks[i]]");
|
|
7340
7417
|
/* eslint-enable no-unexpected-multiline */
|
|
7341
7418
|
};
|
|
@@ -7468,10 +7545,13 @@ Type.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(ed
|
|
|
7468
7545
|
* @override
|
|
7469
7546
|
*/
|
|
7470
7547
|
Type.prototype.get = function get(name) {
|
|
7471
|
-
|
|
7472
|
-
|
|
7473
|
-
|
|
7474
|
-
|
|
7548
|
+
if (Object.prototype.hasOwnProperty.call(this.fields, name))
|
|
7549
|
+
return this.fields[name];
|
|
7550
|
+
if (this.oneofs && Object.prototype.hasOwnProperty.call(this.oneofs, name))
|
|
7551
|
+
return this.oneofs[name];
|
|
7552
|
+
if (this.nested && Object.prototype.hasOwnProperty.call(this.nested, name))
|
|
7553
|
+
return this.nested[name];
|
|
7554
|
+
return null;
|
|
7475
7555
|
};
|
|
7476
7556
|
|
|
7477
7557
|
/**
|
|
@@ -7482,7 +7562,6 @@ Type.prototype.get = function get(name) {
|
|
|
7482
7562
|
* @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
7563
|
*/
|
|
7484
7564
|
Type.prototype.add = function add(object) {
|
|
7485
|
-
|
|
7486
7565
|
if (this.get(object.name))
|
|
7487
7566
|
throw Error("duplicate name '" + object.name + "' in " + this);
|
|
7488
7567
|
|
|
@@ -7498,6 +7577,8 @@ Type.prototype.add = function add(object) {
|
|
|
7498
7577
|
throw Error("id " + object.id + " is reserved in " + this);
|
|
7499
7578
|
if (this.isReservedName(object.name))
|
|
7500
7579
|
throw Error("name '" + object.name + "' is reserved in " + this);
|
|
7580
|
+
if (object.name === "__proto__")
|
|
7581
|
+
return this;
|
|
7501
7582
|
|
|
7502
7583
|
if (object.parent)
|
|
7503
7584
|
object.parent.remove(object);
|
|
@@ -7507,6 +7588,8 @@ Type.prototype.add = function add(object) {
|
|
|
7507
7588
|
return clearCache(this);
|
|
7508
7589
|
}
|
|
7509
7590
|
if (object instanceof OneOf) {
|
|
7591
|
+
if (object.name === "__proto__")
|
|
7592
|
+
return this;
|
|
7510
7593
|
if (!this.oneofs)
|
|
7511
7594
|
this.oneofs = {};
|
|
7512
7595
|
this.oneofs[object.name] = object;
|
|
@@ -7655,12 +7738,14 @@ Type.prototype.encodeDelimited = function encodeDelimited(message, writer) {
|
|
|
7655
7738
|
* Decodes a message of this type.
|
|
7656
7739
|
* @param {Reader|Uint8Array} reader Reader or buffer to decode from
|
|
7657
7740
|
* @param {number} [length] Length of the message, if known beforehand
|
|
7741
|
+
* @param {number} [end] Expected group end tag, if decoding a group
|
|
7742
|
+
* @param {number} [depth] Current nesting depth
|
|
7658
7743
|
* @returns {Message<{}>} Decoded message
|
|
7659
7744
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
7660
7745
|
* @throws {util.ProtocolError<{}>} If required fields are missing
|
|
7661
7746
|
*/
|
|
7662
|
-
Type.prototype.decode = function decode_setup(reader, length) {
|
|
7663
|
-
return this.setup().decode(reader, length); // overrides this method
|
|
7747
|
+
Type.prototype.decode = function decode_setup(reader, length, end, depth) {
|
|
7748
|
+
return this.setup().decode(reader, length, end, depth); // overrides this method
|
|
7664
7749
|
};
|
|
7665
7750
|
|
|
7666
7751
|
/**
|
|
@@ -7679,19 +7764,21 @@ Type.prototype.decodeDelimited = function decodeDelimited(reader) {
|
|
|
7679
7764
|
/**
|
|
7680
7765
|
* Verifies that field values are valid and that required fields are present.
|
|
7681
7766
|
* @param {Object.<string,*>} message Plain object to verify
|
|
7767
|
+
* @param {number} [depth] Current nesting depth
|
|
7682
7768
|
* @returns {null|string} `null` if valid, otherwise the reason why it is not
|
|
7683
7769
|
*/
|
|
7684
|
-
Type.prototype.verify = function verify_setup(message) {
|
|
7685
|
-
return this.setup().verify(message); // overrides this method
|
|
7770
|
+
Type.prototype.verify = function verify_setup(message, depth) {
|
|
7771
|
+
return this.setup().verify(message, depth); // overrides this method
|
|
7686
7772
|
};
|
|
7687
7773
|
|
|
7688
7774
|
/**
|
|
7689
7775
|
* Creates a new message of this type from a plain object. Also converts values to their respective internal types.
|
|
7690
7776
|
* @param {Object.<string,*>} object Plain object to convert
|
|
7777
|
+
* @param {number} [depth] Current nesting depth
|
|
7691
7778
|
* @returns {Message<{}>} Message instance
|
|
7692
7779
|
*/
|
|
7693
|
-
Type.prototype.fromObject = function fromObject(object) {
|
|
7694
|
-
return this.setup().fromObject(object);
|
|
7780
|
+
Type.prototype.fromObject = function fromObject(object, depth) {
|
|
7781
|
+
return this.setup().fromObject(object, depth);
|
|
7695
7782
|
};
|
|
7696
7783
|
|
|
7697
7784
|
/**
|
|
@@ -7744,7 +7831,7 @@ Type.d = function decorateType(typeName) {
|
|
|
7744
7831
|
};
|
|
7745
7832
|
};
|
|
7746
7833
|
|
|
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,"
|
|
7834
|
+
},{"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
7835
|
"use strict";
|
|
7749
7836
|
|
|
7750
7837
|
/**
|
|
@@ -7774,7 +7861,7 @@ var s = [
|
|
|
7774
7861
|
];
|
|
7775
7862
|
|
|
7776
7863
|
function bake(values, offset) {
|
|
7777
|
-
var i = 0, o =
|
|
7864
|
+
var i = 0, o = Object.create(null);
|
|
7778
7865
|
offset |= 0;
|
|
7779
7866
|
while (i < values.length) o[s[i + offset]] = values[i++];
|
|
7780
7867
|
return o;
|
|
@@ -7959,6 +8046,10 @@ var Type, // cyclic
|
|
|
7959
8046
|
util.codegen = require(3);
|
|
7960
8047
|
util.fetch = require(5);
|
|
7961
8048
|
util.path = require(8);
|
|
8049
|
+
util.patterns = require(40);
|
|
8050
|
+
|
|
8051
|
+
var reservedRe = util.patterns.reservedRe,
|
|
8052
|
+
unsafePropertyRe = util.patterns.unsafePropertyRe;
|
|
7962
8053
|
|
|
7963
8054
|
/**
|
|
7964
8055
|
* Node's fs module if available.
|
|
@@ -8000,16 +8091,13 @@ util.toObject = function toObject(array) {
|
|
|
8000
8091
|
return object;
|
|
8001
8092
|
};
|
|
8002
8093
|
|
|
8003
|
-
var safePropBackslashRe = /\\/g,
|
|
8004
|
-
safePropQuoteRe = /"/g;
|
|
8005
|
-
|
|
8006
8094
|
/**
|
|
8007
8095
|
* Tests whether the specified name is a reserved word in JS.
|
|
8008
8096
|
* @param {string} name Name to test
|
|
8009
8097
|
* @returns {boolean} `true` if reserved, otherwise `false`
|
|
8010
8098
|
*/
|
|
8011
8099
|
util.isReserved = function isReserved(name) {
|
|
8012
|
-
return
|
|
8100
|
+
return reservedRe.test(name);
|
|
8013
8101
|
};
|
|
8014
8102
|
|
|
8015
8103
|
/**
|
|
@@ -8018,8 +8106,8 @@ util.isReserved = function isReserved(name) {
|
|
|
8018
8106
|
* @returns {string} Safe accessor
|
|
8019
8107
|
*/
|
|
8020
8108
|
util.safeProp = function safeProp(prop) {
|
|
8021
|
-
if (!/^[$\w_]+$/.test(prop) ||
|
|
8022
|
-
return "[
|
|
8109
|
+
if (!/^[$\w_]+$/.test(prop) || reservedRe.test(prop))
|
|
8110
|
+
return "[" + JSON.stringify(prop) + "]";
|
|
8023
8111
|
return "." + prop;
|
|
8024
8112
|
};
|
|
8025
8113
|
|
|
@@ -8122,9 +8210,8 @@ util.decorateEnum = function decorateEnum(object) {
|
|
|
8122
8210
|
util.setProperty = function setProperty(dst, path, value, ifNotSet) {
|
|
8123
8211
|
function setProp(dst, path, value) {
|
|
8124
8212
|
var part = path.shift();
|
|
8125
|
-
if (part
|
|
8126
|
-
|
|
8127
|
-
}
|
|
8213
|
+
if (unsafePropertyRe.test(part))
|
|
8214
|
+
return dst;
|
|
8128
8215
|
if (path.length > 0) {
|
|
8129
8216
|
dst[part] = setProp(dst[part] || {}, path, value);
|
|
8130
8217
|
} else {
|
|
@@ -8159,7 +8246,7 @@ Object.defineProperty(util, "decorateRoot", {
|
|
|
8159
8246
|
}
|
|
8160
8247
|
});
|
|
8161
8248
|
|
|
8162
|
-
},{"15":15,"29":29,"3":3,"30":30,"35":35,"39":39,"5":5,"8":8}],38:[function(require,module,exports){
|
|
8249
|
+
},{"15":15,"29":29,"3":3,"30":30,"35":35,"39":39,"40":40,"5":5,"8":8}],38:[function(require,module,exports){
|
|
8163
8250
|
"use strict";
|
|
8164
8251
|
module.exports = LongBits;
|
|
8165
8252
|
|
|
@@ -8601,12 +8688,35 @@ util.longFromHash = function longFromHash(hash, unsigned) {
|
|
|
8601
8688
|
function merge(dst, src, ifNotSet) { // used by converters
|
|
8602
8689
|
for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)
|
|
8603
8690
|
if (dst[keys[i]] === undefined || !ifNotSet)
|
|
8604
|
-
|
|
8691
|
+
if (keys[i] !== "__proto__")
|
|
8692
|
+
dst[keys[i]] = src[keys[i]];
|
|
8605
8693
|
return dst;
|
|
8606
8694
|
}
|
|
8607
8695
|
|
|
8608
8696
|
util.merge = merge;
|
|
8609
8697
|
|
|
8698
|
+
/**
|
|
8699
|
+
* Recursion limit.
|
|
8700
|
+
* @memberof util
|
|
8701
|
+
* @type {number}
|
|
8702
|
+
*/
|
|
8703
|
+
util.recursionLimit = 100;
|
|
8704
|
+
|
|
8705
|
+
/**
|
|
8706
|
+
* Makes a property safe for assignment as an own property.
|
|
8707
|
+
* @memberof util
|
|
8708
|
+
* @param {Object.<string,*>} obj Object
|
|
8709
|
+
* @param {string} key Property key
|
|
8710
|
+
* @returns {undefined}
|
|
8711
|
+
*/
|
|
8712
|
+
util.makeProp = function makeProp(obj, key) {
|
|
8713
|
+
Object.defineProperty(obj, key, {
|
|
8714
|
+
enumerable: true,
|
|
8715
|
+
configurable: true,
|
|
8716
|
+
writable: true
|
|
8717
|
+
});
|
|
8718
|
+
};
|
|
8719
|
+
|
|
8610
8720
|
/**
|
|
8611
8721
|
* Converts the first character of a string to lower case.
|
|
8612
8722
|
* @param {string} str String to convert
|
|
@@ -8803,6 +8913,16 @@ util._configure = function() {
|
|
|
8803
8913
|
|
|
8804
8914
|
},{"1":1,"10":10,"2":2,"38":38,"4":4,"6":6,"7":7,"9":9}],40:[function(require,module,exports){
|
|
8805
8915
|
"use strict";
|
|
8916
|
+
|
|
8917
|
+
var patterns = exports;
|
|
8918
|
+
|
|
8919
|
+
patterns.numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;
|
|
8920
|
+
patterns.typeRefRe = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;
|
|
8921
|
+
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)$/;
|
|
8922
|
+
patterns.unsafePropertyRe = /^(?:__proto__|prototype|constructor)$/;
|
|
8923
|
+
|
|
8924
|
+
},{}],41:[function(require,module,exports){
|
|
8925
|
+
"use strict";
|
|
8806
8926
|
module.exports = verifier;
|
|
8807
8927
|
|
|
8808
8928
|
var Enum = require(15),
|
|
@@ -8836,7 +8956,7 @@ function genVerifyValue(gen, field, fieldIndex, ref) {
|
|
|
8836
8956
|
} else {
|
|
8837
8957
|
gen
|
|
8838
8958
|
("{")
|
|
8839
|
-
("var e=types[%i].verify(%s);", fieldIndex, ref)
|
|
8959
|
+
("var e=types[%i].verify(%s,n+1);", fieldIndex, ref)
|
|
8840
8960
|
("if(e)")
|
|
8841
8961
|
("return%j+e", field.name + ".")
|
|
8842
8962
|
("}");
|
|
@@ -8926,9 +9046,12 @@ function genVerifyKey(gen, field, ref) {
|
|
|
8926
9046
|
function verifier(mtype) {
|
|
8927
9047
|
/* eslint-disable no-unexpected-multiline */
|
|
8928
9048
|
|
|
8929
|
-
var gen = util.codegen(["m"], mtype.name + "$verify")
|
|
9049
|
+
var gen = util.codegen(["m", "n"], mtype.name + "$verify")
|
|
8930
9050
|
("if(typeof m!==\"object\"||m===null)")
|
|
8931
|
-
("return%j", "object expected")
|
|
9051
|
+
("return%j", "object expected")
|
|
9052
|
+
("if(n===undefined)n=0")
|
|
9053
|
+
("if(n>util.recursionLimit)")
|
|
9054
|
+
("return%j", "maximum nesting depth exceeded");
|
|
8932
9055
|
var oneofs = mtype.oneofsArray,
|
|
8933
9056
|
seenFirstField = {};
|
|
8934
9057
|
if (oneofs.length) gen
|
|
@@ -8979,7 +9102,8 @@ function verifier(mtype) {
|
|
|
8979
9102
|
("return null");
|
|
8980
9103
|
/* eslint-enable no-unexpected-multiline */
|
|
8981
9104
|
}
|
|
8982
|
-
|
|
9105
|
+
|
|
9106
|
+
},{"15":15,"37":37}],42:[function(require,module,exports){
|
|
8983
9107
|
"use strict";
|
|
8984
9108
|
|
|
8985
9109
|
/**
|
|
@@ -9020,7 +9144,7 @@ var Message = require(21);
|
|
|
9020
9144
|
// Custom wrapper for Any
|
|
9021
9145
|
wrappers[".google.protobuf.Any"] = {
|
|
9022
9146
|
|
|
9023
|
-
fromObject: function(object) {
|
|
9147
|
+
fromObject: function(object, depth) {
|
|
9024
9148
|
|
|
9025
9149
|
// unwrap value type if mapped
|
|
9026
9150
|
if (object && object["@type"]) {
|
|
@@ -9036,14 +9160,15 @@ wrappers[".google.protobuf.Any"] = {
|
|
|
9036
9160
|
if (type_url.indexOf("/") === -1) {
|
|
9037
9161
|
type_url = "/" + type_url;
|
|
9038
9162
|
}
|
|
9163
|
+
var nextDepth = depth === undefined ? 1 : depth + 1;
|
|
9039
9164
|
return this.create({
|
|
9040
9165
|
type_url: type_url,
|
|
9041
|
-
value: type.encode(type.fromObject(object)).finish()
|
|
9166
|
+
value: type.encode(type.fromObject(object, nextDepth)).finish()
|
|
9042
9167
|
});
|
|
9043
9168
|
}
|
|
9044
9169
|
}
|
|
9045
9170
|
|
|
9046
|
-
return this.fromObject(object);
|
|
9171
|
+
return this.fromObject(object, depth);
|
|
9047
9172
|
},
|
|
9048
9173
|
|
|
9049
9174
|
toObject: function(message, options) {
|
|
@@ -9083,7 +9208,7 @@ wrappers[".google.protobuf.Any"] = {
|
|
|
9083
9208
|
}
|
|
9084
9209
|
};
|
|
9085
9210
|
|
|
9086
|
-
},{"21":21}],
|
|
9211
|
+
},{"21":21}],43:[function(require,module,exports){
|
|
9087
9212
|
"use strict";
|
|
9088
9213
|
module.exports = Writer;
|
|
9089
9214
|
|
|
@@ -9550,12 +9675,12 @@ Writer._configure = function(BufferWriter_) {
|
|
|
9550
9675
|
BufferWriter._configure();
|
|
9551
9676
|
};
|
|
9552
9677
|
|
|
9553
|
-
},{"39":39}],
|
|
9678
|
+
},{"39":39}],44:[function(require,module,exports){
|
|
9554
9679
|
"use strict";
|
|
9555
9680
|
module.exports = BufferWriter;
|
|
9556
9681
|
|
|
9557
9682
|
// extends Writer
|
|
9558
|
-
var Writer = require(
|
|
9683
|
+
var Writer = require(43);
|
|
9559
9684
|
(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;
|
|
9560
9685
|
|
|
9561
9686
|
var util = require(39);
|
|
@@ -9637,7 +9762,7 @@ BufferWriter.prototype.string = function write_string_buffer(value) {
|
|
|
9637
9762
|
|
|
9638
9763
|
BufferWriter._configure();
|
|
9639
9764
|
|
|
9640
|
-
},{"39":39,"
|
|
9765
|
+
},{"39":39,"43":43}]},{},[19])
|
|
9641
9766
|
|
|
9642
9767
|
})();
|
|
9643
9768
|
//# sourceMappingURL=protobuf.js.map
|