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

Function memoize

static/word2md/mammoth.browser.js:28609–28614  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

28607 // Memoize an expensive function by storing its results.
28608 _.memoize = function(func, hasher) {
28609 var memoize = function(key) {
28610 var cache = memoize.cache;
28611 var address = '' + (hasher ? hasher.apply(this, arguments) : key);
28612 if (!_.has(cache, address)) cache[address] = func.apply(this, arguments);
28613 return cache[address];
28614 };
28615 memoize.cache = {};
28616 return memoize;
28617 };

Callers

nothing calls this directly

Calls 1

hasMethod · 0.80

Tested by

no test coverage detected