src/js/social-share.js
function dataset(elem) {
        if (elem.dataset) {
            return JSON.parse(JSON.stringify(elem.dataset));
        }

        var target = {};

        if (elem.hasAttributes()) {
            each(elem.attributes, function (attr) {
                var name = attr.name;
                if (name.indexOf('data-') !== 0) {
                    return true;
                }

                name = name.replace(/^data-/i, '')
                    .replace(/-(\w)/g, function (all, letter) {
                        return letter.toUpperCase();
                    });

                target[name] = attr.value;
            });

            return target;
        }

        return {};
    }
function dataset(elem) {
        if (elem.dataset) {
            return JSON.parse(JSON.stringify(elem.dataset));
        }

        var target = {};

        if (elem.hasAttributes()) {
            each(elem.attributes, function (attr) {
                var name = attr.name;
                if (name.indexOf('data-') !== 0) {
                    return true;
                }

                name = name.replace(/^data-/i, '')
                    .replace(/-(\w)/g, function (all, letter) {
                        return letter.toUpperCase();
                    });

                target[name] = attr.value;
            });

            return target;
        }

        return {};
    }
function dataset ( elem ) { if ( elem . dataset ) { return JSON . parse ( JSON . stringify ( elem . dataset ) ) ; } var target = { } ; if ( elem . hasAttributes ( ) ) { each ( elem . attributes , function ( attr ) { var name = attr . name ; if ( name . indexOf ( 'data-' ) !== 0 ) { return true ; } name = name . replace ( / ^data- / i , '' ) . replace ( / -(\w) / g , function ( all , letter ) { return letter . toUpperCase ( ) ; } ) ; target [ name ] = attr . value ; } ) ; return target ; } return { } ; }
Get dataset object.

@param {Element} elem

@returns {Object}
Get dataset object .