protobufjs 7.2.1 → 7.2.3

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.1 (c) 2016, daniel wirtz
3
- * compiled thu, 02 feb 2023 21:27:33 utc
2
+ * protobuf.js v7.2.3 (c) 2016, daniel wirtz
3
+ * compiled mon, 27 mar 2023 18:08:22 utc
4
4
  * licensed under the bsd-3-clause license
5
5
  * see: https://github.com/dcodeio/protobuf.js for details
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * protobuf.js v7.2.1 (c) 2016, daniel wirtz
3
- * compiled thu, 02 feb 2023 21:27:33 utc
2
+ * protobuf.js v7.2.3 (c) 2016, daniel wirtz
3
+ * compiled mon, 27 mar 2023 18:08:22 utc
4
4
  * licensed under the bsd-3-clause license
5
5
  * see: https://github.com/dcodeio/protobuf.js for details
6
6
  */
package/dist/protobuf.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * protobuf.js v7.2.1 (c) 2016, daniel wirtz
3
- * compiled thu, 02 feb 2023 21:27:33 utc
2
+ * protobuf.js v7.2.3 (c) 2016, daniel wirtz
3
+ * compiled mon, 27 mar 2023 18:08:22 utc
4
4
  * licensed under the bsd-3-clause license
5
5
  * see: https://github.com/dcodeio/protobuf.js for details
6
6
  */
@@ -4460,6 +4460,16 @@ function parse(source, root, options) {
4460
4460
  parseGroup(parent, rule);
4461
4461
  return;
4462
4462
  }
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
+ }
4463
4473
 
4464
4474
  /* istanbul ignore if */
4465
4475
  if (!typeRefRe.test(type))
@@ -5701,6 +5711,10 @@ function tryHandleExtension(root, field) {
5701
5711
  var extendedType = field.parent.lookup(field.extend);
5702
5712
  if (extendedType) {
5703
5713
  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
+ }
5704
5718
  sisterField.declaringField = field;
5705
5719
  field.extensionField = sisterField;
5706
5720
  extendedType.add(sisterField);