MCPcopy
hub / github.com/webpack/webpack / getCache

Function getCache

lib/util/identifier.js:132–139  ·  view source on GitHub ↗
(associatedObjectForCache)

Source from the content-addressed store, hash-verified

130 * @returns {CacheItem<T>} cache item
131 */
132 const getCache = (associatedObjectForCache) => {
133 const entry = cache.get(associatedObjectForCache);
134 if (entry !== undefined) return entry;
135 /** @type {Map<string, T>} */
136 const map = new Map();
137 cache.set(associatedObjectForCache, map);
138 return map;
139 };
140
141 /** @type {MakeCacheableResult<T> & { bindCache: BindCache<T> }} */
142 const fn = (str, associatedObjectForCache) => {

Callers 2

fnFunction · 0.70
makeCacheableFunction · 0.70

Calls 2

getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected