function cleanAttributes( attributes ) {
	for ( const [ key, value ] of Object.entries( attributes) ) {
		if ( ! isNaN( value ) ) {
			let newValue = value;
			if ( newValue === '' ) {
				newValue = null;
			} else {
				newValue = parseInt( value );
				if ( newValue === 0 ) {
					newValue = false;
				}
			}
			attributes[key] = newValue;
		}
	}
	return null;
}
/**
 * Takes attributes passed from wp_localize_script to frontend scripts and
 * parses and recasts them to match the format of attributes in the editor.
 *
 * @param {Object} attributes Attributes of a block, passed from
 *                            wp_localize_script.
 */
Takes attributes passed from wp_localize_script to frontend scripts and
parses and recasts them to match the format of attributes in the editor.

@param {Object} attributes Attributes of a block, passed from
wp_localize_script.
Takes attributes passed from wp_localize_script to frontend scripts and parses and recasts them to match the format of attributes in the editor . @param { Object } attributes Attributes of a block passed from wp_localize_script .
function cleanAttributes( attributes ) {
	for ( const [ key, value ] of Object.entries( attributes) ) {
		if ( ! isNaN( value ) ) {
			let newValue = value;
			if ( newValue === '' ) {
				newValue = null;
			} else {
				newValue = parseInt( value );
				if ( newValue === 0 ) {
					newValue = false;
				}
			}
			attributes[key] = newValue;
		}
	}
	return null;
}
function cleanAttributes ( attributes ) { for ( const [ key , value ] of Object . entries ( attributes ) ) { if ( ! isNaN ( value ) ) { let newValue = value ; if ( newValue === '' ) { newValue = null ; } else { newValue = parseInt ( value ) ; if ( newValue === 0 ) { newValue = false ; } } attributes [ key ] = newValue ; } } return null ; }
Takes attributes passed from wp_localize_script to frontend scripts and
 parses and recasts them to match the format of attributes in the editor.
Takes attributes passed from wp_localize_script to frontend scripts and parses and recasts them to match the format of attributes in the editor .