We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2904e58 commit 463e585Copy full SHA for 463e585
lib/fs.js
@@ -282,8 +282,8 @@ let showExistsDeprecation = true;
282
function existsSync(path) {
283
try {
284
path = getValidatedPath(path);
285
- } catch {
286
- if (showExistsDeprecation) {
+ } catch (err) {
+ if (showExistsDeprecation && err?.code === 'ERR_INVALID_ARG_TYPE') {
287
process.emitWarning(
288
'Passing invalid argument types to fs.existsSync is deprecated', 'DeprecationWarning', 'DEP0187',
289
);
0 commit comments