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

Function getCompiled

static/word2md/mammoth.browser.js:4326–4342  ·  view source on GitHub ↗
(name, compiler, cache)

Source from the content-addressed store, hash-verified

4324};
4325
4326var getCompiled = function(name, compiler, cache) {
4327 var ret = cache[name];
4328 if (typeof ret !== "function") {
4329 if (!isIdentifier(name)) {
4330 return null;
4331 }
4332 ret = compiler(name);
4333 cache[name] = ret;
4334 cache[" size"]++;
4335 if (cache[" size"] > 512) {
4336 var keys = Object.keys(cache);
4337 for (var i = 0; i < 256; ++i) delete cache[keys[i]];
4338 cache[" size"] = keys.length - 256;
4339 }
4340 }
4341 return ret;
4342};
4343
4344getMethodCaller = function(name) {
4345 return getCompiled(name, makeMethodCaller, callerCache);

Callers 1

mammoth.browser.jsFile · 0.70

Calls 1

isIdentifierFunction · 0.70

Tested by

no test coverage detected