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.
- package/README.md +21 -3
- package/dist/light/protobuf.js +67 -29
- 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 +36 -16
- package/dist/minimal/protobuf.js.map +1 -1
- package/dist/minimal/protobuf.min.js +3 -3
- package/dist/minimal/protobuf.min.js.map +1 -1
- package/dist/protobuf.js +75 -34
- 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.js +31 -9
- package/index.d.ts +22 -9
- package/package.json +3 -2
- package/src/converter.js +4 -2
- package/src/decoder.js +4 -2
- package/src/method.js +16 -2
- package/src/namespace.js +5 -5
- package/src/parse.js +8 -5
- package/src/reader.js +12 -0
- package/src/roots.js +1 -1
- package/src/rpc/service.js +10 -4
- package/src/writer.js +11 -9
package/dist/minimal/protobuf.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* protobuf.js v8.
|
|
3
|
-
* compiled
|
|
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 {
|
|
770
|
-
*
|
|
771
|
-
*
|
|
772
|
-
*
|
|
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
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
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 (
|
|
2712
|
-
buf[pos++] =
|
|
2713
|
-
|
|
2731
|
+
while (lo > 127) {
|
|
2732
|
+
buf[pos++] = lo & 127 | 128;
|
|
2733
|
+
lo = lo >>> 7;
|
|
2714
2734
|
}
|
|
2715
|
-
buf[pos++] =
|
|
2735
|
+
buf[pos++] = lo;
|
|
2716
2736
|
}
|
|
2717
2737
|
|
|
2718
2738
|
/**
|