function attributesFromJSON( attributeJSON ) {
	const attributes = JSON.parse( attributeJSON );
	for ( const [ key, value ] of Object.entries( attributes ) ) {
		if ( value === 'false' ) {
			attributes[key] = false;
		}
		if ( value === 'true' ) {
			attributes[key] = true;
		}
	}
	return attributes;
}
/**
 * Parses attributes passed as JSON (json encoded php associative array).
 *
 * @todo: Use a schema to check datatypes, so that we know whether to cast
 * strings as booleans, etc. Currently an attribute with value 'true' is
 * converted to boolean regardless of the attribute's type.
 *
 * @param {*} attributeJSON
 * @return {Object} Attributes object in same format as WordPress attributes
 * objects.
 */
Parses attributes passed as JSON (json encoded php associative array).
@todo: Use a schema to check datatypes, so that we know whether to cast
strings as booleans, etc. Currently an attribute with value 'true' is
converted to boolean regardless of the attribute's type.

@param {*} attributeJSON
@return {Object} Attributes object in same format as WordPress attributes
objects.
Parses attributes passed as JSON ( json encoded php associative array ) . @todo : Use a schema to check datatypes so that we know whether to cast strings as booleans etc . Currently an attribute with value ' true ' is converted to boolean regardless of the attribute ' s type . @param { * } attributeJSON @return { Object } Attributes object in same format as WordPress attributes objects .
function attributesFromJSON( attributeJSON ) {
	const attributes = JSON.parse( attributeJSON );
	for ( const [ key, value ] of Object.entries( attributes ) ) {
		if ( value === 'false' ) {
			attributes[key] = false;
		}
		if ( value === 'true' ) {
			attributes[key] = true;
		}
	}
	return attributes;
}
function attributesFromJSON ( attributeJSON ) { const attributes = JSON . parse ( attributeJSON ) ; for ( const [ key , value ] of Object . entries ( attributes ) ) { if ( value === 'false' ) { attributes [ key ] = false ; } if ( value === 'true' ) { attributes [ key ] = true ; } } return attributes ; }
Parses attributes passed as JSON (json encoded php associative array).
Parses attributes passed as JSON ( json encoded php associative array ) .