Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e6c8da4

Browse filesBrowse files
estliberitasFishrock123
authored andcommitted
doc: make writable.setDefaultEncoding() return this
Let this function return `this` for parity with `readable.setEncoding()`. PR-URL: #5040 Fixes: #5013 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Calvin Metcalf <calvin.metcalf@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 0d19853 commit e6c8da4
Copy full SHA for e6c8da4

File tree

Expand file treeCollapse file tree

2 files changed

+2
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+2
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/stream.md‎

Copy file name to clipboardExpand all lines: doc/api/stream.md
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,7 @@ file.end('world!');
695695
#### writable.setDefaultEncoding(encoding)
696696

697697
* `encoding` {String} The new default encoding
698+
* Return: `this`
698699

699700
Sets the default encoding for a writable stream.
700701

Collapse file

‎lib/_stream_writable.js‎

Copy file name to clipboardExpand all lines: lib/_stream_writable.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
251251
if (!Buffer.isEncoding(encoding))
252252
throw new TypeError('Unknown encoding: ' + encoding);
253253
this._writableState.defaultEncoding = encoding;
254+
return this;
254255
};
255256

256257
function decodeChunk(state, chunk, encoding) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.