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.
@@ -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
  */
@@ -1129,20 +1129,18 @@ var Enum = require(14),
1129
1129
  * @ignore
1130
1130
  */
1131
1131
  function genValuePartial_fromObject(gen, field, fieldIndex, prop) {
1132
- var defaultAlreadyEmitted = false;
1133
1132
  /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */
1134
1133
  if (field.resolvedType) {
1135
1134
  if (field.resolvedType instanceof Enum) { gen
1136
1135
  ("switch(d%s){", prop);
1137
1136
  for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) {
1138
1137
  // enum unknown values passthrough
1139
- if (values[keys[i]] === field.typeDefault && !defaultAlreadyEmitted) { gen
1138
+ if (values[keys[i]] === field.typeDefault) { gen
1140
1139
  ("default:")
1141
1140
  ("if(typeof(d%s)===\"number\"){m%s=d%s;break}", prop, prop, prop);
1142
1141
  if (!field.repeated) gen // fallback to default value only for
1143
1142
  // arrays, to avoid leaving holes.
1144
1143
  ("break"); // for non-repeated fields, just ignore
1145
- defaultAlreadyEmitted = true;
1146
1144
  }
1147
1145
  gen
1148
1146
  ("case%j:", keys[i])
@@ -2943,8 +2941,9 @@ Object.defineProperty(Namespace.prototype, "nestedArray", {
2943
2941
  /**
2944
2942
  * Any nested object descriptor.
2945
2943
  * @typedef AnyNestedObject
2946
- * @type {IEnum|IType|IService|AnyExtensionField|INamespace|IOneOf}
2944
+ * @type {IEnum|IType|IService|AnyExtensionField|INamespace}
2947
2945
  */
2946
+ // ^ BEWARE: VSCode hangs forever when using more than 5 types (that's why AnyExtensionField exists in the first place)
2948
2947
 
2949
2948
  /**
2950
2949
  * Converts this namespace to a namespace descriptor.
@@ -4249,10 +4248,10 @@ Root.prototype.load = function load(filename, options, callback) {
4249
4248
  /* istanbul ignore if */
4250
4249
  if (!callback)
4251
4250
  return;
4252
- if (sync)
4253
- throw err;
4254
4251
  var cb = callback;
4255
4252
  callback = null;
4253
+ if (sync)
4254
+ throw err;
4256
4255
  cb(err, root);
4257
4256
  }
4258
4257