Skip to content

Commit

Permalink
Lodash: Remove _.mapValues() from block editor (#49638)
Browse files Browse the repository at this point in the history
  • Loading branch information
tyxla authored Apr 7, 2023
1 parent eb24385 commit 40b5015
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/block-editor/src/hooks/utils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { isEmpty, mapValues, get } from 'lodash';
import { isEmpty, get } from 'lodash';

/**
* WordPress dependencies
Expand Down Expand Up @@ -31,9 +31,9 @@ export 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 40b5015

@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 40b5015.
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/4637158795
📝 Reported issues:

Please sign in to comment.