easy-json-stream
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -47,4 +47,4 @@ var Transform = require('stream').Transform | ||
if (++this.count < 2) | ||
chunks.push(Object.keys(chunk).join(',')); | ||
chunks.push(Object.keys(chunk).map(function(key) { return chunk[key] }).map(escapeCommasAndSingleQuotes).join(',')); | ||
chunks.push(Object.keys(chunk).join(',') + '\n'); | ||
chunks.push(Object.keys(chunk).map(function(key) { return chunk[key] }).map(escapeCommasAndSingleQuotes).join(',') + '\n'); | ||
chunks.forEach(this.push.bind(this)); | ||
@@ -51,0 +51,0 @@ next(); |
{ | ||
"name": "easy-json-stream", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "Stream objects to JSON and JSON into objects.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -118,6 +118,6 @@ var path = require('path') | ||
var headers = chunk.split(','); | ||
t.deepEquals(headers, ['one', 'two', 'three'], 'it should emit the headers first'); | ||
t.deepEquals(headers, ['one', 'two', 'three\n'], 'it should emit the headers first'); | ||
}) | ||
.on('end', function() { | ||
t.equals(buffer[1], '1,2,3', 'it should emit rows of data'); | ||
t.equals(buffer[1], '1,2,3\n', 'it should emit rows of data'); | ||
t.end(); | ||
@@ -140,3 +140,3 @@ }).resume() | ||
.on('end', function() { | ||
t.equals(buffer[2], "'it\'s, one','it\'s, two','it\'s, three'", 'it should escape commas and single quotes'); | ||
t.equals(buffer[2], "'it\'s, one','it\'s, two','it\'s, three'\n", 'it should escape commas and single quotes'); | ||
t.end(); | ||
@@ -143,0 +143,0 @@ }).resume() |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9460