protobufjs 7.5.4 → 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 +238 -110
- 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 +242 -113
- 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/message.js +7 -3
- 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 +23 -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
|
|
|
@@ -3025,8 +3077,12 @@ var util = require(39);
|
|
|
3025
3077
|
function Message(properties) {
|
|
3026
3078
|
// not used internally
|
|
3027
3079
|
if (properties)
|
|
3028
|
-
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
3029
|
-
|
|
3080
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) {
|
|
3081
|
+
var key = keys[i];
|
|
3082
|
+
if (key === "__proto__")
|
|
3083
|
+
continue;
|
|
3084
|
+
this[key] = properties[key];
|
|
3085
|
+
}
|
|
3030
3086
|
}
|
|
3031
3087
|
|
|
3032
3088
|
/**
|
|
@@ -3149,6 +3205,7 @@ Message.prototype.toJSON = function toJSON() {
|
|
|
3149
3205
|
};
|
|
3150
3206
|
|
|
3151
3207
|
/*eslint-enable valid-jsdoc*/
|
|
3208
|
+
|
|
3152
3209
|
},{"39":39}],22:[function(require,module,exports){
|
|
3153
3210
|
"use strict";
|
|
3154
3211
|
module.exports = Method;
|
|
@@ -3430,7 +3487,7 @@ function Namespace(name, options) {
|
|
|
3430
3487
|
* @type {Object.<string,ReflectionObject|null>}
|
|
3431
3488
|
* @private
|
|
3432
3489
|
*/
|
|
3433
|
-
this._lookupCache =
|
|
3490
|
+
this._lookupCache = Object.create(null);
|
|
3434
3491
|
|
|
3435
3492
|
/**
|
|
3436
3493
|
* Whether or not objects contained in this namespace need feature resolution.
|
|
@@ -3449,12 +3506,12 @@ function Namespace(name, options) {
|
|
|
3449
3506
|
|
|
3450
3507
|
function clearCache(namespace) {
|
|
3451
3508
|
namespace._nestedArray = null;
|
|
3452
|
-
namespace._lookupCache =
|
|
3509
|
+
namespace._lookupCache = Object.create(null);
|
|
3453
3510
|
|
|
3454
3511
|
// Also clear parent caches, since they include nested lookups.
|
|
3455
3512
|
var parent = namespace;
|
|
3456
3513
|
while(parent = parent.parent) {
|
|
3457
|
-
parent._lookupCache =
|
|
3514
|
+
parent._lookupCache = Object.create(null);
|
|
3458
3515
|
}
|
|
3459
3516
|
return namespace;
|
|
3460
3517
|
}
|
|
@@ -3535,8 +3592,9 @@ Namespace.prototype.addJSON = function addJSON(nestedJson) {
|
|
|
3535
3592
|
* @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist
|
|
3536
3593
|
*/
|
|
3537
3594
|
Namespace.prototype.get = function get(name) {
|
|
3538
|
-
return this.nested && this.nested
|
|
3539
|
-
|
|
3595
|
+
return this.nested && Object.prototype.hasOwnProperty.call(this.nested, name)
|
|
3596
|
+
? this.nested[name]
|
|
3597
|
+
: null;
|
|
3540
3598
|
};
|
|
3541
3599
|
|
|
3542
3600
|
/**
|
|
@@ -3547,7 +3605,7 @@ Namespace.prototype.get = function get(name) {
|
|
|
3547
3605
|
* @throws {Error} If there is no such enum
|
|
3548
3606
|
*/
|
|
3549
3607
|
Namespace.prototype.getEnum = function getEnum(name) {
|
|
3550
|
-
if (this.nested && this.nested[name] instanceof Enum)
|
|
3608
|
+
if (this.nested && Object.prototype.hasOwnProperty.call(this.nested, name) && this.nested[name] instanceof Enum)
|
|
3551
3609
|
return this.nested[name].values;
|
|
3552
3610
|
throw Error("no such enum: " + name);
|
|
3553
3611
|
};
|
|
@@ -3564,6 +3622,9 @@ Namespace.prototype.add = function add(object) {
|
|
|
3564
3622
|
if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof OneOf || object instanceof Enum || object instanceof Service || object instanceof Namespace))
|
|
3565
3623
|
throw TypeError("object must be a valid nested object");
|
|
3566
3624
|
|
|
3625
|
+
if (object.name === "__proto__")
|
|
3626
|
+
return this;
|
|
3627
|
+
|
|
3567
3628
|
if (!this.nested)
|
|
3568
3629
|
this.nested = {};
|
|
3569
3630
|
else {
|
|
@@ -4145,6 +4206,8 @@ ReflectionObject.prototype.getOption = function getOption(name) {
|
|
|
4145
4206
|
* @returns {ReflectionObject} `this`
|
|
4146
4207
|
*/
|
|
4147
4208
|
ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) {
|
|
4209
|
+
if (name === "__proto__")
|
|
4210
|
+
return this;
|
|
4148
4211
|
if (!this.options)
|
|
4149
4212
|
this.options = {};
|
|
4150
4213
|
if (/^features\./.test(name)) {
|
|
@@ -4165,6 +4228,8 @@ ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet)
|
|
|
4165
4228
|
* @returns {ReflectionObject} `this`
|
|
4166
4229
|
*/
|
|
4167
4230
|
ReflectionObject.prototype.setParsedOption = function setParsedOption(name, value, propName) {
|
|
4231
|
+
if (name === "__proto__")
|
|
4232
|
+
return this;
|
|
4168
4233
|
if (!this.parsedOptions) {
|
|
4169
4234
|
this.parsedOptions = [];
|
|
4170
4235
|
}
|
|
@@ -4489,9 +4554,9 @@ var base10Re = /^[1-9][0-9]*$/,
|
|
|
4489
4554
|
base16NegRe = /^-?0[x][0-9a-fA-F]+$/,
|
|
4490
4555
|
base8Re = /^0[0-7]+$/,
|
|
4491
4556
|
base8NegRe = /^-?0[0-7]+$/,
|
|
4492
|
-
numberRe =
|
|
4557
|
+
numberRe = util.patterns.numberRe,
|
|
4493
4558
|
nameRe = /^[a-zA-Z_][a-zA-Z_0-9]*$/,
|
|
4494
|
-
typeRefRe =
|
|
4559
|
+
typeRefRe = util.patterns.typeRefRe;
|
|
4495
4560
|
|
|
4496
4561
|
/**
|
|
4497
4562
|
* Result object returned from {@link parse}.
|
|
@@ -5206,7 +5271,8 @@ function parse(source, root, options) {
|
|
|
5206
5271
|
if (prevValue)
|
|
5207
5272
|
value = [].concat(prevValue).concat(value);
|
|
5208
5273
|
|
|
5209
|
-
|
|
5274
|
+
if (propName !== "__proto__")
|
|
5275
|
+
objectResult[propName] = value;
|
|
5210
5276
|
|
|
5211
5277
|
// Semicolons and commas can be optional
|
|
5212
5278
|
skip(",", true);
|
|
@@ -5789,12 +5855,22 @@ Reader.prototype.skip = function skip(length) {
|
|
|
5789
5855
|
return this;
|
|
5790
5856
|
};
|
|
5791
5857
|
|
|
5858
|
+
/**
|
|
5859
|
+
* Recursion limit.
|
|
5860
|
+
* @type {number}
|
|
5861
|
+
*/
|
|
5862
|
+
Reader.recursionLimit = util.recursionLimit;
|
|
5863
|
+
|
|
5792
5864
|
/**
|
|
5793
5865
|
* Skips the next element of the specified wire type.
|
|
5794
5866
|
* @param {number} wireType Wire type received
|
|
5867
|
+
* @param {number} [depth] Depth of recursion to control nested calls; 0 if omitted
|
|
5795
5868
|
* @returns {Reader} `this`
|
|
5796
5869
|
*/
|
|
5797
|
-
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");
|
|
5798
5874
|
switch (wireType) {
|
|
5799
5875
|
case 0:
|
|
5800
5876
|
this.skip();
|
|
@@ -5807,7 +5883,7 @@ Reader.prototype.skipType = function(wireType) {
|
|
|
5807
5883
|
break;
|
|
5808
5884
|
case 3:
|
|
5809
5885
|
while ((wireType = this.uint32() & 7) !== 4) {
|
|
5810
|
-
this.skipType(wireType);
|
|
5886
|
+
this.skipType(wireType, depth + 1);
|
|
5811
5887
|
}
|
|
5812
5888
|
break;
|
|
5813
5889
|
case 5:
|
|
@@ -6525,6 +6601,8 @@ var Method = require(22),
|
|
|
6525
6601
|
util = require(37),
|
|
6526
6602
|
rpc = require(31);
|
|
6527
6603
|
|
|
6604
|
+
var reservedRe = util.patterns.reservedRe;
|
|
6605
|
+
|
|
6528
6606
|
/**
|
|
6529
6607
|
* Constructs a new service instance.
|
|
6530
6608
|
* @classdesc Reflected service.
|
|
@@ -6618,8 +6696,9 @@ function clearCache(service) {
|
|
|
6618
6696
|
* @override
|
|
6619
6697
|
*/
|
|
6620
6698
|
Service.prototype.get = function get(name) {
|
|
6621
|
-
return this.methods
|
|
6622
|
-
|
|
6699
|
+
return Object.prototype.hasOwnProperty.call(this.methods, name)
|
|
6700
|
+
? this.methods[name]
|
|
6701
|
+
: Namespace.prototype.get.call(this, name);
|
|
6623
6702
|
};
|
|
6624
6703
|
|
|
6625
6704
|
/**
|
|
@@ -6654,12 +6733,13 @@ Service.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive
|
|
|
6654
6733
|
* @override
|
|
6655
6734
|
*/
|
|
6656
6735
|
Service.prototype.add = function add(object) {
|
|
6657
|
-
|
|
6658
6736
|
/* istanbul ignore if */
|
|
6659
6737
|
if (this.get(object.name))
|
|
6660
6738
|
throw Error("duplicate name '" + object.name + "' in " + this);
|
|
6661
6739
|
|
|
6662
6740
|
if (object instanceof Method) {
|
|
6741
|
+
if (object.name === "__proto__")
|
|
6742
|
+
return this;
|
|
6663
6743
|
this.methods[object.name] = object;
|
|
6664
6744
|
object.parent = this;
|
|
6665
6745
|
return clearCache(this);
|
|
@@ -6695,7 +6775,7 @@ Service.prototype.create = function create(rpcImpl, requestDelimited, responseDe
|
|
|
6695
6775
|
var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited);
|
|
6696
6776
|
for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) {
|
|
6697
6777
|
var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\w_]/g, "");
|
|
6698
|
-
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)")({
|
|
6699
6779
|
m: method,
|
|
6700
6780
|
q: method.resolvedRequestType.ctor,
|
|
6701
6781
|
s: method.resolvedResponseType.ctor
|
|
@@ -7137,13 +7217,13 @@ var Enum = require(15),
|
|
|
7137
7217
|
Service = require(33),
|
|
7138
7218
|
Message = require(21),
|
|
7139
7219
|
Reader = require(27),
|
|
7140
|
-
Writer = require(
|
|
7220
|
+
Writer = require(43),
|
|
7141
7221
|
util = require(37),
|
|
7142
7222
|
encoder = require(14),
|
|
7143
7223
|
decoder = require(13),
|
|
7144
|
-
verifier = require(
|
|
7224
|
+
verifier = require(41),
|
|
7145
7225
|
converter = require(12),
|
|
7146
|
-
wrappers = require(
|
|
7226
|
+
wrappers = require(42);
|
|
7147
7227
|
|
|
7148
7228
|
/**
|
|
7149
7229
|
* Constructs a new reflected message type instance.
|
|
@@ -7154,6 +7234,7 @@ var Enum = require(15),
|
|
|
7154
7234
|
* @param {Object.<string,*>} [options] Declared options
|
|
7155
7235
|
*/
|
|
7156
7236
|
function Type(name, options) {
|
|
7237
|
+
name = name.replace(/\W/g, "");
|
|
7157
7238
|
Namespace.call(this, name, options);
|
|
7158
7239
|
|
|
7159
7240
|
/**
|
|
@@ -7329,7 +7410,7 @@ Type.generateConstructor = function generateConstructor(mtype) {
|
|
|
7329
7410
|
else if (field.repeated) gen
|
|
7330
7411
|
("this%s=[]", util.safeProp(field.name));
|
|
7331
7412
|
return gen
|
|
7332
|
-
("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
|
|
7333
7414
|
("this[ks[i]]=p[ks[i]]");
|
|
7334
7415
|
/* eslint-enable no-unexpected-multiline */
|
|
7335
7416
|
};
|
|
@@ -7462,10 +7543,13 @@ Type.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(ed
|
|
|
7462
7543
|
* @override
|
|
7463
7544
|
*/
|
|
7464
7545
|
Type.prototype.get = function get(name) {
|
|
7465
|
-
|
|
7466
|
-
|
|
7467
|
-
|
|
7468
|
-
|
|
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;
|
|
7469
7553
|
};
|
|
7470
7554
|
|
|
7471
7555
|
/**
|
|
@@ -7476,7 +7560,6 @@ Type.prototype.get = function get(name) {
|
|
|
7476
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
|
|
7477
7561
|
*/
|
|
7478
7562
|
Type.prototype.add = function add(object) {
|
|
7479
|
-
|
|
7480
7563
|
if (this.get(object.name))
|
|
7481
7564
|
throw Error("duplicate name '" + object.name + "' in " + this);
|
|
7482
7565
|
|
|
@@ -7492,6 +7575,8 @@ Type.prototype.add = function add(object) {
|
|
|
7492
7575
|
throw Error("id " + object.id + " is reserved in " + this);
|
|
7493
7576
|
if (this.isReservedName(object.name))
|
|
7494
7577
|
throw Error("name '" + object.name + "' is reserved in " + this);
|
|
7578
|
+
if (object.name === "__proto__")
|
|
7579
|
+
return this;
|
|
7495
7580
|
|
|
7496
7581
|
if (object.parent)
|
|
7497
7582
|
object.parent.remove(object);
|
|
@@ -7501,6 +7586,8 @@ Type.prototype.add = function add(object) {
|
|
|
7501
7586
|
return clearCache(this);
|
|
7502
7587
|
}
|
|
7503
7588
|
if (object instanceof OneOf) {
|
|
7589
|
+
if (object.name === "__proto__")
|
|
7590
|
+
return this;
|
|
7504
7591
|
if (!this.oneofs)
|
|
7505
7592
|
this.oneofs = {};
|
|
7506
7593
|
this.oneofs[object.name] = object;
|
|
@@ -7649,12 +7736,14 @@ Type.prototype.encodeDelimited = function encodeDelimited(message, writer) {
|
|
|
7649
7736
|
* Decodes a message of this type.
|
|
7650
7737
|
* @param {Reader|Uint8Array} reader Reader or buffer to decode from
|
|
7651
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
|
|
7652
7741
|
* @returns {Message<{}>} Decoded message
|
|
7653
7742
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
7654
7743
|
* @throws {util.ProtocolError<{}>} If required fields are missing
|
|
7655
7744
|
*/
|
|
7656
|
-
Type.prototype.decode = function decode_setup(reader, length) {
|
|
7657
|
-
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
|
|
7658
7747
|
};
|
|
7659
7748
|
|
|
7660
7749
|
/**
|
|
@@ -7673,19 +7762,21 @@ Type.prototype.decodeDelimited = function decodeDelimited(reader) {
|
|
|
7673
7762
|
/**
|
|
7674
7763
|
* Verifies that field values are valid and that required fields are present.
|
|
7675
7764
|
* @param {Object.<string,*>} message Plain object to verify
|
|
7765
|
+
* @param {number} [depth] Current nesting depth
|
|
7676
7766
|
* @returns {null|string} `null` if valid, otherwise the reason why it is not
|
|
7677
7767
|
*/
|
|
7678
|
-
Type.prototype.verify = function verify_setup(message) {
|
|
7679
|
-
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
|
|
7680
7770
|
};
|
|
7681
7771
|
|
|
7682
7772
|
/**
|
|
7683
7773
|
* Creates a new message of this type from a plain object. Also converts values to their respective internal types.
|
|
7684
7774
|
* @param {Object.<string,*>} object Plain object to convert
|
|
7775
|
+
* @param {number} [depth] Current nesting depth
|
|
7685
7776
|
* @returns {Message<{}>} Message instance
|
|
7686
7777
|
*/
|
|
7687
|
-
Type.prototype.fromObject = function fromObject(object) {
|
|
7688
|
-
return this.setup().fromObject(object);
|
|
7778
|
+
Type.prototype.fromObject = function fromObject(object, depth) {
|
|
7779
|
+
return this.setup().fromObject(object, depth);
|
|
7689
7780
|
};
|
|
7690
7781
|
|
|
7691
7782
|
/**
|
|
@@ -7738,7 +7829,7 @@ Type.d = function decorateType(typeName) {
|
|
|
7738
7829
|
};
|
|
7739
7830
|
};
|
|
7740
7831
|
|
|
7741
|
-
},{"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){
|
|
7742
7833
|
"use strict";
|
|
7743
7834
|
|
|
7744
7835
|
/**
|
|
@@ -7768,7 +7859,7 @@ var s = [
|
|
|
7768
7859
|
];
|
|
7769
7860
|
|
|
7770
7861
|
function bake(values, offset) {
|
|
7771
|
-
var i = 0, o =
|
|
7862
|
+
var i = 0, o = Object.create(null);
|
|
7772
7863
|
offset |= 0;
|
|
7773
7864
|
while (i < values.length) o[s[i + offset]] = values[i++];
|
|
7774
7865
|
return o;
|
|
@@ -7953,6 +8044,10 @@ var Type, // cyclic
|
|
|
7953
8044
|
util.codegen = require(3);
|
|
7954
8045
|
util.fetch = require(5);
|
|
7955
8046
|
util.path = require(8);
|
|
8047
|
+
util.patterns = require(40);
|
|
8048
|
+
|
|
8049
|
+
var reservedRe = util.patterns.reservedRe,
|
|
8050
|
+
unsafePropertyRe = util.patterns.unsafePropertyRe;
|
|
7956
8051
|
|
|
7957
8052
|
/**
|
|
7958
8053
|
* Node's fs module if available.
|
|
@@ -7994,16 +8089,13 @@ util.toObject = function toObject(array) {
|
|
|
7994
8089
|
return object;
|
|
7995
8090
|
};
|
|
7996
8091
|
|
|
7997
|
-
var safePropBackslashRe = /\\/g,
|
|
7998
|
-
safePropQuoteRe = /"/g;
|
|
7999
|
-
|
|
8000
8092
|
/**
|
|
8001
8093
|
* Tests whether the specified name is a reserved word in JS.
|
|
8002
8094
|
* @param {string} name Name to test
|
|
8003
8095
|
* @returns {boolean} `true` if reserved, otherwise `false`
|
|
8004
8096
|
*/
|
|
8005
8097
|
util.isReserved = function isReserved(name) {
|
|
8006
|
-
return
|
|
8098
|
+
return reservedRe.test(name);
|
|
8007
8099
|
};
|
|
8008
8100
|
|
|
8009
8101
|
/**
|
|
@@ -8012,8 +8104,8 @@ util.isReserved = function isReserved(name) {
|
|
|
8012
8104
|
* @returns {string} Safe accessor
|
|
8013
8105
|
*/
|
|
8014
8106
|
util.safeProp = function safeProp(prop) {
|
|
8015
|
-
if (!/^[$\w_]+$/.test(prop) ||
|
|
8016
|
-
return "[
|
|
8107
|
+
if (!/^[$\w_]+$/.test(prop) || reservedRe.test(prop))
|
|
8108
|
+
return "[" + JSON.stringify(prop) + "]";
|
|
8017
8109
|
return "." + prop;
|
|
8018
8110
|
};
|
|
8019
8111
|
|
|
@@ -8116,9 +8208,8 @@ util.decorateEnum = function decorateEnum(object) {
|
|
|
8116
8208
|
util.setProperty = function setProperty(dst, path, value, ifNotSet) {
|
|
8117
8209
|
function setProp(dst, path, value) {
|
|
8118
8210
|
var part = path.shift();
|
|
8119
|
-
if (part
|
|
8120
|
-
|
|
8121
|
-
}
|
|
8211
|
+
if (unsafePropertyRe.test(part))
|
|
8212
|
+
return dst;
|
|
8122
8213
|
if (path.length > 0) {
|
|
8123
8214
|
dst[part] = setProp(dst[part] || {}, path, value);
|
|
8124
8215
|
} else {
|
|
@@ -8153,7 +8244,7 @@ Object.defineProperty(util, "decorateRoot", {
|
|
|
8153
8244
|
}
|
|
8154
8245
|
});
|
|
8155
8246
|
|
|
8156
|
-
},{"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){
|
|
8157
8248
|
"use strict";
|
|
8158
8249
|
module.exports = LongBits;
|
|
8159
8250
|
|
|
@@ -8595,12 +8686,35 @@ util.longFromHash = function longFromHash(hash, unsigned) {
|
|
|
8595
8686
|
function merge(dst, src, ifNotSet) { // used by converters
|
|
8596
8687
|
for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)
|
|
8597
8688
|
if (dst[keys[i]] === undefined || !ifNotSet)
|
|
8598
|
-
|
|
8689
|
+
if (keys[i] !== "__proto__")
|
|
8690
|
+
dst[keys[i]] = src[keys[i]];
|
|
8599
8691
|
return dst;
|
|
8600
8692
|
}
|
|
8601
8693
|
|
|
8602
8694
|
util.merge = merge;
|
|
8603
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
|
+
|
|
8604
8718
|
/**
|
|
8605
8719
|
* Converts the first character of a string to lower case.
|
|
8606
8720
|
* @param {string} str String to convert
|
|
@@ -8797,6 +8911,16 @@ util._configure = function() {
|
|
|
8797
8911
|
|
|
8798
8912
|
},{"1":1,"10":10,"2":2,"38":38,"4":4,"6":6,"7":7,"9":9}],40:[function(require,module,exports){
|
|
8799
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";
|
|
8800
8924
|
module.exports = verifier;
|
|
8801
8925
|
|
|
8802
8926
|
var Enum = require(15),
|
|
@@ -8830,7 +8954,7 @@ function genVerifyValue(gen, field, fieldIndex, ref) {
|
|
|
8830
8954
|
} else {
|
|
8831
8955
|
gen
|
|
8832
8956
|
("{")
|
|
8833
|
-
("var e=types[%i].verify(%s);", fieldIndex, ref)
|
|
8957
|
+
("var e=types[%i].verify(%s,n+1);", fieldIndex, ref)
|
|
8834
8958
|
("if(e)")
|
|
8835
8959
|
("return%j+e", field.name + ".")
|
|
8836
8960
|
("}");
|
|
@@ -8920,9 +9044,12 @@ function genVerifyKey(gen, field, ref) {
|
|
|
8920
9044
|
function verifier(mtype) {
|
|
8921
9045
|
/* eslint-disable no-unexpected-multiline */
|
|
8922
9046
|
|
|
8923
|
-
var gen = util.codegen(["m"], mtype.name + "$verify")
|
|
9047
|
+
var gen = util.codegen(["m", "n"], mtype.name + "$verify")
|
|
8924
9048
|
("if(typeof m!==\"object\"||m===null)")
|
|
8925
|
-
("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");
|
|
8926
9053
|
var oneofs = mtype.oneofsArray,
|
|
8927
9054
|
seenFirstField = {};
|
|
8928
9055
|
if (oneofs.length) gen
|
|
@@ -8973,7 +9100,8 @@ function verifier(mtype) {
|
|
|
8973
9100
|
("return null");
|
|
8974
9101
|
/* eslint-enable no-unexpected-multiline */
|
|
8975
9102
|
}
|
|
8976
|
-
|
|
9103
|
+
|
|
9104
|
+
},{"15":15,"37":37}],42:[function(require,module,exports){
|
|
8977
9105
|
"use strict";
|
|
8978
9106
|
|
|
8979
9107
|
/**
|
|
@@ -9014,7 +9142,7 @@ var Message = require(21);
|
|
|
9014
9142
|
// Custom wrapper for Any
|
|
9015
9143
|
wrappers[".google.protobuf.Any"] = {
|
|
9016
9144
|
|
|
9017
|
-
fromObject: function(object) {
|
|
9145
|
+
fromObject: function(object, depth) {
|
|
9018
9146
|
|
|
9019
9147
|
// unwrap value type if mapped
|
|
9020
9148
|
if (object && object["@type"]) {
|
|
@@ -9030,14 +9158,15 @@ wrappers[".google.protobuf.Any"] = {
|
|
|
9030
9158
|
if (type_url.indexOf("/") === -1) {
|
|
9031
9159
|
type_url = "/" + type_url;
|
|
9032
9160
|
}
|
|
9161
|
+
var nextDepth = depth === undefined ? 1 : depth + 1;
|
|
9033
9162
|
return this.create({
|
|
9034
9163
|
type_url: type_url,
|
|
9035
|
-
value: type.encode(type.fromObject(object)).finish()
|
|
9164
|
+
value: type.encode(type.fromObject(object, nextDepth)).finish()
|
|
9036
9165
|
});
|
|
9037
9166
|
}
|
|
9038
9167
|
}
|
|
9039
9168
|
|
|
9040
|
-
return this.fromObject(object);
|
|
9169
|
+
return this.fromObject(object, depth);
|
|
9041
9170
|
},
|
|
9042
9171
|
|
|
9043
9172
|
toObject: function(message, options) {
|
|
@@ -9077,7 +9206,7 @@ wrappers[".google.protobuf.Any"] = {
|
|
|
9077
9206
|
}
|
|
9078
9207
|
};
|
|
9079
9208
|
|
|
9080
|
-
},{"21":21}],
|
|
9209
|
+
},{"21":21}],43:[function(require,module,exports){
|
|
9081
9210
|
"use strict";
|
|
9082
9211
|
module.exports = Writer;
|
|
9083
9212
|
|
|
@@ -9544,12 +9673,12 @@ Writer._configure = function(BufferWriter_) {
|
|
|
9544
9673
|
BufferWriter._configure();
|
|
9545
9674
|
};
|
|
9546
9675
|
|
|
9547
|
-
},{"39":39}],
|
|
9676
|
+
},{"39":39}],44:[function(require,module,exports){
|
|
9548
9677
|
"use strict";
|
|
9549
9678
|
module.exports = BufferWriter;
|
|
9550
9679
|
|
|
9551
9680
|
// extends Writer
|
|
9552
|
-
var Writer = require(
|
|
9681
|
+
var Writer = require(43);
|
|
9553
9682
|
(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;
|
|
9554
9683
|
|
|
9555
9684
|
var util = require(39);
|
|
@@ -9631,7 +9760,7 @@ BufferWriter.prototype.string = function write_string_buffer(value) {
|
|
|
9631
9760
|
|
|
9632
9761
|
BufferWriter._configure();
|
|
9633
9762
|
|
|
9634
|
-
},{"39":39,"
|
|
9763
|
+
},{"39":39,"43":43}]},{},[19])
|
|
9635
9764
|
|
|
9636
9765
|
})();
|
|
9637
9766
|
//# sourceMappingURL=protobuf.js.map
|