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

looksSame throws an error when an error is present using the readme code #57

Open
vctr-dev opened this issue Aug 21, 2019 · 2 comments
Open

Comments

@vctr-dev
Copy link

looksSame throws an error when an error is present, using the readme code

looksSame('image1.png', 'image2.png', function(error, {equal}) {
    // equal will be true, if images looks the same
});

> TypeError: Cannot destructure property `equal` of 'undefined' or 'null'.

Should probably update the docs to set the default in the callback i.e.

looksSame('image1.png', 'image2.png', function(error, {equal} = {}) {
    // equal will be true, if images looks the same
});
@Pathos14489
Copy link

This doesn't resolve the error, this just makes it not stop the script. Equal still comes out as undefined.

@Pathos14489
Copy link

After some more fidgeting, I figured out the issue. looks-same only works on .png images.

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

2 participants