-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix: Fix empty toDataURL()
in TypeScript
#672
Conversation
toDataURL
type signature introduced by release 4.1.0
The whole point of the overload is so the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test for toDataURL
without a type parameter so this doesn't break again?
Added.
Yeah. I understand the intent. When As it is defined with and without the changes in this PR,
Unless you feel like releasing version 5.0.0 with some breaking changes, it seems like the available options are limited. |
I don't care if they put a number for SVG. It will be handled the same as setting a number for PNG It does nothing. But I don't want ToSVGOption except for SVG. |
toDataURL
type signature introduced by release 4.1.0toDataURL()
in TypeScript
Thanks for bringing this to my attention! 💯 |
## [4.1.1](v4.1.0...v4.1.1) (2022-10-31) ### Bug Fixes * Fix empty `toDataURL()` in TypeScript ([#672](#672)) ([0ce27f0](0ce27f0))
🎉 This PR is included in version 4.1.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The recent change to the
toDataURL
function made thetype
parameter required. It was previously optional. This is a breaking change and most likely an innocent mistake.Additionally, the type of the
encoderOptions
parameter for the second overload was corrected. The type oftype
could bestring
and its value could be'image/svg+xml'
. SoToSVGOptions
should be accepted by theencoderOptions
parameter. This is not technically a breaking change but it's something I noticed while I was in the area.