Skip to content

Commit

Permalink
Lodash: Remove _.pickBy() from getNodesWithStyles() (#46980)
Browse files Browse the repository at this point in the history
  • Loading branch information
tyxla authored Jan 10, 2023
1 parent f2671b2 commit 6c7c672
Showing 1 changed file with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { get, isEmpty, kebabCase, pickBy, set } from 'lodash';
import { get, isEmpty, kebabCase, set } from 'lodash';

/**
* WordPress dependencies
Expand Down Expand Up @@ -449,17 +449,19 @@ export const getNodesWithStyles = ( tree, blockSelectors ) => {
}

const pickStyleKeys = ( treeToPickFrom ) =>
pickBy( treeToPickFrom, ( value, key ) =>
[
'border',
'color',
'dimensions',
'spacing',
'typography',
'filter',
'outline',
'shadow',
].includes( key )
Object.fromEntries(
Object.entries( treeToPickFrom ?? {} ).filter( ( [ key ] ) =>
[
'border',
'color',
'dimensions',
'spacing',
'typography',
'filter',
'outline',
'shadow',
].includes( key )
)
);

// Top-level.
Expand Down

1 comment on commit 6c7c672

@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 6c7c672.
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/3881253015
📝 Reported issues:

Please sign in to comment.