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

Request.accepts documentation comment issue. #5410

Closed
Bunpasi opened this issue Jan 26, 2024 · 5 comments
Closed

Request.accepts documentation comment issue. #5410

Bunpasi opened this issue Jan 26, 2024 · 5 comments

Comments

@Bunpasi
Copy link

Bunpasi commented Jan 26, 2024

Hello.

Small thing in the documentation comments of 'Request.accepts' in 'index.d.ts'. It says to return 'undefined' instead of 'false'.

Kind regards,

@krzysdz
Copy link
Contributor

krzysdz commented Jan 26, 2024

May I know which documentation are you referring to? The official documentation says:

The method returns the best match, or if none of the specified content types is acceptable, returns false ...

However, Express does not contain TypeScript definition files. The @types/express package is maintained by the DefinitelyTyped project, but the declaration of Request.accepts() there does not contain undefined as the return type in any overload.

@Bunpasi
Copy link
Author

Bunpasi commented Jan 30, 2024

express-serve-static-core/index.d.ts line 398.

@krzysdz
Copy link
Contributor

krzysdz commented Jan 30, 2024

I've opened a PR to fix it: DefinitelyTyped/DefinitelyTyped#68381

@krzysdz
Copy link
Contributor

krzysdz commented Feb 3, 2024

New version of @types/express-serve-static-core (4.17.43) was released with the documentation fix.

@Bunpasi
Copy link
Author

Bunpasi commented Feb 11, 2024

Great! I heard you guys had some issues with contributions lately. I know this wasn't the most important thing, but I hope it will be helpful to someone.

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

No branches or pull requests

3 participants