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

feat: add flattenObject method #306

Merged
merged 4 commits into from
Jul 15, 2024
Merged

feat: add flattenObject method #306

merged 4 commits into from
Jul 15, 2024

Conversation

ilyevskii
Copy link
Contributor

No description provided.

@fruneen
Copy link
Member

fruneen commented Jul 8, 2024

@ilyevskii can we demonstrate this util in an endpoint?

Comment on lines 4 to 6
!_.isObject(obj)
? { [path.join('.')]: obj }
: Object.entries(obj).reduce((cur, [key, value]) => _.merge(cur, flattenObject<T>(value, [...path, key])), {});
Copy link
Member

Choose a reason for hiding this comment

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

flip this condition. More readable case when we don't need to apply logical not to the condition.

Copy link
Member

@fruneen fruneen left a comment

Choose a reason for hiding this comment

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

I approves that, but I assigned to you task with adding documentation for utils.

@fruneen fruneen merged commit 0d7ed38 into main Jul 15, 2024
5 checks passed
@fruneen fruneen deleted the ilyevskii/add-object-util branch July 15, 2024 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants