From 32f217bb2a90812864004740f30e579a528bd0ec Mon Sep 17 00:00:00 2001 From: Marin Atanasov <8436925+tyxla@users.noreply.github.com> Date: Fri, 7 Apr 2023 12:38:56 +0300 Subject: [PATCH] Lodash: Remove _.mapValues() from edit-site (#49639) --- .../components/global-styles/global-styles-provider.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 20e3d03c54d1fc..b194873916a9fc 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; };