protobufjs 8.7.0 → 8.7.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/README.md CHANGED
@@ -60,7 +60,7 @@ const root = await protobuf.load("awesome.proto");
60
60
  const AwesomeMessage = root.lookupType("awesomepackage.AwesomeMessage");
61
61
  ```
62
62
 
63
- Optionally use `load()` with a callback, or `loadSync()` for synchronous loading on Node.js.
63
+ Optionally use `load()` with a callback, or `loadSync()` for synchronous loading on Node.js. Imports resolve relative to the importing file by default. To resolve imports against a specific base directory, create a `Root` and override `root.resolvePath` before calling `root.load()`.
64
64
 
65
65
  ### Encode and decode
66
66
 
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * protobuf.js v8.7.0 (c) 2016, daniel wirtz
3
- * compiled mon, 06 jul 2026 13:50:00 utc
2
+ * protobuf.js v8.7.1 (c) 2016, daniel wirtz
3
+ * compiled mon, 13 jul 2026 11:04:12 utc
4
4
  * licensed under the bsd-3-clause license
5
5
  * see: https://github.com/dcodeio/protobuf.js for details
6
6
  */
@@ -340,7 +340,7 @@ converter.toObject = function toObject(mtype) {
340
340
  else if (field.bytes) {
341
341
  var arrayDefault = Array.prototype.slice.call(field.typeDefault);
342
342
  gen
343
- ("if(o.bytes===String)d%s=%j", prop, String.fromCharCode.apply(String, field.typeDefault))
343
+ ("if(o.bytes===String)d%s=%j", prop, util.base64.encode(field.typeDefault, 0, field.typeDefault.length))
344
344
  ("else{")
345
345
  ("d%s=%j", prop, arrayDefault)
346
346
  ("if(o.bytes!==Array)d%s=util.newBuffer(d%s)", prop, prop)
@@ -498,7 +498,7 @@ function decoder(mtype) {
498
498
  ("break");
499
499
 
500
500
  if (types.basic[type] === undefined) gen
501
- ("v=types[%i].decode(r,r.uint32(),undefined,q+1)", i); // can't be groups
501
+ ("v=types[%i].decode(r,r.uint32(),undefined,q+1,v)", i); // can't be groups
502
502
  else gen
503
503
  ("v=r.%s()", type === "string" ? stringMethod(field) : type);
504
504
 
@@ -1682,6 +1682,7 @@ exports.configure = configure;
1682
1682
  * @returns {undefined}
1683
1683
  */
1684
1684
  function configure() {
1685
+ exports.util.LongBits._configure(exports.util.Long);
1685
1686
  exports.Writer._configure(exports.BufferWriter);
1686
1687
  exports.Reader._configure(exports.BufferReader);
1687
1688
  }
@@ -7102,7 +7103,7 @@ module.exports = fs;
7102
7103
  "use strict";
7103
7104
  module.exports = LongBits;
7104
7105
 
7105
- var util = require(33);
7106
+ var Long;
7106
7107
 
7107
7108
  /**
7108
7109
  * Constructs new long bits.
@@ -7181,10 +7182,10 @@ LongBits.fromNumber = function fromNumber(value) {
7181
7182
  LongBits.from = function from(value) {
7182
7183
  if (typeof value === "number")
7183
7184
  return LongBits.fromNumber(value);
7184
- if (util.isString(value)) {
7185
+ if (typeof value === "string" || value instanceof String) {
7185
7186
  /* istanbul ignore else */
7186
- if (util.Long)
7187
- value = util.Long.fromString(value);
7187
+ if (Long)
7188
+ value = Long.fromString(value);
7188
7189
  else
7189
7190
  return LongBits.fromNumber(parseInt(value, 10));
7190
7191
  }
@@ -7213,8 +7214,8 @@ LongBits.prototype.toNumber = function toNumber(unsigned) {
7213
7214
  * @returns {Long} Long
7214
7215
  */
7215
7216
  LongBits.prototype.toLong = function toLong(unsigned) {
7216
- return util.Long
7217
- ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))
7217
+ return Long
7218
+ ? new Long(this.lo | 0, this.hi | 0, Boolean(unsigned))
7218
7219
  /* istanbul ignore next */
7219
7220
  : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };
7220
7221
  };
@@ -7300,7 +7301,11 @@ LongBits.prototype.length = function length() {
7300
7301
  : part2 < 128 ? 9 : 10;
7301
7302
  };
7302
7303
 
7303
- },{"33":33}],33:[function(require,module,exports){
7304
+ LongBits._configure = function(Long_) {
7305
+ Long = Long_;
7306
+ };
7307
+
7308
+ },{}],33:[function(require,module,exports){
7304
7309
  "use strict";
7305
7310
  /* global globalThis */
7306
7311
  var util = exports;