Skip to content

Commit 89a58f6

Browse files
aduh95codebytere
authored andcommitted
module: use isURLInstance instead of instanceof
PR-URL: #34951 Backport-PR-URL: #35385 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Derek Lewis <[email protected]>
1 parent bf7b796 commit 89a58f6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎lib/internal/modules/cjs/loader.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const{
5454
maybeCacheSourceMap,
5555
rekeySourceMap
5656
}=require('internal/source_map/source_map_cache');
57-
const{ pathToFileURL, fileURLToPath,URL}=require('internal/url');
57+
const{ pathToFileURL, fileURLToPath,isURLInstance}=require('internal/url');
5858
const{ deprecate }=require('internal/util');
5959
constvm=require('vm');
6060
constassert=require('internal/assert');
@@ -1089,7 +1089,7 @@ const createRequireError = 'must be a file URL object, file URL string, or ' +
10891089
functioncreateRequire(filename){
10901090
letfilepath;
10911091

1092-
if(filenameinstanceofURL||
1092+
if(isURLInstance(filename)||
10931093
(typeoffilename==='string'&&!path.isAbsolute(filename))){
10941094
try{
10951095
filepath=fileURLToPath(filename);

0 commit comments

Comments
(0)