b0y-101 Mini Shell


Current Path : E:/www/km/wp2/wp-content/plugins/cartflows/modules/gutenberg/src/controls/
File Upload :
Current File : E:/www/km/wp2/wp-content/plugins/cartflows/modules/gutenberg/src/controls/getAttributeFallback.js

import { blocksAttributes } from '@Attributes/getBlocksDefaultAttributes';

// Parameters for these methods:
// currentValue - The variable/attribute that is altered by settings.
// key          - The key of the default attribute for that setting.
// blockName    - The name of the block.

const getAttributeFallback = ( currentValue, key, blockName ) =>
	currentValue ? currentValue : blocksAttributes[ blockName ][ key ].default;

export const getFallbackNumber = ( currentValue, key, blockName ) =>
	isNaN( currentValue )
		? blocksAttributes[ blockName ][ key ].default
		: currentValue;

export default getAttributeFallback;

Copyright © 2019 by b0y-101