mini-svg-data-uri icon indicating copy to clipboard operation
mini-svg-data-uri copied to clipboard

Adjust svgToTinyDataUri return type

Open AdrianFahrbach opened this issue 9 months ago • 0 comments

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.

AdrianFahrbach avatar May 02 '24 16:05 AdrianFahrbach