Skip to content

Commit 76e24f9

Browse files
aduh95ruyadorno
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 49da459 commit 76e24f9

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
@@ -58,7 +58,7 @@ const {
5858
maybeCacheSourceMap,
5959
rekeySourceMap
6060
} = require('internal/source_map/source_map_cache');
61-
const { pathToFileURL, fileURLToPath, URL } = require('internal/url');
61+
const { pathToFileURL, fileURLToPath, isURLInstance } = require('internal/url');
6262
const { deprecate } = require('internal/util');
6363
const vm = require('vm');
6464
const assert = require('internal/assert');
@@ -1156,7 +1156,7 @@ const createRequireError = 'must be a file URL object, file URL string, or ' +
11561156
function createRequire(filename) {
11571157
let filepath;
11581158

1159-
if (filename instanceof URL ||
1159+
if (isURLInstance(filename) ||
11601160
(typeof filename === 'string' && !path.isAbsolute(filename))) {
11611161
try {
11621162
filepath = fileURLToPath(filename);

0 commit comments

Comments
 (0)