function dataSet( element ) {
  if ( document.documentElement.dataset ) {
    return _assign( {}, element.dataset );
  }

  var dataset = {};
  var regex = /^data-(.+)/;
  var attr;
  var match;
  for ( var i = 0; i < element.attributes.length; i++ ) {
    attr = element.attributes[i];
    match = attr.name.match( regex );
    if ( match ) {
      dataset[_toCamelCase( match[1] )] = attr.value;
    }
  }

  return dataset;
}
/**
 * Get dataset from DOM element.
 * Contains code copied from
 * https://github.com/remy/polyfills/blob/master/dataset.js.
 * @param {HTMLElement} element - The element to check for dataset support.
 * @returns {Object} The data set.
 */
Get dataset from DOM element.
Get dataset from DOM element .
function dataSet( element ) {
  if ( document.documentElement.dataset ) {
    return _assign( {}, element.dataset );
  }
  var dataset = {};
  var regex = /^data-(.+)/;
  var attr;
  var match;
  for ( var i = 0; i < element.attributes.length; i++ ) {
    attr = element.attributes[i];
    match = attr.name.match( regex );
    if ( match ) {
      dataset[_toCamelCase( match[1] )] = attr.value;
    }
  }
  return dataset;
}
function dataSet ( element ) { if ( document . documentElement . dataset ) { return _assign ( { } , element . dataset ) ; } var dataset = { } ; var regex = / ^data-(.+) / ; var attr ; var match ; for ( var i = 0 ; i < element . attributes . length ; i ++ ) { attr = element . attributes [ i ] ; match = attr . name . match ( regex ) ; if ( match ) { dataset [ _toCamelCase ( match [ 1 ] ) ] = attr . value ; } } return dataset ; }
Get dataset from DOM element.
Get dataset from DOM element .