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

Avoid null as return type #162

Open
javagl opened this issue Nov 29, 2024 · 0 comments
Open

Avoid null as return type #162

javagl opened this issue Nov 29, 2024 · 0 comments

Comments

@javagl
Copy link
Contributor

javagl commented Nov 29, 2024

The ResourceResolver interface is intended as an abstraction for file systems, databases, or web requests. It offers the functionality to just throw in a (relative) URI/path as a string, and receive a Buffer with the data.

For some reason, I once decided to use null as the return type indicating that "this thing is not threre". This is the only place where null is used in the codebase. But I don't see a strong reason do do this. So I'd change this from null to undefined.

This may not happen in the next "patch" release (0.4.x). But it may happen in the next "semi-major" release (i.e. 0.5.0), which may contain other "breaking changes".

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

1 participant