Skip to content

Commit

Permalink
#6 Amend(1)
Browse files Browse the repository at this point in the history
- Defaulted New Line to "\n" instead of "\r\n"
  • Loading branch information
Stephen Pugliese committed Dec 18, 2015
1 parent 38a8a34 commit 87bd606
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ internals.parse = function(specs, input){
}
switch(specs.options.format){
case "csv":
return Papa.unparse(output);
return Papa.unparse(output, {
newline: "\n"
});
break;
default:
return output;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fixy",
"version": "0.3.1",
"version": "0.3.2",
"description": "A Fixed Width Input Parser",
"main": "index.js",
"directories": {
Expand Down
4 changes: 2 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe("Fixy Tests", function() {
format: "csv"
}
}, "30SJP\n30SJP");
assert.deepEqual(test, "Age,Initial\r\n30,SJP\r\n30,SJP");
assert.deepEqual(test, "Age,Initial\n30,SJP\n30,SJP");
});
it("should return fixed-width-input as csv-string (inner commas)", function () {
var test = fixy.parse({
Expand All @@ -88,7 +88,7 @@ describe("Fixy Tests", function() {
format: "csv"
}
}, "30S,JP\n30S,JP");
assert.deepEqual(test, "Age,Initial\r\n30,\"S,JP\"\r\n30,\"S,JP\"");
assert.deepEqual(test, "Age,Initial\n30,\"S,JP\"\n30,\"S,JP\"");
});
});
});

0 comments on commit 87bd606

Please sign in to comment.