MCPcopy
hub / github.com/webpack/webpack / toCachedSource

Function toCachedSource

lib/optimize/RealContentHashPlugin.js:140–149  ·  lib/optimize/RealContentHashPlugin.js::toCachedSource
(source)

Source from the content-addressed store, hash-verified

138 * @returns {CachedSource} cached source
139 */
140const toCachedSource = (source) => {
141 if (source instanceof CachedSource) {
142 return source;
143 }
144 const entry = cachedSourceMap.get(source);
145 if (entry !== undefined) return entry;
146 const newSource = new CachedSource(CompatSource.from(source));
147 cachedSourceMap.set(source, newSource);
148 return newSource;
149};
150
151/** @typedef {Set<string>} Hashes */
152

Callers 1

applyMethod · 0.85

Calls 2

getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected