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

Add quotes if a field contains a carriage return \r even if it doesn't contain a line feed \n #57

Merged
merged 1 commit into from
Nov 14, 2020
Merged

Conversation

mvaneerde
Copy link
Contributor

See Issue #56 for details

@@ -25,7 +25,7 @@ class DefaultFieldStringifier extends FieldStringifier {
}

private needsQuote(str: string): boolean {
return str.includes(this.fieldDelimiter) || str.includes('\n') || str.includes('"')
return str.includes(this.fieldDelimiter) || str.includes('\r') || str.includes('\n') || str.includes('"')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth unrolling these four substring searches into a single loop

@coveralls
Copy link

Pull Request Test Coverage Report for Build 103

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 102: 0.0%
Covered Lines: 145
Relevant Lines: 145

💛 - Coveralls

@ryu1kn ryu1kn merged commit 907e616 into ryu1kn:master Nov 14, 2020
@ryu1kn
Copy link
Owner

ryu1kn commented Nov 14, 2020

Thanks for the contribution! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants