src/lib/entity.js
function optimizeComponents(copy, source) {
  var removeAttribute = HTMLElement.prototype.removeAttribute;
  var setAttribute = HTMLElement.prototype.setAttribute;
  var components = source.components || {};
  Object.keys(components).forEach(function(name) {
    var component = components[name];
    var result = getImplicitValue(component, source);
    var isInherited = result[1];
    var implicitValue = result[0];
    var currentValue = source.getAttribute(name);
    var optimalUpdate = getOptimalUpdate(
      component,
      implicitValue,
      currentValue
    );
    var doesNotNeedUpdate = optimalUpdate === null;
    if (isInherited && doesNotNeedUpdate) {
      removeAttribute.call(copy, name);
    } else {
      var schema = component.schema;
      var value = stringifyComponentValue(schema, optimalUpdate);
      setAttribute.call(copy, name, value);
    }
  });
}
function optimizeComponents(copy, source) {
  var removeAttribute = HTMLElement.prototype.removeAttribute;
  var setAttribute = HTMLElement.prototype.setAttribute;
  var components = source.components || {};
  Object.keys(components).forEach(function(name) {
    var component = components[name];
    var result = getImplicitValue(component, source);
    var isInherited = result[1];
    var implicitValue = result[0];
    var currentValue = source.getAttribute(name);
    var optimalUpdate = getOptimalUpdate(
      component,
      implicitValue,
      currentValue
    );
    var doesNotNeedUpdate = optimalUpdate === null;
    if (isInherited && doesNotNeedUpdate) {
      removeAttribute.call(copy, name);
    } else {
      var schema = component.schema;
      var value = stringifyComponentValue(schema, optimalUpdate);
      setAttribute.call(copy, name, value);
    }
  });
}
function optimizeComponents ( copy , source ) { var removeAttribute = HTMLElement . prototype . removeAttribute ; var setAttribute = HTMLElement . prototype . setAttribute ; var components = source . components || { } ; Object . keys ( components ) . forEach ( function ( name ) { var component = components [ name ] ; var result = getImplicitValue ( component , source ) ; var isInherited = result [ 1 ] ; var implicitValue = result [ 0 ] ; var currentValue = source . getAttribute ( name ) ; var optimalUpdate = getOptimalUpdate ( component , implicitValue , currentValue ) ; var doesNotNeedUpdate = optimalUpdate === null ; if ( isInherited && doesNotNeedUpdate ) { removeAttribute . call ( copy , name ) ; } else { var schema = component . schema ; var value = stringifyComponentValue ( schema , optimalUpdate ) ; setAttribute . call ( copy , name , value ) ; } } ) ; }
Removes from copy those components or components' properties that comes from
primitive attributes, mixins, injected default components or schema defaults.

@param {Element} copy   Destinatary element for the optimization.
@param {Element} source Element to be optimized.
Removes from copy those components or components properties that comes from primitive attributes mixins injected default components or schema defaults .