Skip to content
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

Support throwIfNoEntry in StatOptions #782

Merged
merged 1 commit into from Nov 24, 2021

Conversation

mausworks
Copy link
Contributor

This PR solves #781

This option is available since node v14 and is quite useful
@mausworks mausworks changed the title Support throwIfNoEntry: false in StatOptions Support throwIfNoEntry in StatOptions Nov 24, 2021
Copy link
Owner

@streamich streamich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

Comment on lines 1525 to +1532
lstatSync(path: PathLike): Stats<number>;
lstatSync(path: PathLike, options: { bigint: false }): Stats<number>;
lstatSync(path: PathLike, options: { bigint: true }): Stats<bigint>;
lstatSync(path: PathLike, options?: IStatOptions): Stats {
return this.lstatBase(pathToFilename(path), getStatOptions(options).bigint as any);
lstatSync(path: PathLike, options: { throwIfNoEntry?: true | undefined }): Stats<number>;
lstatSync(path: PathLike, options: { bigint: false; throwIfNoEntry?: true | undefined }): Stats<number>;
lstatSync(path: PathLike, options: { bigint: true; throwIfNoEntry?: true | undefined }): Stats<bigint>;
lstatSync(path: PathLike, options: { throwIfNoEntry: false }): Stats<number> | undefined;
lstatSync(path: PathLike, options: { bigint: false; throwIfNoEntry: false }): Stats<number> | undefined;
lstatSync(path: PathLike, options: { bigint: true; throwIfNoEntry: false }): Stats<bigint> | undefined;
lstatSync(path: PathLike, options?: IStatOptions): Stats | undefined {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like these type overloads are slowly getting out of control.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed! 😅

Should probably be revised if a future version of NodeJS ships with new options.

@streamich streamich merged commit ed195b4 into streamich:master Nov 24, 2021
@streamich
Copy link
Owner

🎉 This PR is included in version 3.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@mausworks
Copy link
Contributor Author

Fantastic. Thanks for your quick review! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants