MCPcopy
hub / github.com/HumanSignal/label-studio / cached

Function cached

docs/themes/htx/source/js/vue.js:156–162  ·  view source on GitHub ↗

* Create a cached version of a pure function.

(fn)

Source from the content-addressed store, hash-verified

154 * Create a cached version of a pure function.
155 */
156 function cached(fn) {
157 var cache = Object.create(null);
158 return function cachedFn(str) {
159 var hit = cache[str];
160 return hit || (cache[str] = fn(str));
161 };
162 }
163
164 /**
165 * Camelize a hyphen-delimited string.

Callers 1

vue.jsFile · 0.85

Calls 2

fnFunction · 0.50
createMethod · 0.45

Tested by

no test coverage detected