streams2: Convert strings to buffers before passing to _write()
authorisaacs <i@izs.me>
Tue, 2 Oct 2012 23:28:02 +0000 (16:28 -0700)
committerisaacs <i@izs.me>
Fri, 14 Dec 2012 01:00:23 +0000 (17:00 -0800)
lib/_stream_writable.js

index e2343e6..fd0cd11 100644 (file)
@@ -65,7 +65,7 @@ Writable.prototype.write = function(chunk, encoding) {
     return;
   }
 
-  if (typeof chunk === 'string' && encoding)
+  if (typeof chunk === 'string')
     chunk = new Buffer(chunk, encoding);
 
   var ret = state.length >= state.highWaterMark;