diff --git a/lib/fs.js b/lib/fs.js index dba9049faec111..ef516a218c7052 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -209,7 +209,7 @@ function exists(path, callback) { try { fs.access(path, F_OK, suppressedCallback); - } catch (err) { + } catch { return callback(false); } } @@ -230,7 +230,7 @@ function existsSync(path) { try { path = toPathIfFileURL(path); validatePath(path); - } catch (e) { + } catch { return false; } const ctx = { path };