Skip to content

Commit 26a540d

Browse files
committed
fixup! fs: deprecate never throw behaviour in fs.existsSync
1 parent a36a0fd commit 26a540d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

doc/api/deprecations.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -3786,7 +3786,7 @@ Type: Documentation-only
37863786
Passing non-supported argument types is deprecated and, instead of returning `false`,
37873787
will throw an error in a future version.
37883788

3789-
### DEP0187: `fs.existsSync` never throw on invalid arguments
3789+
### DEP0187: Passing invalid argument types to `fs.existsSync`
37903790

37913791
<!-- YAML
37923792
changes:
@@ -3797,7 +3797,8 @@ changes:
37973797

37983798
Type: Runtime
37993799

3800-
Returning false on validation errors is deprecated.
3800+
Passing non-supported argument types is deprecated and, instead of returning `false`,
3801+
will throw an error in a future version.
38013802

38023803
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
38033804
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3

lib/fs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ function existsSync(path) {
288288
try {
289289
path = getValidatedPath(path);
290290
} catch {
291-
deprecate(() => {}, 'never throw on invalid arguments for fs.existsSync is deprecated', 'DEP0187');
291+
deprecate(() => {}, 'Passing invalid argument types to fs.existsSync is deprecated', 'DEP0187');
292292
return false;
293293
}
294294

0 commit comments

Comments
 (0)