MCPcopy
hub / github.com/webpack/webpack / checkSnapshotValid

Method checkSnapshotValid

lib/FileSystemInfo.js:3061–3074  ·  lib/FileSystemInfo.js::FileSystemInfo.checkSnapshotValid

* Checks snapshot valid. * @param {Snapshot} snapshot the snapshot made * @param {CheckSnapshotValidCallback} callback callback function * @returns {void}

(snapshot, callback)

Source from the content-addressed store, hash-verified

3059 * @returns {void}
3060 */
3061 checkSnapshotValid(snapshot, callback) {
3062 const cachedResult = this._snapshotCache.get(snapshot);
3063 if (cachedResult !== undefined) {
3064 this._statTestedSnapshotsCached++;
3065 if (typeof cachedResult === class="st">"boolean") {
3066 callback(null, cachedResult);
3067 } else {
3068 cachedResult.push(callback);
3069 }
3070 return;
3071 }
3072 this._statTestedSnapshotsNotCached++;
3073 this._checkSnapshotValidNoCache(snapshot, callback);
3074 }
3075
3076 /**
3077 * Check snapshot valid no cache.

Callers 8

_loadEnvMethod · 0.95
needBuildMethod · 0.80
needBuildMethod · 0.80
_openPackMethod · 0.80
processCacheResultMethod · 0.80
applyMethod · 0.80
expectSnapshotStateFunction · 0.80

Calls 4

callbackFunction · 0.50
getMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected