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

The loadImageFromURL type definition is misleading #842

Open
marlo22 opened this issue Feb 19, 2023 · 0 comments
Open

The loadImageFromURL type definition is misleading #842

marlo22 opened this issue Feb 19, 2023 · 0 comments
Labels

Comments

@marlo22
Copy link

marlo22 commented Feb 19, 2023

Describe the bug
The loadImageFromURL method's type suggests that the second parameter (imageName) is optional, but it's required.

To Reproduce
Just use the method and look that TS doesn't complain when we don't pass imageName. If you run the application, it logs an error.

Here, we can see that the function rejects a Promise if imageName is falsy.

loadImageFromURL(url, imageName) {
if (!imageName || !url) {
return Promise.reject(rejectMessages.invalidParameters);
}

Expected behavior
The imageName parameter in the loadImageFromURL definition is marked as required.

@marlo22 marlo22 added the Bug label Feb 19, 2023
marlo22 added a commit to marlo22/tui.image-editor that referenced this issue Feb 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant