MCPcopy
hub / github.com/webpack/webpack / getContextTsh

Method getContextTsh

lib/FileSystemInfo.js:1774–1788  ·  view source on GitHub ↗

* Returns context tsh. * @param {string} path context path * @param {(err?: WebpackError | null, resolvedContextTimestampAndHash?: ResolvedContextTimestampAndHash | null) => void} callback callback function * @returns {void}

(path, callback)

Source from the content-addressed store, hash-verified

1772 * @returns {void}
1773 */
1774 getContextTsh(path, callback) {
1775 const cache = this._contextTshs.get(path);
1776 if (cache !== undefined) {
1777 const resolved = getResolvedTimestamp(cache);
1778 if (resolved !== undefined) return callback(null, resolved);
1779 return this._resolveContextTsh(cache, callback);
1780 }
1781 this.contextTshQueue.add(path, (err, _entry) => {
1782 if (err) return callback(err);
1783 const entry = /** @type {ContextTimestampAndHash} */ (_entry);
1784 const resolved = getResolvedTimestamp(entry);
1785 if (resolved !== undefined) return callback(null, resolved);
1786 this._resolveContextTsh(entry, callback);
1787 });
1788 }
1789
1790 /**
1791 * Get unresolved context tsh.

Callers 2

Calls 5

_resolveContextTshMethod · 0.95
getResolvedTimestampFunction · 0.85
callbackFunction · 0.50
getMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected