From 106e9c5fbf0ff1945a84a92f68f1af6eb873c346 Mon Sep 17 00:00:00 2001 From: Hiroki Osame Date: Wed, 20 Sep 2023 19:41:44 +0900 Subject: [PATCH] refactor: improve resolver var name --- src/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index c481e37..8e72c6c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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 @@ -172,7 +172,7 @@ Module._resolveFilename = (request, parent, isMain, options) => { } try { - return resolveFilename( + return defaultResolveFilename( possiblePath, parent, isMain, @@ -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 & { @@ -211,7 +211,7 @@ const resolveTsFilename = ( && tsPath ) { try { - return resolveFilename( + return defaultResolveFilename( tsPath, parent, isMain,