protobufjs 7.2.3 → 7.2.4
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 +7 -13
- 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 +4 -4
- 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 +7 -23
- package/dist/protobuf.js.map +1 -1
- package/dist/protobuf.min.js +3 -3
- package/dist/protobuf.min.js.map +1 -1
- package/package.json +1 -1
- package/src/util.js +1 -1
package/dist/protobuf.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* protobuf.js v7.
|
|
3
|
-
* compiled
|
|
2
|
+
* protobuf.js v7.1.0 (c) 2016, daniel wirtz
|
|
3
|
+
* compiled fri, 09 sep 2022 03:02:57 utc
|
|
4
4
|
* licensed under the bsd-3-clause license
|
|
5
5
|
* see: https://github.com/dcodeio/protobuf.js for details
|
|
6
6
|
*/
|
|
@@ -1530,20 +1530,18 @@ var Enum = require(15),
|
|
|
1530
1530
|
* @ignore
|
|
1531
1531
|
*/
|
|
1532
1532
|
function genValuePartial_fromObject(gen, field, fieldIndex, prop) {
|
|
1533
|
-
var defaultAlreadyEmitted = false;
|
|
1534
1533
|
/* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */
|
|
1535
1534
|
if (field.resolvedType) {
|
|
1536
1535
|
if (field.resolvedType instanceof Enum) { gen
|
|
1537
1536
|
("switch(d%s){", prop);
|
|
1538
1537
|
for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) {
|
|
1539
1538
|
// enum unknown values passthrough
|
|
1540
|
-
if (values[keys[i]] === field.typeDefault
|
|
1539
|
+
if (values[keys[i]] === field.typeDefault) { gen
|
|
1541
1540
|
("default:")
|
|
1542
1541
|
("if(typeof(d%s)===\"number\"){m%s=d%s;break}", prop, prop, prop);
|
|
1543
1542
|
if (!field.repeated) gen // fallback to default value only for
|
|
1544
1543
|
// arrays, to avoid leaving holes.
|
|
1545
1544
|
("break"); // for non-repeated fields, just ignore
|
|
1546
|
-
defaultAlreadyEmitted = true;
|
|
1547
1545
|
}
|
|
1548
1546
|
gen
|
|
1549
1547
|
("case%j:", keys[i])
|
|
@@ -3358,8 +3356,9 @@ Object.defineProperty(Namespace.prototype, "nestedArray", {
|
|
|
3358
3356
|
/**
|
|
3359
3357
|
* Any nested object descriptor.
|
|
3360
3358
|
* @typedef AnyNestedObject
|
|
3361
|
-
* @type {IEnum|IType|IService|AnyExtensionField|INamespace
|
|
3359
|
+
* @type {IEnum|IType|IService|AnyExtensionField|INamespace}
|
|
3362
3360
|
*/
|
|
3361
|
+
// ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionField exists in the first place)
|
|
3363
3362
|
|
|
3364
3363
|
/**
|
|
3365
3364
|
* Converts this namespace to a namespace descriptor.
|
|
@@ -4460,16 +4459,6 @@ function parse(source, root, options) {
|
|
|
4460
4459
|
parseGroup(parent, rule);
|
|
4461
4460
|
return;
|
|
4462
4461
|
}
|
|
4463
|
-
// Type names can consume multiple tokens, in multiple variants:
|
|
4464
|
-
// package.subpackage field tokens: "package.subpackage" [TYPE NAME ENDS HERE] "field"
|
|
4465
|
-
// package . subpackage field tokens: "package" "." "subpackage" [TYPE NAME ENDS HERE] "field"
|
|
4466
|
-
// package. subpackage field tokens: "package." "subpackage" [TYPE NAME ENDS HERE] "field"
|
|
4467
|
-
// package .subpackage field tokens: "package" ".subpackage" [TYPE NAME ENDS HERE] "field"
|
|
4468
|
-
// Keep reading tokens until we get a type name with no period at the end,
|
|
4469
|
-
// and the next token does not start with a period.
|
|
4470
|
-
while (type.endsWith(".") || peek().startsWith(".")) {
|
|
4471
|
-
type += next();
|
|
4472
|
-
}
|
|
4473
4462
|
|
|
4474
4463
|
/* istanbul ignore if */
|
|
4475
4464
|
if (!typeRefRe.test(type))
|
|
@@ -5582,7 +5571,6 @@ Root.prototype.load = function load(filename, options, callback) {
|
|
|
5582
5571
|
|
|
5583
5572
|
// Fetches a single file
|
|
5584
5573
|
function fetch(filename, weak) {
|
|
5585
|
-
filename = getBundledFileName(filename) || filename;
|
|
5586
5574
|
|
|
5587
5575
|
// Skip if already loaded / attempted
|
|
5588
5576
|
if (self.files.indexOf(filename) > -1)
|
|
@@ -5711,10 +5699,6 @@ function tryHandleExtension(root, field) {
|
|
|
5711
5699
|
var extendedType = field.parent.lookup(field.extend);
|
|
5712
5700
|
if (extendedType) {
|
|
5713
5701
|
var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options);
|
|
5714
|
-
//do not allow to extend same field twice to prevent the error
|
|
5715
|
-
if (extendedType.get(sisterField.name)) {
|
|
5716
|
-
return true;
|
|
5717
|
-
}
|
|
5718
5702
|
sisterField.declaringField = field;
|
|
5719
5703
|
field.extensionField = sisterField;
|
|
5720
5704
|
extendedType.add(sisterField);
|
|
@@ -8091,7 +8075,7 @@ function newError(name) {
|
|
|
8091
8075
|
configurable: true,
|
|
8092
8076
|
},
|
|
8093
8077
|
name: {
|
|
8094
|
-
get
|
|
8078
|
+
get() { return name; },
|
|
8095
8079
|
set: undefined,
|
|
8096
8080
|
enumerable: false,
|
|
8097
8081
|
// configurable: false would accurately preserve the behavior of
|
|
@@ -8101,7 +8085,7 @@ function newError(name) {
|
|
|
8101
8085
|
configurable: true,
|
|
8102
8086
|
},
|
|
8103
8087
|
toString: {
|
|
8104
|
-
value
|
|
8088
|
+
value() { return this.name + ": " + this.message; },
|
|
8105
8089
|
writable: true,
|
|
8106
8090
|
enumerable: false,
|
|
8107
8091
|
configurable: true,
|