Get data from the given element.
@param {Element} element - The target element.
@param {string} name - The data key to get.
@returns {string} The data value.
function getData(element, name) {
  if (isObject(element[name])) {
    return element[name];
  }

  if (element.dataset) {
    return element.dataset[name];
  }

  return element.getAttribute("data-".concat(toParamCase(name)));
}