MCPcopy
hub / github.com/webpack/webpack / getContextTimestamp

Method getContextTimestamp

lib/FileSystemInfo.js:1657–1673  ·  view source on GitHub ↗

* Gets context timestamp. * @param {string} path context path * @param {(err?: WebpackError | null, resolvedContextTimestamp?: ResolvedContextTimestamp) => void} callback callback function * @returns {void}

(path, callback)

Source from the content-addressed store, hash-verified

1655 * @returns {void}
1656 */
1657 getContextTimestamp(path, callback) {
1658 const cache = this._contextTimestamps.get(path);
1659 if (cache !== undefined && !isExistenceOnly(cache)) {
1660 if (cache === "ignore") return callback(null, "ignore");
1661 const fullEntry =
1662 /** @type {ContextFileSystemInfoEntry | null} */
1663 (cache);
1664 const resolved = getResolvedTimestamp(fullEntry);
1665 if (resolved !== undefined) return callback(null, resolved);
1666 return this._resolveContextTimestamp(
1667 /** @type {ContextFileSystemInfoEntry} */
1668 (fullEntry),
1669 callback
1670 );
1671 }
1672 this._readFreshContextTimestamp(path, callback);
1673 }
1674
1675 /**
1676 * Reads a context timestamp directly from disk, bypassing any cached

Callers 2

Calls 6

isExistenceOnlyFunction · 0.85
getResolvedTimestampFunction · 0.85
callbackFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected