mirror of
https://github.com/pheralb/svgl.git
synced 2025-12-29 08:01:36 +08:00
🛠 Create getSvgContent function.
This commit is contained in:
@@ -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;
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user