mirror of
https://github.com/NohamR/lanyard-profile-readme.git
synced 2026-05-24 20:00:37 +00:00
fix(toBase64): remove image-to-base64 dependencies
This commit is contained in:
@@ -8,11 +8,10 @@
|
|||||||
"start": "next start",
|
"start": "next start",
|
||||||
"lint": "next lint"
|
"lint": "next lint"
|
||||||
},
|
},
|
||||||
|
"packageManager": "pnpm@9.11.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/escape-html": "^1.0.4",
|
"@types/escape-html": "^1.0.4",
|
||||||
"@types/image-to-base64": "^2.1.2",
|
|
||||||
"escape-html": "^1.0.3",
|
"escape-html": "^1.0.3",
|
||||||
"image-to-base64": "^2.2.0",
|
|
||||||
"ioredis": "^5.4.1",
|
"ioredis": "^5.4.1",
|
||||||
"next": "14.2.15",
|
"next": "14.2.15",
|
||||||
"react": "^18",
|
"react": "^18",
|
||||||
|
|||||||
3491
pnpm-lock.yaml
generated
Normal file
3491
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,4 @@
|
|||||||
|
"use server";
|
||||||
// probably the messiest code i've ever written but it works so :)
|
// probably the messiest code i've ever written but it works so :)
|
||||||
|
|
||||||
import { Badges } from "#/public/assets/badges/BadgesEncoded";
|
import { Badges } from "#/public/assets/badges/BadgesEncoded";
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
import imageToBase64 from "image-to-base64";
|
|
||||||
|
|
||||||
export const encodeBase64 = async (url: string): Promise<string> => {
|
export const encodeBase64 = async (url: string): Promise<string> => {
|
||||||
let response = "";
|
let response = "";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
response = await imageToBase64(url);
|
response = await fetch(url)
|
||||||
|
.then((res) => res.blob())
|
||||||
|
.then(async (blob) => {
|
||||||
|
const buffer = Buffer.from(await blob.arrayBuffer());
|
||||||
|
return buffer.toString("base64");
|
||||||
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user