MCPcopy
hub / github.com/webpack/webpack / resolveDirectory

Method resolveDirectory

lib/FileSystemInfo.js:1942–1974  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

1940 * @returns {void}
1941 */
1942 const resolveDirectory = (path) => {
1943 const key = `d\n${context}\n${path}`;
1944 if (resolveResults.has(key)) {
1945 return callback();
1946 }
1947 resolveResults.set(key, undefined);
1948 resolveContext(
1949 /** @type {string} */ (context),
1950 path,
1951 resolverContext,
1952 (err, _, result) => {
1953 if (err) {
1954 if (expected === false) {
1955 resolveResults.set(key, false);
1956 return callback();
1957 }
1958 invalidResolveResults.add(key);
1959 err.message += `\nwhile resolving '${path}' in ${context} to a directory`;
1960 return callback(err);
1961 }
1962 const resultPath = /** @type {ResolveRequest} */ (result).path;
1963 resolveResults.set(key, resultPath);
1964 push({
1965 type: RBDT_DIRECTORY,
1966 context: undefined,
1967 path: /** @type {string} */ (resultPath),
1968 expected: undefined,
1969 issuer: job
1970 });
1971 callback();
1972 }
1973 );
1974 };
1975 /**
1976 * Processes the provided path.
1977 * @param {string} path path

Callers

nothing calls this directly

Calls 5

callbackFunction · 0.50
pushFunction · 0.50
hasMethod · 0.45
setMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected