Skip to content

Commit

Permalink
鈿欙笍 Remove special characters from SVG name in svgr server file
Browse files Browse the repository at this point in the history
  • Loading branch information
pheralb committed Jun 1, 2024
1 parent 054c198 commit 7bcb167
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/routes/api/svgs/svgr/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -48,4 +48,4 @@ export const POST = async ({ request }: RequestEvent) => {
{ status: 500 }
);
}
};
};

0 comments on commit 7bcb167

Please sign in to comment.