Skip to content

Commit d24eecd

Browse files
aduh95nodejs-github-bot
authored andcommitted
module: use isURLInstance instead of instanceof
PR-URL: #34951 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Derek Lewis <[email protected]>
1 parent 8e17383 commit d24eecd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/internal/modules/cjs/loader.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const {
6060
maybeCacheSourceMap,
6161
rekeySourceMap
6262
} = require('internal/source_map/source_map_cache');
63-
const { pathToFileURL, fileURLToPath, URL } = require('internal/url');
63+
const { pathToFileURL, fileURLToPath, isURLInstance } = require('internal/url');
6464
const { deprecate } = require('internal/util');
6565
const vm = require('vm');
6666
const assert = require('internal/assert');
@@ -1169,7 +1169,7 @@ const createRequireError = 'must be a file URL object, file URL string, or ' +
11691169
function createRequire(filename) {
11701170
let filepath;
11711171

1172-
if (filename instanceof URL ||
1172+
if (isURLInstance(filename) ||
11731173
(typeof filename === 'string' && !path.isAbsolute(filename))) {
11741174
try {
11751175
filepath = fileURLToPath(filename);

0 commit comments

Comments
 (0)