MCPcopy
hub / github.com/SortableJS/Vue.Draggable / cached

Function cached

src/util/helper.js:9–15  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

7const console = getConsole();
8
9function cached(fn) {
10 const cache = Object.create(null);
11 return function cachedFn(str) {
12 const hit = cache[str];
13 return hit || (cache[str] = fn(str));
14 };
15}
16
17const regex = /-(\w)/g;
18const camelize = cached(str =>

Callers 1

helper.jsFile · 0.85

Calls 1

fnFunction · 0.85

Tested by

no test coverage detected