Skip to content

Commit

Permalink
Lodash: Remove _.mapValues() from edit-site (#49639)
Browse files Browse the repository at this point in the history
  • Loading branch information
tyxla authored Apr 7, 2023
1 parent 40b5015 commit 32f217b
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { mergeWith, isEmpty, mapValues } from 'lodash';
import { mergeWith, isEmpty } from 'lodash';

/**
* WordPress dependencies
Expand Down Expand Up @@ -41,9 +41,9 @@ const cleanEmptyObject = ( object ) => {
return object;
}
const cleanedNestedObjects = Object.fromEntries(
Object.entries( mapValues( object, cleanEmptyObject ) ).filter(
( [ , value ] ) => Boolean( value )
)
Object.entries( object )
.map( ( [ key, value ] ) => [ key, cleanEmptyObject( value ) ] )
.filter( ( [ , value ] ) => Boolean( value ) )
);
return isEmpty( cleanedNestedObjects ) ? undefined : cleanedNestedObjects;
};
Expand Down

1 comment on commit 32f217b

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in 32f217b.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4637162359
📝 Reported issues:

Please sign in to comment.