Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function initDiscovery(options) {
const { Widget, router, complexViews } = require('@discoveryjs/discovery/dist/discovery.umd.js');
const settingsPage = require('../settings').default;
require('@discoveryjs/discovery/dist/discovery.css');
require('./index.css');
const { settings } = options;
const discovery = new Widget(options.discoveryNode);
discovery.apply(router);
discovery.apply(complexViews);
settingsPage(discovery);
discovery.page.define('default', [
{
view: 'struct',
expanded: parseInt(settings.expandLevel, 10) || 0
}
]);
discovery.view.define('raw', el => {
const { raw } = discovery.context;
const div = document.createElement('div');