From d61b54cc173c454a88a591c7a5bfeabd532a734e Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Thu, 1 Feb 2024 06:49:52 +0100 Subject: [PATCH] fix: do not attempt to repair broken URLs (#13) --- lib/reporters.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/reporters.js b/lib/reporters.js index 6a87724..0f50859 100644 --- a/lib/reporters.js +++ b/lib/reporters.js @@ -4,13 +4,7 @@ import { fileURLToPath } from 'node:url' function normalizeFile (file, cwd) { let res = file if (file.startsWith('file://')) { - try { - res = fileURLToPath(new URL(file)) - } catch (err) { - if (err.code === 'ERR_INVALID_FILE_URL_PATH') { - res = fileURLToPath(new URL(file.replace('file:///', 'file://'))) - } - } + res = fileURLToPath(file) } res = res.replace(cwd, '') if (res.startsWith('/') || res.startsWith('\\')) {