function getConfigFromElement(element, mergeWithDefaults = false) {
  if (!element || !element.attributes) {
    return {};
  }

  const attrs = arrayFrom(element.attributes)
    .reduce((acc, {name, value}) => {
      if (name.indexOf('data-') === -1) return acc;

      const className = dashToCamel(name.replace('data-', ''));
      acc[className] = value;
      return acc;
    }, {});

  return mergeWithDefaults
    ? merge.all([defaultConfig, attrs || {}])
    : attrs;
}
@param {Element} element
@param {boolean} mergeWithDefaults
@return {Object<string, string>}