From 8e29103cc7c4484b88651c8a777536015d6e5dee Mon Sep 17 00:00:00 2001 From: Carlos Espa <43477095+Ceres6@users.noreply.github.com> Date: Wed, 27 Nov 2024 08:27:05 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Antoine du Hamel --- doc/api/deprecations.md | 3 +++ lib/fs.js | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 6e4cfc9e0ada78..1de6fdf8ddb0d4 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -3779,6 +3779,9 @@ changes: - version: REPLACEME pr-url: https://github.com/nodejs/node/pull/55753 description: Runtime deprecation. + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/55892 + description: Documentation-only. --> Type: Runtime diff --git a/lib/fs.js b/lib/fs.js index e96d351bfe8ae4..eb6ca101243be7 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -286,7 +286,10 @@ function existsSync(path) { try { path = getValidatedPath(path); } catch { - deprecate(() => {}, 'Passing invalid argument types to fs.existsSync is deprecated', 'DEP0187'); + if (!deprecationWarningEmitted) { + process.emitWarning('Passing invalid argument types to fs.existsSync is deprecated', 'DeprecationWarning', 'DEP0187'); + deprecationWarningEmitted = true; + } return false; }