Skip to content

Commit

Permalink
Revert "Use for-of, it seems to be used elsewhere too"
Browse files Browse the repository at this point in the history
This reverts commit 2c577cb.
  • Loading branch information
fregante committed Aug 23, 2024
1 parent ce00140 commit f91e455
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions resolvers/webpack/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,9 @@ const MAX_CACHE = 10;
const _cache = [];
function getResolveSync(configPath, webpackConfig, cwd) {
const cacheKey = { configPath, webpackConfig };
for (const entry of _cache) {
if (isEqual(entry.key, cacheKey)) {
return entry.value;
for (let i = 0; i < _cache.length; i++) {
if (isEqual(_cache[i].key, cacheKey)) {
return _cache[i].value;
}
}

Expand Down Expand Up @@ -411,9 +411,9 @@ exports.resolve = function (source, file, settings) {
if (typeof configIndex !== 'undefined' && webpackConfig.length > configIndex) {
webpackConfig = webpackConfig[configIndex];
} else {
for (const config of webpackConfig) {
if (config.resolve) {
webpackConfig = config;
for (let i = 0; i < webpackConfig.length; i++) {
if (webpackConfig[i].resolve) {
webpackConfig = webpackConfig[i];
break;

Check warning on line 417 in resolvers/webpack/index.js

View check run for this annotation

Codecov / codecov/patch

resolvers/webpack/index.js#L414-L417

Added lines #L414 - L417 were not covered by tests
}
}
Expand Down

0 comments on commit f91e455

Please sign in to comment.