Skip to content

Commit 3ad28ec

Browse files
committed
Docs: Even more usage for README [ci skip]
1 parent 588ffd9 commit 3ad28ec

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ In case of doubt you can just use the full library.
8686
Usage
8787
-----
8888

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.
9090

9191
Note that **Message** refers to any message type below.
9292

9393
* **Message.verify**(message: `Object`): `null|string`<br />
94-
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.
9595

9696
```js
9797
var payload = "invalid (not an object)";
@@ -118,8 +118,7 @@ Note that **Message** refers to any message type below.
118118
var decodedMessage = AwesomeMessage.decode(buffer);
119119
} catch (e) {
120120
if (e instanceof protobuf.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
123122
} else {
124123
// wire format is invalid
125124
}
@@ -153,8 +152,8 @@ Note that **Message** refers to any message type below.
153152
longs: String, // longs as strings (requires long.js)
154153
bytes: String, // bytes as base64 encoded strings
155154
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
158157
oneofs: true // includes virtual oneof fields set to the present field's name
159158
});
160159
```

0 commit comments

Comments
 (0)