@wordpress/core-data
Version:
Access to and manipulation of core WordPress entities.
12 lines (11 loc) • 332 B
JavaScript
/**
* Checks whether the attribute is a "raw" attribute or not.
*
* @param {Object} entity Entity record.
* @param {string} attribute Attribute name.
*
* @return {boolean} Is the attribute raw
*/
export default function isRawAttribute( entity, attribute ) {
return ( entity.rawAttributes || [] ).includes( attribute );
}