docker-stream-cleanser
Advanced tools
Comparing version 0.0.9 to 0.0.10
@@ -7,3 +7,5 @@ module.exports = function(data, encoding, fixCarriageReturns) { | ||
var header = null, pointer = 0; | ||
if (!data || data.length < 8 || data[1] !== 0) { return data; } | ||
if (!data || data.length < 8 || data[1] !== 0) { | ||
return (fixCarriageReturns) ? data.toString().replace(/\r?\n/g, '\r\n') : data.toString(); | ||
} | ||
while(pointer < data.length) { | ||
@@ -26,3 +28,3 @@ header = data.slice(pointer, pointer += 8); | ||
* This takes data from an input stream, strips out the payload, then writes that payload | ||
* to the output stream | ||
* to the output stream. Since this method is for real-time streaming | ||
* @param buildStream input stream | ||
@@ -40,3 +42,4 @@ * @param clientStream output stream | ||
if (!data || data.length < 8 || data[1] !== 0) { | ||
clientStream.write(data.toString()); | ||
clientStream.write((fixCarriageReturns) ? | ||
data.toString().replace(/\r?\n/g, '\r\n') : data.toString()); | ||
} else { | ||
@@ -43,0 +46,0 @@ while(pointer < data.length) { |
{ | ||
"name": "docker-stream-cleanser", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"main": "app.js", | ||
@@ -5,0 +5,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
60533
127