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

TypeScript type returned by parse is misleading #937

Closed
danielnixon opened this issue Dec 29, 2024 · 2 comments · Fixed by #944
Closed

TypeScript type returned by parse is misleading #937

danielnixon opened this issue Dec 29, 2024 · 2 comments · Fixed by #944

Comments

@danielnixon
Copy link
Contributor

The return type in https://github.com/mozilla/readability/blob/main/index.d.ts is misleading. It doesn't include null/undefined in the types of values that can definitely be null or undefined. byline, for example, can commonly be null/undefined.

This has bitten me a few times while calling Readability from a TypeScript context.

It might be nice if we could update index.d.ts to reflect the types more accurately.

@gijsk
Copy link
Contributor

gijsk commented Dec 31, 2024

None of the maintainers rely on or use the typescript definitions. They were externally contributed and merged; I'd be happy to take pull requests but that would be why the types listed may not be correct.

@danielnixon
Copy link
Contributor Author

PR: #944

@cmkm cmkm closed this as completed in #944 Jan 9, 2025
@cmkm cmkm closed this as completed in 8c0ff87 Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants