🛠 Create getSvgContent function.

This commit is contained in:
Pablo Hdez 2023-03-16 11:26:23 +00:00
parent 30beff7b67
commit 79e6b9ba8e

View File

@ -0,0 +1,7 @@
export const MIMETYPE = 'text/plain';
export const getSvgContent = async (url: string | undefined, isSupported: boolean) => {
const response = await fetch(url || '');
const content = await response.text();
const blob = new Blob([content], { type: MIMETYPE });
return isSupported ? blob : content;
};