protobufjs 7.5.4 → 7.5.5

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.5.4",
3
+ "version": "7.5.5",
4
4
  "versionScheme": "~",
5
5
  "description": "Protocol Buffers for JavaScript (& TypeScript).",
6
6
  "author": "Daniel Wirtz <dcode+protobufjs@dcode.io>",
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
- this[keys[i]] = properties[keys[i]];
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
@@ -29,6 +29,7 @@ var Enum = require("./enum"),
29
29
  * @param {Object.<string,*>} [options] Declared options
30
30
  */
31
31
  function Type(name, options) {
32
+ name = name.replace(/\W/g, "");
32
33
  Namespace.call(this, name, options);
33
34
 
34
35
  /**