Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
refactor: improve resolver var name
Browse files Browse the repository at this point in the history
  • Loading branch information
privatenumber committed Sep 20, 2023
1 parent f06cd4e commit 106e9c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const supportsNodePrefix = (
);

// Add support for "node:" protocol
const resolveFilename = Module._resolveFilename.bind(Module);
const defaultResolveFilename = Module._resolveFilename.bind(Module);
Module._resolveFilename = (request, parent, isMain, options) => {
// Added in v12.20.0
// https://nodejs.org/api/esm.html#esm_node_imports
Expand All @@ -172,7 +172,7 @@ Module._resolveFilename = (request, parent, isMain, options) => {
}

try {
return resolveFilename(
return defaultResolveFilename(
possiblePath,
parent,
isMain,
Expand All @@ -187,7 +187,7 @@ Module._resolveFilename = (request, parent, isMain, options) => {
return tsFilename;
}

return resolveFilename(request, parent, isMain, options);
return defaultResolveFilename(request, parent, isMain, options);
};

type NodeError = Error & {
Expand All @@ -211,7 +211,7 @@ const resolveTsFilename = (
&& tsPath
) {
try {
return resolveFilename(
return defaultResolveFilename(
tsPath,
parent,
isMain,
Expand Down

0 comments on commit 106e9c5

Please sign in to comment.