-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
fs: add throwIfNoEntry option for fs.stat and fs.promises.stat
#61178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Fixes: nodejs#61116 Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #61178 +/- ##
==========================================
+ Coverage 88.52% 88.53% +0.01%
==========================================
Files 703 703
Lines 208585 208610 +25
Branches 40225 40235 +10
==========================================
+ Hits 184650 184702 +52
+ Misses 15953 15911 -42
- Partials 7982 7997 +15
🚀 New features to boost your workflow:
|
| } | ||
|
|
||
| async function stat(path, options = { bigint: false }) { | ||
| async function stat(path, options = { bigint: false, throwIfNoEntry: true }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you adjust the JSDoc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Roger that
| * `throwIfNoEntry` {boolean} Whether an exception will be thrown | ||
| if no file system entry exists, rather than returning `undefined`. | ||
| **Default:** `true`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes: #61116