protobufjs 6.10.0-beta.2 → 6.10.2
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/CHANGELOG.md +36 -0
- package/README.md +9 -5
- package/cli/targets/static.js +4 -1
- package/dist/light/protobuf.js +19 -12
- 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 +19 -12
- 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 +19 -12
- package/dist/protobuf.js.map +1 -1
- package/dist/protobuf.min.js +3 -3
- package/dist/protobuf.min.js.map +1 -1
- package/index.d.ts +6 -3
- package/package-lock.json +276 -129
- package/package.json +7 -7
- package/src/method.js +12 -3
- package/src/util/minimal.js +17 -10
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "protobufjs",
|
|
3
|
-
"version": "6.10.
|
|
3
|
+
"version": "6.10.2",
|
|
4
4
|
"versionScheme": "~",
|
|
5
5
|
"description": "Protocol Buffers for JavaScript (& TypeScript).",
|
|
6
6
|
"author": "Daniel Wirtz <dcode+protobufjs@dcode.io>",
|
|
7
7
|
"license": "BSD-3-Clause",
|
|
8
8
|
"repository": "protobufjs/protobuf.js",
|
|
9
9
|
"bugs": "https://github.com/dcodeIO/protobuf.js/issues",
|
|
10
|
-
"homepage": "
|
|
10
|
+
"homepage": "https://protobufjs.github.io/protobuf.js/",
|
|
11
11
|
"keywords": [
|
|
12
12
|
"protobuf",
|
|
13
13
|
"protocol-buffers",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"prof": "node bench/prof",
|
|
38
38
|
"test": "npm run test:sources && npm run test:types",
|
|
39
39
|
"test:sources": "tape -r ./lib/tape-adapter tests/*.js tests/node/*.js",
|
|
40
|
-
"test:types": "tsc tests/comp_typescript.ts --lib es2015 --strictNullChecks --experimentalDecorators --emitDecoratorMetadata && tsc tests/data/test.js.ts --lib es2015 --noEmit --strictNullChecks && tsc tests/data
|
|
41
|
-
"make": "npm run lint && npm run build && npm test"
|
|
40
|
+
"test:types": "tsc tests/comp_typescript.ts --lib es2015 --strictNullChecks --experimentalDecorators --emitDecoratorMetadata && tsc tests/data/test.js.ts --lib es2015 --noEmit --strictNullChecks && tsc tests/data/*.ts --lib es2015 --noEmit --strictNullChecks",
|
|
41
|
+
"make": "npm run lint:sources && npm run build && npm run lint:types && node ./scripts/gentests.js && npm test"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@protobufjs/aspromise": "^1.1.2",
|
|
@@ -57,11 +57,11 @@
|
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"benchmark": "^2.1.4",
|
|
60
|
-
"browserify": "^
|
|
60
|
+
"browserify": "^17.0.0",
|
|
61
61
|
"browserify-wrap": "^1.0.2",
|
|
62
62
|
"bundle-collapser": "^1.3.0",
|
|
63
63
|
"chalk": "^4.0.0",
|
|
64
|
-
"escodegen": "^
|
|
64
|
+
"escodegen": "^2.0.0",
|
|
65
65
|
"eslint": "^7.0.0",
|
|
66
66
|
"espree": "^7.0.0",
|
|
67
67
|
"estraverse": "^5.1.0",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"semver": "^7.1.2",
|
|
84
84
|
"tape": "^5.0.0",
|
|
85
85
|
"tmp": "^0.2.0",
|
|
86
|
-
"tslint": "^
|
|
86
|
+
"tslint": "^6.0.0",
|
|
87
87
|
"typescript": "^3.7.5",
|
|
88
88
|
"uglify-js": "^3.7.7",
|
|
89
89
|
"vinyl-buffer": "^1.0.1",
|
package/src/method.js
CHANGED
|
@@ -20,8 +20,9 @@ var util = require("./util");
|
|
|
20
20
|
* @param {boolean|Object.<string,*>} [responseStream] Whether the response is streamed
|
|
21
21
|
* @param {Object.<string,*>} [options] Declared options
|
|
22
22
|
* @param {string} [comment] The comment for this method
|
|
23
|
+
* @param {Object.<string,*>} [parsedOptions] Declared options, properly parsed into an object
|
|
23
24
|
*/
|
|
24
|
-
function Method(name, type, requestType, responseType, requestStream, responseStream, options, comment) {
|
|
25
|
+
function Method(name, type, requestType, responseType, requestStream, responseStream, options, comment, parsedOptions) {
|
|
25
26
|
|
|
26
27
|
/* istanbul ignore next */
|
|
27
28
|
if (util.isObject(requestStream)) {
|
|
@@ -93,6 +94,11 @@ function Method(name, type, requestType, responseType, requestStream, responseSt
|
|
|
93
94
|
* @type {string|null}
|
|
94
95
|
*/
|
|
95
96
|
this.comment = comment;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Options properly parsed into an object
|
|
100
|
+
*/
|
|
101
|
+
this.parsedOptions = parsedOptions;
|
|
96
102
|
}
|
|
97
103
|
|
|
98
104
|
/**
|
|
@@ -104,6 +110,8 @@ function Method(name, type, requestType, responseType, requestStream, responseSt
|
|
|
104
110
|
* @property {boolean} [requestStream=false] Whether requests are streamed
|
|
105
111
|
* @property {boolean} [responseStream=false] Whether responses are streamed
|
|
106
112
|
* @property {Object.<string,*>} [options] Method options
|
|
113
|
+
* @property {string} comment Method comments
|
|
114
|
+
* @property {Object.<string,*>} [parsedOptions] Method options properly parsed into an object
|
|
107
115
|
*/
|
|
108
116
|
|
|
109
117
|
/**
|
|
@@ -114,7 +122,7 @@ function Method(name, type, requestType, responseType, requestStream, responseSt
|
|
|
114
122
|
* @throws {TypeError} If arguments are invalid
|
|
115
123
|
*/
|
|
116
124
|
Method.fromJSON = function fromJSON(name, json) {
|
|
117
|
-
return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment);
|
|
125
|
+
return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment, json.parsedOptions);
|
|
118
126
|
};
|
|
119
127
|
|
|
120
128
|
/**
|
|
@@ -131,7 +139,8 @@ Method.prototype.toJSON = function toJSON(toJSONOptions) {
|
|
|
131
139
|
"responseType" , this.responseType,
|
|
132
140
|
"responseStream" , this.responseStream,
|
|
133
141
|
"options" , this.options,
|
|
134
|
-
"comment" , keepComments ? this.comment : undefined
|
|
142
|
+
"comment" , keepComments ? this.comment : undefined,
|
|
143
|
+
"parsedOptions" , this.parsedOptions,
|
|
135
144
|
]);
|
|
136
145
|
};
|
|
137
146
|
|
package/src/util/minimal.js
CHANGED
|
@@ -25,8 +25,23 @@ util.pool = require("@protobufjs/pool");
|
|
|
25
25
|
// utility to work with the low and high bits of a 64 bit value
|
|
26
26
|
util.LongBits = require("./longbits");
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Whether running within node or not.
|
|
30
|
+
* @memberof util
|
|
31
|
+
* @type {boolean}
|
|
32
|
+
*/
|
|
33
|
+
util.isNode = Boolean(typeof global !== "undefined"
|
|
34
|
+
&& global
|
|
35
|
+
&& global.process
|
|
36
|
+
&& global.process.versions
|
|
37
|
+
&& global.process.versions.node);
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Global object reference.
|
|
41
|
+
* @memberof util
|
|
42
|
+
* @type {Object}
|
|
43
|
+
*/
|
|
44
|
+
util.global = util.isNode && global
|
|
30
45
|
|| typeof window !== "undefined" && window
|
|
31
46
|
|| typeof self !== "undefined" && self
|
|
32
47
|
|| this; // eslint-disable-line no-invalid-this
|
|
@@ -46,14 +61,6 @@ util.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */
|
|
|
46
61
|
*/
|
|
47
62
|
util.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes
|
|
48
63
|
|
|
49
|
-
/**
|
|
50
|
-
* Whether running within node or not.
|
|
51
|
-
* @memberof util
|
|
52
|
-
* @type {boolean}
|
|
53
|
-
* @const
|
|
54
|
-
*/
|
|
55
|
-
util.isNode = Boolean(util.global.process && util.global.process.versions && util.global.process.versions.node);
|
|
56
|
-
|
|
57
64
|
/**
|
|
58
65
|
* Tests if the specified value is an integer.
|
|
59
66
|
* @function
|