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 0d92ce4 commit 48f381dCopy full SHA for 48f381d
lib/fs.js
@@ -278,8 +278,8 @@ let showExistsDeprecation = true;
278
function existsSync(path) {
279
try {
280
path = getValidatedPath(path);
281
- } catch {
282
- if (showExistsDeprecation) {
+ } catch (err) {
+ if (showExistsDeprecation && err?.code === 'ERR_INVALID_ARG_TYPE') {
283
process.emitWarning(
284
'Passing invalid argument types to fs.existsSync is deprecated', 'DeprecationWarning', 'DEP0187',
285
);
0 commit comments