protobufjs 7.5.4 → 8.0.0
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 +2 -2
- package/dist/minimal/protobuf.min.js +2 -2
- package/dist/protobuf.js +53 -6
- 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 +1 -1
- package/src/object.js +6 -3
- package/src/parse.js +45 -1
package/dist/minimal/protobuf.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* protobuf.js
|
|
3
|
-
* compiled
|
|
2
|
+
* protobuf.js v8.0.0 (c) 2016, daniel wirtz
|
|
3
|
+
* compiled tue, 16 dec 2025 22:00:06 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
|
|
3
|
-
* compiled
|
|
2
|
+
* protobuf.js v8.0.0 (c) 2016, daniel wirtz
|
|
3
|
+
* compiled tue, 16 dec 2025 22:00:06 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
|
|
3
|
-
* compiled
|
|
2
|
+
* protobuf.js v8.0.0 (c) 2016, daniel wirtz
|
|
3
|
+
* compiled tue, 16 dec 2025 22:00:06 utc
|
|
4
4
|
* licensed under the bsd-3-clause license
|
|
5
5
|
* see: https://github.com/dcodeio/protobuf.js for details
|
|
6
6
|
*/
|
|
@@ -3872,9 +3872,10 @@ var Root; // cyclic
|
|
|
3872
3872
|
|
|
3873
3873
|
/* eslint-disable no-warning-comments */
|
|
3874
3874
|
// TODO: Replace with embedded proto.
|
|
3875
|
-
var
|
|
3876
|
-
var
|
|
3877
|
-
var
|
|
3875
|
+
var editions2024Defaults = {enum_type: "OPEN", field_presence: "EXPLICIT", json_format: "ALLOW", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "PACKED", utf8_validation: "VERIFY", enforce_naming_style: "STYLE2024", default_symbol_visibility: "EXPORT_TOP_LEVEL" };
|
|
3876
|
+
var editions2023Defaults = {enum_type: "OPEN", field_presence: "EXPLICIT", json_format: "ALLOW", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "PACKED", utf8_validation: "VERIFY", enforce_naming_style: "STYLE_LEGACY", default_symbol_visibility: "EXPORT_ALL" };
|
|
3877
|
+
var proto2Defaults = {enum_type: "CLOSED", field_presence: "EXPLICIT", json_format: "LEGACY_BEST_EFFORT", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "EXPANDED", utf8_validation: "NONE", enforce_naming_style: "STYLE_LEGACY", default_symbol_visibility: "EXPORT_ALL" };
|
|
3878
|
+
var proto3Defaults = {enum_type: "OPEN", field_presence: "IMPLICIT", json_format: "ALLOW", message_encoding: "LENGTH_PREFIXED", repeated_field_encoding: "PACKED", utf8_validation: "VERIFY", enforce_naming_style: "STYLE_LEGACY", default_symbol_visibility: "EXPORT_ALL" };
|
|
3878
3879
|
|
|
3879
3880
|
/**
|
|
3880
3881
|
* Constructs a new reflection object instance.
|
|
@@ -4087,6 +4088,8 @@ ReflectionObject.prototype._resolveFeatures = function _resolveFeatures(edition)
|
|
|
4087
4088
|
defaults = Object.assign({}, proto3Defaults);
|
|
4088
4089
|
} else if (edition === "2023") {
|
|
4089
4090
|
defaults = Object.assign({}, editions2023Defaults);
|
|
4091
|
+
} else if (edition === "2024") {
|
|
4092
|
+
defaults = Object.assign({}, editions2024Defaults);
|
|
4090
4093
|
} else {
|
|
4091
4094
|
throw new Error("Unknown edition: " + edition);
|
|
4092
4095
|
}
|
|
@@ -4727,6 +4730,16 @@ function parse(source, root, options) {
|
|
|
4727
4730
|
var token = peek();
|
|
4728
4731
|
var whichImports;
|
|
4729
4732
|
switch (token) {
|
|
4733
|
+
case "option":
|
|
4734
|
+
if (edition < "2024") {
|
|
4735
|
+
throw illegal("option");
|
|
4736
|
+
}
|
|
4737
|
+
// Import options are only used for resolving options, which we don't
|
|
4738
|
+
// do. We can just throw them out.
|
|
4739
|
+
next();
|
|
4740
|
+
readString();
|
|
4741
|
+
skip(";");
|
|
4742
|
+
return;
|
|
4730
4743
|
case "weak":
|
|
4731
4744
|
whichImports = weakImports || (weakImports = []);
|
|
4732
4745
|
next();
|
|
@@ -4757,7 +4770,7 @@ function parse(source, root, options) {
|
|
|
4757
4770
|
function parseEdition() {
|
|
4758
4771
|
skip("=");
|
|
4759
4772
|
edition = readString();
|
|
4760
|
-
const supportedEditions = ["2023"];
|
|
4773
|
+
const supportedEditions = ["2023", "2024"];
|
|
4761
4774
|
|
|
4762
4775
|
/* istanbul ignore if */
|
|
4763
4776
|
if (!supportedEditions.includes(edition))
|
|
@@ -4783,6 +4796,22 @@ function parse(source, root, options) {
|
|
|
4783
4796
|
parseEnum(parent, token);
|
|
4784
4797
|
return true;
|
|
4785
4798
|
|
|
4799
|
+
case "export":
|
|
4800
|
+
case "local":
|
|
4801
|
+
if (edition < "2024") {
|
|
4802
|
+
return false;
|
|
4803
|
+
}
|
|
4804
|
+
token = next();
|
|
4805
|
+
if (token === "export" || token === "local") {
|
|
4806
|
+
return false;
|
|
4807
|
+
}
|
|
4808
|
+
if (token !== "message" && token !== "enum") {
|
|
4809
|
+
return false;
|
|
4810
|
+
}
|
|
4811
|
+
/* eslint-disable no-warning-comments */
|
|
4812
|
+
// TODO: actually enforce visiblity modifiers like protoc does.
|
|
4813
|
+
return parseCommon(parent, token);
|
|
4814
|
+
|
|
4786
4815
|
case "service":
|
|
4787
4816
|
parseService(parent, token);
|
|
4788
4817
|
return true;
|
|
@@ -4993,6 +5022,24 @@ function parse(source, root, options) {
|
|
|
4993
5022
|
readRanges(type.reserved || (type.reserved = []), true);
|
|
4994
5023
|
break;
|
|
4995
5024
|
|
|
5025
|
+
case "export":
|
|
5026
|
+
case "local":
|
|
5027
|
+
if (edition < "2024") {
|
|
5028
|
+
throw illegal(token);
|
|
5029
|
+
}
|
|
5030
|
+
token = next();
|
|
5031
|
+
switch (token) {
|
|
5032
|
+
case "message":
|
|
5033
|
+
parseType(type, token);
|
|
5034
|
+
break;
|
|
5035
|
+
case "enum":
|
|
5036
|
+
parseType(type, token);
|
|
5037
|
+
break;
|
|
5038
|
+
default:
|
|
5039
|
+
throw illegal(token);
|
|
5040
|
+
}
|
|
5041
|
+
break;
|
|
5042
|
+
|
|
4996
5043
|
/* istanbul ignore next */
|
|
4997
5044
|
default:
|
|
4998
5045
|
throw illegal(token); // there are no groups with proto3 semantics
|