Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option quoteDataWithSpaces (default - true) to unparse config. #836

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added test to check working of quoteDataWithSpaces option
  • Loading branch information
AkvelonAccount committed Oct 8, 2020
commit ab42a04fe8a63389a1cd51cd90efcc272772ac56
7 changes: 7 additions & 0 deletions tests/test-cases.js
Original file line number Diff line number Diff line change
Expand Up @@ -1881,6 +1881,13 @@ var UNPARSE_TESTS = [
config: { escapeFormulae: true, quotes: true, quoteChar: "'", escapeChar: "'" },
expected: '\'Col1\',\'Col2\',\'Col3\'\r\n\'\'\'=danger\',\'\'\'@danger\',\'safe\'\r\n\'safe=safe\',\'\'\'+danger\',\'\'\'-danger, danger\'\r\n\'\'\'+safe\',\'\'\'@safe\',\'safe, safe\''
},
{
description: "Use quoteDataWithSpaces set to false",
notes: "Papa should not add quotes to data with spaces in the start or in the end)",
input: { data: ["abc", "d", " ef "] },
config: { quoteDataWithSpaces: false },
expected: 'abc,d, ef '
},
];

describe('Unparse Tests', function() {
Expand Down