In docs remove Object as a data type for send#2077
Merged
lpinca merged 1 commit intowebsockets:masterfrom Sep 18, 2022
DLiblik:dliblik-fix-docs
Merged
In docs remove Object as a data type for send#2077lpinca merged 1 commit intowebsockets:masterfrom DLiblik:dliblik-fix-docs
lpinca merged 1 commit intowebsockets:masterfrom
DLiblik:dliblik-fix-docs
Conversation
Member
|
See #2076 (comment). |
lpinca
reviewed
Sep 18, 2022
| - `data` {Array|Number|Object|String|ArrayBuffer|Buffer|DataView|TypedArray} The | ||
| data to send. For Object values, the passed-in item will be serialized through | ||
| node's own | ||
| [Buffer.from()](https://nodejs.org/api/buffer.html#static-method-bufferfromobject-offsetorencoding-length) |
Member
There was a problem hiding this comment.
Suggested change
| [Buffer.from()](https://nodejs.org/api/buffer.html#static-method-bufferfromobject-offsetorencoding-length) | |
| [`Buffer.from()`](https://nodejs.org/api/buffer.html#static-method-bufferfromobject-offsetorencoding-length) |
Also, for consistency can you please move the link to the bottom?
| node's own | ||
| [Buffer.from()](https://nodejs.org/api/buffer.html#static-method-bufferfromobject-offsetorencoding-length) | ||
| function, which defines additional constraints. If those constraints are not | ||
| met, a TypeError will occur. |
Member
There was a problem hiding this comment.
Suggested change
| met, a TypeError will occur. | |
| met, a `TypeError` will occur. |
Add reference to Node.js's own related documentation about the constraints on `Object` values.
lpinca
approved these changes
Sep 18, 2022
Member
|
Thank you. |
Merged
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
websocket.send does not support a plain old Object of any shape and throws a TypeError.
This fixes the docs to remove Object as a supported type for the data parameter
Addresses #2076