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/light/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
|
/**
|
|
@@ -1154,7 +1186,7 @@ function genValuePartial_fromObject(gen, field, fieldIndex, prop) {
|
|
|
1154
1186
|
} else gen
|
|
1155
1187
|
("if(typeof d%s!==\"object\")", prop)
|
|
1156
1188
|
("throw TypeError(%j)", field.fullName + ": object expected")
|
|
1157
|
-
("m%s=types[%i].fromObject(d%s)", prop, fieldIndex, prop);
|
|
1189
|
+
("m%s=types[%i].fromObject(d%s,n+1)", prop, fieldIndex, prop);
|
|
1158
1190
|
} else {
|
|
1159
1191
|
var isUnsigned = false;
|
|
1160
1192
|
switch (field.type) {
|
|
@@ -1216,9 +1248,12 @@ function genValuePartial_fromObject(gen, field, fieldIndex, prop) {
|
|
|
1216
1248
|
converter.fromObject = function fromObject(mtype) {
|
|
1217
1249
|
/* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */
|
|
1218
1250
|
var fields = mtype.fieldsArray;
|
|
1219
|
-
var gen = util.codegen(["d"], mtype.name + "$fromObject")
|
|
1251
|
+
var gen = util.codegen(["d", "n"], mtype.name + "$fromObject")
|
|
1220
1252
|
("if(d instanceof this.ctor)")
|
|
1221
|
-
("return d")
|
|
1253
|
+
("return d")
|
|
1254
|
+
("if(n===undefined)n=0")
|
|
1255
|
+
("if(n>util.recursionLimit)")
|
|
1256
|
+
("throw Error(\"maximum nesting depth exceeded\")");
|
|
1222
1257
|
if (!fields.length) return gen
|
|
1223
1258
|
("return new this.ctor");
|
|
1224
1259
|
gen
|
|
@@ -1234,6 +1269,9 @@ converter.fromObject = function fromObject(mtype) {
|
|
|
1234
1269
|
("throw TypeError(%j)", field.fullName + ": object expected")
|
|
1235
1270
|
("m%s={}", prop)
|
|
1236
1271
|
("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){", prop);
|
|
1272
|
+
gen
|
|
1273
|
+
("if(ks[i]===\"__proto__\")")
|
|
1274
|
+
("util.makeProp(m%s,ks[i])", prop);
|
|
1237
1275
|
genValuePartial_fromObject(gen, field, /* not sorted */ i, prop + "[ks[i]]")
|
|
1238
1276
|
("}")
|
|
1239
1277
|
("}");
|
|
@@ -1364,11 +1402,11 @@ converter.toObject = function toObject(mtype) {
|
|
|
1364
1402
|
("}else")
|
|
1365
1403
|
("d%s=o.longs===String?%j:%i", prop, field.typeDefault.toString(), field.typeDefault.toNumber());
|
|
1366
1404
|
else if (field.bytes) {
|
|
1367
|
-
var arrayDefault =
|
|
1405
|
+
var arrayDefault = Array.prototype.slice.call(field.typeDefault);
|
|
1368
1406
|
gen
|
|
1369
1407
|
("if(o.bytes===String)d%s=%j", prop, String.fromCharCode.apply(String, field.typeDefault))
|
|
1370
1408
|
("else{")
|
|
1371
|
-
("d%s=%
|
|
1409
|
+
("d%s=%j", prop, arrayDefault)
|
|
1372
1410
|
("if(o.bytes!==Array)d%s=util.newBuffer(d%s)", prop, prop)
|
|
1373
1411
|
("}");
|
|
1374
1412
|
} else gen
|
|
@@ -1388,6 +1426,9 @@ converter.toObject = function toObject(mtype) {
|
|
|
1388
1426
|
("if(m%s&&(ks2=Object.keys(m%s)).length){", prop, prop)
|
|
1389
1427
|
("d%s={}", prop)
|
|
1390
1428
|
("for(var j=0;j<ks2.length;++j){");
|
|
1429
|
+
gen
|
|
1430
|
+
("if(ks2[j]===\"__proto__\")")
|
|
1431
|
+
("util.makeProp(d%s,ks2[j])", prop);
|
|
1391
1432
|
genValuePartial_toObject(gen, field, /* sorted */ index, prop + "[ks2[j]]")
|
|
1392
1433
|
("}");
|
|
1393
1434
|
} else if (field.repeated) { gen
|
|
@@ -1430,9 +1471,12 @@ function missing(field) {
|
|
|
1430
1471
|
*/
|
|
1431
1472
|
function decoder(mtype) {
|
|
1432
1473
|
/* eslint-disable no-unexpected-multiline */
|
|
1433
|
-
var gen = util.codegen(["r", "l", "e"], mtype.name + "$decode")
|
|
1474
|
+
var gen = util.codegen(["r", "l", "e", "n"], mtype.name + "$decode")
|
|
1434
1475
|
("if(!(r instanceof Reader))")
|
|
1435
1476
|
("r=Reader.create(r)")
|
|
1477
|
+
("if(n===undefined)n=0")
|
|
1478
|
+
("if(n>Reader.recursionLimit)")
|
|
1479
|
+
("throw Error(\"maximum nesting depth exceeded\")")
|
|
1436
1480
|
("var c=l===undefined?r.len:r.pos+l,m=new this.ctor" + (mtype.fieldsArray.filter(function(field) { return field.map; }).length ? ",k,value" : ""))
|
|
1437
1481
|
("while(r.pos<c){")
|
|
1438
1482
|
("var t=r.uint32()")
|
|
@@ -1471,22 +1515,27 @@ function decoder(mtype) {
|
|
|
1471
1515
|
("case 2:");
|
|
1472
1516
|
|
|
1473
1517
|
if (types.basic[type] === undefined) gen
|
|
1474
|
-
("value=types[%i].decode(r,r.uint32())", i); // can't be groups
|
|
1518
|
+
("value=types[%i].decode(r,r.uint32(),undefined,n+1)", i); // can't be groups
|
|
1475
1519
|
else gen
|
|
1476
1520
|
("value=r.%s()", type);
|
|
1477
1521
|
|
|
1478
1522
|
gen
|
|
1479
1523
|
("break")
|
|
1480
1524
|
("default:")
|
|
1481
|
-
("r.skipType(tag2&7)")
|
|
1525
|
+
("r.skipType(tag2&7,n)")
|
|
1482
1526
|
("break")
|
|
1483
1527
|
("}")
|
|
1484
1528
|
("}");
|
|
1485
1529
|
|
|
1486
1530
|
if (types.long[field.keyType] !== undefined) gen
|
|
1487
1531
|
("%s[typeof k===\"object\"?util.longToHash(k):k]=value", ref);
|
|
1488
|
-
else
|
|
1532
|
+
else {
|
|
1533
|
+
if (field.keyType === "string") gen
|
|
1534
|
+
("if(k===\"__proto__\")")
|
|
1535
|
+
("util.makeProp(%s,k)", ref);
|
|
1536
|
+
gen
|
|
1489
1537
|
("%s[k]=value", ref);
|
|
1538
|
+
}
|
|
1490
1539
|
|
|
1491
1540
|
// Repeated fields
|
|
1492
1541
|
} else if (field.repeated) { gen
|
|
@@ -1504,15 +1553,15 @@ function decoder(mtype) {
|
|
|
1504
1553
|
|
|
1505
1554
|
// Non-packed
|
|
1506
1555
|
if (types.basic[type] === undefined) gen(field.delimited
|
|
1507
|
-
? "%s.push(types[%i].decode(r,undefined,((t&~7)|4)))"
|
|
1508
|
-
: "%s.push(types[%i].decode(r,r.uint32()))", ref, i);
|
|
1556
|
+
? "%s.push(types[%i].decode(r,undefined,((t&~7)|4),n+1))"
|
|
1557
|
+
: "%s.push(types[%i].decode(r,r.uint32(),undefined,n+1))", ref, i);
|
|
1509
1558
|
else gen
|
|
1510
1559
|
("%s.push(r.%s())", ref, type);
|
|
1511
1560
|
|
|
1512
1561
|
// Non-repeated
|
|
1513
1562
|
} else if (types.basic[type] === undefined) gen(field.delimited
|
|
1514
|
-
? "%s=types[%i].decode(r,undefined,((t&~7)|4))"
|
|
1515
|
-
: "%s=types[%i].decode(r,r.uint32())", ref, i);
|
|
1563
|
+
? "%s=types[%i].decode(r,undefined,((t&~7)|4),n+1)"
|
|
1564
|
+
: "%s=types[%i].decode(r,r.uint32(),undefined,n+1)", ref, i);
|
|
1516
1565
|
else gen
|
|
1517
1566
|
("%s=r.%s()", ref, type);
|
|
1518
1567
|
gen
|
|
@@ -1521,7 +1570,7 @@ function decoder(mtype) {
|
|
|
1521
1570
|
// Unknown fields
|
|
1522
1571
|
} gen
|
|
1523
1572
|
("default:")
|
|
1524
|
-
("r.skipType(t&7)")
|
|
1573
|
+
("r.skipType(t&7,n)")
|
|
1525
1574
|
("break")
|
|
1526
1575
|
|
|
1527
1576
|
("}")
|
|
@@ -1719,7 +1768,7 @@ function Enum(name, values, options, comment, comments, valuesOptions) {
|
|
|
1719
1768
|
|
|
1720
1769
|
if (values)
|
|
1721
1770
|
for (var keys = Object.keys(values), i = 0; i < keys.length; ++i)
|
|
1722
|
-
if (typeof values[keys[i]] === "number") // use forward entries only
|
|
1771
|
+
if (keys[i] !== "__proto__" && typeof values[keys[i]] === "number") // use forward entries only
|
|
1723
1772
|
this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i];
|
|
1724
1773
|
}
|
|
1725
1774
|
|
|
@@ -1798,6 +1847,9 @@ Enum.prototype.add = function add(name, id, comment, options) {
|
|
|
1798
1847
|
if (!util.isInteger(id))
|
|
1799
1848
|
throw TypeError("id must be an integer");
|
|
1800
1849
|
|
|
1850
|
+
if (name === "__proto__")
|
|
1851
|
+
return this;
|
|
1852
|
+
|
|
1801
1853
|
if (this.values[name] !== undefined)
|
|
1802
1854
|
throw Error("duplicate name '" + name + "' in " + this);
|
|
1803
1855
|
|
|
@@ -2399,7 +2451,7 @@ protobuf.loadSync = loadSync;
|
|
|
2399
2451
|
// Serialization
|
|
2400
2452
|
protobuf.encoder = require(13);
|
|
2401
2453
|
protobuf.decoder = require(12);
|
|
2402
|
-
protobuf.verifier = require(
|
|
2454
|
+
protobuf.verifier = require(37);
|
|
2403
2455
|
protobuf.converter = require(11);
|
|
2404
2456
|
|
|
2405
2457
|
// Reflection
|
|
@@ -2416,7 +2468,7 @@ protobuf.Method = require(20);
|
|
|
2416
2468
|
|
|
2417
2469
|
// Runtime
|
|
2418
2470
|
protobuf.Message = require(19);
|
|
2419
|
-
protobuf.wrappers = require(
|
|
2471
|
+
protobuf.wrappers = require(38);
|
|
2420
2472
|
|
|
2421
2473
|
// Utility
|
|
2422
2474
|
protobuf.types = require(32);
|
|
@@ -2428,7 +2480,7 @@ protobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum);
|
|
|
2428
2480
|
protobuf.Root._configure(protobuf.Type);
|
|
2429
2481
|
protobuf.Field._configure(protobuf.Type);
|
|
2430
2482
|
|
|
2431
|
-
},{"11":11,"12":12,"13":13,"14":14,"15":15,"17":17,"18":18,"19":19,"20":20,"21":21,"22":22,"23":23,"26":26,"30":30,"31":31,"32":32,"33":33,"
|
|
2483
|
+
},{"11":11,"12":12,"13":13,"14":14,"15":15,"17":17,"18":18,"19":19,"20":20,"21":21,"22":22,"23":23,"26":26,"30":30,"31":31,"32":32,"33":33,"37":37,"38":38}],17:[function(require,module,exports){
|
|
2432
2484
|
"use strict";
|
|
2433
2485
|
var protobuf = exports;
|
|
2434
2486
|
|
|
@@ -2441,8 +2493,8 @@ var protobuf = exports;
|
|
|
2441
2493
|
protobuf.build = "minimal";
|
|
2442
2494
|
|
|
2443
2495
|
// Serialization
|
|
2444
|
-
protobuf.Writer = require(
|
|
2445
|
-
protobuf.BufferWriter = require(
|
|
2496
|
+
protobuf.Writer = require(39);
|
|
2497
|
+
protobuf.BufferWriter = require(40);
|
|
2446
2498
|
protobuf.Reader = require(24);
|
|
2447
2499
|
protobuf.BufferReader = require(25);
|
|
2448
2500
|
|
|
@@ -2466,7 +2518,7 @@ function configure() {
|
|
|
2466
2518
|
// Set up buffer utility according to the environment
|
|
2467
2519
|
configure();
|
|
2468
2520
|
|
|
2469
|
-
},{"24":24,"25":25,"27":27,"28":28,"35":35,"
|
|
2521
|
+
},{"24":24,"25":25,"27":27,"28":28,"35":35,"39":39,"40":40}],18:[function(require,module,exports){
|
|
2470
2522
|
"use strict";
|
|
2471
2523
|
module.exports = MapField;
|
|
2472
2524
|
|
|
@@ -2610,8 +2662,12 @@ var util = require(35);
|
|
|
2610
2662
|
function Message(properties) {
|
|
2611
2663
|
// not used internally
|
|
2612
2664
|
if (properties)
|
|
2613
|
-
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
2614
|
-
|
|
2665
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) {
|
|
2666
|
+
var key = keys[i];
|
|
2667
|
+
if (key === "__proto__")
|
|
2668
|
+
continue;
|
|
2669
|
+
this[key] = properties[key];
|
|
2670
|
+
}
|
|
2615
2671
|
}
|
|
2616
2672
|
|
|
2617
2673
|
/**
|
|
@@ -2734,6 +2790,7 @@ Message.prototype.toJSON = function toJSON() {
|
|
|
2734
2790
|
};
|
|
2735
2791
|
|
|
2736
2792
|
/*eslint-enable valid-jsdoc*/
|
|
2793
|
+
|
|
2737
2794
|
},{"35":35}],20:[function(require,module,exports){
|
|
2738
2795
|
"use strict";
|
|
2739
2796
|
module.exports = Method;
|
|
@@ -3015,7 +3072,7 @@ function Namespace(name, options) {
|
|
|
3015
3072
|
* @type {Object.<string,ReflectionObject|null>}
|
|
3016
3073
|
* @private
|
|
3017
3074
|
*/
|
|
3018
|
-
this._lookupCache =
|
|
3075
|
+
this._lookupCache = Object.create(null);
|
|
3019
3076
|
|
|
3020
3077
|
/**
|
|
3021
3078
|
* Whether or not objects contained in this namespace need feature resolution.
|
|
@@ -3034,12 +3091,12 @@ function Namespace(name, options) {
|
|
|
3034
3091
|
|
|
3035
3092
|
function clearCache(namespace) {
|
|
3036
3093
|
namespace._nestedArray = null;
|
|
3037
|
-
namespace._lookupCache =
|
|
3094
|
+
namespace._lookupCache = Object.create(null);
|
|
3038
3095
|
|
|
3039
3096
|
// Also clear parent caches, since they include nested lookups.
|
|
3040
3097
|
var parent = namespace;
|
|
3041
3098
|
while(parent = parent.parent) {
|
|
3042
|
-
parent._lookupCache =
|
|
3099
|
+
parent._lookupCache = Object.create(null);
|
|
3043
3100
|
}
|
|
3044
3101
|
return namespace;
|
|
3045
3102
|
}
|
|
@@ -3120,8 +3177,9 @@ Namespace.prototype.addJSON = function addJSON(nestedJson) {
|
|
|
3120
3177
|
* @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist
|
|
3121
3178
|
*/
|
|
3122
3179
|
Namespace.prototype.get = function get(name) {
|
|
3123
|
-
return this.nested && this.nested
|
|
3124
|
-
|
|
3180
|
+
return this.nested && Object.prototype.hasOwnProperty.call(this.nested, name)
|
|
3181
|
+
? this.nested[name]
|
|
3182
|
+
: null;
|
|
3125
3183
|
};
|
|
3126
3184
|
|
|
3127
3185
|
/**
|
|
@@ -3132,7 +3190,7 @@ Namespace.prototype.get = function get(name) {
|
|
|
3132
3190
|
* @throws {Error} If there is no such enum
|
|
3133
3191
|
*/
|
|
3134
3192
|
Namespace.prototype.getEnum = function getEnum(name) {
|
|
3135
|
-
if (this.nested && this.nested[name] instanceof Enum)
|
|
3193
|
+
if (this.nested && Object.prototype.hasOwnProperty.call(this.nested, name) && this.nested[name] instanceof Enum)
|
|
3136
3194
|
return this.nested[name].values;
|
|
3137
3195
|
throw Error("no such enum: " + name);
|
|
3138
3196
|
};
|
|
@@ -3149,6 +3207,9 @@ Namespace.prototype.add = function add(object) {
|
|
|
3149
3207
|
if (!(object instanceof Field && object.extend !== undefined || object instanceof Type || object instanceof OneOf || object instanceof Enum || object instanceof Service || object instanceof Namespace))
|
|
3150
3208
|
throw TypeError("object must be a valid nested object");
|
|
3151
3209
|
|
|
3210
|
+
if (object.name === "__proto__")
|
|
3211
|
+
return this;
|
|
3212
|
+
|
|
3152
3213
|
if (!this.nested)
|
|
3153
3214
|
this.nested = {};
|
|
3154
3215
|
else {
|
|
@@ -3730,6 +3791,8 @@ ReflectionObject.prototype.getOption = function getOption(name) {
|
|
|
3730
3791
|
* @returns {ReflectionObject} `this`
|
|
3731
3792
|
*/
|
|
3732
3793
|
ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) {
|
|
3794
|
+
if (name === "__proto__")
|
|
3795
|
+
return this;
|
|
3733
3796
|
if (!this.options)
|
|
3734
3797
|
this.options = {};
|
|
3735
3798
|
if (/^features\./.test(name)) {
|
|
@@ -3750,6 +3813,8 @@ ReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet)
|
|
|
3750
3813
|
* @returns {ReflectionObject} `this`
|
|
3751
3814
|
*/
|
|
3752
3815
|
ReflectionObject.prototype.setParsedOption = function setParsedOption(name, value, propName) {
|
|
3816
|
+
if (name === "__proto__")
|
|
3817
|
+
return this;
|
|
3753
3818
|
if (!this.parsedOptions) {
|
|
3754
3819
|
this.parsedOptions = [];
|
|
3755
3820
|
}
|
|
@@ -4403,12 +4468,22 @@ Reader.prototype.skip = function skip(length) {
|
|
|
4403
4468
|
return this;
|
|
4404
4469
|
};
|
|
4405
4470
|
|
|
4471
|
+
/**
|
|
4472
|
+
* Recursion limit.
|
|
4473
|
+
* @type {number}
|
|
4474
|
+
*/
|
|
4475
|
+
Reader.recursionLimit = util.recursionLimit;
|
|
4476
|
+
|
|
4406
4477
|
/**
|
|
4407
4478
|
* Skips the next element of the specified wire type.
|
|
4408
4479
|
* @param {number} wireType Wire type received
|
|
4480
|
+
* @param {number} [depth] Depth of recursion to control nested calls; 0 if omitted
|
|
4409
4481
|
* @returns {Reader} `this`
|
|
4410
4482
|
*/
|
|
4411
|
-
Reader.prototype.skipType = function(wireType) {
|
|
4483
|
+
Reader.prototype.skipType = function(wireType, depth) {
|
|
4484
|
+
if (depth === undefined) depth = 0;
|
|
4485
|
+
if (depth > Reader.recursionLimit)
|
|
4486
|
+
throw Error("maximum nesting depth exceeded");
|
|
4412
4487
|
switch (wireType) {
|
|
4413
4488
|
case 0:
|
|
4414
4489
|
this.skip();
|
|
@@ -4421,7 +4496,7 @@ Reader.prototype.skipType = function(wireType) {
|
|
|
4421
4496
|
break;
|
|
4422
4497
|
case 3:
|
|
4423
4498
|
while ((wireType = this.uint32() & 7) !== 4) {
|
|
4424
|
-
this.skipType(wireType);
|
|
4499
|
+
this.skipType(wireType, depth + 1);
|
|
4425
4500
|
}
|
|
4426
4501
|
break;
|
|
4427
4502
|
case 5:
|
|
@@ -5139,6 +5214,8 @@ var Method = require(20),
|
|
|
5139
5214
|
util = require(33),
|
|
5140
5215
|
rpc = require(28);
|
|
5141
5216
|
|
|
5217
|
+
var reservedRe = util.patterns.reservedRe;
|
|
5218
|
+
|
|
5142
5219
|
/**
|
|
5143
5220
|
* Constructs a new service instance.
|
|
5144
5221
|
* @classdesc Reflected service.
|
|
@@ -5232,8 +5309,9 @@ function clearCache(service) {
|
|
|
5232
5309
|
* @override
|
|
5233
5310
|
*/
|
|
5234
5311
|
Service.prototype.get = function get(name) {
|
|
5235
|
-
return this.methods
|
|
5236
|
-
|
|
5312
|
+
return Object.prototype.hasOwnProperty.call(this.methods, name)
|
|
5313
|
+
? this.methods[name]
|
|
5314
|
+
: Namespace.prototype.get.call(this, name);
|
|
5237
5315
|
};
|
|
5238
5316
|
|
|
5239
5317
|
/**
|
|
@@ -5268,12 +5346,13 @@ Service.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive
|
|
|
5268
5346
|
* @override
|
|
5269
5347
|
*/
|
|
5270
5348
|
Service.prototype.add = function add(object) {
|
|
5271
|
-
|
|
5272
5349
|
/* istanbul ignore if */
|
|
5273
5350
|
if (this.get(object.name))
|
|
5274
5351
|
throw Error("duplicate name '" + object.name + "' in " + this);
|
|
5275
5352
|
|
|
5276
5353
|
if (object instanceof Method) {
|
|
5354
|
+
if (object.name === "__proto__")
|
|
5355
|
+
return this;
|
|
5277
5356
|
this.methods[object.name] = object;
|
|
5278
5357
|
object.parent = this;
|
|
5279
5358
|
return clearCache(this);
|
|
@@ -5309,7 +5388,7 @@ Service.prototype.create = function create(rpcImpl, requestDelimited, responseDe
|
|
|
5309
5388
|
var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited);
|
|
5310
5389
|
for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) {
|
|
5311
5390
|
var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\w_]/g, "");
|
|
5312
|
-
rpcService[methodName] = util.codegen(["r","c"],
|
|
5391
|
+
rpcService[methodName] = util.codegen(["r","c"], reservedRe.test(methodName) ? methodName + "_" : methodName)("return this.rpcCall(m,q,s,r,c)")({
|
|
5313
5392
|
m: method,
|
|
5314
5393
|
q: method.resolvedRequestType.ctor,
|
|
5315
5394
|
s: method.resolvedResponseType.ctor
|
|
@@ -5333,13 +5412,13 @@ var Enum = require(14),
|
|
|
5333
5412
|
Service = require(30),
|
|
5334
5413
|
Message = require(19),
|
|
5335
5414
|
Reader = require(24),
|
|
5336
|
-
Writer = require(
|
|
5415
|
+
Writer = require(39),
|
|
5337
5416
|
util = require(33),
|
|
5338
5417
|
encoder = require(13),
|
|
5339
5418
|
decoder = require(12),
|
|
5340
|
-
verifier = require(
|
|
5419
|
+
verifier = require(37),
|
|
5341
5420
|
converter = require(11),
|
|
5342
|
-
wrappers = require(
|
|
5421
|
+
wrappers = require(38);
|
|
5343
5422
|
|
|
5344
5423
|
/**
|
|
5345
5424
|
* Constructs a new reflected message type instance.
|
|
@@ -5350,6 +5429,7 @@ var Enum = require(14),
|
|
|
5350
5429
|
* @param {Object.<string,*>} [options] Declared options
|
|
5351
5430
|
*/
|
|
5352
5431
|
function Type(name, options) {
|
|
5432
|
+
name = name.replace(/\W/g, "");
|
|
5353
5433
|
Namespace.call(this, name, options);
|
|
5354
5434
|
|
|
5355
5435
|
/**
|
|
@@ -5525,7 +5605,7 @@ Type.generateConstructor = function generateConstructor(mtype) {
|
|
|
5525
5605
|
else if (field.repeated) gen
|
|
5526
5606
|
("this%s=[]", util.safeProp(field.name));
|
|
5527
5607
|
return gen
|
|
5528
|
-
("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)") // omit undefined or null
|
|
5608
|
+
("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
|
|
5529
5609
|
("this[ks[i]]=p[ks[i]]");
|
|
5530
5610
|
/* eslint-enable no-unexpected-multiline */
|
|
5531
5611
|
};
|
|
@@ -5658,10 +5738,13 @@ Type.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(ed
|
|
|
5658
5738
|
* @override
|
|
5659
5739
|
*/
|
|
5660
5740
|
Type.prototype.get = function get(name) {
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
|
|
5741
|
+
if (Object.prototype.hasOwnProperty.call(this.fields, name))
|
|
5742
|
+
return this.fields[name];
|
|
5743
|
+
if (this.oneofs && Object.prototype.hasOwnProperty.call(this.oneofs, name))
|
|
5744
|
+
return this.oneofs[name];
|
|
5745
|
+
if (this.nested && Object.prototype.hasOwnProperty.call(this.nested, name))
|
|
5746
|
+
return this.nested[name];
|
|
5747
|
+
return null;
|
|
5665
5748
|
};
|
|
5666
5749
|
|
|
5667
5750
|
/**
|
|
@@ -5672,7 +5755,6 @@ Type.prototype.get = function get(name) {
|
|
|
5672
5755
|
* @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
|
|
5673
5756
|
*/
|
|
5674
5757
|
Type.prototype.add = function add(object) {
|
|
5675
|
-
|
|
5676
5758
|
if (this.get(object.name))
|
|
5677
5759
|
throw Error("duplicate name '" + object.name + "' in " + this);
|
|
5678
5760
|
|
|
@@ -5688,6 +5770,8 @@ Type.prototype.add = function add(object) {
|
|
|
5688
5770
|
throw Error("id " + object.id + " is reserved in " + this);
|
|
5689
5771
|
if (this.isReservedName(object.name))
|
|
5690
5772
|
throw Error("name '" + object.name + "' is reserved in " + this);
|
|
5773
|
+
if (object.name === "__proto__")
|
|
5774
|
+
return this;
|
|
5691
5775
|
|
|
5692
5776
|
if (object.parent)
|
|
5693
5777
|
object.parent.remove(object);
|
|
@@ -5697,6 +5781,8 @@ Type.prototype.add = function add(object) {
|
|
|
5697
5781
|
return clearCache(this);
|
|
5698
5782
|
}
|
|
5699
5783
|
if (object instanceof OneOf) {
|
|
5784
|
+
if (object.name === "__proto__")
|
|
5785
|
+
return this;
|
|
5700
5786
|
if (!this.oneofs)
|
|
5701
5787
|
this.oneofs = {};
|
|
5702
5788
|
this.oneofs[object.name] = object;
|
|
@@ -5845,12 +5931,14 @@ Type.prototype.encodeDelimited = function encodeDelimited(message, writer) {
|
|
|
5845
5931
|
* Decodes a message of this type.
|
|
5846
5932
|
* @param {Reader|Uint8Array} reader Reader or buffer to decode from
|
|
5847
5933
|
* @param {number} [length] Length of the message, if known beforehand
|
|
5934
|
+
* @param {number} [end] Expected group end tag, if decoding a group
|
|
5935
|
+
* @param {number} [depth] Current nesting depth
|
|
5848
5936
|
* @returns {Message<{}>} Decoded message
|
|
5849
5937
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
5850
5938
|
* @throws {util.ProtocolError<{}>} If required fields are missing
|
|
5851
5939
|
*/
|
|
5852
|
-
Type.prototype.decode = function decode_setup(reader, length) {
|
|
5853
|
-
return this.setup().decode(reader, length); // overrides this method
|
|
5940
|
+
Type.prototype.decode = function decode_setup(reader, length, end, depth) {
|
|
5941
|
+
return this.setup().decode(reader, length, end, depth); // overrides this method
|
|
5854
5942
|
};
|
|
5855
5943
|
|
|
5856
5944
|
/**
|
|
@@ -5869,19 +5957,21 @@ Type.prototype.decodeDelimited = function decodeDelimited(reader) {
|
|
|
5869
5957
|
/**
|
|
5870
5958
|
* Verifies that field values are valid and that required fields are present.
|
|
5871
5959
|
* @param {Object.<string,*>} message Plain object to verify
|
|
5960
|
+
* @param {number} [depth] Current nesting depth
|
|
5872
5961
|
* @returns {null|string} `null` if valid, otherwise the reason why it is not
|
|
5873
5962
|
*/
|
|
5874
|
-
Type.prototype.verify = function verify_setup(message) {
|
|
5875
|
-
return this.setup().verify(message); // overrides this method
|
|
5963
|
+
Type.prototype.verify = function verify_setup(message, depth) {
|
|
5964
|
+
return this.setup().verify(message, depth); // overrides this method
|
|
5876
5965
|
};
|
|
5877
5966
|
|
|
5878
5967
|
/**
|
|
5879
5968
|
* Creates a new message of this type from a plain object. Also converts values to their respective internal types.
|
|
5880
5969
|
* @param {Object.<string,*>} object Plain object to convert
|
|
5970
|
+
* @param {number} [depth] Current nesting depth
|
|
5881
5971
|
* @returns {Message<{}>} Message instance
|
|
5882
5972
|
*/
|
|
5883
|
-
Type.prototype.fromObject = function fromObject(object) {
|
|
5884
|
-
return this.setup().fromObject(object);
|
|
5973
|
+
Type.prototype.fromObject = function fromObject(object, depth) {
|
|
5974
|
+
return this.setup().fromObject(object, depth);
|
|
5885
5975
|
};
|
|
5886
5976
|
|
|
5887
5977
|
/**
|
|
@@ -5934,7 +6024,7 @@ Type.d = function decorateType(typeName) {
|
|
|
5934
6024
|
};
|
|
5935
6025
|
};
|
|
5936
6026
|
|
|
5937
|
-
},{"11":11,"12":12,"13":13,"14":14,"15":15,"18":18,"19":19,"21":21,"23":23,"24":24,"30":30,"33":33,"
|
|
6027
|
+
},{"11":11,"12":12,"13":13,"14":14,"15":15,"18":18,"19":19,"21":21,"23":23,"24":24,"30":30,"33":33,"37":37,"38":38,"39":39}],32:[function(require,module,exports){
|
|
5938
6028
|
"use strict";
|
|
5939
6029
|
|
|
5940
6030
|
/**
|
|
@@ -5964,7 +6054,7 @@ var s = [
|
|
|
5964
6054
|
];
|
|
5965
6055
|
|
|
5966
6056
|
function bake(values, offset) {
|
|
5967
|
-
var i = 0, o =
|
|
6057
|
+
var i = 0, o = Object.create(null);
|
|
5968
6058
|
offset |= 0;
|
|
5969
6059
|
while (i < values.length) o[s[i + offset]] = values[i++];
|
|
5970
6060
|
return o;
|
|
@@ -6149,6 +6239,10 @@ var Type, // cyclic
|
|
|
6149
6239
|
util.codegen = require(3);
|
|
6150
6240
|
util.fetch = require(5);
|
|
6151
6241
|
util.path = require(8);
|
|
6242
|
+
util.patterns = require(36);
|
|
6243
|
+
|
|
6244
|
+
var reservedRe = util.patterns.reservedRe,
|
|
6245
|
+
unsafePropertyRe = util.patterns.unsafePropertyRe;
|
|
6152
6246
|
|
|
6153
6247
|
/**
|
|
6154
6248
|
* Node's fs module if available.
|
|
@@ -6190,16 +6284,13 @@ util.toObject = function toObject(array) {
|
|
|
6190
6284
|
return object;
|
|
6191
6285
|
};
|
|
6192
6286
|
|
|
6193
|
-
var safePropBackslashRe = /\\/g,
|
|
6194
|
-
safePropQuoteRe = /"/g;
|
|
6195
|
-
|
|
6196
6287
|
/**
|
|
6197
6288
|
* Tests whether the specified name is a reserved word in JS.
|
|
6198
6289
|
* @param {string} name Name to test
|
|
6199
6290
|
* @returns {boolean} `true` if reserved, otherwise `false`
|
|
6200
6291
|
*/
|
|
6201
6292
|
util.isReserved = function isReserved(name) {
|
|
6202
|
-
return
|
|
6293
|
+
return reservedRe.test(name);
|
|
6203
6294
|
};
|
|
6204
6295
|
|
|
6205
6296
|
/**
|
|
@@ -6208,8 +6299,8 @@ util.isReserved = function isReserved(name) {
|
|
|
6208
6299
|
* @returns {string} Safe accessor
|
|
6209
6300
|
*/
|
|
6210
6301
|
util.safeProp = function safeProp(prop) {
|
|
6211
|
-
if (!/^[$\w_]+$/.test(prop) ||
|
|
6212
|
-
return "[
|
|
6302
|
+
if (!/^[$\w_]+$/.test(prop) || reservedRe.test(prop))
|
|
6303
|
+
return "[" + JSON.stringify(prop) + "]";
|
|
6213
6304
|
return "." + prop;
|
|
6214
6305
|
};
|
|
6215
6306
|
|
|
@@ -6312,9 +6403,8 @@ util.decorateEnum = function decorateEnum(object) {
|
|
|
6312
6403
|
util.setProperty = function setProperty(dst, path, value, ifNotSet) {
|
|
6313
6404
|
function setProp(dst, path, value) {
|
|
6314
6405
|
var part = path.shift();
|
|
6315
|
-
if (part
|
|
6316
|
-
|
|
6317
|
-
}
|
|
6406
|
+
if (unsafePropertyRe.test(part))
|
|
6407
|
+
return dst;
|
|
6318
6408
|
if (path.length > 0) {
|
|
6319
6409
|
dst[part] = setProp(dst[part] || {}, path, value);
|
|
6320
6410
|
} else {
|
|
@@ -6349,7 +6439,7 @@ Object.defineProperty(util, "decorateRoot", {
|
|
|
6349
6439
|
}
|
|
6350
6440
|
});
|
|
6351
6441
|
|
|
6352
|
-
},{"14":14,"26":26,"27":27,"3":3,"31":31,"35":35,"5":5,"8":8}],34:[function(require,module,exports){
|
|
6442
|
+
},{"14":14,"26":26,"27":27,"3":3,"31":31,"35":35,"36":36,"5":5,"8":8}],34:[function(require,module,exports){
|
|
6353
6443
|
"use strict";
|
|
6354
6444
|
module.exports = LongBits;
|
|
6355
6445
|
|
|
@@ -6791,12 +6881,35 @@ util.longFromHash = function longFromHash(hash, unsigned) {
|
|
|
6791
6881
|
function merge(dst, src, ifNotSet) { // used by converters
|
|
6792
6882
|
for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)
|
|
6793
6883
|
if (dst[keys[i]] === undefined || !ifNotSet)
|
|
6794
|
-
|
|
6884
|
+
if (keys[i] !== "__proto__")
|
|
6885
|
+
dst[keys[i]] = src[keys[i]];
|
|
6795
6886
|
return dst;
|
|
6796
6887
|
}
|
|
6797
6888
|
|
|
6798
6889
|
util.merge = merge;
|
|
6799
6890
|
|
|
6891
|
+
/**
|
|
6892
|
+
* Recursion limit.
|
|
6893
|
+
* @memberof util
|
|
6894
|
+
* @type {number}
|
|
6895
|
+
*/
|
|
6896
|
+
util.recursionLimit = 100;
|
|
6897
|
+
|
|
6898
|
+
/**
|
|
6899
|
+
* Makes a property safe for assignment as an own property.
|
|
6900
|
+
* @memberof util
|
|
6901
|
+
* @param {Object.<string,*>} obj Object
|
|
6902
|
+
* @param {string} key Property key
|
|
6903
|
+
* @returns {undefined}
|
|
6904
|
+
*/
|
|
6905
|
+
util.makeProp = function makeProp(obj, key) {
|
|
6906
|
+
Object.defineProperty(obj, key, {
|
|
6907
|
+
enumerable: true,
|
|
6908
|
+
configurable: true,
|
|
6909
|
+
writable: true
|
|
6910
|
+
});
|
|
6911
|
+
};
|
|
6912
|
+
|
|
6800
6913
|
/**
|
|
6801
6914
|
* Converts the first character of a string to lower case.
|
|
6802
6915
|
* @param {string} str String to convert
|
|
@@ -6993,6 +7106,16 @@ util._configure = function() {
|
|
|
6993
7106
|
|
|
6994
7107
|
},{"1":1,"10":10,"2":2,"34":34,"4":4,"6":6,"7":7,"9":9}],36:[function(require,module,exports){
|
|
6995
7108
|
"use strict";
|
|
7109
|
+
|
|
7110
|
+
var patterns = exports;
|
|
7111
|
+
|
|
7112
|
+
patterns.numberRe = /^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;
|
|
7113
|
+
patterns.typeRefRe = /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;
|
|
7114
|
+
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)$/;
|
|
7115
|
+
patterns.unsafePropertyRe = /^(?:__proto__|prototype|constructor)$/;
|
|
7116
|
+
|
|
7117
|
+
},{}],37:[function(require,module,exports){
|
|
7118
|
+
"use strict";
|
|
6996
7119
|
module.exports = verifier;
|
|
6997
7120
|
|
|
6998
7121
|
var Enum = require(14),
|
|
@@ -7026,7 +7149,7 @@ function genVerifyValue(gen, field, fieldIndex, ref) {
|
|
|
7026
7149
|
} else {
|
|
7027
7150
|
gen
|
|
7028
7151
|
("{")
|
|
7029
|
-
("var e=types[%i].verify(%s);", fieldIndex, ref)
|
|
7152
|
+
("var e=types[%i].verify(%s,n+1);", fieldIndex, ref)
|
|
7030
7153
|
("if(e)")
|
|
7031
7154
|
("return%j+e", field.name + ".")
|
|
7032
7155
|
("}");
|
|
@@ -7116,9 +7239,12 @@ function genVerifyKey(gen, field, ref) {
|
|
|
7116
7239
|
function verifier(mtype) {
|
|
7117
7240
|
/* eslint-disable no-unexpected-multiline */
|
|
7118
7241
|
|
|
7119
|
-
var gen = util.codegen(["m"], mtype.name + "$verify")
|
|
7242
|
+
var gen = util.codegen(["m", "n"], mtype.name + "$verify")
|
|
7120
7243
|
("if(typeof m!==\"object\"||m===null)")
|
|
7121
|
-
("return%j", "object expected")
|
|
7244
|
+
("return%j", "object expected")
|
|
7245
|
+
("if(n===undefined)n=0")
|
|
7246
|
+
("if(n>util.recursionLimit)")
|
|
7247
|
+
("return%j", "maximum nesting depth exceeded");
|
|
7122
7248
|
var oneofs = mtype.oneofsArray,
|
|
7123
7249
|
seenFirstField = {};
|
|
7124
7250
|
if (oneofs.length) gen
|
|
@@ -7169,7 +7295,8 @@ function verifier(mtype) {
|
|
|
7169
7295
|
("return null");
|
|
7170
7296
|
/* eslint-enable no-unexpected-multiline */
|
|
7171
7297
|
}
|
|
7172
|
-
|
|
7298
|
+
|
|
7299
|
+
},{"14":14,"33":33}],38:[function(require,module,exports){
|
|
7173
7300
|
"use strict";
|
|
7174
7301
|
|
|
7175
7302
|
/**
|
|
@@ -7210,7 +7337,7 @@ var Message = require(19);
|
|
|
7210
7337
|
// Custom wrapper for Any
|
|
7211
7338
|
wrappers[".google.protobuf.Any"] = {
|
|
7212
7339
|
|
|
7213
|
-
fromObject: function(object) {
|
|
7340
|
+
fromObject: function(object, depth) {
|
|
7214
7341
|
|
|
7215
7342
|
// unwrap value type if mapped
|
|
7216
7343
|
if (object && object["@type"]) {
|
|
@@ -7226,14 +7353,15 @@ wrappers[".google.protobuf.Any"] = {
|
|
|
7226
7353
|
if (type_url.indexOf("/") === -1) {
|
|
7227
7354
|
type_url = "/" + type_url;
|
|
7228
7355
|
}
|
|
7356
|
+
var nextDepth = depth === undefined ? 1 : depth + 1;
|
|
7229
7357
|
return this.create({
|
|
7230
7358
|
type_url: type_url,
|
|
7231
|
-
value: type.encode(type.fromObject(object)).finish()
|
|
7359
|
+
value: type.encode(type.fromObject(object, nextDepth)).finish()
|
|
7232
7360
|
});
|
|
7233
7361
|
}
|
|
7234
7362
|
}
|
|
7235
7363
|
|
|
7236
|
-
return this.fromObject(object);
|
|
7364
|
+
return this.fromObject(object, depth);
|
|
7237
7365
|
},
|
|
7238
7366
|
|
|
7239
7367
|
toObject: function(message, options) {
|
|
@@ -7273,7 +7401,7 @@ wrappers[".google.protobuf.Any"] = {
|
|
|
7273
7401
|
}
|
|
7274
7402
|
};
|
|
7275
7403
|
|
|
7276
|
-
},{"19":19}],
|
|
7404
|
+
},{"19":19}],39:[function(require,module,exports){
|
|
7277
7405
|
"use strict";
|
|
7278
7406
|
module.exports = Writer;
|
|
7279
7407
|
|
|
@@ -7740,12 +7868,12 @@ Writer._configure = function(BufferWriter_) {
|
|
|
7740
7868
|
BufferWriter._configure();
|
|
7741
7869
|
};
|
|
7742
7870
|
|
|
7743
|
-
},{"35":35}],
|
|
7871
|
+
},{"35":35}],40:[function(require,module,exports){
|
|
7744
7872
|
"use strict";
|
|
7745
7873
|
module.exports = BufferWriter;
|
|
7746
7874
|
|
|
7747
7875
|
// extends Writer
|
|
7748
|
-
var Writer = require(
|
|
7876
|
+
var Writer = require(39);
|
|
7749
7877
|
(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;
|
|
7750
7878
|
|
|
7751
7879
|
var util = require(35);
|
|
@@ -7827,7 +7955,7 @@ BufferWriter.prototype.string = function write_string_buffer(value) {
|
|
|
7827
7955
|
|
|
7828
7956
|
BufferWriter._configure();
|
|
7829
7957
|
|
|
7830
|
-
},{"35":35,"
|
|
7958
|
+
},{"35":35,"39":39}]},{},[16])
|
|
7831
7959
|
|
|
7832
7960
|
})();
|
|
7833
7961
|
//# sourceMappingURL=protobuf.js.map
|