MCPcopy
hub / github.com/webpack/webpack / restore

Method restore

lib/cache/PackFileCacheStrategy.js:1411–1424  ·  view source on GitHub ↗

* Returns promise to the cached content. * @param {string} identifier unique name for the resource * @param {Etag | null} etag etag of the resource * @returns {Promise<Data>} promise to the cached content

(identifier, etag)

Source from the content-addressed store, hash-verified

1409 * @returns {Promise<Data>} promise to the cached content
1410 */
1411 restore(identifier, etag) {
1412 return this._getPack()
1413 .then((pack) =>
1414 pack.get(identifier, etag === null ? null : etag.toString())
1415 )
1416 .catch((err) => {
1417 if (err && err.code !== "ENOENT") {
1418 this.logger.warn(
1419 `Restoring failed for ${identifier} from pack: ${err}`
1420 );
1421 this.logger.debug(err.stack);
1422 }
1423 });
1424 }
1425
1426 /**
1427 * Stores build dependencies.

Callers

nothing calls this directly

Calls 5

_getPackMethod · 0.95
warnMethod · 0.80
debugMethod · 0.80
getMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected