🌟 Code Cleanup

This commit is contained in:
callumok2004
2021-06-21 03:43:22 +01:00
parent bf4f6dab8d
commit b169bbc15d
9 changed files with 111 additions and 172 deletions

View File

@@ -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);