protobufjs 7.2.0 → 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/protobuf.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * protobuf.js v7.2.0 (c) 2016, daniel wirtz
3
- * compiled tue, 24 jan 2023 20:12:01 utc
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 && !defaultAlreadyEmitted) { gen
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|IOneOf}
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.
@@ -5525,10 +5524,10 @@ Root.prototype.load = function load(filename, options, callback) {
5525
5524
  /* istanbul ignore if */
5526
5525
  if (!callback)
5527
5526
  return;
5528
- if (sync)
5529
- throw err;
5530
5527
  var cb = callback;
5531
5528
  callback = null;
5529
+ if (sync)
5530
+ throw err;
5532
5531
  cb(err, root);
5533
5532
  }
5534
5533