-
-
Notifications
You must be signed in to change notification settings - Fork 735
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
[New] parse
/stringify
: add allowEmptyArrays
option to allow [] in object values
#487
Conversation
…in object values
a7f71fd
to
62397f0
Compare
62397f0
to
c40572b
Compare
@ljharb Current behaviour is |
Yes, that would be a breaking change, and it’s important that things round trip - so i think we do need the option in both. |
c40572b
to
23ff94a
Compare
281de52
to
f3b3bc5
Compare
f3b3bc5
to
e96bff8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; i can make the remaining changes as part of landing, but feel free to do it yourself too :-)
e96bff8
to
f7d8438
Compare
parse
/stringify
: add allowEmptyArrays
option to allow [] in object values
f7d8438
to
f22b2bc
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #487 +/- ##
=======================================
Coverage 99.80% 99.81%
=======================================
Files 9 9
Lines 1543 1583 +40
Branches 177 183 +6
=======================================
+ Hits 1540 1580 +40
Misses 3 3 ☔ View full report in Codecov by Sentry. |
@ljharb any ETA to release a new version containing these changes? |
@konnng-dev there's a few open PRs i want to land first |
Needs adding to the typescript definitions Object literal may only specify known properties, and 'allowEmptyArrays' does not exist in type 'IStringifyOptions'. |
This PR adds
allowEmptyArrays
option which let's you keep empty arrays in the object values and address this issueWithout
allowEmptyArrays
optionWith
allowEmptyArrays
options set to true