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

Fix _extend fn - alter provided object #286

Merged
merged 1 commit into from
Jun 8, 2024

Conversation

jakubhruby
Copy link
Contributor

Fixes #285

@@ -381,13 +381,12 @@ function _extend(origin: object, add: object) {
// Don't do anything if add isn't an object
if (!add || !isObject(add)) return origin;

const clonedOrigin = { ...origin } as { [key: string]: unknown };
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was not needed - it lived just in this method

const clonedAdd = { ...add } as { [key: string]: unknown };

const keys = Object.keys(add);
let i = keys.length;
while (i--) {
clonedOrigin[keys[i]] = clonedAdd[keys[i]];
origin[keys[i]] = clonedAdd[keys[i]];
}
return origin;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Passed object was returned with no change

@terehov terehov changed the base branch from master to development June 8, 2024 11:54
@terehov terehov merged commit 7e47b61 into fullstack-build:development Jun 8, 2024
@terehov
Copy link
Contributor

terehov commented Jun 8, 2024

Thank you. I have released an update with your changes 👍

@jakubhruby
Copy link
Contributor Author

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.

Bug: Only a few levels are printed in pretty mode
2 participants