mirror of
https://github.com/pheralb/svgl.git
synced 2024-09-20 11:16:19 +08:00
refactor: moving the targetCategory string generation out of the filter
This commit is contained in:
parent
88ba73ba9d
commit
24e9c827ca
@ -58,9 +58,8 @@ export const GET = async ({ url, request }: RequestEvent) => {
|
||||
const category = getCategoryParams;
|
||||
|
||||
if (category) {
|
||||
const targetCategory = category.charAt(0).toUpperCase() + category.slice(1);
|
||||
const categorySvgs = fullRouteSvgsData.filter((svg) => {
|
||||
const targetCategory = category.charAt(0).toUpperCase() + category.slice(1);
|
||||
|
||||
if (typeof svg.category === 'string') {
|
||||
return svg.category === targetCategory;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user