Skip to content

Commit be78b83

Browse files
aduh95guybedford
authored andcommitted
module: use isURLInstance instead of instanceof
PR-URL: nodejs#34951 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Derek Lewis <[email protected]>
1 parent b29b966 commit be78b83

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
const vm = require('vm');
6060
const assert = require('internal/assert');
@@ -1087,7 +1087,7 @@ const createRequireError = 'must be a file URL object, file URL string, or ' +
10871087
function createRequire(filename) {
10881088
let filepath;
10891089

1090-
if (filename instanceof URL ||
1090+
if (isURLInstance(filename) ||
10911091
(typeof filename === 'string' && !path.isAbsolute(filename))) {
10921092
try {
10931093
filepath = fileURLToPath(filename);

0 commit comments

Comments
 (0)