Skip to content

Commit

Permalink
remove Buffer references
Browse files Browse the repository at this point in the history
  • Loading branch information
gugu committed Mar 9, 2024
1 parent 741b743 commit e28b403
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/svg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,7 @@ function getLogoImage(
logoWidth: ImageOptions["logoWidth"],
logoHeight: ImageOptions["logoHeight"]
): string {
const imageBase64 = `data:image/png;base64,${
typeof Buffer !== "undefined" && Buffer.isBuffer(logo)
? logo.toString("base64")
: Base64.fromUint8Array(new Uint8Array(logo))
}`;
const imageBase64 = `data:image/png;base64,${Base64.fromUint8Array(new Uint8Array(logo))}`;

return (
`<image ` +
Expand Down
2 changes: 1 addition & 1 deletion src/typing/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export interface ImageOptions {
* Buffer with PNG image to draw on top of QR code.
* @default undefined
*/
logo?: ArrayBufferLike | Buffer;
logo?: ArrayBufferLike;

/**
* Width of the overlay logo in percent.
Expand Down

0 comments on commit e28b403

Please sign in to comment.