data_get-config.js

/**
 * @module getConfig
 * @description A function to get data from our configs in Gravity Forms. Mocks return all data objects,
 * while we return specific subsets in final bundles.
 *
 * @since 1.1.18
 *
 * @param {object} data The data object to find the data for.
 * @param {string} name The key to get.
 *
 * @return {object} The data object.
 */
export default function getConfig( data = {}, name = '' ) {
	if ( ! name ) {
		return data;
	}
	if ( ! data[ name ] ) {
		return data;
	}
	return data[ name ];
}