mirror of
https://github.com/pheralb/svgl.git
synced 2025-12-29 08:01:36 +08:00
✨ Add settings management with package manager and SVG optimization options
This commit is contained in:
@@ -2,11 +2,13 @@ import { optimizeSvg } from "@/utils/optimizeSvg";
|
||||
|
||||
interface SourceParams {
|
||||
url: string | undefined;
|
||||
optimize?: boolean;
|
||||
}
|
||||
|
||||
export const getSource = async (params: SourceParams) => {
|
||||
const response = await fetch(params.url || "");
|
||||
const content = await response.text();
|
||||
if (!params.optimize) return content;
|
||||
const optimizedContent = optimizeSvg({ svgCode: content });
|
||||
return optimizedContent;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user