gemini-testing / looks-same

Node.js library for comparing images
MIT License
669 stars 55 forks source link

fix(prepareOpts): TypeError when opts is undefined #66

Closed Vorobeyko closed 4 years ago

Vorobeyko commented 4 years ago

My tools use lookSame and pass some parameters to this function. But sometimes the tools has bugs and passes to lookSame undefined opts, and I get error.

Cannot set property 'tolerance' of undefined

Because prepareOpts try to set value to opts.tolerance, but opts is undefined.

My proposal using empty object by default.

Vorobeyko commented 4 years ago

@DudaGod HI! Can you merge this mr?

DudaGod commented 4 years ago

@Vorobeyko hello. Can you fix type for options here - https://github.com/gemini-testing/looks-same/blob/master/index.d.ts#L194?

And I will merge it. Thank you.

Vorobeyko commented 4 years ago

@DudaGod I did! Thats ok?

DudaGod commented 4 years ago

Yes. Thank you.

DudaGod commented 4 years ago

available at looks-same@7.2.3