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/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
  [
@@ -62,7 +62,8 @@
62
62
  "additionalBindings": {
63
63
  "rule": "repeated",
64
64
  "type": "HttpRule",
65
- "id": 11
65
+ "id": 11,
66
+ "protoName": "additional_bindings"
66
67
  }
67
68
  }
68
69
  },
@@ -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
  },