Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Apr 24, 2023
1 parent 1fb49a6 commit 549c607
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ module.exports = function({ dependency: dep, filename, directory } = {}) {
const fileDir = path.dirname(filename);

debug(`trying to resolve: ${dep}`);
debug('filename: ', filename);
debug('directory: ', directory);
debug(`filename: ${filename}`);
debug(`directory: ${directory}`);

// Use the file's extension if necessary
const ext = path.extname(dep) ? '' : path.extname(filename);
Expand All @@ -41,10 +41,10 @@ module.exports = function({ dependency: dep, filename, directory } = {}) {
debug('resolved file does not exist');
}

const samedir = path.resolve(fileDir, dep) + ext;
debug(`resolving dep about the parent file's directory: ${samedir}`);
const sameDir = path.resolve(fileDir, dep) + ext;
debug(`resolving dep about the parent file's directory: ${sameDir}`);

if (fs.existsSync(samedir)) return samedir;
if (fs.existsSync(sameDir)) return sameDir;

debug('resolved file does not exist');

Expand Down

0 comments on commit 549c607

Please sign in to comment.