-
Notifications
You must be signed in to change notification settings - Fork 196
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
Possible to keep parent key #116
Comments
We can add key and value when isObject is true.
|
Hey @yashinnhl ! I'm also interested in this. |
Hey @giorgosera I edited my comments. Sorry for confusion. In general, I mean we can keep first level keys just like an example even if they are object.
Can be converted to :
To achieve this, we need to add condition - if (isObject) - to the index, and output[newKey] = value will keep parent key for us. I hope it helps. I am still not sure it is optimized or not but at least worked for me :). |
Hi I want to keep parent key and all its children as stringified JSON, is it possible to do that with flatten?
Example
expected output
I really appreciate if you can guide me here? Thanks
The text was updated successfully, but these errors were encountered: