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 +1 -1
- package/dist/light/protobuf.js +16 -11
- 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 +14 -9
- 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 +72 -33
- package/dist/protobuf.js.map +1 -1
- package/dist/protobuf.min.js +3 -3
- package/dist/protobuf.min.js.map +1 -1
- package/ext/protojson.js +5 -1
- package/google/api/annotations.json +3 -1
- package/google/api/http.json +2 -1
- package/google/protobuf/api.json +12 -6
- package/google/protobuf/descriptor.json +170 -87
- package/google/protobuf/descriptor.proto +0 -8
- package/google/protobuf/source_context.json +2 -1
- package/google/protobuf/type.json +14 -7
- package/package.json +4 -4
- package/src/common.js +12 -6
- package/src/converter.js +1 -1
- package/src/decoder.js +1 -1
- package/src/index-minimal.js +1 -0
- package/src/parse.js +44 -16
- package/src/util/longbits.js +10 -6
package/ext/protojson.js
CHANGED
|
@@ -295,7 +295,7 @@ function readField(field, value, options, depth) {
|
|
|
295
295
|
throw invalid(field.fullName, value, "expected array");
|
|
296
296
|
var arr = [], i = 0;
|
|
297
297
|
for (; i < value.length; ++i) {
|
|
298
|
-
if (value[i] === null && !isValueType(field.resolvedType))
|
|
298
|
+
if (value[i] === null && !isValueType(field.resolvedType) && !isNullValueType(field.resolvedType))
|
|
299
299
|
throw invalid(field.fullName, null, "null element");
|
|
300
300
|
var el = readSingular(field, value[i], options, depth);
|
|
301
301
|
if (el !== SKIP)
|
|
@@ -318,6 +318,10 @@ function isValueType(type) {
|
|
|
318
318
|
return type instanceof Type && type.fullName === ".google.protobuf.Value";
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
+
function isNullValueType(type) {
|
|
322
|
+
return type instanceof Enum && type.fullName === ".google.protobuf.NullValue";
|
|
323
|
+
}
|
|
324
|
+
|
|
321
325
|
function isImplicitDefault(field, value) {
|
|
322
326
|
if (field.hasPresence || field.repeated || field.map || field.resolvedType instanceof Type)
|
|
323
327
|
return false;
|
|
@@ -58,7 +58,8 @@
|
|
|
58
58
|
"additionalBindings": {
|
|
59
59
|
"rule": "repeated",
|
|
60
60
|
"type": "HttpRule",
|
|
61
|
-
"id": 11
|
|
61
|
+
"id": 11,
|
|
62
|
+
"protoName": "additional_bindings"
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
}
|
|
@@ -67,6 +68,7 @@
|
|
|
67
68
|
"protobuf": {
|
|
68
69
|
"nested": {
|
|
69
70
|
"MethodOptions": {
|
|
71
|
+
"edition": "proto2",
|
|
70
72
|
"fields": {},
|
|
71
73
|
"extensions": [
|
|
72
74
|
[
|
package/google/api/http.json
CHANGED
package/google/protobuf/api.json
CHANGED
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
},
|
|
27
27
|
"sourceContext": {
|
|
28
28
|
"type": "SourceContext",
|
|
29
|
-
"id": 5
|
|
29
|
+
"id": 5,
|
|
30
|
+
"protoName": "source_context"
|
|
30
31
|
},
|
|
31
32
|
"mixins": {
|
|
32
33
|
"rule": "repeated",
|
|
@@ -47,19 +48,23 @@
|
|
|
47
48
|
},
|
|
48
49
|
"requestTypeUrl": {
|
|
49
50
|
"type": "string",
|
|
50
|
-
"id": 2
|
|
51
|
+
"id": 2,
|
|
52
|
+
"protoName": "request_type_url"
|
|
51
53
|
},
|
|
52
54
|
"requestStreaming": {
|
|
53
55
|
"type": "bool",
|
|
54
|
-
"id": 3
|
|
56
|
+
"id": 3,
|
|
57
|
+
"protoName": "request_streaming"
|
|
55
58
|
},
|
|
56
59
|
"responseTypeUrl": {
|
|
57
60
|
"type": "string",
|
|
58
|
-
"id": 4
|
|
61
|
+
"id": 4,
|
|
62
|
+
"protoName": "response_type_url"
|
|
59
63
|
},
|
|
60
64
|
"responseStreaming": {
|
|
61
65
|
"type": "bool",
|
|
62
|
-
"id": 5
|
|
66
|
+
"id": 5,
|
|
67
|
+
"protoName": "response_streaming"
|
|
63
68
|
},
|
|
64
69
|
"options": {
|
|
65
70
|
"rule": "repeated",
|
|
@@ -88,7 +93,8 @@
|
|
|
88
93
|
"fields": {
|
|
89
94
|
"fileName": {
|
|
90
95
|
"type": "string",
|
|
91
|
-
"id": 1
|
|
96
|
+
"id": 1,
|
|
97
|
+
"protoName": "file_name"
|
|
92
98
|
}
|
|
93
99
|
}
|
|
94
100
|
},
|