fix: parseTypes handles array input defensively (prevents .split crash)

This commit is contained in:
erio
2026-04-07 02:34:58 +08:00
parent 49c683de62
commit 862f1c846b
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -1 +1 @@
0.1.108.54
0.1.108.55
@@ -84,7 +84,9 @@ export const PROVIDER_CONFIG_FIELDS: Record<string, ConfigFieldDef[]> = {
// --- Helpers ---
/** Parse comma-separated types string into array. */
export function parseTypes(raw: string): string[] {
export function parseTypes(raw: string | string[]): string[] {
if (Array.isArray(raw)) return raw.map(s => s.trim()).filter(Boolean)
if (!raw) return []
return raw.split(',').map(s => s.trim()).filter(Boolean)
}