diff --git a/lib/internal/url.js b/lib/internal/url.js index 7c2637246e9b51..b65e2cb9b14e4c 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -1390,8 +1390,7 @@ function pathToFileURL(filepath) { } function isURLInstance(fileURLOrPath) { - return fileURLOrPath != null && fileURLOrPath[searchParams] && - fileURLOrPath[searchParams][searchParams]; + return fileURLOrPath != null && fileURLOrPath.href && fileURLOrPath.origin; } function toPathIfFileURL(fileURLOrPath) {