mirror of
https://github.com/NohamR/lanyard-profile-readme.git
synced 2026-05-26 04:17:19 +00:00
🌟 Code Cleanup
This commit is contained in:
@@ -1,22 +1,3 @@
|
||||
const imageToBase64 = require('image-to-base64');
|
||||
import imageToBase64 from "image-to-base64";
|
||||
|
||||
const encodeBase64 = async (url: string): Promise<string> => {
|
||||
|
||||
let encoded: string = '';
|
||||
|
||||
await imageToBase64(url)
|
||||
.then(
|
||||
(response: string) => {
|
||||
return encoded = response;
|
||||
}
|
||||
)
|
||||
.catch(
|
||||
(error: any) => {
|
||||
console.log(error);
|
||||
}
|
||||
)
|
||||
|
||||
return encoded;
|
||||
}
|
||||
|
||||
export default encodeBase64;
|
||||
export const encodeBase64 = async (url: string): Promise<string> => await imageToBase64(url);
|
||||
Reference in New Issue
Block a user