MCPcopy
hub / github.com/webpack/webpack / fn

Function fn

lib/util/identifier.js:142–150  ·  view source on GitHub ↗
(str, associatedObjectForCache)

Source from the content-addressed store, hash-verified

140
141 /** @type {MakeCacheableResult<T> & { bindCache: BindCache<T> }} */
142 const fn = (str, associatedObjectForCache) => {
143 if (!associatedObjectForCache) return realFn(str);
144 const cache = getCache(associatedObjectForCache);
145 const entry = cache.get(str);
146 if (entry !== undefined) return entry;
147 const result = realFn(str);
148 cache.set(str, result);
149 return result;
150 };
151
152 /** @type {BindCache<T>} */
153 fn.bindCache = (associatedObjectForCache) => {

Callers 15

resultFunction · 0.70
newFnFunction · 0.70
memoizeFunction · 0.70
ArrayHelpers.jsFile · 0.70
forEachRuntimeFunction · 0.70
updateMethod · 0.70
provideMethod · 0.70
findFunction · 0.70
getFromCacheMethod · 0.70
getFromUnorderedCacheMethod · 0.70
cachedFnFunction · 0.70
boundFnFunction · 0.70

Calls 3

getCacheFunction · 0.70
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected