-
-
Notifications
You must be signed in to change notification settings - Fork 929
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(image): fix dataUri with type svg-base64 in browsers #3144
Conversation
✅ Deploy Preview for fakerjs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## next #3144 +/- ##
=======================================
Coverage 99.97% 99.97%
=======================================
Files 2777 2778 +1
Lines 226355 226364 +9
Branches 945 946 +1
=======================================
+ Hits 226288 226297 +9
Misses 67 67
|
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.
Could we use Buffer.from where available (as it's faster) and only fallback to the custom code when needed?
Fixes #3143
Replaces the problematic
Buffer.from(input).toString('base64')
call with a custom replacement that also works in browsers.Also adds an eslint rule that should prevent this error in the future.
Similar to the
toBase64URL
method from #2936