refactor: extract parseClassList to shared utils

This commit is contained in:
2026-04-21 01:22:04 +02:00
parent 1ceca3bd9e
commit bece1a970a
3 changed files with 12 additions and 24 deletions

10
static/utils.ts Normal file
View File

@@ -0,0 +1,10 @@
export const parseClassList = (value: string | null): string[] => {
if (!value) {
return []
}
return value
.split(' ')
.map((entry: string): string => entry.trim())
.filter((entry: string): boolean => entry.length > 0)
}