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

Remove empty arrays when remove_empty_properties is set #1423

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rmonnerat
Copy link

The condition should check if the construct is an Array also, you can easily reproduce in plain javascript:

obj = Array()
obj === Object(obj) // true
Object.keys(obj).length === 0 // true
obj.constructor === Array // true
obj.constructor === Object // false

Otherwise, empty arrays ends up on the getValue result.

Q A
Is bugfix? ✔️
New feature?
Is backward-compatible? ✔️
Tests pass? ✔️
Fixed issues Unknown
Updated README/docs?
Added CHANGELOG entry?

@navytux
Copy link

navytux commented Nov 16, 2023

@schmunk42
Copy link
Collaborator

@rmonnerat, do you have an idea why tests fail? (see e.g. https://github.com/json-editor/json-editor/actions/runs/6868513133/job/18698471271?pr=1423)

I triggered the failed builds again, let's see if this was just a hickup.

@rmonnerat
Copy link
Author

@navytux I don't know, I ran the npm run eslint and npm test and it looked fine. However, I am not familiar with the development in JS using npm very much.

@germanbisurgi
Copy link
Collaborator

@schmunk42 related: #1427

Copy link
Collaborator

@germanbisurgi germanbisurgi left a comment

Choose a reason for hiding this comment

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

Wait for #1427 to be merged and test again, please

@rmonnerat
Copy link
Author

@germanbisurgi I updated the branch, waiting for tests re-rerun.

@germanbisurgi
Copy link
Collaborator

The tests show positive results, yet it would be beneficial to create an issue outlining the details along with a description and steps to reproduce the situation. This is to ensure we prevent any potential regression.

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

4 participants