Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 76e24f9

Browse filesBrowse files
aduh95ruyadorno
authored andcommitted
module: use isURLInstance instead of instanceof
PR-URL: #34951 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
1 parent 49da459 commit 76e24f9
Copy full SHA for 76e24f9

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: lib/internal/modules/cjs/loader.js
+2-2Lines changed: 2 additions & 2 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.