mini-svg-data-uri
mini-svg-data-uri copied to clipboard
Adjust svgToTinyDataUri return type
What this does
This PR changes the return type of the main function from string to data:image/svg+xml,${string}
.
The main function always adds data:image/svg+xml,
at the beginning of the returned string and therefore this type changes definitely improves the type accuracy.
Motivation
I'm using this package to generate placeholder images for my Next.js page.
The Next.js image component expects the placeholder string to start with data:image/
and therefore throws an error when I pass a regular string to it. This could very well be useful when using other frameworks as well though.