⚙️ Remove special characters from SVG name in `svgr` server file

This commit is contained in:
pheralb 2024-06-01 14:24:00 +01:00
parent 054c1980c5
commit 7bcb167fb7

View File

@ -29,7 +29,7 @@ export const POST = async ({ request }: RequestEvent) => {
const svgCode = body.code;
const typescript = body.typescript;
const name = body.name;
const name = body.name.replace(/[^a-zA-Z0-9]/g, '');
const jsCode = await transform(
svgCode,
@ -48,4 +48,4 @@ export const POST = async ({ request }: RequestEvent) => {
{ status: 500 }
);
}
};
};