diff --git a/packages/edit-site/src/components/global-styles/global-styles-provider.js b/packages/edit-site/src/components/global-styles/global-styles-provider.js index 20e3d03c54d1f..b194873916a9f 100644 --- a/packages/edit-site/src/components/global-styles/global-styles-provider.js +++ b/packages/edit-site/src/components/global-styles/global-styles-provider.js @@ -1,7 +1,7 @@ /** * External dependencies */ -import { mergeWith, isEmpty, mapValues } from 'lodash'; +import { mergeWith, isEmpty } from 'lodash'; /** * WordPress dependencies @@ -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; };