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
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,7 +106,7 @@ Where bundle size is a factor, there are additional stripped-down versions of th
106
106
Usage
107
107
-----
108
108
109
-
Because JavaScript is a dynamically typed language, protobuf.js introduces the concept of a **valid message** in order to provide the best possible [performance](#performance):
109
+
Because JavaScript is a dynamically typed language, protobuf.js introduces the concept of a **valid message** in order to provide the best possible [performance](#performance) (and, as a side product, proper typings):
110
110
111
111
### Valid message
112
112
@@ -119,8 +119,8 @@ There are two possible types of valid messages and the encoder is able to work w
119
119
120
120
In a nutshell, the wire format writer understands the following types:
121
121
122
-
| Field type | Expected JS type (create, encode) | Naive conversion (fromObject)
naively converts any non-valid **plain JavaScript object** to a **message instance**. See the table above for the exact conversion operations performed.
190
+
converts any non-valid **plain JavaScript object** to a **message instance** using the conversion steps outlined within the table above.
191
191
192
192
```js
193
193
var message =AwesomeMessage.fromObject({ awesomeField:42 });
@@ -213,6 +213,8 @@ For reference, the following diagram aims to display the relationships between t
> In other words: `verify` indicates that calling `create` or `encode` directly on the plain object will [result in a valid message respectively] succeed. `fromObject`, on the other hand, does conversion from a broader range of plain objects to create valid messages. ([ref](https://github.com/dcodeIO/protobuf.js/issues/748#issuecomment-291925749))
0 commit comments