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

Adding compact object method #5572

Closed
wants to merge 2 commits into from
Closed

Conversation

amyrsaalehi
Copy link

@amyrsaalehi amyrsaalehi commented Dec 15, 2022

I was working with one of my backend projects so I was feeling this feature is needed for objects that are received from req.body either in frontend or backend.

This method works very well with objects and safeties are also checked to prevent the app from crashing.

I should note that this method gets inspired by the compact method which is used for arrays and works very similarly but it will validate both Keys and Value pairs in the object, and lastly, I was thinking about a flag that can be passed as a second arg to the method (which is optional btw!) to check if a developer wants to check Keys or Values or Both of them in the object.

…ifically.These are some of the features:

- Falsey values in the Key and Value pairs in the object will be omitted.
- There is no problem with passing falsey values instead of Object.
- It works very well in a lazy sequence.
@jdalton jdalton closed this Sep 16, 2023
@jdalton jdalton added the issue bankruptcy Closing the issue/PR to start fresh label Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue bankruptcy Closing the issue/PR to start fresh
Development

Successfully merging this pull request may close these issues.

None yet

2 participants