Skip to content

Commit

Permalink
Global Styles: Alternative means of variation cloning
Browse files Browse the repository at this point in the history
  • Loading branch information
tyxla committed Jan 14, 2025
1 parent 167ecbd commit dc92d51
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/global-styles/src/gutenberg-bridge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ const filterObjectByProperties = ( object: Record< string, any >, properties: st
* @returns {boolean} Whether the variation contains only the specified properties.
*/
const isVariationWithProperties = ( variation: GlobalStylesObject, properties: string[] ) => {
const variationWithProperties = filterObjectByProperties(
window.structuredClone( variation ),
properties
);
const clonedVariation = window.structuredClone
? window.structuredClone( variation )
: JSON.parse( JSON.stringify( variation ) );
const variationWithProperties = filterObjectByProperties( clonedVariation, properties );

return areGlobalStyleConfigsEqual( variationWithProperties, variation );
};
Expand Down

0 comments on commit dc92d51

Please sign in to comment.