2020-06-05 19:13:51 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
2024-05-24 12:13:24 +00:00
|
|
|
import { getSetting } from '@woocommerce/settings';
|
2020-06-05 19:13:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2024-05-24 12:13:24 +00:00
|
|
|
import { WC_BLOCKS_PHASE, WcBlocksConfig } from './constants';
|
2020-06-05 19:13:51 +00:00
|
|
|
|
|
|
|
/**
|
2024-05-24 12:13:24 +00:00
|
|
|
* Checks if experimental blocks are enabled.
|
|
|
|
*
|
|
|
|
* @return {boolean} True if this experimental blocks are enabled.
|
2020-06-05 19:13:51 +00:00
|
|
|
*/
|
2024-05-24 12:13:24 +00:00
|
|
|
export const isExperimentalBlocksEnabled = (): boolean => {
|
|
|
|
const { experimentalBlocksEnabled } = getSetting( 'wcBlocksConfig', {
|
|
|
|
experimentalBlocksEnabled: false,
|
|
|
|
} ) as WcBlocksConfig;
|
2020-06-05 19:13:51 +00:00
|
|
|
|
2024-05-24 12:13:24 +00:00
|
|
|
return experimentalBlocksEnabled;
|
2020-06-05 19:13:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks if we're executing the code in an feature plugin or experimental build mode.
|
|
|
|
*
|
|
|
|
* @return {boolean} True if this is an experimental or feature plugin build, false otherwise.
|
|
|
|
*/
|
2021-04-22 11:37:27 +00:00
|
|
|
export const isFeaturePluginBuild = (): boolean => WC_BLOCKS_PHASE > 1;
|