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

Function cached

static/vuejs/vue.js:87–93  ·  view source on GitHub ↗

* Create a cached version of a pure function.

(fn)

Source from the content-addressed store, hash-verified

85 * Create a cached version of a pure function.
86 */
87function cached (fn) {
88 var cache = Object.create(null);
89 return (function cachedFn (str) {
90 var hit = cache[str];
91 return hit || (cache[str] = fn(str))
92 })
93}
94
95/**
96 * Camelize a hyphen-delimited string.

Callers 1

vue.jsFile · 0.70

Calls 1

fnFunction · 0.70

Tested by

no test coverage detected