mirror of
https://github.com/pheralb/svgl.git
synced 2025-12-29 08:01:36 +08:00
refactor: moving the targetCategory string generation out of the filter
This commit is contained in:
@@ -58,9 +58,8 @@ export const GET = async ({ url, request }: RequestEvent) => {
|
|||||||
const category = getCategoryParams;
|
const category = getCategoryParams;
|
||||||
|
|
||||||
if (category) {
|
if (category) {
|
||||||
|
const targetCategory = category.charAt(0).toUpperCase() + category.slice(1);
|
||||||
const categorySvgs = fullRouteSvgsData.filter((svg) => {
|
const categorySvgs = fullRouteSvgsData.filter((svg) => {
|
||||||
const targetCategory = category.charAt(0).toUpperCase() + category.slice(1);
|
|
||||||
|
|
||||||
if (typeof svg.category === 'string') {
|
if (typeof svg.category === 'string') {
|
||||||
return svg.category === targetCategory;
|
return svg.category === targetCategory;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user