MCPcopy Create free account
hub / github.com/TruthHun/BookStack / ensureDeps

Function ensureDeps

static/editor.md/lib/codemirror/addon/mode/loadmode.js:19–31  ·  view source on GitHub ↗
(mode, cont)

Source from the content-addressed store, hash-verified

17 return function() { if (--countDown == 0) cont(); };
18 }
19 function ensureDeps(mode, cont) {
20 var deps = CodeMirror.modes[mode].dependencies;
21 if (!deps) return cont();
22 var missing = [];
23 for (var i = 0; i < deps.length; ++i) {
24 if (!CodeMirror.modes.hasOwnProperty(deps[i]))
25 missing.push(deps[i]);
26 }
27 if (!missing.length) return cont();
28 var split = splitCallback(cont, missing.length);
29 for (var i = 0; i < missing.length; ++i)
30 CodeMirror.requireMode(missing[i], split);
31 }
32
33 CodeMirror.requireMode = function(mode, cont) {
34 if (typeof mode != "string") mode = mode.name;

Callers 1

loadmode.jsFile · 0.85

Calls 2

splitCallbackFunction · 0.85
contFunction · 0.50

Tested by

no test coverage detected