MCPcopy
hub / github.com/webpack/webpack / get

Method get

lib/cache/PackFileCacheStrategy.js:184–200  ·  view source on GitHub ↗

* Returns cached content. * @param {string} identifier unique name for the resource * @param {string | null} etag etag of the resource * @returns {Data} cached content

(identifier, etag)

Source from the content-addressed store, hash-verified

182 * @returns {Data} cached content
183 */
184 get(identifier, etag) {
185 const info = this.itemInfo.get(identifier);
186 this._addRequest(identifier);
187 if (info === undefined) {
188 return;
189 }
190 if (info.etag !== etag) return null;
191 info.lastAccess = Date.now();
192 const loc = info.location;
193 if (loc === -1) {
194 return info.freshValue;
195 }
196 if (!this.content[loc]) {
197 return;
198 }
199 return /** @type {PackContent} */ (this.content[loc]).get(identifier);
200 }
201
202 /**
203 * Updates value using the provided identifier.

Callers 15

applyMethod · 0.45
getterFunction · 0.45
setMethod · 0.45
_gcAndUpdateLocationMethod · 0.45
_persistFreshContentMethod · 0.45
_gcOldestContentMethod · 0.45
deserializeMethod · 0.45
getMethod · 0.45
writeLazyMethod · 0.45
restoreMethod · 0.45
mergeEtagsFunction · 0.45

Calls 1

_addRequestMethod · 0.95

Tested by

no test coverage detected