-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add doubleQuote to cli, rename other options to line up with th…
…e cli BREAKING CHANGE: Rename del to delimiter to match the cli flag BREAKING CHANGE: Rename quotes to quote to match the cli flag * Remove unused double quotes comment * Fix noHeader in CLI * Revert "Remove unused double quotes comment" This reverts commit 250d3e6. * Add doubleQuote to CLI
- Loading branch information
1 parent
f053c8b
commit 5e402dc
Showing
5 changed files
with
42 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,7 @@ async.parallel(loadFixtures(csvFixtures), function (err) { | |
{ firstname: 'foo', lastname: 'bar', email: '[email protected]' }, | ||
{ firstname: 'bar', lastname: 'foo', email: '[email protected]' } | ||
], | ||
del: '|@|' | ||
delimiter: '|@|' | ||
}, function (err, csv) { | ||
t.equal(csv, csvFixtures.delimiter); | ||
t.end(); | ||
|
@@ -224,35 +224,35 @@ async.parallel(loadFixtures(csvFixtures), function (err) { | |
}); | ||
}); | ||
|
||
test('should use a custom delimiter when \'quotes\' property is present', function (t) { | ||
test('should use a custom delimiter when \'quote\' property is present', function (t) { | ||
json2csv({ | ||
data: jsonDefault, | ||
fields: ['carModel', 'price'], | ||
quotes: '\'' | ||
quote: '\'' | ||
}, function (error, csv) { | ||
t.error(error); | ||
t.equal(csv, csvFixtures.withSimpleQuotes); | ||
t.end(); | ||
}); | ||
}); | ||
|
||
test('should be able to don\'t output quotes when using \'quotes\' property', function (t) { | ||
test('should be able to don\'t output quotes when using \'quote\' property', function (t) { | ||
json2csv({ | ||
data: jsonDefault, | ||
fields: ['carModel', 'price'], | ||
quotes: '' | ||
quote: '' | ||
}, function (error, csv) { | ||
t.error(error); | ||
t.equal(csv, csvFixtures.withoutQuotes); | ||
t.end(); | ||
}); | ||
}); | ||
|
||
test('should use a custom delimiter when \'del\' property is present', function (t) { | ||
test('should use a custom delimiter when \'delimiter\' property is present', function (t) { | ||
json2csv({ | ||
data: jsonDefault, | ||
fields: ['carModel', 'price', 'color'], | ||
del: '\t' | ||
delimiter: '\t' | ||
}, function (error, csv) { | ||
t.error(error); | ||
t.equal(csv, csvFixtures.tsv); | ||
|