protobufjs 8.4.1 → 8.5.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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * protobuf.js v8.4.1 (c) 2016, daniel wirtz
3
- * compiled thu, 21 may 2026 18:52:08 utc
2
+ * protobuf.js v8.5.0 (c) 2016, daniel wirtz
3
+ * compiled fri, 29 may 2026 22:57:25 utc
4
4
  * licensed under the bsd-3-clause license
5
5
  * see: https://github.com/dcodeio/protobuf.js for details
6
6
  */
@@ -116,6 +116,12 @@ function Reader(buffer) {
116
116
  * @type {number}
117
117
  */
118
118
  this.len = buffer.length;
119
+
120
+ /**
121
+ * Whether to discard unknown fields while decoding.
122
+ * @type {boolean}
123
+ */
124
+ this.discardUnknown = Reader.discardUnknown;
119
125
  }
120
126
 
121
127
  var create_array = typeof Uint8Array !== "undefined"
@@ -528,6 +534,12 @@ Reader.prototype.skip = function skip(length) {
528
534
  */
529
535
  Reader.recursionLimit = util.recursionLimit;
530
536
 
537
+ /**
538
+ * Whether readers discard unknown fields while decoding.
539
+ * @type {boolean}
540
+ */
541
+ Reader.discardUnknown = false;
542
+
531
543
  /**
532
544
  * Skips the next element of the specified wire type.
533
545
  * @param {number} wireType Wire type received
@@ -684,7 +696,7 @@ BufferReader._configure();
684
696
 
685
697
  },{"13":13,"2":2}],4:[function(require,module,exports){
686
698
  "use strict";
687
- module.exports = {};
699
+ module.exports = Object.create(null);
688
700
 
689
701
  /**
690
702
  * Named roots.
@@ -766,10 +778,16 @@ var util = require(13);
766
778
  * @typedef rpc.ServiceMethod
767
779
  * @template TReq extends Message<TReq>
768
780
  * @template TRes extends Message<TRes>
769
- * @type {function}
770
- * @param {TReq|Properties<TReq>} request Request message or plain object
771
- * @param {rpc.ServiceMethodCallback<TRes>} [callback] Node-style callback called with the error, if any, and the response message
772
- * @returns {Promise<Message<TRes>>} Promise if `callback` has been omitted, otherwise `undefined`
781
+ * @type {{
782
+ * (request: TReq|Properties<TReq>, callback: rpc.ServiceMethodCallback<TRes>): void;
783
+ * (request: TReq|Properties<TReq>): Promise<TRes>;
784
+ * readonly name: string;
785
+ * readonly path: string;
786
+ * readonly requestType: string;
787
+ * readonly responseType: string;
788
+ * readonly requestStream: true|undefined;
789
+ * readonly responseStream: true|undefined;
790
+ * }}
773
791
  */
774
792
 
775
793
  /**
@@ -2688,7 +2706,7 @@ Writer.prototype.uint32 = function write_uint32(value) {
2688
2706
  * @returns {Writer} `this`
2689
2707
  */
2690
2708
  Writer.prototype.int32 = function write_int32(value) {
2691
- return value < 0
2709
+ return (value |= 0) < 0
2692
2710
  ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec
2693
2711
  : this.uint32(value);
2694
2712
  };
@@ -2703,16 +2721,18 @@ Writer.prototype.sint32 = function write_sint32(value) {
2703
2721
  };
2704
2722
 
2705
2723
  function writeVarint64(val, buf, pos) {
2706
- while (val.hi) {
2707
- buf[pos++] = val.lo & 127 | 128;
2708
- val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;
2709
- val.hi >>>= 7;
2724
+ var lo = val.lo,
2725
+ hi = val.hi;
2726
+ while (hi) {
2727
+ buf[pos++] = lo & 127 | 128;
2728
+ lo = (lo >>> 7 | hi << 25) >>> 0;
2729
+ hi >>>= 7;
2710
2730
  }
2711
- while (val.lo > 127) {
2712
- buf[pos++] = val.lo & 127 | 128;
2713
- val.lo = val.lo >>> 7;
2731
+ while (lo > 127) {
2732
+ buf[pos++] = lo & 127 | 128;
2733
+ lo = lo >>> 7;
2714
2734
  }
2715
- buf[pos++] = val.lo;
2735
+ buf[pos++] = lo;
2716
2736
  }
2717
2737
 
2718
2738
  /**