Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function showMerge(data: {
base: nbformat.INotebookContent,
merge_decisions: IMergeDecision[]
}): Promise {
let rendermime = new RenderMimeRegistry({
initialFactories: rendererFactories,
sanitizer: defaultSanitizer,
});
let nbmModel = new NotebookMergeModel(data.base,
data.merge_decisions);
let nbmWidget = new NotebookMergeWidget(nbmModel, rendermime);
let root = document.getElementById('nbdime-root');
if (!root) {
throw new Error('Missing root element "nbidme-root"');
}
root.innerHTML = '';
// Hide unchanged cells by default:
toggleShowUnchanged(!getConfigOption('hideUnchanged', true));
let panel = new Panel();
panel.id = 'main';
Widget.attach(panel, root);
panel.addWidget(nbmWidget);
let work = nbmWidget.init();