{"size": 1084, "ext": "js", "max_stars_repo_path": "src/js/editorialfloor/datasetextract_wts.js", "max_stars_repo_name": "toddoh/thisisallabout_frontend", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/js/editorialfloor/datasetextract_wts.js", "max_issues_repo_name": "toddoh/thisisallabout_frontend", "max_issues_repo_issues_event_min_datetime": "2021-03-09T00:48:51.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-08T03:30:09.000Z", "max_forks_repo_path": "src/js/editorialfloor/datasetextract_wts.js", "max_forks_repo_name": "toddoh/thisisallabout_frontend", "max_forks_repo_forks_event_min_datetime": "2019-10-16T19:26:08.000Z", "max_forks_repo_forks_event_max_datetime": "2019-10-16T19:26:08.000Z"}
{"max_stars_count": null, "max_issues_count": 2, "max_forks_count": 1, "avg_line_length": 40.1481481481, "max_line_length": 148, "alphanum_fraction": 0.5857933579}
import {html, render} from 'lit-html';
import _ from 'lodash';

export function process(dataset_url) {
    fetch(dataset_url).then(response => response.text()).then(function(text) {
        var module = eval(text);
        var dataset_d = module;
        var d_content = [];

        _.filter(dataset_d, function (set) {
            _.filter(set.data, function (d) {
                var item = {};
                item['header'] = d['header'];
                if (d.msg) item['msg'] = d['msg'];
                d_content.push(item);
                console.log(item);
            });
        });

        document.querySelector('.editorial-editor-viewer textarea').value = JSON.stringify(d_content);
        document.querySelector('.minion-dataload').setAttribute('status', 'dl_d_0');
        document.querySelector('.editorial-editor-viewer').classList.add('opened');
        Array.prototype.forEach.call(document.querySelectorAll('.editorial-editor-datatype .datatype-action-list div'), function(el, index, array) {
            el.classList.remove('selected');
        });
    });
}