protobufjs 7.1.2 → 7.2.1
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 +8 -5
- 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 +8 -5
- 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 +10 -2
- package/src/root.js +1 -0
- package/src/util/minimal.js +2 -2
package/dist/protobuf.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* protobuf.js v7.1
|
|
3
|
-
* compiled thu,
|
|
2
|
+
* protobuf.js v7.2.1 (c) 2016, daniel wirtz
|
|
3
|
+
* compiled thu, 02 feb 2023 21:27:33 utc
|
|
4
4
|
* licensed under the bsd-3-clause license
|
|
5
5
|
* see: https://github.com/dcodeio/protobuf.js for details
|
|
6
6
|
*/
|
|
@@ -1530,18 +1530,20 @@ var Enum = require(15),
|
|
|
1530
1530
|
* @ignore
|
|
1531
1531
|
*/
|
|
1532
1532
|
function genValuePartial_fromObject(gen, field, fieldIndex, prop) {
|
|
1533
|
+
var defaultAlreadyEmitted = false;
|
|
1533
1534
|
/* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */
|
|
1534
1535
|
if (field.resolvedType) {
|
|
1535
1536
|
if (field.resolvedType instanceof Enum) { gen
|
|
1536
1537
|
("switch(d%s){", prop);
|
|
1537
1538
|
for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) {
|
|
1538
1539
|
// enum unknown values passthrough
|
|
1539
|
-
if (values[keys[i]] === field.typeDefault) { gen
|
|
1540
|
+
if (values[keys[i]] === field.typeDefault && !defaultAlreadyEmitted) { gen
|
|
1540
1541
|
("default:")
|
|
1541
1542
|
("if(typeof(d%s)===\"number\"){m%s=d%s;break}", prop, prop, prop);
|
|
1542
1543
|
if (!field.repeated) gen // fallback to default value only for
|
|
1543
1544
|
// arrays, to avoid leaving holes.
|
|
1544
1545
|
("break"); // for non-repeated fields, just ignore
|
|
1546
|
+
defaultAlreadyEmitted = true;
|
|
1545
1547
|
}
|
|
1546
1548
|
gen
|
|
1547
1549
|
("case%j:", keys[i])
|
|
@@ -5570,6 +5572,7 @@ Root.prototype.load = function load(filename, options, callback) {
|
|
|
5570
5572
|
|
|
5571
5573
|
// Fetches a single file
|
|
5572
5574
|
function fetch(filename, weak) {
|
|
5575
|
+
filename = getBundledFileName(filename) || filename;
|
|
5573
5576
|
|
|
5574
5577
|
// Skip if already loaded / attempted
|
|
5575
5578
|
if (self.files.indexOf(filename) > -1)
|
|
@@ -8074,7 +8077,7 @@ function newError(name) {
|
|
|
8074
8077
|
configurable: true,
|
|
8075
8078
|
},
|
|
8076
8079
|
name: {
|
|
8077
|
-
get() { return name; },
|
|
8080
|
+
get: function get() { return name; },
|
|
8078
8081
|
set: undefined,
|
|
8079
8082
|
enumerable: false,
|
|
8080
8083
|
// configurable: false would accurately preserve the behavior of
|
|
@@ -8084,7 +8087,7 @@ function newError(name) {
|
|
|
8084
8087
|
configurable: true,
|
|
8085
8088
|
},
|
|
8086
8089
|
toString: {
|
|
8087
|
-
value() { return this.name + ": " + this.message; },
|
|
8090
|
+
value: function value() { return this.name + ": " + this.message; },
|
|
8088
8091
|
writable: true,
|
|
8089
8092
|
enumerable: false,
|
|
8090
8093
|
configurable: true,
|