protobufjs 7.2.2 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "protobufjs",
3
- "version": "7.2.2",
3
+ "version": "7.2.3",
4
4
  "versionScheme": "~",
5
5
  "description": "Protocol Buffers for JavaScript (& TypeScript).",
6
6
  "author": "Daniel Wirtz <dcode+protobufjs@dcode.io>",
package/src/parse.js CHANGED
@@ -360,6 +360,16 @@ function parse(source, root, options) {
360
360
  parseGroup(parent, rule);
361
361
  return;
362
362
  }
363
+ // Type names can consume multiple tokens, in multiple variants:
364
+ // package.subpackage field tokens: "package.subpackage" [TYPE NAME ENDS HERE] "field"
365
+ // package . subpackage field tokens: "package" "." "subpackage" [TYPE NAME ENDS HERE] "field"
366
+ // package. subpackage field tokens: "package." "subpackage" [TYPE NAME ENDS HERE] "field"
367
+ // package .subpackage field tokens: "package" ".subpackage" [TYPE NAME ENDS HERE] "field"
368
+ // Keep reading tokens until we get a type name with no period at the end,
369
+ // and the next token does not start with a period.
370
+ while (type.endsWith(".") || peek().startsWith(".")) {
371
+ type += next();
372
+ }
363
373
 
364
374
  /* istanbul ignore if */
365
375
  if (!typeRefRe.test(type))