File "parse-style.ts"
Full Path: /home/warrior1/public_html/wp-content/plugins/woocommerce/packages/woocommerce-blocks/assets/js/base/utils/parse-style.ts
File size: 299 bytes
MIME-type: text/x-java
Charset: utf-8
/**
* External dependencies
*/
import { isString, isObject } from '@woocommerce/types';
export const parseStyle = ( style: unknown ): Record< string, unknown > => {
if ( isString( style ) ) {
return JSON.parse( style ) || {};
}
if ( isObject( style ) ) {
return style;
}
return {};
};