Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var definitionsView;
for (var i = 0; i < views.length; i++) {
const view = views[i];
const el = view.element;
if (is(el, 'dmn:Decision')) {
return view;
}
if (is(el, 'dmn:Definitions')) {
definitionsView = view;
if (containsDi(el)) {
return view;
}
}
}
return definitionsView || views[0];
}
eventBus.on('import.start', ({ definitions }) => {
if (!containsDi(definitions)) {
createDi(definitions);
}
});
}
var definitionsView;
for (var i = 0; i < views.length; i++) {
const view = views[i];
const el = view.element;
if (is(el, 'dmn:Decision')) {
return view;
}
if (is(el, 'dmn:Definitions')) {
definitionsView = view;
if (containsDi(el)) {
return view;
}
}
}
return definitionsView || views[0];
}
opens(element) {
return is(element, 'dmn:Definitions') && containsDi(element);
}
},