mirror of
https://github.com/koala73/worldmonitor.git
synced 2026-04-25 17:14:57 +02:00
10 lines
355 B
TypeScript
10 lines
355 B
TypeScript
/**
|
|
* Defensive parser for repeated-string query params.
|
|
* Some codegen paths may pass comma-separated strings into string[] fields.
|
|
*/
|
|
export function parseStringArray(raw: unknown): string[] {
|
|
if (Array.isArray(raw)) return raw.filter(Boolean);
|
|
if (typeof raw === 'string' && raw.length > 0) return raw.split(',').filter(Boolean);
|
|
return [];
|
|
}
|