unparse null and undefined values with forced quotes
See original GitHub issueI’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:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@janisdd Makes sense! If you create a PR for the docs I will be happy to merge it.
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?