You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,12 +86,12 @@ In case of doubt you can just use the full library.
86
86
Usage
87
87
-----
88
88
89
-
Each message type provides a set of methods with each of them doing just one thing. This is done for [performance](#performance)reasons because it allows to avoid unnecessary operations but also forces a user to perform verification explicitly where necessary (for example when dealing with user input).
89
+
Each message type provides a set of methods with each method doing just one thing. This allows to avoid unnecessary operations where [performance](#performance)is a concern but also forces a user to perform verification explicitly where necessary - for example when dealing with user input.
90
90
91
91
Note that **Message** refers to any message type below.
explicitly performs verification prior to encoding / converting a plain object (i.e. where data comes from user input). Instead of throwing, it returns the error message as a string, if any.
94
+
explicitly performs verification prior to encoding / converting a plain object. Instead of throwing, it returns the error message as a string, if any.
95
95
96
96
```js
97
97
var payload ="invalid (not an object)";
@@ -118,8 +118,7 @@ Note that **Message** refers to any message type below.
118
118
var decodedMessage =AwesomeMessage.decode(buffer);
119
119
} catch (e) {
120
120
if (e instanceofprotobuf.util.ProtocolError) {
121
-
// e.instance holds the so far decoded message
122
-
// with missing required fields
121
+
// e.instance holds the so far decoded message with missing required fields
123
122
} else {
124
123
// wire format is invalid
125
124
}
@@ -153,8 +152,8 @@ Note that **Message** refers to any message type below.
153
152
longs:String, // longs as strings (requires long.js)
154
153
bytes:String, // bytes as base64 encoded strings
155
154
defaults:true, // includes default values
156
-
arrays:true, // populates empty arrays even if defaults=false
157
-
objects:true, // populates empty objects even if defaults=false
155
+
arrays:true, // populates empty arrays (repeated fields) even if defaults=false
156
+
objects:true, // populates empty objects (map fields) even if defaults=false
158
157
oneofs:true// includes virtual oneof fields set to the present field's name
0 commit comments