Skip to content

Conversation

jakubhruby
Copy link
Contributor

Fixes #285

function _extend(origin: object, add: object): object {
const typedOrigin = { ...origin } as { [key: string]: unknown };
function _extend(origin: object, add: object): void {
const typedOrigin = 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.

It has to be exactly the same object. If it is cloned, only typedOrigin is extended, not origin.


function _extend(origin: object, add: object): object {
const typedOrigin = { ...origin } as { [key: string]: unknown };
function _extend(origin: object, add: object): void {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Return value is not used anywhere, it only confuses what exactly is done here. Apparently this method is meant to only alter provided origin and not to return anything.

while (i--) {
typedOrigin[keys[i]] = clonedAdd[keys[i]];
}
return typedOrigin;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not used anywhere

@jakubhruby
Copy link
Contributor Author

ping

@jakubhruby
Copy link
Contributor Author

@terehov ?

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
1 participant