protobufjs 8.0.0 → 8.0.1
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 +10 -4
- 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 +10 -4
- package/dist/protobuf.js.map +1 -1
- package/dist/protobuf.min.js +3 -3
- package/dist/protobuf.min.js.map +1 -1
- package/ext/descriptor/index.js +3 -2
- package/package.json +1 -1
- package/src/message.js +7 -3
- package/src/type.js +1 -0
- package/tsconfig.json +2 -2
package/ext/descriptor/index.js
CHANGED
|
@@ -518,10 +518,11 @@ Field.prototype.toDescriptor = function toDescriptor(edition) {
|
|
|
518
518
|
// Handle extension field
|
|
519
519
|
descriptor.extendee = this.extensionField ? this.extensionField.parent.fullName : this.extend;
|
|
520
520
|
|
|
521
|
-
// Handle part of oneof
|
|
522
|
-
if (this.partOf)
|
|
521
|
+
// Handle part of oneof (only meaningful for message types)
|
|
522
|
+
if (this.partOf && this.parent instanceof Type) {
|
|
523
523
|
if ((descriptor.oneofIndex = this.parent.oneofsArray.indexOf(this.partOf)) < 0)
|
|
524
524
|
throw Error("missing oneof");
|
|
525
|
+
}
|
|
525
526
|
|
|
526
527
|
if (this.options) {
|
|
527
528
|
descriptor.options = toDescriptorOptions(this.options, exports.FieldOptions);
|
package/package.json
CHANGED
package/src/message.js
CHANGED
|
@@ -13,8 +13,12 @@ var util = require("./util/minimal");
|
|
|
13
13
|
function Message(properties) {
|
|
14
14
|
// not used internally
|
|
15
15
|
if (properties)
|
|
16
|
-
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
17
|
-
|
|
16
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) {
|
|
17
|
+
var key = keys[i];
|
|
18
|
+
if (key === "__proto__")
|
|
19
|
+
continue;
|
|
20
|
+
this[key] = properties[key];
|
|
21
|
+
}
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
/**
|
|
@@ -136,4 +140,4 @@ Message.prototype.toJSON = function toJSON() {
|
|
|
136
140
|
return this.$type.toObject(this, util.toJSONOptions);
|
|
137
141
|
};
|
|
138
142
|
|
|
139
|
-
/*eslint-enable valid-jsdoc*/
|
|
143
|
+
/*eslint-enable valid-jsdoc*/
|
package/src/type.js
CHANGED
package/tsconfig.json
CHANGED