feat: update homepage

This commit is contained in:
KazooTTT
2024-11-23 15:28:47 +08:00
parent 9fd0776bb1
commit 8ec0d309ef
4 changed files with 30 additions and 8 deletions

View File

@ -1,7 +1,7 @@
import { defineCollection, z } from 'astro:content'
function removeDupsAndLowerCase(array: string[]) {
if (!array.length) return array
function removeDupsAndLowerCase(array: string[] | null) {
if (!array?.length) return []
const lowercaseItems = array.map((str) => str.toLowerCase())
const distinctItems = new Set(lowercaseItems)
return Array.from(distinctItems)