question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

unparse null and undefined values with forced quotes

See original GitHub issue

I’m not sure if this intended or not…

When unparsing and the value is null or undefined and the unparse config has quotes: true (or array, function, … which forces quotes), I would expect null,null to become "","" currently it gives ,

Input data: a,b,c null, undefined, null

Expected: "a","b","c" "", "", ""

Actual: "a","b","c" , ,

I can create a PR if this is an error

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
pokolicommented, Mar 4, 2021

@janisdd Makes sense! If you create a PR for the docs I will be happy to merge it.

0reactions
janisddcommented, Mar 4, 2021

Didn’t know that null and empty should never be quotes in csv… If this is common knowledge everything works as expected. Maybe we can add a small hint in the docs for the quotes unparse option that it does not apply for null and undefined values?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Feature request: An "undefined" value in addition to "null" #385
So the simple scenario is C# producer, using Newtonsoft (the JSON one, not the DSON one), paired with a JavaScript consumer using JSON.parse...
Read more >
Documentation - Papa Parse
If true , forces all fields to be enclosed in quotes. If an array of true/false values, specifies which fields should be force-quoted...
Read more >
Converting JSON into Javascript Objects with JSON.parse()
Null values and empty strings (“”) are valid JSON values, but the state of being undefined is not valid within JSON. JSON.parse() will...
Read more >
Postgresql COPY empty string as NULL not work
I want to COPY them to a table as NULL value. With JAVA code, I have try these: String sql = "COPY "...
Read more >
2 Ways to Convert Values to Boolean in JavaScript
In JavaScript, there are 6 falsy values. If you convert any of these to a boolean , it will return false . false...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found