Skip to content

Conversation

@mausworks
Copy link
Contributor

This PR solves #781

@mausworks mausworks force-pushed the fix/support-throwIfNoEntry branch from 24f86cc to 23aa210 Compare November 24, 2021 01:11
This option is available since node v14 and is quite useful
@mausworks mausworks force-pushed the fix/support-throwIfNoEntry branch from 23aa210 to 80cf803 Compare November 24, 2021 01:13
@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.

2 participants