From 843151fb99b5348bb79bb2d0f1e8abb542b27db5 Mon Sep 17 00:00:00 2001 From: Ryusei Yamaguchi Date: Mon, 2 Apr 2018 23:08:48 +0900 Subject: [PATCH 1/4] doc: fix about `decodeStrings` property of `stream.Writable` This fixes negation ommitted at 80ea0c5a64fe673011e8b1025de23a0ea7f3f7f8. --- doc/api/stream.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index 252ed15ceaed11..ce5fb08a90ff78 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1504,7 +1504,7 @@ If the `decodeStrings` property is set in the constructor options, then `chunk` may be a string rather than a Buffer, and `encoding` will indicate the character encoding of the string. This is to support implementations that have an optimized handling for certain string -data encodings. If the `decodeStrings` property is explicitly set to `false`, +data encodings. Unless the `decodeStrings` property is explicitly set to `false`, the `encoding` argument can be safely ignored, and `chunk` will remain the same object that is passed to `.write()`. From 8a354c87c0a50f0f236fc75164764a55f7afd2c9 Mon Sep 17 00:00:00 2001 From: Ryusei Yamaguchi Date: Tue, 3 Apr 2018 00:13:36 +0900 Subject: [PATCH 2/4] doc: refactoring complicated sentences --- doc/api/stream.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index ce5fb08a90ff78..dc1fa9968c70f7 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1500,13 +1500,11 @@ buffered. When the `callback` is invoked, the stream might emit a [`'drain'`][] event. If a stream implementation is capable of processing multiple chunks of data at once, the `writable._writev()` method should be implemented. -If the `decodeStrings` property is set in the constructor options, then -`chunk` may be a string rather than a Buffer, and `encoding` will -indicate the character encoding of the string. This is to support -implementations that have an optimized handling for certain string -data encodings. Unless the `decodeStrings` property is explicitly set to `false`, -the `encoding` argument can be safely ignored, and `chunk` will remain the same -object that is passed to `.write()`. +If the `decodeStrings` property is explicitly set to `false` in the constructor +options, then `chunk` will remain the same object that is passed to `.write()`, +and may be a string rather than a Buffer. In that case, the `encoding` argument +will indicate the character encoding of the string. Otherwise, the `encoding` +argument can be safely ignored. The `writable._write()` method is prefixed with an underscore because it is internal to the class that defines it, and should never be called directly by From 2e78f6a0a3ba608183fc73ae59d86cac19c3ce59 Mon Sep 17 00:00:00 2001 From: Ryusei Yamaguchi Date: Tue, 3 Apr 2018 01:04:29 +0900 Subject: [PATCH 3/4] doc: add the missed sentence on `decodeStrings` This adds the sentence missed at 8a354c87c0a50f0f236fc75164764a55f7afd2c9 --- doc/api/stream.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index dc1fa9968c70f7..7defdce61b66a8 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1502,9 +1502,10 @@ data at once, the `writable._writev()` method should be implemented. If the `decodeStrings` property is explicitly set to `false` in the constructor options, then `chunk` will remain the same object that is passed to `.write()`, -and may be a string rather than a Buffer. In that case, the `encoding` argument -will indicate the character encoding of the string. Otherwise, the `encoding` -argument can be safely ignored. +and may be a string rather than a Buffer. This is to support implementations +that have an optimized handling for certain string data encodings. In that case, +the `encoding` argument will indicate the character encoding of the string. +Otherwise, the `encoding` argument can be safely ignored. The `writable._write()` method is prefixed with an underscore because it is internal to the class that defines it, and should never be called directly by From 0e9e2e27a30a787b08921b7f4a045c1f2f6cc7d4 Mon Sep 17 00:00:00 2001 From: Ryusei Yamaguchi Date: Thu, 5 Apr 2018 08:08:04 +0900 Subject: [PATCH 4/4] doc: surround Buffer with backticks --- doc/api/stream.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index 7defdce61b66a8..3e77f2a625babe 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1502,7 +1502,7 @@ data at once, the `writable._writev()` method should be implemented. If the `decodeStrings` property is explicitly set to `false` in the constructor options, then `chunk` will remain the same object that is passed to `.write()`, -and may be a string rather than a Buffer. This is to support implementations +and may be a string rather than a `Buffer`. This is to support implementations that have an optimized handling for certain string data encodings. In that case, the `encoding` argument will indicate the character encoding of the string. Otherwise, the `encoding` argument can be safely ignored.